diff --git a/java-run/README.md b/java-run/README.md
index 51426b952dcd..008f9cb91280 100644
--- a/java-run/README.md
+++ b/java-run/README.md
@@ -22,20 +22,20 @@ If you are using Maven, add this to your pom.xml file:
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]"); + * Execution response = executionsClient.getExecution(name); + * } + * }+ * + *
Note: close() needs to be called on the ExecutionsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of ExecutionsSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * ExecutionsSettings executionsSettings = + * ExecutionsSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ExecutionsClient executionsClient = ExecutionsClient.create(executionsSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * ExecutionsSettings executionsSettings = + * ExecutionsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ExecutionsClient executionsClient = ExecutionsClient.create(executionsSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * ExecutionsSettings executionsSettings = ExecutionsSettings.newHttpJsonBuilder().build(); + * ExecutionsClient executionsClient = ExecutionsClient.create(executionsSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ExecutionsClient implements BackgroundResource { + private final ExecutionsSettings settings; + private final ExecutionsStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of ExecutionsClient with default settings. */ + public static final ExecutionsClient create() throws IOException { + return create(ExecutionsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ExecutionsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ExecutionsClient create(ExecutionsSettings settings) throws IOException { + return new ExecutionsClient(settings); + } + + /** + * Constructs an instance of ExecutionsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ExecutionsSettings). + */ + public static final ExecutionsClient create(ExecutionsStub stub) { + return new ExecutionsClient(stub); + } + + /** + * Constructs an instance of ExecutionsClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected ExecutionsClient(ExecutionsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ExecutionsStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected ExecutionsClient(ExecutionsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final ExecutionsSettings getSettings() { + return settings; + } + + public ExecutionsStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an Execution. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]"); + * Execution response = executionsClient.getExecution(name); + * } + * }+ * + * @param name Required. The full name of the Execution. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution getExecution(ExecutionName name) { + GetExecutionRequest request = + GetExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an Execution. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString(); + * Execution response = executionsClient.getExecution(name); + * } + * }+ * + * @param name Required. The full name of the Execution. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution getExecution(String name) { + GetExecutionRequest request = GetExecutionRequest.newBuilder().setName(name).build(); + return getExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an Execution. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * GetExecutionRequest request = + * GetExecutionRequest.newBuilder() + * .setName( + * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString()) + * .build(); + * Execution response = executionsClient.getExecution(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution getExecution(GetExecutionRequest request) { + return getExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an Execution. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * GetExecutionRequest request = + * GetExecutionRequest.newBuilder() + * .setName( + * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = executionsClient.getExecutionCallable().futureCall(request); + * // Do something. + * Execution response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * JobName parent = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]"); + * for (Execution element : executionsClient.listExecutions(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The Execution from which the Executions should be listed. To list all + * Executions across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExecutionsPagedResponse listExecutions(JobName parent) { + ListExecutionsRequest request = + ListExecutionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExecutions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Executions from a Job. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * String parent = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString(); + * for (Execution element : executionsClient.listExecutions(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The Execution from which the Executions should be listed. To list all + * Executions across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExecutionsPagedResponse listExecutions(String parent) { + ListExecutionsRequest request = ListExecutionsRequest.newBuilder().setParent(parent).build(); + return listExecutions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Executions from a Job. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * ListExecutionsRequest request = + * ListExecutionsRequest.newBuilder() + * .setParent(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setShowDeleted(true) + * .build(); + * for (Execution element : executionsClient.listExecutions(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) { + return listExecutionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Executions from a Job. + * + *
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * ListExecutionsRequest request = + * ListExecutionsRequest.newBuilder() + * .setParent(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setShowDeleted(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * executionsClient.listExecutionsPagedCallable().futureCall(request); + * // Do something. + * for (Execution element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * ListExecutionsRequest request = + * ListExecutionsRequest.newBuilder() + * .setParent(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setShowDeleted(true) + * .build(); + * while (true) { + * ListExecutionsResponse response = executionsClient.listExecutionsCallable().call(request); + * for (Execution element : response.getExecutionsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]"); + * Execution response = executionsClient.deleteExecutionAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the Execution to delete. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString(); + * Execution response = executionsClient.deleteExecutionAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the Execution to delete. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * DeleteExecutionRequest request = + * DeleteExecutionRequest.newBuilder() + * .setName( + * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString()) + * .setValidateOnly(true) + * .setEtag("etag3123477") + * .build(); + * Execution response = executionsClient.deleteExecutionAsync(request).get(); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * DeleteExecutionRequest request = + * DeleteExecutionRequest.newBuilder() + * .setName( + * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString()) + * .setValidateOnly(true) + * .setEtag("etag3123477") + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * executionsClient.deleteExecutionOperationCallable().futureCall(request); + * // Do something. + * Execution response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * try (ExecutionsClient executionsClient = ExecutionsClient.create()) { + * DeleteExecutionRequest request = + * DeleteExecutionRequest.newBuilder() + * .setName( + * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString()) + * .setValidateOnly(true) + * .setEtag("etag3123477") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = executionsClient.deleteExecutionCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getExecution to 30 seconds: + * + *
{@code + * // 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/java/docs/setup#configure_endpoints_for_the_client_library + * ExecutionsSettings.Builder executionsSettingsBuilder = ExecutionsSettings.newBuilder(); + * executionsSettingsBuilder + * .getExecutionSettings() + * .setRetrySettings( + * executionsSettingsBuilder.getExecutionSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ExecutionsSettings executionsSettings = executionsSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class ExecutionsSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the JobsClient object to clean up resources such as
+ * threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ * The surface of this class includes several types of Java methods for each of the API's
+ * methods:
+ *
+ * See the individual methods for example code.
+ *
+ * Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ * This class can be customized by passing in a custom instance of JobsSettings to create(). For
+ * example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class JobsClient implements BackgroundResource {
+ private final JobsSettings settings;
+ private final JobsStub stub;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
+
+ /** Constructs an instance of JobsClient with default settings. */
+ public static final JobsClient create() throws IOException {
+ return create(JobsSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of JobsClient, using the given settings. The channels are created based
+ * on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final JobsClient create(JobsSettings settings) throws IOException {
+ return new JobsClient(settings);
+ }
+
+ /**
+ * Constructs an instance of JobsClient, using the given stub for making calls. This is for
+ * advanced usage - prefer using create(JobsSettings).
+ */
+ public static final JobsClient create(JobsStub stub) {
+ return new JobsClient(stub);
+ }
+
+ /**
+ * Constructs an instance of JobsClient, using the given settings. This is protected so that it is
+ * easy to make a subclass, but otherwise, the static factory methods should be preferred.
+ */
+ protected JobsClient(JobsSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((JobsStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
+ }
+
+ protected JobsClient(JobsStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
+ }
+
+ public final JobsSettings getSettings() {
+ return settings;
+ }
+
+ public JobsStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Job.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * There are no permissions required for making this API call.
+ *
+ * Sample code:
+ *
+ * There are no permissions required for making this API call.
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getJob to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction Sample code:
*
@@ -350,7 +346,7 @@ public final ListRevisionsPagedResponse listRevisions(ServiceName parent) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Revisions from a given Service, or from a given location.
+ * Lists Revisions from a given Service, or from a given location.
*
* Sample code:
*
@@ -380,7 +376,7 @@ public final ListRevisionsPagedResponse listRevisions(String parent) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Revisions from a given Service, or from a given location.
+ * Lists Revisions from a given Service, or from a given location.
*
* Sample code:
*
@@ -413,7 +409,7 @@ public final ListRevisionsPagedResponse listRevisions(ListRevisionsRequest reque
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Revisions from a given Service, or from a given location.
+ * Lists Revisions from a given Service, or from a given location.
*
* Sample code:
*
@@ -446,7 +442,7 @@ public final ListRevisionsPagedResponse listRevisions(ListRevisionsRequest reque
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Revisions from a given Service, or from a given location.
+ * Lists Revisions from a given Service, or from a given location.
*
* Sample code:
*
@@ -485,7 +481,7 @@ public final UnaryCallable Sample code:
*
@@ -513,7 +509,7 @@ public final OperationFuture Sample code:
*
@@ -541,7 +537,7 @@ public final OperationFuture Sample code:
*
@@ -573,7 +569,7 @@ public final OperationFuture Sample code:
*
@@ -605,7 +601,7 @@ public final OperationFuture Sample code:
*
diff --git a/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/ServicesClient.java b/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/ServicesClient.java
index 29652a3ba603..9ecd1a1bc37f 100644
--- a/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/ServicesClient.java
+++ b/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/ServicesClient.java
@@ -124,11 +124,7 @@
* // - 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/java/docs/setup#configure_endpoints_for_the_client_library
- * ServicesSettings servicesSettings =
- * ServicesSettings.newBuilder()
- * .setTransportChannelProvider(
- * ServicesSettings.defaultHttpJsonTransportProviderBuilder().build())
- * .build();
+ * ServicesSettings servicesSettings = ServicesSettings.newHttpJsonBuilder().build();
* ServicesClient servicesClient = ServicesClient.create(servicesSettings);
* }
*
@@ -227,8 +223,9 @@ public final OperationsClient getHttpJsonOperationsClient() {
* }
* }
*
- * @param parent The location and project in which this service should be created. Format:
- * projects/{project}/locations/{location} Only lowercase characters, digits, and hyphens.
+ * @param parent Required. The location and project in which this service should be created.
+ * Format: projects/{project}/locations/{location} Only lowercase characters, digits, and
+ * hyphens.
* @param service Required. The Service instance to create.
* @param serviceId Required. The unique identifier for the Service. It must begin with letter,
* and may not end with hyphen; must contain fewer than 50 characters. The name of the service
@@ -266,8 +263,9 @@ public final OperationFuture Sample code:
*
@@ -523,7 +521,7 @@ public final ListServicesPagedResponse listServices(LocationName parent) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Services.
+ * Lists Services.
*
* Sample code:
*
@@ -553,7 +551,7 @@ public final ListServicesPagedResponse listServices(String parent) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Services.
+ * Lists Services.
*
* Sample code:
*
@@ -586,7 +584,7 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request)
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Services.
+ * Lists Services.
*
* Sample code:
*
@@ -619,7 +617,7 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request)
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * List Services.
+ * Lists Services.
*
* Sample code:
*
@@ -924,7 +922,7 @@ public final UnaryCallable Sample code:
@@ -954,7 +952,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
- * Get the IAM Access Control policy currently in effect for the given Cloud Run Service. This
+ * Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This
* result does not include any inherited policies.
*
* Sample code:
diff --git a/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/TasksClient.java b/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/TasksClient.java
new file mode 100644
index 000000000000..afe232919c85
--- /dev/null
+++ b/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/TasksClient.java
@@ -0,0 +1,550 @@
+/*
+ * 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.
+ */
+
+package com.google.cloud.run.v2;
+
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.run.v2.stub.TasksStub;
+import com.google.cloud.run.v2.stub.TasksStubSettings;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: Cloud Run Task Control Plane API.
+ *
+ * This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the TasksClient object to clean up resources such as
+ * threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ * The surface of this class includes several types of Java methods for each of the API's
+ * methods:
+ *
+ * See the individual methods for example code.
+ *
+ * Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ * This class can be customized by passing in a custom instance of TasksSettings to create(). For
+ * example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class TasksClient implements BackgroundResource {
+ private final TasksSettings settings;
+ private final TasksStub stub;
+
+ /** Constructs an instance of TasksClient with default settings. */
+ public static final TasksClient create() throws IOException {
+ return create(TasksSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of TasksClient, using the given settings. The channels are created based
+ * on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final TasksClient create(TasksSettings settings) throws IOException {
+ return new TasksClient(settings);
+ }
+
+ /**
+ * Constructs an instance of TasksClient, using the given stub for making calls. This is for
+ * advanced usage - prefer using create(TasksSettings).
+ */
+ public static final TasksClient create(TasksStub stub) {
+ return new TasksClient(stub);
+ }
+
+ /**
+ * Constructs an instance of TasksClient, using the given settings. This is protected so that it
+ * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
+ */
+ protected TasksClient(TasksSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((TasksStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected TasksClient(TasksStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final TasksSettings getSettings() {
+ return settings;
+ }
+
+ public TasksStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Task.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getTask to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
*
+ * ======================= ExecutionsClient =======================
+ *
+ * Service Description: Cloud Run Execution Control Plane API.
+ *
+ * Sample for ExecutionsClient:
+ *
+ * ======================= JobsClient =======================
+ *
+ * Service Description: Cloud Run Job Control Plane API.
+ *
+ * Sample for JobsClient:
+ *
+ * ======================= RevisionsClient =======================
*
* Service Description: Cloud Run Revision Control Plane API.
@@ -54,6 +90,24 @@
* Service response = servicesClient.getService(name);
* }
* }
+ *
+ * ======================= TasksClient =======================
+ *
+ * Service Description: Cloud Run Task Control Plane API.
+ *
+ * Sample for TasksClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class ExecutionsStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getExecution to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcExecutionsCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcExecutionsStub extends ExecutionsStub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcJobsCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
+ * Job response = jobsClient.getJob(name);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * JobsSettings jobsSettings =
+ * JobsSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * JobsClient jobsClient = JobsClient.create(jobsSettings);
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * JobsSettings jobsSettings = JobsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * JobsClient jobsClient = JobsClient.create(jobsSettings);
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * JobsSettings jobsSettings = JobsSettings.newHttpJsonBuilder().build();
+ * JobsClient jobsClient = JobsClient.create(jobsSettings);
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Job job = Job.newBuilder().build();
+ * String jobId = "jobId101296568";
+ * Job response = jobsClient.createJobAsync(parent, job, jobId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The location and project in which this Job should be created. Format:
+ * projects/{project}/locations/{location}
+ * @param job Required. The Job instance to create.
+ * @param jobId Required. The unique identifier for the Job. The name of the job becomes
+ * {parent}/jobs/{job_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Job job = Job.newBuilder().build();
+ * String jobId = "jobId101296568";
+ * Job response = jobsClient.createJobAsync(parent, job, jobId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The location and project in which this Job should be created. Format:
+ * projects/{project}/locations/{location}
+ * @param job Required. The Job instance to create.
+ * @param jobId Required. The unique identifier for the Job. The name of the job becomes
+ * {parent}/jobs/{job_id}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * CreateJobRequest request =
+ * CreateJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setJob(Job.newBuilder().build())
+ * .setJobId("jobId101296568")
+ * .setValidateOnly(true)
+ * .build();
+ * Job response = jobsClient.createJobAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * CreateJobRequest request =
+ * CreateJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setJob(Job.newBuilder().build())
+ * .setJobId("jobId101296568")
+ * .setValidateOnly(true)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * CreateJobRequest request =
+ * CreateJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setJob(Job.newBuilder().build())
+ * .setJobId("jobId101296568")
+ * .setValidateOnly(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
+ * Job response = jobsClient.getJob(name);
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Job. Format:
+ * projects/{project}/locations/{location}/jobs/{job}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Job getJob(JobName name) {
+ GetJobRequest request =
+ GetJobRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Job.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * String name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString();
+ * Job response = jobsClient.getJob(name);
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Job. Format:
+ * projects/{project}/locations/{location}/jobs/{job}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Job getJob(String name) {
+ GetJobRequest request = GetJobRequest.newBuilder().setName(name).build();
+ return getJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Job.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * GetJobRequest request =
+ * GetJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .build();
+ * Job response = jobsClient.getJob(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Job getJob(GetJobRequest request) {
+ return getJobCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Job.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * GetJobRequest request =
+ * GetJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Job element : jobsClient.listJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The location and project to list resources on. Format:
+ * projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListJobsPagedResponse listJobs(LocationName parent) {
+ ListJobsRequest request =
+ ListJobsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listJobs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Jobs.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Job element : jobsClient.listJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The location and project to list resources on. Format:
+ * projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListJobsPagedResponse listJobs(String parent) {
+ ListJobsRequest request = ListJobsRequest.newBuilder().setParent(parent).build();
+ return listJobs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Jobs.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * ListJobsRequest request =
+ * ListJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (Job element : jobsClient.listJobs(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListJobsPagedResponse listJobs(ListJobsRequest request) {
+ return listJobsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Jobs.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * ListJobsRequest request =
+ * ListJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * ListJobsRequest request =
+ * ListJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListJobsResponse response = jobsClient.listJobsCallable().call(request);
+ * for (Job element : response.getJobsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * Job job = Job.newBuilder().build();
+ * Job response = jobsClient.updateJobAsync(job).get();
+ * }
+ * }
+ *
+ * @param job Required. The Job to be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * UpdateJobRequest request =
+ * UpdateJobRequest.newBuilder()
+ * .setJob(Job.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .build();
+ * Job response = jobsClient.updateJobAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * UpdateJobRequest request =
+ * UpdateJobRequest.newBuilder()
+ * .setJob(Job.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * UpdateJobRequest request =
+ * UpdateJobRequest.newBuilder()
+ * .setJob(Job.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
+ * Job response = jobsClient.deleteJobAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Job. Format:
+ * projects/{project}/locations/{location}/jobs/{job}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * String name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString();
+ * Job response = jobsClient.deleteJobAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Job. Format:
+ * projects/{project}/locations/{location}/jobs/{job}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * DeleteJobRequest request =
+ * DeleteJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * Job response = jobsClient.deleteJobAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * DeleteJobRequest request =
+ * DeleteJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * DeleteJobRequest request =
+ * DeleteJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
+ * Execution response = jobsClient.runJobAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Job. Format:
+ * projects/{project}/locations/{location}/jobs/{job}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * String name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString();
+ * Execution response = jobsClient.runJobAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Job. Format:
+ * projects/{project}/locations/{location}/jobs/{job}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * RunJobRequest request =
+ * RunJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * Execution response = jobsClient.runJobAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * RunJobRequest request =
+ * RunJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * RunJobRequest request =
+ * RunJobRequest.newBuilder()
+ * .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = jobsClient.getIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get the IAM Access Control policy currently in effect for the given Job. This result does not
+ * include any inherited policies.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = jobsClient.setIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the IAM Access control policy for the specified Job. Overwrites any existing policy.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .addAllPermissions(new ArrayList
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified Project.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+ * .addAllPermissions(new ArrayList
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * JobsSettings.Builder jobsSettingsBuilder = JobsSettings.newBuilder();
+ * jobsSettingsBuilder
+ * .getJobSettings()
+ * .setRetrySettings(
+ * jobsSettingsBuilder.getJobSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * JobsSettings jobsSettings = jobsSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class JobsSettings extends ClientSettings{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]", "[TASK]");
+ * Task response = tasksClient.getTask(name);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * TasksSettings tasksSettings =
+ * TasksSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * TasksClient tasksClient = TasksClient.create(tasksSettings);
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * TasksSettings tasksSettings = TasksSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TasksClient tasksClient = TasksClient.create(tasksSettings);
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * TasksSettings tasksSettings = TasksSettings.newHttpJsonBuilder().build();
+ * TasksClient tasksClient = TasksClient.create(tasksSettings);
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]", "[TASK]");
+ * Task response = tasksClient.getTask(name);
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Task. Format:
+ * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Task getTask(TaskName name) {
+ GetTaskRequest request =
+ GetTaskRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getTask(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Task.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * String name =
+ * TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]", "[TASK]").toString();
+ * Task response = tasksClient.getTask(name);
+ * }
+ * }
+ *
+ * @param name Required. The full name of the Task. Format:
+ * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Task getTask(String name) {
+ GetTaskRequest request = GetTaskRequest.newBuilder().setName(name).build();
+ return getTask(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Task.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * GetTaskRequest request =
+ * GetTaskRequest.newBuilder()
+ * .setName(
+ * TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]", "[TASK]")
+ * .toString())
+ * .build();
+ * Task response = tasksClient.getTask(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Task getTask(GetTaskRequest request) {
+ return getTaskCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a Task.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * GetTaskRequest request =
+ * GetTaskRequest.newBuilder()
+ * .setName(
+ * TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]", "[TASK]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * ExecutionName parent = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]");
+ * for (Task element : tasksClient.listTasks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The Execution from which the Tasks should be listed. To list all Tasks
+ * across Executions of a Job, use "-" instead of Execution name. To list all Tasks across
+ * Jobs, use "-" instead of Job name. Format:
+ * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTasksPagedResponse listTasks(ExecutionName parent) {
+ ListTasksRequest request =
+ ListTasksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listTasks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Tasks from an Execution of a Job.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * String parent =
+ * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString();
+ * for (Task element : tasksClient.listTasks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The Execution from which the Tasks should be listed. To list all Tasks
+ * across Executions of a Job, use "-" instead of Execution name. To list all Tasks across
+ * Jobs, use "-" instead of Job name. Format:
+ * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTasksPagedResponse listTasks(String parent) {
+ ListTasksRequest request = ListTasksRequest.newBuilder().setParent(parent).build();
+ return listTasks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Tasks from an Execution of a Job.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * ListTasksRequest request =
+ * ListTasksRequest.newBuilder()
+ * .setParent(
+ * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (Task element : tasksClient.listTasks(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTasksPagedResponse listTasks(ListTasksRequest request) {
+ return listTasksPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Tasks from an Execution of a Job.
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * ListTasksRequest request =
+ * ListTasksRequest.newBuilder()
+ * .setParent(
+ * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * ListTasksRequest request =
+ * ListTasksRequest.newBuilder()
+ * .setParent(
+ * ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListTasksResponse response = tasksClient.listTasksCallable().call(request);
+ * for (Task element : response.getTasksList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * TasksSettings.Builder tasksSettingsBuilder = TasksSettings.newBuilder();
+ * tasksSettingsBuilder
+ * .getTaskSettings()
+ * .setRetrySettings(
+ * tasksSettingsBuilder.getTaskSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * TasksSettings tasksSettings = tasksSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class TasksSettings extends ClientSettings{@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+ * ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]");
+ * Execution response = executionsClient.getExecution(name);
+ * }
+ * }
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (JobsClient jobsClient = JobsClient.create()) {
+ * JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
+ * Job response = jobsClient.getJob(name);
+ * }
+ * }
+ *
* {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (TasksClient tasksClient = TasksClient.create()) {
+ * TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[EXECUTION]", "[TASK]");
+ * Task response = tasksClient.getTask(name);
+ * }
+ * }
*/
@Generated("by gapic-generator-java")
package com.google.cloud.run.v2;
diff --git a/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/stub/ExecutionsStub.java b/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/stub/ExecutionsStub.java
new file mode 100644
index 000000000000..842b9d7e80b9
--- /dev/null
+++ b/java-run/google-cloud-run/src/main/java/com/google/cloud/run/v2/stub/ExecutionsStub.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+
+package com.google.cloud.run.v2.stub;
+
+import static com.google.cloud.run.v2.ExecutionsClient.ListExecutionsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.run.v2.DeleteExecutionRequest;
+import com.google.cloud.run.v2.Execution;
+import com.google.cloud.run.v2.GetExecutionRequest;
+import com.google.cloud.run.v2.ListExecutionsRequest;
+import com.google.cloud.run.v2.ListExecutionsResponse;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the Executions service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * // 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/java/docs/setup#configure_endpoints_for_the_client_library
+ * ExecutionsStubSettings.Builder executionsSettingsBuilder = ExecutionsStubSettings.newBuilder();
+ * executionsSettingsBuilder
+ * .getExecutionSettings()
+ * .setRetrySettings(
+ * executionsSettingsBuilder.getExecutionSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ExecutionsStubSettings executionsSettings = executionsSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ExecutionsStubSettings extends StubSettings