Skip to content

Commit

Permalink
docs: Rephrase reservation field doc
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 700712274

Source-Link: googleapis/googleapis@81e2500

Source-Link: googleapis/googleapis-gen@ef2cb66
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQmF0Y2guVjFBbHBoYS8uT3dsQm90LnlhbWwiLCJoIjoiZWYyY2I2NmZlYjk5YmVkNjU5OTQ4ZjQ0YzViMGFjMTNmYjNkZjU5MSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 27, 2024
1 parent 2f40f0e commit 9ae93f9
Show file tree
Hide file tree
Showing 90 changed files with 37,346 additions and 0 deletions.
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]
}
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]
}
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]
}
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]
}
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]
}
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]
}
Loading

0 comments on commit 9ae93f9

Please sign in to comment.