예제 #1
0
        /// <summary>Snippet for CreateGateway</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateGatewayResourceNames()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            LocationName parent    = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
            Gateway      gateway   = new Gateway();
            string       gatewayId = "";
            // Make the request
            Operation <Gateway, OperationMetadata> response = apiGatewayServiceClient.CreateGateway(parent, gateway, gatewayId);

            // Poll until the returned long-running operation is complete
            Operation <Gateway, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Gateway result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Gateway, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceCreateGateway(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Gateway retrievedResult = retrievedResponse.Result;
            }
        }
예제 #2
0
        /// <summary>Snippet for UpdateApiConfigAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task UpdateApiConfigRequestObjectAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            UpdateApiConfigRequest request = new UpdateApiConfigRequest
            {
                UpdateMask = new FieldMask(),
                ApiConfig  = new ApiConfig(),
            };
            // Make the request
            Operation <ApiConfig, OperationMetadata> response = await apiGatewayServiceClient.UpdateApiConfigAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <ApiConfig, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            ApiConfig result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <ApiConfig, OperationMetadata> retrievedResponse = await apiGatewayServiceClient.PollOnceUpdateApiConfigAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                ApiConfig retrievedResult = retrievedResponse.Result;
            }
        }
예제 #3
0
        /// <summary>Snippet for CreateApiAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CreateApiResourceNamesAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
            Api          api    = new Api();
            string       apiId  = "";
            // Make the request
            Operation <Api, OperationMetadata> response = await apiGatewayServiceClient.CreateApiAsync(parent, api, apiId);

            // Poll until the returned long-running operation is complete
            Operation <Api, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Api result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Api, OperationMetadata> retrievedResponse = await apiGatewayServiceClient.PollOnceCreateApiAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Api retrievedResult = retrievedResponse.Result;
            }
        }
예제 #4
0
        /// <summary>Snippet for DeleteApi</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteApi()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/global/apis/[API]";
            // Make the request
            Operation <Empty, OperationMetadata> response = apiGatewayServiceClient.DeleteApi(name);

            // Poll until the returned long-running operation is complete
            Operation <Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceDeleteApi(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for UpdateGateway</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void UpdateGateway()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            Gateway   gateway    = new Gateway();
            FieldMask updateMask = new FieldMask();
            // Make the request
            Operation <Gateway, OperationMetadata> response = apiGatewayServiceClient.UpdateGateway(gateway, updateMask);

            // Poll until the returned long-running operation is complete
            Operation <Gateway, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Gateway result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Gateway, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceUpdateGateway(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Gateway retrievedResult = retrievedResponse.Result;
            }
        }
예제 #6
0
        /// <summary>Snippet for CreateApiConfig</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateApiConfigRequestObject()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            CreateApiConfigRequest request = new CreateApiConfigRequest
            {
                ParentAsApiName = ApiName.FromProjectApi("[PROJECT]", "[API]"),
                ApiConfigId     = "",
                ApiConfig       = new ApiConfig(),
            };
            // Make the request
            Operation <ApiConfig, OperationMetadata> response = apiGatewayServiceClient.CreateApiConfig(request);

            // Poll until the returned long-running operation is complete
            Operation <ApiConfig, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            ApiConfig result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <ApiConfig, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceCreateApiConfig(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                ApiConfig retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for DeleteGateway</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteGatewayRequestObject()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            DeleteGatewayRequest request = new DeleteGatewayRequest
            {
                GatewayName = GatewayName.FromProjectLocationGateway("[PROJECT]", "[LOCATION]", "[GATEWAY]"),
            };
            // Make the request
            Operation <Empty, OperationMetadata> response = apiGatewayServiceClient.DeleteGateway(request);

            // Poll until the returned long-running operation is complete
            Operation <Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceDeleteGateway(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
        }
예제 #8
0
        /// <summary>Snippet for CreateApi</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateApi()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            string parent = "projects/[PROJECT]/locations/[LOCATION]";
            Api    api    = new Api();
            string apiId  = "";
            // Make the request
            Operation <Api, OperationMetadata> response = apiGatewayServiceClient.CreateApi(parent, api, apiId);

            // Poll until the returned long-running operation is complete
            Operation <Api, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Api result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Api, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceCreateApi(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Api retrievedResult = retrievedResponse.Result;
            }
        }
예제 #9
0
        /// <summary>Snippet for CreateGatewayAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CreateGatewayAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            string  parent    = "projects/[PROJECT]/locations/[LOCATION]";
            Gateway gateway   = new Gateway();
            string  gatewayId = "";
            // Make the request
            Operation <Gateway, OperationMetadata> response = await apiGatewayServiceClient.CreateGatewayAsync(parent, gateway, gatewayId);

            // Poll until the returned long-running operation is complete
            Operation <Gateway, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Gateway result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Gateway, OperationMetadata> retrievedResponse = await apiGatewayServiceClient.PollOnceCreateGatewayAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Gateway retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for DeleteApiAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task DeleteApiResourceNamesAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            ApiName name = ApiName.FromProjectApi("[PROJECT]", "[API]");
            // Make the request
            Operation <Empty, OperationMetadata> response = await apiGatewayServiceClient.DeleteApiAsync(name);

            // Poll until the returned long-running operation is complete
            Operation <Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, OperationMetadata> retrievedResponse = await apiGatewayServiceClient.PollOnceDeleteApiAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
        }
예제 #11
0
        /// <summary>Snippet for UpdateApi</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void UpdateApiRequestObject()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            UpdateApiRequest request = new UpdateApiRequest
            {
                UpdateMask = new FieldMask(),
                Api        = new gcav::Api(),
            };
            // Make the request
            Operation <gcav::Api, OperationMetadata> response = apiGatewayServiceClient.UpdateApi(request);

            // Poll until the returned long-running operation is complete
            Operation <gcav::Api, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            gcav::Api result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <gcav::Api, OperationMetadata> retrievedResponse = apiGatewayServiceClient.PollOnceUpdateApi(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                gcav::Api retrievedResult = retrievedResponse.Result;
            }
        }
예제 #12
0
 /// <summary>Snippet for GetApi</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetApiResourceNames()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
     // Initialize request argument(s)
     ApiName name = ApiName.FromProjectApi("[PROJECT]", "[API]");
     // Make the request
     Api response = apiGatewayServiceClient.GetApi(name);
 }
 /// <summary>Snippet for GetGateway</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGateway()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/locations/[LOCATION]/gateways/[GATEWAY]";
     // Make the request
     Gateway response = apiGatewayServiceClient.GetGateway(name);
 }
예제 #14
0
 /// <summary>Snippet for GetApiConfig</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetApiConfig()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/locations/global/apis/[API]/configs/[API_CONFIG]";
     // Make the request
     ApiConfig response = apiGatewayServiceClient.GetApiConfig(name);
 }
 /// <summary>Snippet for GetGatewayAsync</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public async Task GetGatewayResourceNamesAsync()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();
     // Initialize request argument(s)
     GatewayName name = GatewayName.FromProjectLocationGateway("[PROJECT]", "[LOCATION]", "[GATEWAY]");
     // Make the request
     Gateway response = await apiGatewayServiceClient.GetGatewayAsync(name);
 }
        /// <summary>Snippet for GetApiAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetApiAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/global/apis/[API]";
            // Make the request
            Api response = await apiGatewayServiceClient.GetApiAsync(name);
        }
        /// <summary>Snippet for GetApiConfigAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetApiConfigResourceNamesAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            ApiConfigName name = ApiConfigName.FromProjectApiApiConfig("[PROJECT]", "[API]", "[API_CONFIG]");
            // Make the request
            ApiConfig response = await apiGatewayServiceClient.GetApiConfigAsync(name);
        }
예제 #18
0
 /// <summary>Snippet for GetApi</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetApiRequestObject()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
     // Initialize request argument(s)
     GetApiRequest request = new GetApiRequest
     {
         ApiName = ApiName.FromProjectApi("[PROJECT]", "[API]"),
     };
     // Make the request
     Api response = apiGatewayServiceClient.GetApi(request);
 }
예제 #19
0
 /// <summary>Snippet for GetGateway</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGatewayRequestObject()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
     // Initialize request argument(s)
     GetGatewayRequest request = new GetGatewayRequest
     {
         GatewayName = GatewayName.FromProjectLocationGateway("[PROJECT]", "[LOCATION]", "[GATEWAY]"),
     };
     // Make the request
     Gateway response = apiGatewayServiceClient.GetGateway(request);
 }
 /// <summary>Snippet for GetApiConfig</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetApiConfigRequestObject()
 {
     // Create client
     ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
     // Initialize request argument(s)
     GetApiConfigRequest request = new GetApiConfigRequest
     {
         ApiConfigName = ApiConfigName.FromProjectApiApiConfig("[PROJECT]", "[API]", "[API_CONFIG]"),
         View          = GetApiConfigRequest.Types.ConfigView.Unspecified,
     };
     // Make the request
     ApiConfig response = apiGatewayServiceClient.GetApiConfig(request);
 }
예제 #21
0
        /// <summary>Snippet for ListApisAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListApisRequestObjectAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListApisRequest request = new ListApisRequest
            {
                ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
                Filter  = "",
                OrderBy = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListApisResponse, Api> response = apiGatewayServiceClient.ListApisAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Api item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListApisResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Api item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int        pageSize   = 10;
            Page <Api> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Api item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
예제 #22
0
        /// <summary>Snippet for ListApiConfigs</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListApiConfigsRequestObject()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            ListApiConfigsRequest request = new ListApiConfigsRequest
            {
                ParentAsApiName = ApiName.FromProjectApi("[PROJECT]", "[API]"),
                Filter          = "",
                OrderBy         = "",
            };
            // Make the request
            PagedEnumerable <ListApiConfigsResponse, ApiConfig> response = apiGatewayServiceClient.ListApiConfigs(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (ApiConfig item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListApiConfigsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (ApiConfig item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <ApiConfig> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (ApiConfig item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
예제 #23
0
        /// <summary>Snippet for ListGatewaysAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListGatewaysAsync()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = await ApiGatewayServiceClient.CreateAsync();

            // Initialize request argument(s)
            string parent = "projects/[PROJECT]/locations/[LOCATION]";
            // Make the request
            PagedAsyncEnumerable <ListGatewaysResponse, Gateway> response = apiGatewayServiceClient.ListGatewaysAsync(parent);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Gateway item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListGatewaysResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Gateway item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int            pageSize   = 10;
            Page <Gateway> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Gateway item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
        /// <summary>Snippet for ListGateways</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListGatewaysResourceNames()
        {
            // Create client
            ApiGatewayServiceClient apiGatewayServiceClient = ApiGatewayServiceClient.Create();
            // Initialize request argument(s)
            LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
            // Make the request
            PagedEnumerable <ListGatewaysResponse, Gateway> response = apiGatewayServiceClient.ListGateways(parent);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Gateway item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListGatewaysResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Gateway item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int            pageSize   = 10;
            Page <Gateway> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Gateway item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }