/// <summary>Snippet for CreateVersion</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void CreateVersionRequestObject() { // Create client VersionsClient versionsClient = VersionsClient.Create(); // Initialize request argument(s) CreateVersionRequest request = new CreateVersionRequest { Parent = "", Version = new Version(), }; // Make the request Operation <Version, CreateVersionMetadataV1> response = versionsClient.CreateVersion(request); // Poll until the returned long-running operation is complete Operation <Version, CreateVersionMetadataV1> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Version 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 <Version, CreateVersionMetadataV1> retrievedResponse = versionsClient.PollOnceCreateVersion(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Version retrievedResult = retrievedResponse.Result; } }
/// <summary>Snippet for CreateVersion</summary> public void CreateVersionResourceNames() { // Snippet: CreateVersion(FlowName, Version, CallSettings) // Create client VersionsClient versionsClient = VersionsClient.Create(); // Initialize request argument(s) FlowName parent = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); gcdcv::Version version = new gcdcv::Version(); // Make the request Operation <gcdcv::Version, CreateVersionOperationMetadata> response = versionsClient.CreateVersion(parent, version); // Poll until the returned long-running operation is complete Operation <gcdcv::Version, CreateVersionOperationMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result gcdcv::Version 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 <gcdcv::Version, CreateVersionOperationMetadata> retrievedResponse = versionsClient.PollOnceCreateVersion(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result gcdcv::Version retrievedResult = retrievedResponse.Result; } // End snippet }