コード例 #1
0
        /// <summary>Snippet for ExportFlowAsync</summary>
        public async Task ExportFlowRequestObjectAsync()
        {
            // Snippet: ExportFlowAsync(ExportFlowRequest, CallSettings)
            // Additional: ExportFlowAsync(ExportFlowRequest, CancellationToken)
            // Create client
            FlowsClient flowsClient = await FlowsClient.CreateAsync();

            // Initialize request argument(s)
            ExportFlowRequest request = new ExportFlowRequest
            {
                FlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                FlowUri  = "",
                IncludeReferencedFlows = false,
            };
            // Make the request
            Operation <ExportFlowResponse, Struct> response = await flowsClient.ExportFlowAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <ExportFlowResponse, Struct> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            ExportFlowResponse 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 <ExportFlowResponse, Struct> retrievedResponse = await flowsClient.PollOnceExportFlowAsync(operationName);

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