/// <summary>Snippet for Insert</summary>
        public void InsertRequestObject()
        {
            // Snippet: Insert(InsertTargetVpnGatewayRequest, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest
            {
                TargetVpnGatewayResource = new TargetVpnGateway(),
                RequestId = "",
                Region    = "",
                Project   = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = targetVpnGatewaysClient.Insert(request);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = targetVpnGatewaysClient.PollOnceInsert(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, string, TargetVpnGateway, CallSettings)
            // Additional: InsertAsync(string, string, TargetVpnGateway, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            string           project = "";
            string           region  = "";
            TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway();
            // Make the request
            lro::Operation <Operation, Operation> response = await targetVpnGatewaysClient.InsertAsync(project, region, targetVpnGatewayResource);

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

            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = await targetVpnGatewaysClient.PollOnceInsertAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for Delete</summary>
        public void Delete()
        {
            // Snippet: Delete(string, string, string, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            string project          = "";
            string region           = "";
            string targetVpnGateway = "";
            // Make the request
            lro::Operation <Operation, Operation> response = targetVpnGatewaysClient.Delete(project, region, targetVpnGateway);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = targetVpnGatewaysClient.PollOnceDelete(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Example #4
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     TargetVpnGatewayAggregatedList response = targetVpnGatewaysClient.AggregatedList(project);
     // End snippet
 }
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListRequestObjectAsync()
        {
            // Snippet: AggregatedListAsync(AggregatedListTargetVpnGatewaysRequest, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            AggregatedListTargetVpnGatewaysRequest request = new AggregatedListTargetVpnGatewaysRequest
            {
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                IncludeAllScopes     = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <TargetVpnGatewayAggregatedList, KeyValuePair <string, TargetVpnGatewaysScopedList> > response = targetVpnGatewaysClient.AggregatedListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((KeyValuePair <string, TargetVpnGatewaysScopedList> 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((TargetVpnGatewayAggregatedList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, TargetVpnGatewaysScopedList> 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 <KeyValuePair <string, TargetVpnGatewaysScopedList> > 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 (KeyValuePair <string, TargetVpnGatewaysScopedList> 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;
            // End snippet
        }
 /// <summary>Snippet for Get</summary>
 public void Get()
 {
     // Snippet: Get(string, string, string, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project          = "";
     string region           = "";
     string targetVpnGateway = "";
     // Make the request
     TargetVpnGateway response = targetVpnGatewaysClient.Get(project, region, targetVpnGateway);
     // End snippet
 }
Example #7
0
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, TargetVpnGateway, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     string           project = "";
     string           region  = "";
     TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway();
     // Make the request
     Operation response = targetVpnGatewaysClient.Insert(project, region, targetVpnGatewayResource);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListTargetVpnGatewaysRequest, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            ListTargetVpnGatewaysRequest request = new ListTargetVpnGatewaysRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <TargetVpnGatewayList, TargetVpnGateway> response = targetVpnGatewaysClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (TargetVpnGateway 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 (TargetVpnGatewayList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (TargetVpnGateway 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 <TargetVpnGateway> 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 (TargetVpnGateway 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;
            // End snippet
        }
Example #9
0
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListAsync()
        {
            // Snippet: AggregatedListAsync(string, CallSettings)
            // Additional: AggregatedListAsync(string, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            TargetVpnGatewayAggregatedList response = await targetVpnGatewaysClient.AggregatedListAsync(project);

            // End snippet
        }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
     {
         Region           = "",
         Project          = "",
         TargetVpnGateway = "",
     };
     // Make the request
     TargetVpnGateway response = targetVpnGatewaysClient.Get(request);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetAsync()
        {
            // Snippet: GetAsync(string, string, string, CallSettings)
            // Additional: GetAsync(string, string, string, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            string project          = "";
            string region           = "";
            string targetVpnGateway = "";
            // Make the request
            TargetVpnGateway response = await targetVpnGatewaysClient.GetAsync(project, region, targetVpnGateway);

            // End snippet
        }
Example #12
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, string, TargetVpnGateway, CallSettings)
            // Additional: InsertAsync(string, string, TargetVpnGateway, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            string           project = "";
            string           region  = "";
            TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway();
            // Make the request
            Operation response = await targetVpnGatewaysClient.InsertAsync(project, region, targetVpnGatewayResource);

            // End snippet
        }
Example #13
0
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest
     {
         TargetVpnGatewayResource = new TargetVpnGateway(),
         RequestId = "",
         Region    = "",
         Project   = "",
     };
     // Make the request
     Operation response = targetVpnGatewaysClient.Insert(request);
     // End snippet
 }
Example #14
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest
     {
         RequestId        = "",
         Region           = "",
         Project          = "",
         TargetVpnGateway = "",
     };
     // Make the request
     Operation response = targetVpnGatewaysClient.Delete(request);
     // End snippet
 }
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, string, int?, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string region  = "";
            // Make the request
            PagedAsyncEnumerable <TargetVpnGatewayList, TargetVpnGateway> response = targetVpnGatewaysClient.ListAsync(project, region);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((TargetVpnGateway 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((TargetVpnGatewayList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (TargetVpnGateway 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 <TargetVpnGateway> 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 (TargetVpnGateway 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;
            // End snippet
        }
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable <TargetVpnGatewayAggregatedList, KeyValuePair <string, TargetVpnGatewaysScopedList> > response = targetVpnGatewaysClient.AggregatedList(project);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair <string, TargetVpnGatewaysScopedList> 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 (TargetVpnGatewayAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, TargetVpnGatewaysScopedList> 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 <KeyValuePair <string, TargetVpnGatewaysScopedList> > 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 (KeyValuePair <string, TargetVpnGatewaysScopedList> 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;
            // End snippet
        }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetTargetVpnGatewayRequest, CallSettings)
            // Additional: GetAsync(GetTargetVpnGatewayRequest, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
            {
                Region           = "",
                Project          = "",
                TargetVpnGateway = "",
            };
            // Make the request
            TargetVpnGateway response = await targetVpnGatewaysClient.GetAsync(request);

            // End snippet
        }
Example #18
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListTargetVpnGatewaysRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     AggregatedListTargetVpnGatewaysRequest request = new AggregatedListTargetVpnGatewaysRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         IncludeAllScopes     = false,
         ReturnPartialSuccess = false,
     };
     // Make the request
     TargetVpnGatewayAggregatedList response = targetVpnGatewaysClient.AggregatedList(request);
     // End snippet
 }
Example #19
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertTargetVpnGatewayRequest, CallSettings)
            // Additional: InsertAsync(InsertTargetVpnGatewayRequest, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest
            {
                TargetVpnGatewayResource = new TargetVpnGateway(),
                RequestId = "",
                Region    = "",
                Project   = "",
            };
            // Make the request
            Operation response = await targetVpnGatewaysClient.InsertAsync(request);

            // End snippet
        }
Example #20
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListTargetVpnGatewaysRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     ListTargetVpnGatewaysRequest request = new ListTargetVpnGatewaysRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Region               = "",
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     TargetVpnGatewayList response = targetVpnGatewaysClient.List(request);
     // End snippet
 }
Example #21
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteTargetVpnGatewayRequest, CallSettings)
            // Additional: DeleteAsync(DeleteTargetVpnGatewayRequest, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest
            {
                RequestId        = "",
                Region           = "",
                Project          = "",
                TargetVpnGateway = "",
            };
            // Make the request
            Operation response = await targetVpnGatewaysClient.DeleteAsync(request);

            // End snippet
        }
Example #22
0
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListRequestObjectAsync()
        {
            // Snippet: AggregatedListAsync(AggregatedListTargetVpnGatewaysRequest, CallSettings)
            // Additional: AggregatedListAsync(AggregatedListTargetVpnGatewaysRequest, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            AggregatedListTargetVpnGatewaysRequest request = new AggregatedListTargetVpnGatewaysRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                IncludeAllScopes     = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            TargetVpnGatewayAggregatedList response = await targetVpnGatewaysClient.AggregatedListAsync(request);

            // End snippet
        }
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteTargetVpnGatewayRequest, CallSettings)
            // Additional: DeleteAsync(DeleteTargetVpnGatewayRequest, CancellationToken)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = await TargetVpnGatewaysClient.CreateAsync();

            // Initialize request argument(s)
            DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest
            {
                RequestId        = "",
                Region           = "",
                Project          = "",
                TargetVpnGateway = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await targetVpnGatewaysClient.DeleteAsync(request);

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

            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = await targetVpnGatewaysClient.PollOnceDeleteAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }