/// <summary>Snippet for SetTargetAsync</summary> public async Task SetTargetAsync() { // Snippet: SetTargetAsync(string, string, TargetReference, CallSettings) // Additional: SetTargetAsync(string, string, TargetReference, CancellationToken) // Create client GlobalForwardingRulesClient globalForwardingRulesClient = await GlobalForwardingRulesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string forwardingRule = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request lro::Operation <Operation, Operation> response = await globalForwardingRulesClient.SetTargetAsync(project, forwardingRule, targetReferenceResource); // 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 globalForwardingRulesClient.PollOnceSetTargetAsync(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 }
internal lro::Operation ToLroResponse(string name) { // TODO: Work this out much more carefully. In particular, consider whether a Compute LRO can complete successfully with errors... var proto = new lro::Operation { // Derived from [(google.cloud.operation_field) = STATUS] Done = Status == Types.Status.Done, // Taken from [(google.cloud.operation_field) = NAME] Name = name, // Always pack the raw response as metadata Metadata = wkt::Any.Pack(this) }; if (proto.Done) { // Only pack the raw response as the LRO Response if we're done proto.Response = proto.Metadata; } // Derived from [(google.cloud.operation_field) = ERROR_CODE] and [(google.cloud.operation_field) = ERROR_MESSAGE] if (HasHttpErrorStatusCode) { proto.Error = new Rpc.Status { // gRPC status codes directly correspond to values in google.rpc.Code Code = (int)RestGrpcAdapter.ConvertHttpStatusCode(HttpErrorStatusCode), Message = HttpErrorMessage }; } return(proto); }
/// <summary>Snippet for Update</summary> public void Update() { // Snippet: Update(string, string, Firewall, CallSettings) // Create client FirewallsClient firewallsClient = FirewallsClient.Create(); // Initialize request argument(s) string project = ""; string firewall = ""; Firewall firewallResource = new Firewall(); // Make the request lro::Operation <Operation, Operation> response = firewallsClient.Update(project, firewall, firewallResource); // 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 = firewallsClient.PollOnceUpdate(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 SetLabels</summary> public void SetLabelsRequestObject() { // Snippet: SetLabels(SetLabelsGlobalForwardingRuleRequest, CallSettings) // Create client GlobalForwardingRulesClient globalForwardingRulesClient = GlobalForwardingRulesClient.Create(); // Initialize request argument(s) SetLabelsGlobalForwardingRuleRequest request = new SetLabelsGlobalForwardingRuleRequest { Resource = "", Project = "", GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request lro::Operation <Operation, Operation> response = globalForwardingRulesClient.SetLabels(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 = globalForwardingRulesClient.PollOnceSetLabels(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 SetUrlMap</summary> public void SetUrlMapRequestObject() { // Snippet: SetUrlMap(SetUrlMapTargetHttpProxyRequest, CallSettings) // Create client TargetHttpProxiesClient targetHttpProxiesClient = TargetHttpProxiesClient.Create(); // Initialize request argument(s) SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest { RequestId = "", TargetHttpProxy = "", Project = "", UrlMapReferenceResource = new UrlMapReference(), }; // Make the request lro::Operation <Operation, Operation> response = targetHttpProxiesClient.SetUrlMap(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 = targetHttpProxiesClient.PollOnceSetUrlMap(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 SetNamedPorts</summary> public void SetNamedPortsRequestObject() { // Snippet: SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest, CallSettings) // Create client RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create(); // Initialize request argument(s) SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest { RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(), RequestId = "", InstanceGroup = "", Region = "", Project = "", }; // Make the request lro::Operation <Operation, Operation> response = regionInstanceGroupsClient.SetNamedPorts(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 = regionInstanceGroupsClient.PollOnceSetNamedPorts(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 Update</summary> public void UpdateRequestObject() { // Snippet: Update(UpdateRegionBackendServiceRequest, CallSettings) // Create client RegionBackendServicesClient regionBackendServicesClient = RegionBackendServicesClient.Create(); // Initialize request argument(s) UpdateRegionBackendServiceRequest request = new UpdateRegionBackendServiceRequest { RequestId = "", Region = "", Project = "", BackendService = "", BackendServiceResource = new BackendService(), }; // Make the request lro::Operation <Operation, Operation> response = regionBackendServicesClient.Update(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 = regionBackendServicesClient.PollOnceUpdate(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 Patch</summary> public void Patch() { // Snippet: Patch(string, string, string, HealthCheck, CallSettings) // Create client RegionHealthChecksClient regionHealthChecksClient = RegionHealthChecksClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request lro::Operation <Operation, Operation> response = regionHealthChecksClient.Patch(project, region, healthCheck, healthCheckResource); // 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 = regionHealthChecksClient.PollOncePatch(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 SetProxyHeader</summary> public void SetProxyHeader() { // Snippet: SetProxyHeader(string, string, TargetTcpProxiesSetProxyHeaderRequest, CallSettings) // Create client TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.Create(); // Initialize request argument(s) string project = ""; string targetTcpProxy = ""; TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); // Make the request lro::Operation <Operation, Operation> response = targetTcpProxiesClient.SetProxyHeader(project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); // 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 = targetTcpProxiesClient.PollOnceSetProxyHeader(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 Patch</summary> public void PatchRequestObject() { // Snippet: Patch(PatchAutoscalerRequest, CallSettings) // Create client AutoscalersClient autoscalersClient = AutoscalersClient.Create(); // Initialize request argument(s) PatchAutoscalerRequest request = new PatchAutoscalerRequest { Zone = "", RequestId = "", AutoscalerResource = new Autoscaler(), Project = "", Autoscaler = "", }; // Make the request lro::Operation <Operation, Operation> response = autoscalersClient.Patch(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 = autoscalersClient.PollOncePatch(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 Insert</summary> public void Insert() { // Snippet: Insert(string, Address, CallSettings) // Create client GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.Create(); // Initialize request argument(s) string project = ""; Address addressResource = new Address(); // Make the request lro::Operation <Operation, Operation> response = globalAddressesClient.Insert(project, addressResource); // 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 = globalAddressesClient.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 UpdateAsync</summary> public async Task UpdateAsync() { // Snippet: UpdateAsync(string, string, Autoscaler, CallSettings) // Additional: UpdateAsync(string, string, Autoscaler, CancellationToken) // Create client AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync(); // Initialize request argument(s) string project = ""; string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request lro::Operation <Operation, Operation> response = await autoscalersClient.UpdateAsync(project, zone, autoscalerResource); // 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 autoscalersClient.PollOnceUpdateAsync(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 Insert</summary> public void Insert() { // Snippet: Insert(string, string, NetworkEndpointGroup, CallSettings) // Create client RegionNetworkEndpointGroupsClient regionNetworkEndpointGroupsClient = RegionNetworkEndpointGroupsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request lro::Operation <Operation, Operation> response = regionNetworkEndpointGroupsClient.Insert(project, region, networkEndpointGroupResource); // 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 = regionNetworkEndpointGroupsClient.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 SetUrlMap</summary> public void SetUrlMap() { // Snippet: SetUrlMap(string, string, string, UrlMapReference, CallSettings) // Create client RegionTargetHttpProxiesClient regionTargetHttpProxiesClient = RegionTargetHttpProxiesClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string targetHttpProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request lro::Operation <Operation, Operation> response = regionTargetHttpProxiesClient.SetUrlMap(project, region, targetHttpProxy, urlMapReferenceResource); // 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 = regionTargetHttpProxiesClient.PollOnceSetUrlMap(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 Insert</summary> public void InsertRequestObject() { // Snippet: Insert(InsertVpnGatewayRequest, CallSettings) // Create client VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create(); // Initialize request argument(s) InsertVpnGatewayRequest request = new InsertVpnGatewayRequest { RequestId = "", Region = "", VpnGatewayResource = new VpnGateway(), Project = "", }; // Make the request lro::Operation <Operation, Operation> response = vpnGatewaysClient.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 = vpnGatewaysClient.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 SetNamedPortsAsync</summary> public async Task SetNamedPortsAsync() { // Snippet: SetNamedPortsAsync(string, string, string, RegionInstanceGroupsSetNamedPortsRequest, CallSettings) // Additional: SetNamedPortsAsync(string, string, string, RegionInstanceGroupsSetNamedPortsRequest, CancellationToken) // Create client RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync(); // Initialize request argument(s) string project = ""; string region = ""; string instanceGroup = ""; RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); // Make the request lro::Operation <Operation, Operation> response = await regionInstanceGroupsClient.SetNamedPortsAsync(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); // 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 regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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 PatchAsync</summary> public async Task PatchAsync() { // Snippet: PatchAsync(string, string, string, BackendService, CallSettings) // Additional: PatchAsync(string, string, string, BackendService, CancellationToken) // Create client RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync(); // Initialize request argument(s) string project = ""; string region = ""; string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request lro::Operation <Operation, Operation> response = await regionBackendServicesClient.PatchAsync(project, region, backendService, backendServiceResource); // 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 regionBackendServicesClient.PollOncePatchAsync(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 RegionBackendServicesClient regionBackendServicesClient = RegionBackendServicesClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string backendService = ""; // Make the request lro::Operation <Operation, Operation> response = regionBackendServicesClient.Delete(project, region, backendService); // 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 = regionBackendServicesClient.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 DeleteAsync</summary> public async Task DeleteAsync() { // Snippet: DeleteAsync(string, string, string, CallSettings) // Additional: DeleteAsync(string, string, string, CancellationToken) // Create client VpnGatewaysClient vpnGatewaysClient = await VpnGatewaysClient.CreateAsync(); // Initialize request argument(s) string project = ""; string region = ""; string vpnGateway = ""; // Make the request lro::Operation <Operation, Operation> response = await vpnGatewaysClient.DeleteAsync(project, region, vpnGateway); // 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 vpnGatewaysClient.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 }
/// <summary>Snippet for Patch</summary> public void Patch() { // Snippet: Patch(string, string, PublicDelegatedPrefix, CallSettings) // Create client GlobalPublicDelegatedPrefixesClient globalPublicDelegatedPrefixesClient = GlobalPublicDelegatedPrefixesClient.Create(); // Initialize request argument(s) string project = ""; string publicDelegatedPrefix = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request lro::Operation <Operation, Operation> response = globalPublicDelegatedPrefixesClient.Patch(project, publicDelegatedPrefix, publicDelegatedPrefixResource); // 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 = globalPublicDelegatedPrefixesClient.PollOncePatch(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, PublicDelegatedPrefix, CallSettings) // Additional: InsertAsync(string, PublicDelegatedPrefix, CancellationToken) // Create client GlobalPublicDelegatedPrefixesClient globalPublicDelegatedPrefixesClient = await GlobalPublicDelegatedPrefixesClient.CreateAsync(); // Initialize request argument(s) string project = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request lro::Operation <Operation, Operation> response = await globalPublicDelegatedPrefixesClient.InsertAsync(project, publicDelegatedPrefixResource); // 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 globalPublicDelegatedPrefixesClient.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 DeleteRequestObject() { // Snippet: Delete(DeleteGlobalPublicDelegatedPrefixeRequest, CallSettings) // Create client GlobalPublicDelegatedPrefixesClient globalPublicDelegatedPrefixesClient = GlobalPublicDelegatedPrefixesClient.Create(); // Initialize request argument(s) DeleteGlobalPublicDelegatedPrefixeRequest request = new DeleteGlobalPublicDelegatedPrefixeRequest { RequestId = "", PublicDelegatedPrefix = "", Project = "", }; // Make the request lro::Operation <Operation, Operation> response = globalPublicDelegatedPrefixesClient.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 = globalPublicDelegatedPrefixesClient.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 SetLabels</summary> public void SetLabels() { // Snippet: SetLabels(string, string, string, RegionSetLabelsRequest, CallSettings) // Create client VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request lro::Operation <Operation, Operation> response = vpnGatewaysClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); // 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 = vpnGatewaysClient.PollOnceSetLabels(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 SetLabelsAsync</summary> public async Task SetLabelsRequestObjectAsync() { // Snippet: SetLabelsAsync(SetLabelsVpnGatewayRequest, CallSettings) // Additional: SetLabelsAsync(SetLabelsVpnGatewayRequest, CancellationToken) // Create client VpnGatewaysClient vpnGatewaysClient = await VpnGatewaysClient.CreateAsync(); // Initialize request argument(s) SetLabelsVpnGatewayRequest request = new SetLabelsVpnGatewayRequest { RequestId = "", Region = "", Resource = "", Project = "", RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request lro::Operation <Operation, Operation> response = await vpnGatewaysClient.SetLabelsAsync(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 vpnGatewaysClient.PollOnceSetLabelsAsync(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 PatchAsync</summary> public async Task PatchRequestObjectAsync() { // Snippet: PatchAsync(PatchPublicDelegatedPrefixeRequest, CallSettings) // Additional: PatchAsync(PatchPublicDelegatedPrefixeRequest, CancellationToken) // Create client PublicDelegatedPrefixesClient publicDelegatedPrefixesClient = await PublicDelegatedPrefixesClient.CreateAsync(); // Initialize request argument(s) PatchPublicDelegatedPrefixeRequest request = new PatchPublicDelegatedPrefixeRequest { RequestId = "", PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), Region = "", PublicDelegatedPrefix = "", Project = "", }; // Make the request lro::Operation <Operation, Operation> response = await publicDelegatedPrefixesClient.PatchAsync(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 publicDelegatedPrefixesClient.PollOncePatchAsync(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 InsertRequestObjectAsync() { // Snippet: InsertAsync(InsertInterconnectAttachmentRequest, CallSettings) // Additional: InsertAsync(InsertInterconnectAttachmentRequest, CancellationToken) // Create client InterconnectAttachmentsClient interconnectAttachmentsClient = await InterconnectAttachmentsClient.CreateAsync(); // Initialize request argument(s) InsertInterconnectAttachmentRequest request = new InsertInterconnectAttachmentRequest { RequestId = "", Region = "", InterconnectAttachmentResource = new InterconnectAttachment(), Project = "", ValidateOnly = false, }; // Make the request lro::Operation <Operation, Operation> response = await interconnectAttachmentsClient.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 interconnectAttachmentsClient.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 DeleteAsync</summary> public async Task DeleteRequestObjectAsync() { // Snippet: DeleteAsync(DeleteRegionAutoscalerRequest, CallSettings) // Additional: DeleteAsync(DeleteRegionAutoscalerRequest, CancellationToken) // Create client RegionAutoscalersClient regionAutoscalersClient = await RegionAutoscalersClient.CreateAsync(); // Initialize request argument(s) DeleteRegionAutoscalerRequest request = new DeleteRegionAutoscalerRequest { RequestId = "", Region = "", Project = "", Autoscaler = "", }; // Make the request lro::Operation <Operation, Operation> response = await regionAutoscalersClient.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 regionAutoscalersClient.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 }
/// <summary>Snippet for UpdateAsync</summary> public async Task UpdateRequestObjectAsync() { // Snippet: UpdateAsync(UpdateFirewallRequest, CallSettings) // Additional: UpdateAsync(UpdateFirewallRequest, CancellationToken) // Create client FirewallsClient firewallsClient = await FirewallsClient.CreateAsync(); // Initialize request argument(s) UpdateFirewallRequest request = new UpdateFirewallRequest { RequestId = "", FirewallResource = new Firewall(), Project = "", Firewall = "", }; // Make the request lro::Operation <Operation, Operation> response = await firewallsClient.UpdateAsync(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 firewallsClient.PollOnceUpdateAsync(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 }