Skip to content

Commit

Permalink
feat: add InitializeServiceAPI
Browse files Browse the repository at this point in the history
feat: Update field behavior of `networks` field in message `ManagementServer` to `OPTIONAL`
feat: add enum to Backup Vault Access Restriction field
feat: `ignore_backup_plan_references` added to the DeleteBackupVaultRequest
fix!: Update field behavior of `resource_type` field in message `BackupPlanAssociation` to `REQUIRED`
docs: A comment for field `networks` in message `.google.cloud.backupdr.v1.ManagementServer` is changed
docs: A comment for field `requested_cancellation` in message `.google.cloud.backupdr.v1.OperationMetadata` is changed
docs: A comment for field `resource_type` in message `.google.cloud.backupdr.v1.BackupPlan` is changed
docs: A comment for field `backup_retention_days` in message `.google.cloud.backupdr.v1.BackupRule` is changed
docs: A comment for field `resource_type` in message `.google.cloud.backupdr.v1.BackupPlanAssociation` is changed
docs: A comment for field `data_source` in message `.google.cloud.backupdr.v1.BackupPlanAssociation` is changed
docs: A comment for field `rule_id` in message `.google.cloud.backupdr.v1.RuleConfigInfo` is changed
docs: A comment for field `last_backup_error` in message `.google.cloud.backupdr.v1.RuleConfigInfo` is changed
docs: A comment for enum value `ACCESS_RESTRICTION_UNSPECIFIED` in enum `AccessRestriction` is changed
docs: A comment for field `uid` in message `.google.cloud.backupdr.v1.BackupVault` is changed
docs: A comment for field `access_restriction` in message `.google.cloud.backupdr.v1.BackupVault` is changed

PiperOrigin-RevId: 713528070

Source-Link: googleapis/googleapis@8cd8706

Source-Link: googleapis/googleapis-gen@a5c65fa
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQmFja3VwRFIuVjEvLk93bEJvdC55YW1sIiwiaCI6ImE1YzY1ZmFjZWJlOGQ1NTIzYWRlNjBmYTU1MDZiYzhjMzVkYWQ4NjgifQ==
  • Loading branch information
gcf-owl-bot[bot] committed Jan 9, 2025
1 parent f1d3f30 commit 8622494
Show file tree
Hide file tree
Showing 13 changed files with 1,539 additions and 439 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public async Task DeleteBackupVaultRequestObjectAsync()
Etag = "",
ValidateOnly = false,
AllowMissing = false,
IgnoreBackupPlanReferences = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteBackupVaultAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void DeleteBackupVaultRequestObject()
Etag = "",
ValidateOnly = false,
AllowMissing = false,
IgnoreBackupPlanReferences = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = backupDRClient.DeleteBackupVault(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START backupdr_v1_generated_BackupDR_InitializeService_async]
using Google.Cloud.BackupDR.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedBackupDRClientSnippets
{
/// <summary>Snippet for InitializeServiceAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task InitializeServiceRequestObjectAsync()
{
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
InitializeServiceRequest request = new InitializeServiceRequest
{
Name = "",
ResourceType = "",
RequestId = "",
};
// Make the request
Operation<InitializeServiceResponse, OperationMetadata> response = await backupDRClient.InitializeServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<InitializeServiceResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
InitializeServiceResponse 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<InitializeServiceResponse, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceInitializeServiceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
InitializeServiceResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END backupdr_v1_generated_BackupDR_InitializeService_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START backupdr_v1_generated_BackupDR_InitializeService_sync]
using Google.Cloud.BackupDR.V1;
using Google.LongRunning;

public sealed partial class GeneratedBackupDRClientSnippets
{
/// <summary>Snippet for InitializeService</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void InitializeServiceRequestObject()
{
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
InitializeServiceRequest request = new InitializeServiceRequest
{
Name = "",
ResourceType = "",
RequestId = "",
};
// Make the request
Operation<InitializeServiceResponse, OperationMetadata> response = backupDRClient.InitializeService(request);

// Poll until the returned long-running operation is complete
Operation<InitializeServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
InitializeServiceResponse 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<InitializeServiceResponse, OperationMetadata> retrievedResponse = backupDRClient.PollOnceInitializeService(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
InitializeServiceResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END backupdr_v1_generated_BackupDR_InitializeService_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2704,12 +2704,12 @@
"segments": [
{
"start": 20,
"end": 67,
"end": 68,
"type": "FULL"
},
{
"start": 36,
"end": 65,
"end": 66,
"type": "SHORT"
}
]
Expand Down Expand Up @@ -2753,12 +2753,12 @@
"segments": [
{
"start": 20,
"end": 68,
"end": 69,
"type": "FULL"
},
{
"start": 37,
"end": 66,
"end": 67,
"type": "SHORT"
}
]
Expand Down Expand Up @@ -7865,6 +7865,103 @@
"type": "SHORT"
}
]
},
{
"regionTag": "backupdr_v1_generated_BackupDR_InitializeService_sync",
"title": "InitializeServiceRequestObject",
"description": "Snippet for InitializeService",
"file": "BackupDRClient.InitializeServiceRequestObjectSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "InitializeService",
"fullName": "Google.Cloud.BackupDR.V1.BackupDRClient.InitializeService",
"parameters": [
{
"type": "Google.Cloud.BackupDR.V1.InitializeServiceRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.LongRunning.Operation<Google.Cloud.BackupDR.V1.InitializeServiceResponse, Google.Cloud.BackupDR.V1.OperationMetadata>",
"client": {
"shortName": "BackupDRClient",
"fullName": "Google.Cloud.BackupDR.V1.BackupDRClient"
},
"method": {
"shortName": "InitializeService",
"fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService",
"service": {
"shortName": "BackupDR",
"fullName": "google.cloud.backupdr.v1.BackupDR"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 63,
"type": "FULL"
},
{
"start": 35,
"end": 61,
"type": "SHORT"
}
]
},
{
"regionTag": "backupdr_v1_generated_BackupDR_InitializeService_async",
"title": "InitializeServiceRequestObjectAsync",
"description": "Snippet for InitializeServiceAsync",
"file": "BackupDRClient.InitializeServiceRequestObjectAsyncSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "InitializeServiceAsync",
"fullName": "Google.Cloud.BackupDR.V1.BackupDRClient.InitializeServiceAsync",
"async": true,
"parameters": [
{
"type": "Google.Cloud.BackupDR.V1.InitializeServiceRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "System.Threading.Tasks.Task<Google.LongRunning.Operation<Google.Cloud.BackupDR.V1.InitializeServiceResponse, Google.Cloud.BackupDR.V1.OperationMetadata>>",
"client": {
"shortName": "BackupDRClient",
"fullName": "Google.Cloud.BackupDR.V1.BackupDRClient"
},
"method": {
"shortName": "InitializeService",
"fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService",
"service": {
"shortName": "BackupDR",
"fullName": "google.cloud.backupdr.v1.BackupDR"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 64,
"type": "FULL"
},
{
"start": 36,
"end": 62,
"type": "SHORT"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,7 @@ public void DeleteBackupVaultRequestObject()
Etag = "",
ValidateOnly = false,
AllowMissing = false,
IgnoreBackupPlanReferences = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = backupDRClient.DeleteBackupVault(request);
Expand Down Expand Up @@ -1814,6 +1815,7 @@ public async Task DeleteBackupVaultRequestObjectAsync()
Etag = "",
ValidateOnly = false,
AllowMissing = false,
IgnoreBackupPlanReferences = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = await backupDRClient.DeleteBackupVaultAsync(request);
Expand Down Expand Up @@ -5014,5 +5016,74 @@ public async Task TriggerBackupResourceNamesAsync()
}
// End snippet
}

/// <summary>Snippet for InitializeService</summary>
public void InitializeServiceRequestObject()
{
// Snippet: InitializeService(InitializeServiceRequest, CallSettings)
// Create client
BackupDRClient backupDRClient = BackupDRClient.Create();
// Initialize request argument(s)
InitializeServiceRequest request = new InitializeServiceRequest
{
Name = "",
ResourceType = "",
RequestId = "",
};
// Make the request
Operation<InitializeServiceResponse, OperationMetadata> response = backupDRClient.InitializeService(request);

// Poll until the returned long-running operation is complete
Operation<InitializeServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
InitializeServiceResponse 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<InitializeServiceResponse, OperationMetadata> retrievedResponse = backupDRClient.PollOnceInitializeService(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
InitializeServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for InitializeServiceAsync</summary>
public async Task InitializeServiceRequestObjectAsync()
{
// Snippet: InitializeServiceAsync(InitializeServiceRequest, CallSettings)
// Additional: InitializeServiceAsync(InitializeServiceRequest, CancellationToken)
// Create client
BackupDRClient backupDRClient = await BackupDRClient.CreateAsync();
// Initialize request argument(s)
InitializeServiceRequest request = new InitializeServiceRequest
{
Name = "",
ResourceType = "",
RequestId = "",
};
// Make the request
Operation<InitializeServiceResponse, OperationMetadata> response = await backupDRClient.InitializeServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<InitializeServiceResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
InitializeServiceResponse 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<InitializeServiceResponse, OperationMetadata> retrievedResponse = await backupDRClient.PollOnceInitializeServiceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
InitializeServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}
}
}
Loading

0 comments on commit 8622494

Please sign in to comment.