-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Rephrase reservation field doc
PiperOrigin-RevId: 700712274 Source-Link: googleapis/googleapis@81e2500 Source-Link: googleapis/googleapis-gen@ef2cb66 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQmF0Y2guVjFBbHBoYS8uT3dsQm90LnlhbWwiLCJoIjoiZWYyY2I2NmZlYjk5YmVkNjU5OTQ4ZjQ0YzViMGFjMTNmYjNkZjU5MSJ9
- Loading branch information
1 parent
2f40f0e
commit 9ae93f9
Showing
90 changed files
with
37,346 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...oogle.Cloud.Batch.V1Alpha.GeneratedSnippets/BatchServiceClient.CancelJobAsyncSnippet.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! | ||
|
||
#pragma warning disable CS8981 | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START batch_v1alpha_generated_BatchService_CancelJob_async_flattened] | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
using gcbv = Google.Cloud.Batch.V1Alpha; | ||
|
||
public sealed partial class GeneratedBatchServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelJobAsync</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 CancelJobAsync() | ||
{ | ||
// Create client | ||
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]"; | ||
// Make the request | ||
Operation<gcbv::CancelJobResponse, gcbv::OperationMetadata> response = await batchServiceClient.CancelJobAsync(name); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<gcbv::CancelJobResponse, gcbv::OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
gcbv::CancelJobResponse 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<gcbv::CancelJobResponse, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceCancelJobAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
gcbv::CancelJobResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END batch_v1alpha_generated_BatchService_CancelJob_async_flattened] | ||
} |
67 changes: 67 additions & 0 deletions
67
...atch.V1Alpha.GeneratedSnippets/BatchServiceClient.CancelJobRequestObjectAsyncSnippet.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! | ||
|
||
#pragma warning disable CS8981 | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START batch_v1alpha_generated_BatchService_CancelJob_async] | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
using gcbv = Google.Cloud.Batch.V1Alpha; | ||
|
||
public sealed partial class GeneratedBatchServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelJobAsync</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 CancelJobRequestObjectAsync() | ||
{ | ||
// Create client | ||
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
gcbv::CancelJobRequest request = new gcbv::CancelJobRequest | ||
{ | ||
JobName = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"), | ||
RequestId = "", | ||
}; | ||
// Make the request | ||
Operation<gcbv::CancelJobResponse, gcbv::OperationMetadata> response = await batchServiceClient.CancelJobAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<gcbv::CancelJobResponse, gcbv::OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
gcbv::CancelJobResponse 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<gcbv::CancelJobResponse, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceCancelJobAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
gcbv::CancelJobResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END batch_v1alpha_generated_BatchService_CancelJob_async] | ||
} |
64 changes: 64 additions & 0 deletions
64
...oud.Batch.V1Alpha.GeneratedSnippets/BatchServiceClient.CancelJobRequestObjectSnippet.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 batch_v1alpha_generated_BatchService_CancelJob_sync] | ||
using Google.Cloud.Batch.V1Alpha; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedBatchServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelJob</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 CancelJobRequestObject() | ||
{ | ||
// Create client | ||
BatchServiceClient batchServiceClient = BatchServiceClient.Create(); | ||
// Initialize request argument(s) | ||
CancelJobRequest request = new CancelJobRequest | ||
{ | ||
JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"), | ||
RequestId = "", | ||
}; | ||
// Make the request | ||
Operation<CancelJobResponse, OperationMetadata> response = batchServiceClient.CancelJob(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<CancelJobResponse, OperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
CancelJobResponse 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<CancelJobResponse, OperationMetadata> retrievedResponse = batchServiceClient.PollOnceCancelJob(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
CancelJobResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END batch_v1alpha_generated_BatchService_CancelJob_sync] | ||
} |
63 changes: 63 additions & 0 deletions
63
...atch.V1Alpha.GeneratedSnippets/BatchServiceClient.CancelJobResourceNamesAsyncSnippet.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! | ||
|
||
#pragma warning disable CS8981 | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START batch_v1alpha_generated_BatchService_CancelJob_async_flattened_resourceNames] | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
using gcbv = Google.Cloud.Batch.V1Alpha; | ||
|
||
public sealed partial class GeneratedBatchServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelJobAsync</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 CancelJobResourceNamesAsync() | ||
{ | ||
// Create client | ||
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
gcbv::JobName name = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"); | ||
// Make the request | ||
Operation<gcbv::CancelJobResponse, gcbv::OperationMetadata> response = await batchServiceClient.CancelJobAsync(name); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<gcbv::CancelJobResponse, gcbv::OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
gcbv::CancelJobResponse 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<gcbv::CancelJobResponse, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceCancelJobAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
gcbv::CancelJobResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END batch_v1alpha_generated_BatchService_CancelJob_async_flattened_resourceNames] | ||
} |
60 changes: 60 additions & 0 deletions
60
...oud.Batch.V1Alpha.GeneratedSnippets/BatchServiceClient.CancelJobResourceNamesSnippet.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 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 batch_v1alpha_generated_BatchService_CancelJob_sync_flattened_resourceNames] | ||
using Google.Cloud.Batch.V1Alpha; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedBatchServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelJob</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 CancelJobResourceNames() | ||
{ | ||
// Create client | ||
BatchServiceClient batchServiceClient = BatchServiceClient.Create(); | ||
// Initialize request argument(s) | ||
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"); | ||
// Make the request | ||
Operation<CancelJobResponse, OperationMetadata> response = batchServiceClient.CancelJob(name); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<CancelJobResponse, OperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
CancelJobResponse 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<CancelJobResponse, OperationMetadata> retrievedResponse = batchServiceClient.PollOnceCancelJob(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
CancelJobResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END batch_v1alpha_generated_BatchService_CancelJob_sync_flattened_resourceNames] | ||
} |
60 changes: 60 additions & 0 deletions
60
...pha/Google.Cloud.Batch.V1Alpha.GeneratedSnippets/BatchServiceClient.CancelJobSnippet.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 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 batch_v1alpha_generated_BatchService_CancelJob_sync_flattened] | ||
using Google.Cloud.Batch.V1Alpha; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedBatchServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelJob</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 CancelJob() | ||
{ | ||
// Create client | ||
BatchServiceClient batchServiceClient = BatchServiceClient.Create(); | ||
// Initialize request argument(s) | ||
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]"; | ||
// Make the request | ||
Operation<CancelJobResponse, OperationMetadata> response = batchServiceClient.CancelJob(name); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<CancelJobResponse, OperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
CancelJobResponse 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<CancelJobResponse, OperationMetadata> retrievedResponse = batchServiceClient.PollOnceCancelJob(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
CancelJobResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END batch_v1alpha_generated_BatchService_CancelJob_sync_flattened] | ||
} |
Oops, something went wrong.