-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spanner): Add support for Cloud Spanner Default Backup Schedules
PiperOrigin-RevId: 688946300 Source-Link: googleapis/googleapis@b11e6b0 Source-Link: googleapis/googleapis-gen@f93f56b Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3Bhbm5lci5BZG1pbi5JbnN0YW5jZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiZjkzZjU2YjIxZmYwMWU0OTk5NzdjNGRkNTQ2ODljY2UxYjdjZjUzMCJ9
- Loading branch information
1 parent
a759d3c
commit 9420b47
Showing
129 changed files
with
42,852 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...ance.V1.GeneratedSnippets/Google.Cloud.Spanner.Admin.Instance.V1.GeneratedSnippets.csproj
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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;net462</TargetFrameworks> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../Google.Cloud.Spanner.Admin.Instance.V1/Google.Cloud.Spanner.Admin.Instance.V1.csproj" /> | ||
<PackageReference Include="System.Linq.Async" Version="6.0.1" /> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
</Project> |
63 changes: 63 additions & 0 deletions
63
...r.Admin.Instance.V1.GeneratedSnippets/InstanceAdminClient.CreateInstanceAsyncSnippet.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,63 @@ | ||
// Copyright 2024 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_InstanceAdmin_CreateInstance_async_flattened] | ||
using Google.Cloud.Spanner.Admin.Instance.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedInstanceAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateInstanceAsync</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 CreateInstanceAsync() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]"; | ||
string instanceId = ""; | ||
Instance instance = new Instance(); | ||
// Make the request | ||
Operation<Instance, CreateInstanceMetadata> response = await instanceAdminClient.CreateInstanceAsync(parent, instanceId, instance); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Instance 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<Instance, CreateInstanceMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Instance retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_InstanceAdmin_CreateInstance_async_flattened] | ||
} |
63 changes: 63 additions & 0 deletions
63
...n.Instance.V1.GeneratedSnippets/InstanceAdminClient.CreateInstanceConfigAsyncSnippet.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,63 @@ | ||
// Copyright 2024 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_InstanceAdmin_CreateInstanceConfig_async_flattened] | ||
using Google.Cloud.Spanner.Admin.Instance.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedInstanceAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateInstanceConfigAsync</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 CreateInstanceConfigAsync() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]"; | ||
InstanceConfig instanceConfig = new InstanceConfig(); | ||
string instanceConfigId = ""; | ||
// Make the request | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> response = await instanceAdminClient.CreateInstanceConfigAsync(parent, instanceConfig, instanceConfigId); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
InstanceConfig 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<InstanceConfig, CreateInstanceConfigMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceConfigAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
InstanceConfig retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_async_flattened] | ||
} |
68 changes: 68 additions & 0 deletions
68
....GeneratedSnippets/InstanceAdminClient.CreateInstanceConfigRequestObjectAsyncSnippet.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 2024 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_InstanceAdmin_CreateInstanceConfig_async] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.Spanner.Admin.Instance.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedInstanceAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateInstanceConfigAsync</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 CreateInstanceConfigRequestObjectAsync() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CreateInstanceConfigRequest request = new CreateInstanceConfigRequest | ||
{ | ||
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), | ||
InstanceConfigId = "", | ||
InstanceConfig = new InstanceConfig(), | ||
ValidateOnly = false, | ||
}; | ||
// Make the request | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> response = await instanceAdminClient.CreateInstanceConfigAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
InstanceConfig 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<InstanceConfig, CreateInstanceConfigMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceConfigAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
InstanceConfig retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_async] | ||
} |
67 changes: 67 additions & 0 deletions
67
...ce.V1.GeneratedSnippets/InstanceAdminClient.CreateInstanceConfigRequestObjectSnippet.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,67 @@ | ||
// Copyright 2024 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_InstanceAdmin_CreateInstanceConfig_sync] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.Spanner.Admin.Instance.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedInstanceAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateInstanceConfig</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 CreateInstanceConfigRequestObject() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create(); | ||
// Initialize request argument(s) | ||
CreateInstanceConfigRequest request = new CreateInstanceConfigRequest | ||
{ | ||
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), | ||
InstanceConfigId = "", | ||
InstanceConfig = new InstanceConfig(), | ||
ValidateOnly = false, | ||
}; | ||
// Make the request | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> response = instanceAdminClient.CreateInstanceConfig(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
InstanceConfig 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<InstanceConfig, CreateInstanceConfigMetadata> retrievedResponse = instanceAdminClient.PollOnceCreateInstanceConfig(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
InstanceConfig retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] | ||
} |
64 changes: 64 additions & 0 deletions
64
....GeneratedSnippets/InstanceAdminClient.CreateInstanceConfigResourceNamesAsyncSnippet.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 2024 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_InstanceAdmin_CreateInstanceConfig_async_flattened_resourceNames] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.Spanner.Admin.Instance.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedInstanceAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateInstanceConfigAsync</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 CreateInstanceConfigResourceNamesAsync() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = await InstanceAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
ProjectName parent = ProjectName.FromProject("[PROJECT]"); | ||
InstanceConfig instanceConfig = new InstanceConfig(); | ||
string instanceConfigId = ""; | ||
// Make the request | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> response = await instanceAdminClient.CreateInstanceConfigAsync(parent, instanceConfig, instanceConfigId); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
InstanceConfig 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<InstanceConfig, CreateInstanceConfigMetadata> retrievedResponse = await instanceAdminClient.PollOnceCreateInstanceConfigAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
InstanceConfig retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_async_flattened_resourceNames] | ||
} |
Oops, something went wrong.