コード例 #1
0
        /// <summary>Snippet for UpdateTriggerAsync</summary>
        public async Task UpdateTriggerAsync()
        {
            // Snippet: UpdateTriggerAsync(Trigger, FieldMask, bool, CallSettings)
            // Additional: UpdateTriggerAsync(Trigger, FieldMask, bool, CancellationToken)
            // Create client
            EventarcClient eventarcClient = await EventarcClient.CreateAsync();

            // Initialize request argument(s)
            Trigger   trigger      = new Trigger();
            FieldMask updateMask   = new FieldMask();
            bool      allowMissing = false;
            // Make the request
            Operation <Trigger, OperationMetadata> response = await eventarcClient.UpdateTriggerAsync(trigger, updateMask, 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.PollOnceUpdateTriggerAsync(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
        }