Example #1
0
        /// <summary>Snippet for ImportFlow</summary>
        public void ImportFlowRequestObject()
        {
            // Snippet: ImportFlow(ImportFlowRequest, CallSettings)
            // Create client
            FlowsClient flowsClient = FlowsClient.Create();
            // Initialize request argument(s)
            ImportFlowRequest request = new ImportFlowRequest
            {
                ParentAsAgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"),
                FlowUri           = "",
                ImportOption      = ImportFlowRequest.Types.ImportOption.Unspecified,
            };
            // Make the request
            Operation <ImportFlowResponse, Struct> response = flowsClient.ImportFlow(request);

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

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