Exemple #1
0
        /// <summary>Snippet for BatchUpdateIntents</summary>
        public void BatchUpdateIntents_RequestObject()
        {
            // Snippet: BatchUpdateIntents(BatchUpdateIntentsRequest,CallSettings)
            // Create client
            IntentsClient intentsClient = IntentsClient.Create();
            // Initialize request argument(s)
            BatchUpdateIntentsRequest request = new BatchUpdateIntentsRequest
            {
                ParentAsProjectAgentName = new ProjectAgentName("[PROJECT]"),
                LanguageCode             = "",
            };
            // Make the request
            Operation <BatchUpdateIntentsResponse, Struct> response =
                intentsClient.BatchUpdateIntents(request);

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

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