Esempio n. 1
0
        /// <summary>Snippet for LoadVersion</summary>
        public void LoadVersionResourceNames()
        {
            // Snippet: LoadVersion(VersionName, CallSettings)
            // Create client
            VersionsClient versionsClient = VersionsClient.Create();
            // Initialize request argument(s)
            VersionName name = VersionName.FromProjectLocationAgentFlowVersion("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
            // Make the request
            Operation <Empty, Struct> response = versionsClient.LoadVersion(name);

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

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