/// <summary>Snippet for CreateVersionAsync</summary> public async Task CreateVersionRequestObjectAsync() { // Snippet: CreateVersionAsync(CreateVersionRequest, CallSettings) // Additional: CreateVersionAsync(CreateVersionRequest, CancellationToken) // Create client VersionsClient versionsClient = await VersionsClient.CreateAsync(); // Initialize request argument(s) CreateVersionRequest request = new CreateVersionRequest { Parent = "", Version = new gcav::Version(), }; // Make the request Operation <gcav::Version, CreateVersionMetadataV1> response = await versionsClient.CreateVersionAsync(request); // Poll until the returned long-running operation is complete Operation <gcav::Version, CreateVersionMetadataV1> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result gcav::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 <gcav::Version, CreateVersionMetadataV1> retrievedResponse = await versionsClient.PollOnceCreateVersionAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result gcav::Version retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for CreateVersionAsync</summary> public async Task CreateVersionAsync() { // Snippet: CreateVersionAsync(string, Version, CallSettings) // Additional: CreateVersionAsync(string, Version, CancellationToken) // Create client VersionsClient versionsClient = await VersionsClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/agent"; gcdv::Version version = new gcdv::Version(); // Make the request gcdv::Version response = await versionsClient.CreateVersionAsync(parent, version); // End snippet }
/// <summary>Snippet for CreateVersionAsync</summary> public async Task CreateVersionResourceNamesAsync() { // Snippet: CreateVersionAsync(AgentName, Version, CallSettings) // Additional: CreateVersionAsync(AgentName, Version, CancellationToken) // Create client VersionsClient versionsClient = await VersionsClient.CreateAsync(); // Initialize request argument(s) AgentName parent = AgentName.FromProject("[PROJECT]"); gcdv::Version version = new gcdv::Version(); // Make the request gcdv::Version response = await versionsClient.CreateVersionAsync(parent, version); // End snippet }
/// <summary>Snippet for CreateVersionAsync</summary> public async Task CreateVersionRequestObjectAsync() { // Snippet: CreateVersionAsync(CreateVersionRequest, CallSettings) // Additional: CreateVersionAsync(CreateVersionRequest, CancellationToken) // Create client VersionsClient versionsClient = await VersionsClient.CreateAsync(); // Initialize request argument(s) CreateVersionRequest request = new CreateVersionRequest { ParentAsAgentName = AgentName.FromProject("[PROJECT]"), Version = new gcdv::Version(), }; // Make the request gcdv::Version response = await versionsClient.CreateVersionAsync(request); // End snippet }
/// <summary>Snippet for CreateVersionAsync</summary> public async Task CreateVersionResourceNamesAsync() { // Snippet: CreateVersionAsync(FlowName, Version, CallSettings) // Additional: CreateVersionAsync(FlowName, Version, CancellationToken) // Create client VersionsClient versionsClient = await VersionsClient.CreateAsync(); // 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 = await versionsClient.CreateVersionAsync(parent, version); // Poll until the returned long-running operation is complete Operation <gcdcv::Version, CreateVersionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); // 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 = await versionsClient.PollOnceCreateVersionAsync(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 }