Skip to content

Commit

Permalink
feat: Added REGIONAL tier support in the v1 API
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 582440290

Source-Link: googleapis/googleapis@d30f933

Source-Link: googleapis/googleapis-gen@7872d2e
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRmlsZXN0b3JlLlYxLy5Pd2xCb3QueWFtbCIsImgiOiI3ODcyZDJlNzU5YTY3OWI4YjM1ZjkzOTkxYWJiNjEyMDEwMmM5MDk1In0=
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed Nov 15, 2023
1 parent 48009d9 commit e6cd7ec
Show file tree
Hide file tree
Showing 13 changed files with 1,104 additions and 199 deletions.
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 GoogleCSharpSnippets
{
// [START file_v1_generated_CloudFilestoreManager_RevertInstance_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 RevertInstanceAsync</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 RevertInstanceRequestObjectAsync()
{
// Create client
CloudFilestoreManagerClient cloudFilestoreManagerClient = await CloudFilestoreManagerClient.CreateAsync();
// Initialize request argument(s)
RevertInstanceRequest request = new RevertInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
TargetSnapshotId = "",
};
// Make the request
Operation<Instance, OperationMetadata> response = await cloudFilestoreManagerClient.RevertInstanceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> 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, OperationMetadata> retrievedResponse = await cloudFilestoreManagerClient.PollOnceRevertInstanceAsync(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 file_v1_generated_CloudFilestoreManager_RevertInstance_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// 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 GoogleCSharpSnippets
{
// [START file_v1_generated_CloudFilestoreManager_RevertInstance_sync]
using Google.Cloud.Common;
using Google.Cloud.Filestore.V1;
using Google.LongRunning;

public sealed partial class GeneratedCloudFilestoreManagerClientSnippets
{
/// <summary>Snippet for RevertInstance</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 RevertInstanceRequestObject()
{
// Create client
CloudFilestoreManagerClient cloudFilestoreManagerClient = CloudFilestoreManagerClient.Create();
// Initialize request argument(s)
RevertInstanceRequest request = new RevertInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
TargetSnapshotId = "",
};
// Make the request
Operation<Instance, OperationMetadata> response = cloudFilestoreManagerClient.RevertInstance(request);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = response.PollUntilCompleted();
// 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, OperationMetadata> retrievedResponse = cloudFilestoreManagerClient.PollOnceRevertInstance(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 file_v1_generated_CloudFilestoreManager_RevertInstance_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,103 @@
}
]
},
{
"regionTag": "file_v1_generated_CloudFilestoreManager_RevertInstance_sync",
"title": "RevertInstanceRequestObject",
"description": "Snippet for RevertInstance",
"file": "CloudFilestoreManagerClient.RevertInstanceRequestObjectSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "RevertInstance",
"fullName": "Google.Cloud.Filestore.V1.CloudFilestoreManagerClient.RevertInstance",
"parameters": [
{
"type": "Google.Cloud.Filestore.V1.RevertInstanceRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.LongRunning.Operation<Google.Cloud.Filestore.V1.Instance, Google.Cloud.Common.OperationMetadata>",
"client": {
"shortName": "CloudFilestoreManagerClient",
"fullName": "Google.Cloud.Filestore.V1.CloudFilestoreManagerClient"
},
"method": {
"shortName": "RevertInstance",
"fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RevertInstance",
"service": {
"shortName": "CloudFilestoreManager",
"fullName": "google.cloud.filestore.v1.CloudFilestoreManager"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 63,
"type": "FULL"
},
{
"start": 36,
"end": 61,
"type": "SHORT"
}
]
},
{
"regionTag": "file_v1_generated_CloudFilestoreManager_RevertInstance_async",
"title": "RevertInstanceRequestObjectAsync",
"description": "Snippet for RevertInstanceAsync",
"file": "CloudFilestoreManagerClient.RevertInstanceRequestObjectAsyncSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "RevertInstanceAsync",
"fullName": "Google.Cloud.Filestore.V1.CloudFilestoreManagerClient.RevertInstanceAsync",
"async": true,
"parameters": [
{
"type": "Google.Cloud.Filestore.V1.RevertInstanceRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "System.Threading.Tasks.Task<Google.LongRunning.Operation<Google.Cloud.Filestore.V1.Instance, Google.Cloud.Common.OperationMetadata>>",
"client": {
"shortName": "CloudFilestoreManagerClient",
"fullName": "Google.Cloud.Filestore.V1.CloudFilestoreManagerClient"
},
"method": {
"shortName": "RevertInstance",
"fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RevertInstance",
"service": {
"shortName": "CloudFilestoreManager",
"fullName": "google.cloud.filestore.v1.CloudFilestoreManager"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 64,
"type": "FULL"
},
{
"start": 37,
"end": 62,
"type": "SHORT"
}
]
},
{
"regionTag": "file_v1_generated_CloudFilestoreManager_DeleteInstance_sync",
"title": "DeleteInstanceRequestObject",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,73 @@ public async Task RestoreInstanceRequestObjectAsync()
// End snippet
}

/// <summary>Snippet for RevertInstance</summary>
public void RevertInstanceRequestObject()
{
// Snippet: RevertInstance(RevertInstanceRequest, CallSettings)
// Create client
CloudFilestoreManagerClient cloudFilestoreManagerClient = CloudFilestoreManagerClient.Create();
// Initialize request argument(s)
RevertInstanceRequest request = new RevertInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
TargetSnapshotId = "",
};
// Make the request
Operation<Instance, OperationMetadata> response = cloudFilestoreManagerClient.RevertInstance(request);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = response.PollUntilCompleted();
// 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, OperationMetadata> retrievedResponse = cloudFilestoreManagerClient.PollOnceRevertInstance(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 snippet
}

/// <summary>Snippet for RevertInstanceAsync</summary>
public async Task RevertInstanceRequestObjectAsync()
{
// Snippet: RevertInstanceAsync(RevertInstanceRequest, CallSettings)
// Additional: RevertInstanceAsync(RevertInstanceRequest, CancellationToken)
// Create client
CloudFilestoreManagerClient cloudFilestoreManagerClient = await CloudFilestoreManagerClient.CreateAsync();
// Initialize request argument(s)
RevertInstanceRequest request = new RevertInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
TargetSnapshotId = "",
};
// Make the request
Operation<Instance, OperationMetadata> response = await cloudFilestoreManagerClient.RevertInstanceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> 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, OperationMetadata> retrievedResponse = await cloudFilestoreManagerClient.PollOnceRevertInstanceAsync(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 snippet
}

/// <summary>Snippet for DeleteInstance</summary>
public void DeleteInstanceRequestObject()
{
Expand Down
Loading

0 comments on commit e6cd7ec

Please sign in to comment.