-
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: updating the client to match the latest v1 API
PiperOrigin-RevId: 517530755 Source-Link: googleapis/googleapis@4257751 Source-Link: googleapis/googleapis-gen@86f9ff4 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRmlsZXN0b3JlLlYxLy5Pd2xCb3QueWFtbCIsImgiOiI4NmY5ZmY0ZTdjNzIxYzY4ODk3MzI3Y2JkYTk4NTY1OTY0YzIwN2FlIn0=
- Loading branch information
1 parent
c655f99
commit 6db60e7
Showing
37 changed files
with
8,622 additions
and
565 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
...ilestore.V1.GeneratedSnippets/CloudFilestoreManagerClient.CreateSnapshotAsyncSnippet.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 2023 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.Filestore.V1.Snippets | ||
{ | ||
// [START file_v1_generated_CloudFilestoreManager_CreateSnapshot_async_flattened] | ||
using Google.Cloud.Common; | ||
using Google.Cloud.Filestore.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedCloudFilestoreManagerClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSnapshotAsync</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 CreateSnapshotAsync() | ||
{ | ||
// Create client | ||
CloudFilestoreManagerClient cloudFilestoreManagerClient = await CloudFilestoreManagerClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]"; | ||
Snapshot snapshot = new Snapshot(); | ||
string snapshotId = ""; | ||
// Make the request | ||
Operation<Snapshot, OperationMetadata> response = await cloudFilestoreManagerClient.CreateSnapshotAsync(parent, snapshot, snapshotId); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Snapshot, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Snapshot 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<Snapshot, OperationMetadata> retrievedResponse = await cloudFilestoreManagerClient.PollOnceCreateSnapshotAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Snapshot retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END file_v1_generated_CloudFilestoreManager_CreateSnapshot_async_flattened] | ||
} |
67 changes: 67 additions & 0 deletions
67
...eneratedSnippets/CloudFilestoreManagerClient.CreateSnapshotRequestObjectAsyncSnippet.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 2023 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.Filestore.V1.Snippets | ||
{ | ||
// [START file_v1_generated_CloudFilestoreManager_CreateSnapshot_async] | ||
using Google.Cloud.Common; | ||
using Google.Cloud.Filestore.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedCloudFilestoreManagerClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSnapshotAsync</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 CreateSnapshotRequestObjectAsync() | ||
{ | ||
// Create client | ||
CloudFilestoreManagerClient cloudFilestoreManagerClient = await CloudFilestoreManagerClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CreateSnapshotRequest request = new CreateSnapshotRequest | ||
{ | ||
ParentAsInstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"), | ||
SnapshotId = "", | ||
Snapshot = new Snapshot(), | ||
}; | ||
// Make the request | ||
Operation<Snapshot, OperationMetadata> response = await cloudFilestoreManagerClient.CreateSnapshotAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Snapshot, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Snapshot 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<Snapshot, OperationMetadata> retrievedResponse = await cloudFilestoreManagerClient.PollOnceCreateSnapshotAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Snapshot retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END file_v1_generated_CloudFilestoreManager_CreateSnapshot_async] | ||
} |
66 changes: 66 additions & 0 deletions
66
....V1.GeneratedSnippets/CloudFilestoreManagerClient.CreateSnapshotRequestObjectSnippet.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,66 @@ | ||
// Copyright 2023 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.Filestore.V1.Snippets | ||
{ | ||
// [START file_v1_generated_CloudFilestoreManager_CreateSnapshot_sync] | ||
using Google.Cloud.Common; | ||
using Google.Cloud.Filestore.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedCloudFilestoreManagerClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSnapshot</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 CreateSnapshotRequestObject() | ||
{ | ||
// Create client | ||
CloudFilestoreManagerClient cloudFilestoreManagerClient = CloudFilestoreManagerClient.Create(); | ||
// Initialize request argument(s) | ||
CreateSnapshotRequest request = new CreateSnapshotRequest | ||
{ | ||
ParentAsInstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"), | ||
SnapshotId = "", | ||
Snapshot = new Snapshot(), | ||
}; | ||
// Make the request | ||
Operation<Snapshot, OperationMetadata> response = cloudFilestoreManagerClient.CreateSnapshot(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Snapshot, OperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Snapshot 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<Snapshot, OperationMetadata> retrievedResponse = cloudFilestoreManagerClient.PollOnceCreateSnapshot(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Snapshot retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END file_v1_generated_CloudFilestoreManager_CreateSnapshot_sync] | ||
} |
64 changes: 64 additions & 0 deletions
64
...eneratedSnippets/CloudFilestoreManagerClient.CreateSnapshotResourceNamesAsyncSnippet.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 2023 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.Filestore.V1.Snippets | ||
{ | ||
// [START file_v1_generated_CloudFilestoreManager_CreateSnapshot_async_flattened_resourceNames] | ||
using Google.Cloud.Common; | ||
using Google.Cloud.Filestore.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedCloudFilestoreManagerClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSnapshotAsync</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 CreateSnapshotResourceNamesAsync() | ||
{ | ||
// Create client | ||
CloudFilestoreManagerClient cloudFilestoreManagerClient = await CloudFilestoreManagerClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
InstanceName parent = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"); | ||
Snapshot snapshot = new Snapshot(); | ||
string snapshotId = ""; | ||
// Make the request | ||
Operation<Snapshot, OperationMetadata> response = await cloudFilestoreManagerClient.CreateSnapshotAsync(parent, snapshot, snapshotId); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Snapshot, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Snapshot 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<Snapshot, OperationMetadata> retrievedResponse = await cloudFilestoreManagerClient.PollOnceCreateSnapshotAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Snapshot retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END file_v1_generated_CloudFilestoreManager_CreateSnapshot_async_flattened_resourceNames] | ||
} |
63 changes: 63 additions & 0 deletions
63
....V1.GeneratedSnippets/CloudFilestoreManagerClient.CreateSnapshotResourceNamesSnippet.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 2023 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.Filestore.V1.Snippets | ||
{ | ||
// [START file_v1_generated_CloudFilestoreManager_CreateSnapshot_sync_flattened_resourceNames] | ||
using Google.Cloud.Common; | ||
using Google.Cloud.Filestore.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedCloudFilestoreManagerClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSnapshot</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 CreateSnapshotResourceNames() | ||
{ | ||
// Create client | ||
CloudFilestoreManagerClient cloudFilestoreManagerClient = CloudFilestoreManagerClient.Create(); | ||
// Initialize request argument(s) | ||
InstanceName parent = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"); | ||
Snapshot snapshot = new Snapshot(); | ||
string snapshotId = ""; | ||
// Make the request | ||
Operation<Snapshot, OperationMetadata> response = cloudFilestoreManagerClient.CreateSnapshot(parent, snapshot, snapshotId); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Snapshot, OperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Snapshot 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<Snapshot, OperationMetadata> retrievedResponse = cloudFilestoreManagerClient.PollOnceCreateSnapshot(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Snapshot retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END file_v1_generated_CloudFilestoreManager_CreateSnapshot_sync_flattened_resourceNames] | ||
} |
63 changes: 63 additions & 0 deletions
63
...oud.Filestore.V1.GeneratedSnippets/CloudFilestoreManagerClient.CreateSnapshotSnippet.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 2023 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.Filestore.V1.Snippets | ||
{ | ||
// [START file_v1_generated_CloudFilestoreManager_CreateSnapshot_sync_flattened] | ||
using Google.Cloud.Common; | ||
using Google.Cloud.Filestore.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedCloudFilestoreManagerClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSnapshot</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 CreateSnapshot() | ||
{ | ||
// Create client | ||
CloudFilestoreManagerClient cloudFilestoreManagerClient = CloudFilestoreManagerClient.Create(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]"; | ||
Snapshot snapshot = new Snapshot(); | ||
string snapshotId = ""; | ||
// Make the request | ||
Operation<Snapshot, OperationMetadata> response = cloudFilestoreManagerClient.CreateSnapshot(parent, snapshot, snapshotId); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Snapshot, OperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Snapshot 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<Snapshot, OperationMetadata> retrievedResponse = cloudFilestoreManagerClient.PollOnceCreateSnapshot(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Snapshot retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END file_v1_generated_CloudFilestoreManager_CreateSnapshot_sync_flattened] | ||
} |
Oops, something went wrong.