Beispiel #1
0
        /// <summary>Snippet for UpdateInstance</summary>
        public void UpdateInstance_RequestObject()
        {
            // Snippet: UpdateInstance(UpdateInstanceRequest,CallSettings)
            // Create client
            InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create();
            // Initialize request argument(s)
            UpdateInstanceRequest request = new UpdateInstanceRequest
            {
                Instance  = new Instance(),
                FieldMask = new FieldMask(),
            };
            // Make the request
            Operation <Instance, UpdateInstanceMetadata> response =
                instanceAdminClient.UpdateInstance(request);

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

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