/// <summary>Snippet for UpdateVersion</summary> public void UpdateVersionRequestObject() { // Snippet: UpdateVersion(UpdateVersionRequest, CallSettings) // Create client VersionsClient versionsClient = VersionsClient.Create(); // Initialize request argument(s) UpdateVersionRequest request = new UpdateVersionRequest { Name = "", Version = new gcav::Version(), UpdateMask = new FieldMask(), }; // Make the request Operation <gcav::Version, OperationMetadataV1> response = versionsClient.UpdateVersion(request); // Poll until the returned long-running operation is complete Operation <gcav::Version, OperationMetadataV1> completedResponse = response.PollUntilCompleted(); // 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, OperationMetadataV1> retrievedResponse = versionsClient.PollOnceUpdateVersion(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 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 GetVersion</summary> public void GetVersionRequestObject() { // Snippet: GetVersion(GetVersionRequest, CallSettings) // Create client VersionsClient versionsClient = VersionsClient.Create(); // Initialize request argument(s) GetVersionRequest request = new GetVersionRequest { Name = "", View = VersionView.Basic, }; // Make the request gcav::Version response = versionsClient.GetVersion(request); // End snippet }
/// <summary>Snippet for GetVersionAsync</summary> public async Task GetVersionRequestObjectAsync() { // Snippet: GetVersionAsync(GetVersionRequest, CallSettings) // Additional: GetVersionAsync(GetVersionRequest, CancellationToken) // Create client VersionsClient versionsClient = await VersionsClient.CreateAsync(); // Initialize request argument(s) GetVersionRequest request = new GetVersionRequest { Name = "", View = VersionView.Basic, }; // Make the request gcav::Version response = await versionsClient.GetVersionAsync(request); // End snippet }