Ejemplo n.º 1
0
        /// <summary>Snippet for DeleteTrigger</summary>
        public void DeleteTriggerResourceNames()
        {
            // Snippet: DeleteTrigger(TriggerName, bool, CallSettings)
            // Create client
            EventarcClient eventarcClient = EventarcClient.Create();
            // Initialize request argument(s)
            TriggerName name         = TriggerName.FromProjectLocationTrigger("[PROJECT]", "[LOCATION]", "[TRIGGER]");
            bool        allowMissing = false;
            // Make the request
            Operation <Trigger, OperationMetadata> response = eventarcClient.DeleteTrigger(name, allowMissing);

            // Poll until the returned long-running operation is complete
            Operation <Trigger, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // 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 = eventarcClient.PollOnceDeleteTrigger(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
        }