/// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertRegionHealthCheckServiceRequest, CallSettings)
            // Additional: InsertAsync(InsertRegionHealthCheckServiceRequest, CancellationToken)
            // Create client
            RegionHealthCheckServicesClient regionHealthCheckServicesClient = await RegionHealthCheckServicesClient.CreateAsync();

            // Initialize request argument(s)
            InsertRegionHealthCheckServiceRequest request = new InsertRegionHealthCheckServiceRequest
            {
                RequestId = "",
                Region    = "",
                Project   = "",
                HealthCheckServiceResource = new HealthCheckService(),
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await regionHealthCheckServicesClient.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 regionHealthCheckServicesClient.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
        }
Exemplo n.º 2
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeletePublicDelegatedPrefixeRequest, CallSettings)
            // Additional: DeleteAsync(DeletePublicDelegatedPrefixeRequest, CancellationToken)
            // Create client
            PublicDelegatedPrefixesClient publicDelegatedPrefixesClient = await PublicDelegatedPrefixesClient.CreateAsync();

            // Initialize request argument(s)
            DeletePublicDelegatedPrefixeRequest request = new DeletePublicDelegatedPrefixeRequest
            {
                RequestId             = "",
                Region                = "",
                PublicDelegatedPrefix = "",
                Project               = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await publicDelegatedPrefixesClient.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 publicDelegatedPrefixesClient.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
        }
Exemplo n.º 3
0
        /// <summary>Snippet for PatchAsync</summary>
        public async Task PatchRequestObjectAsync()
        {
            // Snippet: PatchAsync(PatchGlobalForwardingRuleRequest, CallSettings)
            // Additional: PatchAsync(PatchGlobalForwardingRuleRequest, CancellationToken)
            // Create client
            GlobalForwardingRulesClient globalForwardingRulesClient = await GlobalForwardingRulesClient.CreateAsync();

            // Initialize request argument(s)
            PatchGlobalForwardingRuleRequest request = new PatchGlobalForwardingRuleRequest
            {
                RequestId              = "",
                Project                = "",
                ForwardingRule         = "",
                ForwardingRuleResource = new ForwardingRule(),
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await globalForwardingRulesClient.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 globalForwardingRulesClient.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
        }
Exemplo n.º 4
0
        /// <summary>Snippet for SetUrlMapAsync</summary>
        public async Task SetUrlMapRequestObjectAsync()
        {
            // Snippet: SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest, CallSettings)
            // Additional: SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest, CancellationToken)
            // Create client
            TargetHttpProxiesClient targetHttpProxiesClient = await TargetHttpProxiesClient.CreateAsync();

            // Initialize request argument(s)
            SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest
            {
                RequestId               = "",
                TargetHttpProxy         = "",
                Project                 = "",
                UrlMapReferenceResource = new UrlMapReference(),
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await targetHttpProxiesClient.SetUrlMapAsync(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 targetHttpProxiesClient.PollOnceSetUrlMapAsync(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
        }
Exemplo n.º 5
0
        /// <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
        }