-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds Cloud Run Jobs v2 API client libraries
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
1 parent
3f73874
commit 85bc403
Showing
126 changed files
with
24,517 additions
and
85 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...2/Google.Cloud.Run.V2.GeneratedSnippets/ExecutionsClient.DeleteExecutionAsyncSnippet.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 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] | ||
} |
65 changes: 65 additions & 0 deletions
65
...d.Run.V2.GeneratedSnippets/ExecutionsClient.DeleteExecutionRequestObjectAsyncSnippet.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,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] | ||
} |
62 changes: 62 additions & 0 deletions
62
....Cloud.Run.V2.GeneratedSnippets/ExecutionsClient.DeleteExecutionRequestObjectSnippet.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,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] | ||
} |
60 changes: 60 additions & 0 deletions
60
...d.Run.V2.GeneratedSnippets/ExecutionsClient.DeleteExecutionResourceNamesAsyncSnippet.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 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] | ||
} |
57 changes: 57 additions & 0 deletions
57
....Cloud.Run.V2.GeneratedSnippets/ExecutionsClient.DeleteExecutionResourceNamesSnippet.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,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] | ||
} |
57 changes: 57 additions & 0 deletions
57
...Run.V2/Google.Cloud.Run.V2.GeneratedSnippets/ExecutionsClient.DeleteExecutionSnippet.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,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] | ||
} |
Oops, something went wrong.