Ejemplo n.º 1
0
        /// <summary>Snippet for DeleteTriggerAsync</summary>
        public async Task DeleteTriggerResourceNamesAsync()
        {
            // Snippet: DeleteTriggerAsync(TriggerName, bool, CallSettings)
            // Additional: DeleteTriggerAsync(TriggerName, bool, CancellationToken)
            // Create client
            EventarcClient eventarcClient = await EventarcClient.CreateAsync();

            // Initialize request argument(s)
            TriggerName name         = TriggerName.FromProjectLocationTrigger("[PROJECT]", "[LOCATION]", "[TRIGGER]");
            bool        allowMissing = false;
            // Make the request
            Operation <Trigger, OperationMetadata> response = await eventarcClient.DeleteTriggerAsync(name, allowMissing);

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

            // Retrieve the operation result
            Trigger 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 <Trigger, OperationMetadata> retrievedResponse = await eventarcClient.PollOnceDeleteTriggerAsync(operationName);

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