/// <summary>Snippet for GetAsync</summary> public async Task GetRequestObjectAsync() { // Snippet: GetAsync(GetVpnTunnelRequest, CallSettings) // Additional: GetAsync(GetVpnTunnelRequest, CancellationToken) // Create client VpnTunnelsClient vpnTunnelsClient = await VpnTunnelsClient.CreateAsync(); // Initialize request argument(s) GetVpnTunnelRequest request = new GetVpnTunnelRequest { Region = "", VpnTunnel = "", Project = "", }; // Make the request VpnTunnel response = await vpnTunnelsClient.GetAsync(request); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertRequestObjectAsync() { // Snippet: InsertAsync(InsertVpnTunnelRequest, CallSettings) // Additional: InsertAsync(InsertVpnTunnelRequest, CancellationToken) // Create client VpnTunnelsClient vpnTunnelsClient = await VpnTunnelsClient.CreateAsync(); // Initialize request argument(s) InsertVpnTunnelRequest request = new InsertVpnTunnelRequest { RequestId = "", VpnTunnelResource = new VpnTunnel(), Region = "", Project = "", }; // Make the request Operation response = await vpnTunnelsClient.InsertAsync(request); // End snippet }
/// <summary>Snippet for DeleteAsync</summary> public async Task DeleteRequestObjectAsync() { // Snippet: DeleteAsync(DeleteVpnTunnelRequest, CallSettings) // Additional: DeleteAsync(DeleteVpnTunnelRequest, CancellationToken) // Create client VpnTunnelsClient vpnTunnelsClient = await VpnTunnelsClient.CreateAsync(); // Initialize request argument(s) DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest { RequestId = "", Region = "", VpnTunnel = "", Project = "", }; // Make the request Operation response = await vpnTunnelsClient.DeleteAsync(request); // End snippet }
/// <summary>Snippet for AggregatedListAsync</summary> public async Task AggregatedListRequestObjectAsync() { // Snippet: AggregatedListAsync(AggregatedListVpnTunnelsRequest, CallSettings) // Additional: AggregatedListAsync(AggregatedListVpnTunnelsRequest, CancellationToken) // Create client VpnTunnelsClient vpnTunnelsClient = await VpnTunnelsClient.CreateAsync(); // Initialize request argument(s) AggregatedListVpnTunnelsRequest request = new AggregatedListVpnTunnelsRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", IncludeAllScopes = false, ReturnPartialSuccess = false, }; // Make the request VpnTunnelAggregatedList response = await vpnTunnelsClient.AggregatedListAsync(request); // End snippet }
/// <summary>Snippet for InsertAsync</summary> public async Task InsertRequestObjectAsync() { // Snippet: InsertAsync(InsertVpnTunnelRequest, CallSettings) // Additional: InsertAsync(InsertVpnTunnelRequest, CancellationToken) // Create client VpnTunnelsClient vpnTunnelsClient = await VpnTunnelsClient.CreateAsync(); // Initialize request argument(s) InsertVpnTunnelRequest request = new InsertVpnTunnelRequest { RequestId = "", VpnTunnelResource = new VpnTunnel(), Region = "", Project = "", }; // Make the request lro::Operation <Operation, Operation> response = await vpnTunnelsClient.InsertAsync(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 vpnTunnelsClient.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 }