-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add custom instance config operations
PiperOrigin-RevId: 474535825 Source-Link: googleapis/googleapis@69c840e Source-Link: googleapis/googleapis-gen@33e360e Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3Bhbm5lci5BZG1pbi5JbnN0YW5jZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiMzNlMzYwZTdkNGJmMjQ3OWZhNzllYWNlODUxNjY0NTNjZDc2MGIwZCJ9
- Loading branch information
1 parent
f64fcca
commit 58cadb7
Showing
32 changed files
with
9,259 additions
and
928 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...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,60 @@ | ||
// Copyright 2022 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 Google.Cloud.Spanner.Admin.Instance.V1.Snippets | ||
{ | ||
// [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 for illustrative purposes only. | ||
/// It may require modifications to work in your environment. | ||
/// </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] | ||
} |
65 changes: 65 additions & 0 deletions
65
....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,65 @@ | ||
// Copyright 2022 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 Google.Cloud.Spanner.Admin.Instance.V1.Snippets | ||
{ | ||
// [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 for illustrative purposes only. | ||
/// It may require modifications to work in your environment. | ||
/// </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] | ||
} |
64 changes: 64 additions & 0 deletions
64
...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,64 @@ | ||
// Copyright 2022 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 Google.Cloud.Spanner.Admin.Instance.V1.Snippets | ||
{ | ||
// [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 for illustrative purposes only. | ||
/// It may require modifications to work in your environment. | ||
/// </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] | ||
} |
61 changes: 61 additions & 0 deletions
61
....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,61 @@ | ||
// Copyright 2022 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 Google.Cloud.Spanner.Admin.Instance.V1.Snippets | ||
{ | ||
// [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 for illustrative purposes only. | ||
/// It may require modifications to work in your environment. | ||
/// </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] | ||
} |
60 changes: 60 additions & 0 deletions
60
...ce.V1.GeneratedSnippets/InstanceAdminClient.CreateInstanceConfigResourceNamesSnippet.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,60 @@ | ||
// Copyright 2022 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 Google.Cloud.Spanner.Admin.Instance.V1.Snippets | ||
{ | ||
// [START spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync_flattened_resourceNames] | ||
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 for illustrative purposes only. | ||
/// It may require modifications to work in your environment. | ||
/// </remarks> | ||
public void CreateInstanceConfigResourceNames() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create(); | ||
// Initialize request argument(s) | ||
ProjectName parent = ProjectName.FromProject("[PROJECT]"); | ||
InstanceConfig instanceConfig = new InstanceConfig(); | ||
string instanceConfigId = ""; | ||
// Make the request | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> response = instanceAdminClient.CreateInstanceConfig(parent, instanceConfig, instanceConfigId); | ||
|
||
// 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_flattened_resourceNames] | ||
} |
59 changes: 59 additions & 0 deletions
59
....Admin.Instance.V1.GeneratedSnippets/InstanceAdminClient.CreateInstanceConfigSnippet.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,59 @@ | ||
// Copyright 2022 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 Google.Cloud.Spanner.Admin.Instance.V1.Snippets | ||
{ | ||
// [START spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync_flattened] | ||
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 for illustrative purposes only. | ||
/// It may require modifications to work in your environment. | ||
/// </remarks> | ||
public void CreateInstanceConfig() | ||
{ | ||
// Create client | ||
InstanceAdminClient instanceAdminClient = InstanceAdminClient.Create(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]"; | ||
InstanceConfig instanceConfig = new InstanceConfig(); | ||
string instanceConfigId = ""; | ||
// Make the request | ||
Operation<InstanceConfig, CreateInstanceConfigMetadata> response = instanceAdminClient.CreateInstanceConfig(parent, instanceConfig, instanceConfigId); | ||
|
||
// 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_flattened] | ||
} |
Oops, something went wrong.