示例#1
0
        /// <summary>Snippet for UpdateIndex</summary>
        public void UpdateIndex()
        {
            // Snippet: UpdateIndex(Index, FieldMask, CallSettings)
            // Create client
            IndexServiceClient indexServiceClient = IndexServiceClient.Create();
            // Initialize request argument(s)
            gcav::Index index      = new gcav::Index();
            FieldMask   updateMask = new FieldMask();
            // Make the request
            Operation <gcav::Index, UpdateIndexOperationMetadata> response = indexServiceClient.UpdateIndex(index, updateMask);

            // Poll until the returned long-running operation is complete
            Operation <gcav::Index, UpdateIndexOperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            gcav::Index 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 <gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = indexServiceClient.PollOnceUpdateIndex(operationName);

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