-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PiperOrigin-RevId: 717555125 Source-Link: googleapis/googleapis@318818b Source-Link: googleapis/googleapis-gen@bee9a65 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3Bhbm5lci5BZG1pbi5EYXRhYmFzZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiYmVlOWE2NThmYzIyOGRjZDg4ZThhOTJiODBlZmM0Y2NjMjc0ZmU1NSJ9
- Loading branch information
1 parent
d7026f2
commit 5bb0988
Showing
162 changed files
with
48,945 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...anner.Admin.Database.V1.GeneratedSnippets/DatabaseAdminClient.CopyBackupAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 spanner_v1_generated_DatabaseAdmin_CopyBackup_async_flattened] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CopyBackupAsync</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 CopyBackupAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/instances/[INSTANCE]"; | ||
string backupId = ""; | ||
string sourceBackup = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]"; | ||
Timestamp expireTime = new Timestamp(); | ||
// Make the request | ||
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Backup, CopyBackupMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Backup 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<Backup, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Backup retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_CopyBackup_async_flattened] | ||
} |
69 changes: 69 additions & 0 deletions
69
...atabase.V1.GeneratedSnippets/DatabaseAdminClient.CopyBackupRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// 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 spanner_v1_generated_DatabaseAdmin_CopyBackup_async] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CopyBackupAsync</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 CopyBackupRequestObjectAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CopyBackupRequest request = new CopyBackupRequest | ||
{ | ||
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"), | ||
BackupId = "", | ||
SourceBackupAsBackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"), | ||
ExpireTime = new Timestamp(), | ||
EncryptionConfig = new CopyBackupEncryptionConfig(), | ||
}; | ||
// Make the request | ||
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Backup, CopyBackupMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Backup 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<Backup, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Backup retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_CopyBackup_async] | ||
} |
68 changes: 68 additions & 0 deletions
68
...min.Database.V1.GeneratedSnippets/DatabaseAdminClient.CopyBackupRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// 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 spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CopyBackup</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 CopyBackupRequestObject() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create(); | ||
// Initialize request argument(s) | ||
CopyBackupRequest request = new CopyBackupRequest | ||
{ | ||
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"), | ||
BackupId = "", | ||
SourceBackupAsBackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"), | ||
ExpireTime = new Timestamp(), | ||
EncryptionConfig = new CopyBackupEncryptionConfig(), | ||
}; | ||
// Make the request | ||
Operation<Backup, CopyBackupMetadata> response = databaseAdminClient.CopyBackup(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Backup, CopyBackupMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Backup 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<Backup, CopyBackupMetadata> retrievedResponse = databaseAdminClient.PollOnceCopyBackup(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Backup retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] | ||
} |
65 changes: 65 additions & 0 deletions
65
...atabase.V1.GeneratedSnippets/DatabaseAdminClient.CopyBackupResourceNamesAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 spanner_v1_generated_DatabaseAdmin_CopyBackup_async_flattened_resourceNames] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CopyBackupAsync</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 CopyBackupResourceNamesAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"); | ||
string backupId = ""; | ||
BackupName sourceBackup = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"); | ||
Timestamp expireTime = new Timestamp(); | ||
// Make the request | ||
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Backup, CopyBackupMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Backup 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<Backup, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Backup retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_CopyBackup_async_flattened_resourceNames] | ||
} |
64 changes: 64 additions & 0 deletions
64
...min.Database.V1.GeneratedSnippets/DatabaseAdminClient.CopyBackupResourceNamesSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// 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 spanner_v1_generated_DatabaseAdmin_CopyBackup_sync_flattened_resourceNames] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CopyBackup</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 CopyBackupResourceNames() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create(); | ||
// Initialize request argument(s) | ||
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"); | ||
string backupId = ""; | ||
BackupName sourceBackup = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"); | ||
Timestamp expireTime = new Timestamp(); | ||
// Make the request | ||
Operation<Backup, CopyBackupMetadata> response = databaseAdminClient.CopyBackup(parent, backupId, sourceBackup, expireTime); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Backup, CopyBackupMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Backup 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<Backup, CopyBackupMetadata> retrievedResponse = databaseAdminClient.PollOnceCopyBackup(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Backup retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_CopyBackup_sync_flattened_resourceNames] | ||
} |
Oops, something went wrong.