/// <summary>Snippet for Insert</summary> public void Insert() { // Snippet: Insert(string, string, VpnTunnel, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; VpnTunnel vpnTunnelResource = new VpnTunnel(); // Make the request lro::Operation <Operation, Operation> response = vpnTunnelsClient.Insert(project, region, vpnTunnelResource); // 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 = vpnTunnelsClient.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 Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteVpnTunnelRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest { RequestId = "", Region = "", VpnTunnel = "", Project = "", }; // Make the request lro::Operation <Operation, Operation> response = vpnTunnelsClient.Delete(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 = vpnTunnelsClient.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 }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedList() { // Snippet: AggregatedList(string, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request VpnTunnelAggregatedList response = vpnTunnelsClient.AggregatedList(project); // End snippet }
/// <summary>Snippet for Insert</summary> public void Insert() { // Snippet: Insert(string, string, VpnTunnel, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; VpnTunnel vpnTunnelResource = new VpnTunnel(); // Make the request Operation response = vpnTunnelsClient.Insert(project, region, vpnTunnelResource); // End snippet }
/// <summary>Snippet for Get</summary> public void Get() { // Snippet: Get(string, string, string, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string vpnTunnel = ""; // Make the request VpnTunnel response = vpnTunnelsClient.Get(project, region, vpnTunnel); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListVpnTunnelsRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) ListVpnTunnelsRequest request = new ListVpnTunnelsRequest { Region = "", OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request PagedEnumerable <VpnTunnelList, VpnTunnel> response = vpnTunnelsClient.List(request); // Iterate over all response items, lazily performing RPCs as required foreach (VpnTunnel 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 (VpnTunnelList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (VpnTunnel 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 <VpnTunnel> 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 (VpnTunnel 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 GetRequestObject() { // Snippet: Get(GetVpnTunnelRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) GetVpnTunnelRequest request = new GetVpnTunnelRequest { Region = "", VpnTunnel = "", Project = "", }; // Make the request VpnTunnel response = vpnTunnelsClient.Get(request); // End snippet }
/// <summary>Snippet for Insert</summary> public void InsertRequestObject() { // Snippet: Insert(InsertVpnTunnelRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) InsertVpnTunnelRequest request = new InsertVpnTunnelRequest { RequestId = "", VpnTunnelResource = new VpnTunnel(), Region = "", Project = "", }; // Make the request Operation response = vpnTunnelsClient.Insert(request); // End snippet }
/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteVpnTunnelRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest { RequestId = "", Region = "", VpnTunnel = "", Project = "", }; // Make the request Operation response = vpnTunnelsClient.Delete(request); // End snippet }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedList() { // Snippet: AggregatedList(string, string, int?, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request PagedEnumerable <VpnTunnelAggregatedList, KeyValuePair <string, VpnTunnelsScopedList> > response = vpnTunnelsClient.AggregatedList(project); // Iterate over all response items, lazily performing RPCs as required foreach (KeyValuePair <string, VpnTunnelsScopedList> 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 (VpnTunnelAggregatedList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (KeyValuePair <string, VpnTunnelsScopedList> 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, VpnTunnelsScopedList> > 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, VpnTunnelsScopedList> 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 List</summary> public void ListRequestObject() { // Snippet: List(ListVpnTunnelsRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) ListVpnTunnelsRequest request = new ListVpnTunnelsRequest { PageToken = "", MaxResults = 0U, Region = "", OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request VpnTunnelList response = vpnTunnelsClient.List(request); // End snippet }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedListRequestObject() { // Snippet: AggregatedList(AggregatedListVpnTunnelsRequest, CallSettings) // Create client VpnTunnelsClient vpnTunnelsClient = VpnTunnelsClient.Create(); // Initialize request argument(s) AggregatedListVpnTunnelsRequest request = new AggregatedListVpnTunnelsRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", IncludeAllScopes = false, ReturnPartialSuccess = false, }; // Make the request VpnTunnelAggregatedList response = vpnTunnelsClient.AggregatedList(request); // End snippet }