Skip to content

Commit

Permalink
feat: Adds Cloud Run Jobs v2 API client libraries
Browse files Browse the repository at this point in the history
A Cloud Run Job runs its tasks and exits when finished.

For more information about Cloud Run Jobs, visit https://cloud.google.com/run/docs/create-jobs

PiperOrigin-RevId: 485653075

Source-Link: googleapis/googleapis@a9a137b

Source-Link: googleapis/googleapis-gen@7d398ce
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuUnVuLlYyLy5Pd2xCb3QueWFtbCIsImgiOiI3ZDM5OGNlNjhhZDAxMDFkYjYwMTMwZDUyNjk1MGRmMGVmY2FkZGNlIn0=
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Nov 3, 2022
1 parent 3f73874 commit 85bc403
Show file tree
Hide file tree
Showing 126 changed files with 24,517 additions and 85 deletions.
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!

#pragma warning disable CS8981

namespace Google.Cloud.Run.V2.Snippets
{
// [START run_v2_generated_Executions_DeleteExecution_async_flattened]
using Google.LongRunning;
using System.Threading.Tasks;
using gcrv = Google.Cloud.Run.V2;

public sealed partial class GeneratedExecutionsClientSnippets
{
/// <summary>Snippet for DeleteExecutionAsync</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 DeleteExecutionAsync()
{
// Create client
ExecutionsClient executionsClient = await ExecutionsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/executions/[EXECUTION]";
// Make the request
Operation<Execution, Execution> response = await executionsClient.DeleteExecutionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Execution, Execution> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Execution 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<Execution, Execution> retrievedResponse = await executionsClient.PollOnceDeleteExecutionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Execution retrievedResult = retrievedResponse.Result;
}
}
}
// [END run_v2_generated_Executions_DeleteExecution_async_flattened]
}
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!

#pragma warning disable CS8981

namespace Google.Cloud.Run.V2.Snippets
{
// [START run_v2_generated_Executions_DeleteExecution_async]
using Google.LongRunning;
using System.Threading.Tasks;
using gcrv = Google.Cloud.Run.V2;

public sealed partial class GeneratedExecutionsClientSnippets
{
/// <summary>Snippet for DeleteExecutionAsync</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 DeleteExecutionRequestObjectAsync()
{
// Create client
ExecutionsClient executionsClient = await ExecutionsClient.CreateAsync();
// Initialize request argument(s)
DeleteExecutionRequest request = new DeleteExecutionRequest
{
ExecutionName = ExecutionName.FromProjectLocationJobExecution("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<Execution, Execution> response = await executionsClient.DeleteExecutionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Execution, Execution> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Execution 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<Execution, Execution> retrievedResponse = await executionsClient.PollOnceDeleteExecutionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Execution retrievedResult = retrievedResponse.Result;
}
}
}
// [END run_v2_generated_Executions_DeleteExecution_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// 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.Run.V2.Snippets
{
// [START run_v2_generated_Executions_DeleteExecution_sync]
using Google.Cloud.Run.V2;
using Google.LongRunning;

public sealed partial class GeneratedExecutionsClientSnippets
{
/// <summary>Snippet for DeleteExecution</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void DeleteExecutionRequestObject()
{
// Create client
ExecutionsClient executionsClient = ExecutionsClient.Create();
// Initialize request argument(s)
DeleteExecutionRequest request = new DeleteExecutionRequest
{
ExecutionName = ExecutionName.FromProjectLocationJobExecution("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<Execution, Execution> response = executionsClient.DeleteExecution(request);

// Poll until the returned long-running operation is complete
Operation<Execution, Execution> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Execution 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<Execution, Execution> retrievedResponse = executionsClient.PollOnceDeleteExecution(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Execution retrievedResult = retrievedResponse.Result;
}
}
}
// [END run_v2_generated_Executions_DeleteExecution_sync]
}
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!

#pragma warning disable CS8981

namespace Google.Cloud.Run.V2.Snippets
{
// [START run_v2_generated_Executions_DeleteExecution_async_flattened_resourceNames]
using Google.LongRunning;
using System.Threading.Tasks;
using gcrv = Google.Cloud.Run.V2;

public sealed partial class GeneratedExecutionsClientSnippets
{
/// <summary>Snippet for DeleteExecutionAsync</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 DeleteExecutionResourceNamesAsync()
{
// Create client
ExecutionsClient executionsClient = await ExecutionsClient.CreateAsync();
// Initialize request argument(s)
ExecutionName name = ExecutionName.FromProjectLocationJobExecution("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]");
// Make the request
Operation<Execution, Execution> response = await executionsClient.DeleteExecutionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Execution, Execution> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Execution 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<Execution, Execution> retrievedResponse = await executionsClient.PollOnceDeleteExecutionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Execution retrievedResult = retrievedResponse.Result;
}
}
}
// [END run_v2_generated_Executions_DeleteExecution_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// 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.Run.V2.Snippets
{
// [START run_v2_generated_Executions_DeleteExecution_sync_flattened_resourceNames]
using Google.Cloud.Run.V2;
using Google.LongRunning;

public sealed partial class GeneratedExecutionsClientSnippets
{
/// <summary>Snippet for DeleteExecution</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void DeleteExecutionResourceNames()
{
// Create client
ExecutionsClient executionsClient = ExecutionsClient.Create();
// Initialize request argument(s)
ExecutionName name = ExecutionName.FromProjectLocationJobExecution("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]");
// Make the request
Operation<Execution, Execution> response = executionsClient.DeleteExecution(name);

// Poll until the returned long-running operation is complete
Operation<Execution, Execution> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Execution 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<Execution, Execution> retrievedResponse = executionsClient.PollOnceDeleteExecution(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Execution retrievedResult = retrievedResponse.Result;
}
}
}
// [END run_v2_generated_Executions_DeleteExecution_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// 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.Run.V2.Snippets
{
// [START run_v2_generated_Executions_DeleteExecution_sync_flattened]
using Google.Cloud.Run.V2;
using Google.LongRunning;

public sealed partial class GeneratedExecutionsClientSnippets
{
/// <summary>Snippet for DeleteExecution</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void DeleteExecution()
{
// Create client
ExecutionsClient executionsClient = ExecutionsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/executions/[EXECUTION]";
// Make the request
Operation<Execution, Execution> response = executionsClient.DeleteExecution(name);

// Poll until the returned long-running operation is complete
Operation<Execution, Execution> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Execution 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<Execution, Execution> retrievedResponse = executionsClient.PollOnceDeleteExecution(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Execution retrievedResult = retrievedResponse.Result;
}
}
}
// [END run_v2_generated_Executions_DeleteExecution_sync_flattened]
}
Loading

0 comments on commit 85bc403

Please sign in to comment.