コード例 #1
0
        /// <summary>Snippet for DeleteTagBindingAsync</summary>
        public async Task DeleteTagBindingResourceNamesAsync()
        {
            // Snippet: DeleteTagBindingAsync(TagBindingName, CallSettings)
            // Additional: DeleteTagBindingAsync(TagBindingName, CancellationToken)
            // Create client
            TagBindingsClient tagBindingsClient = await TagBindingsClient.CreateAsync();

            // Initialize request argument(s)
            TagBindingName name = TagBindingName.FromTagBinding("[TAG_BINDING]");
            // Make the request
            Operation <Empty, DeleteTagBindingMetadata> response = await tagBindingsClient.DeleteTagBindingAsync(name);

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

            // Retrieve the operation result
            Empty 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
            Operation <Empty, DeleteTagBindingMetadata> retrievedResponse = await tagBindingsClient.PollOnceDeleteTagBindingAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
コード例 #2
0
        /// <summary>Snippet for DeleteTagBinding</summary>
        public void DeleteTagBindingRequestObject()
        {
            // Snippet: DeleteTagBinding(DeleteTagBindingRequest, CallSettings)
            // Create client
            TagBindingsClient tagBindingsClient = TagBindingsClient.Create();
            // Initialize request argument(s)
            DeleteTagBindingRequest request = new DeleteTagBindingRequest
            {
                TagBindingName = TagBindingName.FromTagBinding("[TAG_BINDING]"),
            };
            // Make the request
            Operation <Empty, DeleteTagBindingMetadata> response = tagBindingsClient.DeleteTagBinding(request);

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

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