From e9caf2145612488be4fd39c96ecefd765ef0db15 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 14:40:33 +0000 Subject: [PATCH] feat: [batch] added StatusEvent.task_state (#9177) - [ ] Regenerate this pull request now. docs: updated comments PiperOrigin-RevId: 513426000 Source-Link: https://togithub.com/googleapis/googleapis/commit/3f95ea2d86b8e826350897efac1674d6784b4030 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b191b40b95e42eeea8d0bccf91dd1d1ba8a61fb1 Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiYjE5MWI0MGI5NWU0MmVlZWE4ZDBiY2NmOTFkZDFkMWJhOGE2MWZiMSJ9 BEGIN_NESTED_COMMIT feat: [batch] resource usage docs: update comments PiperOrigin-RevId: 513425559 Source-Link: https://togithub.com/googleapis/googleapis/commit/2936faa73019cc9fa670eefc2776111457a7d798 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5219e27baeeb63b209c4f0e9ca6c68e3b6698d66 Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNTIxOWUyN2JhZWViNjNiMjA5YzRmMGU5Y2E2YzY4ZTNiNjY5OGQ2NiJ9 END_NESTED_COMMIT --- java-batch/README.md | 2 - .../cloud/batch/v1/BatchServiceClient.java | 196 ------- .../cloud/batch/v1/BatchServiceSettings.java | 37 -- .../google/cloud/batch/v1/gapic_metadata.json | 9 - .../cloud/batch/v1/stub/BatchServiceStub.java | 18 - .../v1/stub/BatchServiceStubSettings.java | 79 +-- .../batch/v1/stub/GrpcBatchServiceStub.java | 94 --- .../v1/stub/HttpJsonBatchServiceStub.java | 163 ------ .../batch/v1alpha/BatchServiceClient.java | 196 ------- .../batch/v1alpha/BatchServiceSettings.java | 37 -- .../cloud/batch/v1alpha/gapic_metadata.json | 9 - .../batch/v1alpha/stub/BatchServiceStub.java | 18 - .../stub/BatchServiceStubSettings.java | 79 +-- .../v1alpha/stub/GrpcBatchServiceStub.java | 94 --- .../stub/HttpJsonBatchServiceStub.java | 163 ------ .../v1/BatchServiceClientHttpJsonTest.java | 172 ------ .../batch/v1/BatchServiceClientTest.java | 162 +----- .../google/cloud/batch/v1/MockIAMPolicy.java | 59 -- .../cloud/batch/v1/MockIAMPolicyImpl.java | 127 ---- .../BatchServiceClientHttpJsonTest.java | 172 ------ .../batch/v1alpha/BatchServiceClientTest.java | 162 +----- .../cloud/batch/v1alpha/MockIAMPolicy.java | 59 -- .../batch/v1alpha/MockIAMPolicyImpl.java | 127 ---- .../cloud/batch/v1/AllocationPolicy.java | 10 +- .../com/google/cloud/batch/v1/BatchProto.java | 124 ++-- .../cloud/batch/v1/CreateJobRequest.java | 28 +- .../batch/v1/CreateJobRequestOrBuilder.java | 8 +- .../cloud/batch/v1/DeleteJobRequest.java | 28 +- .../batch/v1/DeleteJobRequestOrBuilder.java | 8 +- .../java/com/google/cloud/batch/v1/Job.java | 12 +- .../google/cloud/batch/v1/JobOrBuilder.java | 3 +- .../cloud/batch/v1/LifecyclePolicy.java | 28 + .../batch/v1/LifecyclePolicyOrBuilder.java | 8 + .../com/google/cloud/batch/v1/Runnable.java | 144 +++++ .../google/cloud/batch/v1/StatusEvent.java | 148 +++++ .../cloud/batch/v1/StatusEventOrBuilder.java | 25 + .../com/google/cloud/batch/v1/TaskProto.java | 130 +++-- .../com/google/cloud/batch/v1/TaskSpec.java | 299 +++++----- .../cloud/batch/v1/TaskSpecOrBuilder.java | 65 +-- .../proto/google/cloud/batch/v1/batch.proto | 9 +- .../proto/google/cloud/batch/v1/job.proto | 3 +- .../proto/google/cloud/batch/v1/task.proto | 34 +- .../cloud/batch/v1alpha/AllocationPolicy.java | 126 ++-- .../v1alpha/AllocationPolicyOrBuilder.java | 26 +- .../cloud/batch/v1alpha/BatchProto.java | 129 +++-- .../cloud/batch/v1alpha/CreateJobRequest.java | 28 +- .../v1alpha/CreateJobRequestOrBuilder.java | 8 +- .../cloud/batch/v1alpha/DeleteJobRequest.java | 28 +- .../v1alpha/DeleteJobRequestOrBuilder.java | 8 +- .../com/google/cloud/batch/v1alpha/Job.java | 20 +- .../cloud/batch/v1alpha/JobOrBuilder.java | 7 +- .../google/cloud/batch/v1alpha/JobProto.java | 235 ++++---- .../google/cloud/batch/v1alpha/JobStatus.java | 267 +++++++++ .../batch/v1alpha/JobStatusOrBuilder.java | 35 ++ .../cloud/batch/v1alpha/LifecyclePolicy.java | 28 + .../v1alpha/LifecyclePolicyOrBuilder.java | 8 + .../cloud/batch/v1alpha/ResourceUsage.java | 542 +++++++++++++++++ .../batch/v1alpha/ResourceUsageOrBuilder.java | 38 ++ .../google/cloud/batch/v1alpha/Runnable.java | 144 +++++ .../cloud/batch/v1alpha/StatusEvent.java | 150 +++++ .../batch/v1alpha/StatusEventOrBuilder.java | 25 + .../google/cloud/batch/v1alpha/TaskProto.java | 169 +++--- .../batch/v1alpha/TaskResourceUsage.java | 547 ++++++++++++++++++ .../v1alpha/TaskResourceUsageOrBuilder.java | 39 ++ .../google/cloud/batch/v1alpha/TaskSpec.java | 299 +++++----- .../batch/v1alpha/TaskSpecOrBuilder.java | 65 +-- .../cloud/batch/v1alpha/TaskStatus.java | 267 +++++++++ .../batch/v1alpha/TaskStatusOrBuilder.java | 35 ++ .../google/cloud/batch/v1alpha/batch.proto | 9 +- .../google/cloud/batch/v1alpha/job.proto | 12 +- .../google/cloud/batch/v1alpha/task.proto | 44 +- .../getiampolicy/AsyncGetIamPolicy.java | 51 -- .../getiampolicy/SyncGetIamPolicy.java | 48 -- .../setiampolicy/AsyncSetIamPolicy.java | 52 -- .../setiampolicy/SyncSetIamPolicy.java | 49 -- .../AsyncTestIamPermissions.java | 52 -- .../SyncTestIamPermissions.java | 48 -- .../getiampolicy/AsyncGetIamPolicy.java | 51 -- .../getiampolicy/SyncGetIamPolicy.java | 48 -- .../setiampolicy/AsyncSetIamPolicy.java | 52 -- .../setiampolicy/SyncSetIamPolicy.java | 49 -- .../AsyncTestIamPermissions.java | 52 -- .../SyncTestIamPermissions.java | 48 -- 83 files changed, 3499 insertions(+), 3787 deletions(-) delete mode 100644 java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicy.java delete mode 100644 java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicyImpl.java delete mode 100644 java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicy.java delete mode 100644 java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicyImpl.java create mode 100644 java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsage.java create mode 100644 java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsageOrBuilder.java create mode 100644 java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsage.java create mode 100644 java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsageOrBuilder.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/AsyncGetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/SyncGetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/AsyncSetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/SyncSetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/AsyncTestIamPermissions.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/SyncTestIamPermissions.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/AsyncGetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/SyncGetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/AsyncSetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/SyncSetIamPolicy.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/AsyncTestIamPermissions.java delete mode 100644 java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/SyncTestIamPermissions.java diff --git a/java-batch/README.md b/java-batch/README.md index d6b414b84895..8eb706827cd8 100644 --- a/java-batch/README.md +++ b/java-batch/README.md @@ -17,7 +17,6 @@ Java idiomatic client for [Cloud Batch][product-docs]. If you are using Maven, add this to your pom.xml file: - ```xml @@ -38,7 +37,6 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-batch" % "0.12.0" ``` - ## Authentication diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java index e5f701a74046..45da0d901675 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java @@ -35,11 +35,6 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.util.concurrent.MoreExecutors; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -1142,197 +1137,6 @@ public final UnaryCallable getLocationCallable() { return stub.getLocationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Policy response = batchServiceClient.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 access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = batchServiceClient.setIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   Policy response = batchServiceClient.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. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = batchServiceClient.getIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   TestIamPermissionsResponse response = batchServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       batchServiceClient.testIamPermissionsCallable().futureCall(request);
-   *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); - } - @Override public final void close() { stub.close(); diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java index 12914e2c76e5..06fbb66060c9 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java @@ -38,11 +38,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -137,22 +132,6 @@ public UnaryCallSettings getLocationSettings() { return ((BatchServiceStubSettings) getStubSettings()).getLocationSettings(); } - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return ((BatchServiceStubSettings) getStubSettings()).setIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return ((BatchServiceStubSettings) getStubSettings()).getIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return ((BatchServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); - } - public static final BatchServiceSettings create(BatchServiceStubSettings stub) throws IOException { return new BatchServiceSettings.Builder(stub.toBuilder()).build(); @@ -318,22 +297,6 @@ public UnaryCallSettings.Builder getLocationSettin return getStubSettingsBuilder().getLocationSettings(); } - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return getStubSettingsBuilder().setIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getStubSettingsBuilder().getIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return getStubSettingsBuilder().testIamPermissionsSettings(); - } - @Override public BatchServiceSettings build() throws IOException { return new BatchServiceSettings(this); diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/gapic_metadata.json b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/gapic_metadata.json index b66edeea0f6f..31a29beeab0d 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/gapic_metadata.json +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/gapic_metadata.json @@ -16,9 +16,6 @@ "DeleteJob": { "methods": ["deleteJobAsync", "deleteJobAsync", "deleteJobOperationCallable", "deleteJobCallable"] }, - "GetIamPolicy": { - "methods": ["getIamPolicy", "getIamPolicyCallable"] - }, "GetJob": { "methods": ["getJob", "getJob", "getJob", "getJobCallable"] }, @@ -36,12 +33,6 @@ }, "ListTasks": { "methods": ["listTasks", "listTasks", "listTasks", "listTasksPagedCallable", "listTasksCallable"] - }, - "SetIamPolicy": { - "methods": ["setIamPolicy", "setIamPolicyCallable"] - }, - "TestIamPermissions": { - "methods": ["testIamPermissions", "testIamPermissionsCallable"] } } } diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java index d895fe5c02e9..65bb5dfe1534 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java @@ -38,11 +38,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -115,19 +110,6 @@ public UnaryCallable getLocationCallable() { throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); } - public UnaryCallable setIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); - } - - public UnaryCallable getIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); - } - - public UnaryCallable - testIamPermissionsCallable() { - throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); - } - @Override public abstract void close(); } diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java index 788e418880bc..6120f429703e 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java @@ -68,11 +68,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -137,10 +132,6 @@ public class BatchServiceStubSettings extends StubSettings listLocationsSettings; private final UnaryCallSettings getLocationSettings; - private final UnaryCallSettings setIamPolicySettings; - private final UnaryCallSettings getIamPolicySettings; - private final UnaryCallSettings - testIamPermissionsSettings; private static final PagedListDescriptor LIST_JOBS_PAGE_STR_DESC = @@ -349,22 +340,6 @@ public UnaryCallSettings getLocationSettings() { return getLocationSettings; } - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - public BatchServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -480,9 +455,6 @@ protected BatchServiceStubSettings(Builder settingsBuilder) throws IOException { listTasksSettings = settingsBuilder.listTasksSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); - setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); - getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); - testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for BatchServiceStubSettings. */ @@ -504,10 +476,6 @@ public static class Builder extends StubSettings.Builder listLocationsSettings; private final UnaryCallSettings.Builder getLocationSettings; - private final UnaryCallSettings.Builder setIamPolicySettings; - private final UnaryCallSettings.Builder getIamPolicySettings; - private final UnaryCallSettings.Builder - testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -568,9 +536,6 @@ protected Builder(ClientContext clientContext) { listTasksSettings = PagedCallSettings.newBuilder(LIST_TASKS_PAGE_STR_FACT); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -581,10 +546,7 @@ protected Builder(ClientContext clientContext) { getTaskSettings, listTasksSettings, listLocationsSettings, - getLocationSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); + getLocationSettings); initDefaults(this); } @@ -600,9 +562,6 @@ protected Builder(BatchServiceStubSettings settings) { listTasksSettings = settings.listTasksSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); - setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); - getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); - testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -613,10 +572,7 @@ protected Builder(BatchServiceStubSettings settings) { getTaskSettings, listTasksSettings, listLocationsSettings, - getLocationSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); + getLocationSettings); } private static Builder createDefault() { @@ -686,21 +642,6 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - builder - .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - builder .deleteJobOperationSettings() .setInitialCallSettings( @@ -794,22 +735,6 @@ public UnaryCallSettings.Builder getLocationSettin return getLocationSettings; } - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - @Override public BatchServiceStubSettings build() throws IOException { return new BatchServiceStubSettings(this); diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/GrpcBatchServiceStub.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/GrpcBatchServiceStub.java index e463b04cccdd..35526e1049f9 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/GrpcBatchServiceStub.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/GrpcBatchServiceStub.java @@ -43,11 +43,6 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.ImmutableMap; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -134,33 +129,6 @@ public class GrpcBatchServiceStub extends BatchServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) .build(); - private static final MethodDescriptor setIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - testIamPermissionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setRequestMarshaller( - ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) - .build(); - private final UnaryCallable createJobCallable; private final UnaryCallable getJobCallable; private final UnaryCallable deleteJobCallable; @@ -175,10 +143,6 @@ public class GrpcBatchServiceStub extends BatchServiceStub { private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -302,37 +266,6 @@ protected GrpcBatchServiceStub( return params.build(); }) .build(); - GrpcCallSettings setIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - }) - .build(); - GrpcCallSettings getIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - }) - .build(); - GrpcCallSettings - testIamPermissionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - }) - .build(); this.createJobCallable = callableFactory.createUnaryCallable( @@ -373,17 +306,6 @@ protected GrpcBatchServiceStub( this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -455,22 +377,6 @@ public UnaryCallable getLocationCallable() { return getLocationCallable; } - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - @Override public final void close() { try { diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java index 3129b414ab02..e8b3c024bf87 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java @@ -50,11 +50,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; @@ -363,114 +358,6 @@ public class HttpJsonBatchServiceStub extends BatchServiceStub { .build()) .build(); - private static final ApiMethodDescriptor - setIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/locations/*/jobs/*}:getIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - testIamPermissionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - private final UnaryCallable createJobCallable; private final UnaryCallable getJobCallable; private final UnaryCallable deleteJobCallable; @@ -485,10 +372,6 @@ public class HttpJsonBatchServiceStub extends BatchServiceStub { private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -576,22 +459,6 @@ protected HttpJsonBatchServiceStub( .setMethodDescriptor(getLocationMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); - HttpJsonCallSettings setIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - testIamPermissionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); this.createJobCallable = callableFactory.createUnaryCallable( @@ -632,17 +499,6 @@ protected HttpJsonBatchServiceStub( this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -659,9 +515,6 @@ public static List getMethodDescriptors() { methodDescriptors.add(listTasksMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); - methodDescriptors.add(setIamPolicyMethodDescriptor); - methodDescriptors.add(getIamPolicyMethodDescriptor); - methodDescriptors.add(testIamPermissionsMethodDescriptor); return methodDescriptors; } @@ -731,22 +584,6 @@ public UnaryCallable getLocationCallable() { return getLocationCallable; } - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - @Override public final void close() { try { diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java index 145b69a137d2..38e88c9e596d 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java @@ -35,11 +35,6 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.util.concurrent.MoreExecutors; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -1143,197 +1138,6 @@ public final UnaryCallable getLocationCallable() { return stub.getLocationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Policy response = batchServiceClient.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 access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = batchServiceClient.setIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   Policy response = batchServiceClient.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. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = batchServiceClient.getIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   TestIamPermissionsResponse response = batchServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       batchServiceClient.testIamPermissionsCallable().futureCall(request);
-   *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); - } - @Override public final void close() { stub.close(); diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java index 80415e3dc4d9..5026fd5c40de 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java @@ -38,11 +38,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -138,22 +133,6 @@ public UnaryCallSettings getLocationSettings() { return ((BatchServiceStubSettings) getStubSettings()).getLocationSettings(); } - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return ((BatchServiceStubSettings) getStubSettings()).setIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return ((BatchServiceStubSettings) getStubSettings()).getIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return ((BatchServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); - } - public static final BatchServiceSettings create(BatchServiceStubSettings stub) throws IOException { return new BatchServiceSettings.Builder(stub.toBuilder()).build(); @@ -319,22 +298,6 @@ public UnaryCallSettings.Builder getLocationSettin return getStubSettingsBuilder().getLocationSettings(); } - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return getStubSettingsBuilder().setIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getStubSettingsBuilder().getIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return getStubSettingsBuilder().testIamPermissionsSettings(); - } - @Override public BatchServiceSettings build() throws IOException { return new BatchServiceSettings(this); diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json index fb914783e07e..f1bfae0a379e 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json @@ -16,9 +16,6 @@ "DeleteJob": { "methods": ["deleteJobAsync", "deleteJobAsync", "deleteJobOperationCallable", "deleteJobCallable"] }, - "GetIamPolicy": { - "methods": ["getIamPolicy", "getIamPolicyCallable"] - }, "GetJob": { "methods": ["getJob", "getJob", "getJob", "getJobCallable"] }, @@ -36,12 +33,6 @@ }, "ListTasks": { "methods": ["listTasks", "listTasks", "listTasks", "listTasksPagedCallable", "listTasksCallable"] - }, - "SetIamPolicy": { - "methods": ["setIamPolicy", "setIamPolicyCallable"] - }, - "TestIamPermissions": { - "methods": ["testIamPermissions", "testIamPermissionsCallable"] } } } diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java index 0b3397bc8070..c5b028131f33 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java @@ -39,11 +39,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -117,19 +112,6 @@ public UnaryCallable getLocationCallable() { throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); } - public UnaryCallable setIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); - } - - public UnaryCallable getIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); - } - - public UnaryCallable - testIamPermissionsCallable() { - throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); - } - @Override public abstract void close(); } diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java index 175087e049a4..77ea8f186e25 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java @@ -68,11 +68,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -138,10 +133,6 @@ public class BatchServiceStubSettings extends StubSettings listLocationsSettings; private final UnaryCallSettings getLocationSettings; - private final UnaryCallSettings setIamPolicySettings; - private final UnaryCallSettings getIamPolicySettings; - private final UnaryCallSettings - testIamPermissionsSettings; private static final PagedListDescriptor LIST_JOBS_PAGE_STR_DESC = @@ -350,22 +341,6 @@ public UnaryCallSettings getLocationSettings() { return getLocationSettings; } - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - public BatchServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -481,9 +456,6 @@ protected BatchServiceStubSettings(Builder settingsBuilder) throws IOException { listTasksSettings = settingsBuilder.listTasksSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); - setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); - getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); - testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for BatchServiceStubSettings. */ @@ -505,10 +477,6 @@ public static class Builder extends StubSettings.Builder listLocationsSettings; private final UnaryCallSettings.Builder getLocationSettings; - private final UnaryCallSettings.Builder setIamPolicySettings; - private final UnaryCallSettings.Builder getIamPolicySettings; - private final UnaryCallSettings.Builder - testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -569,9 +537,6 @@ protected Builder(ClientContext clientContext) { listTasksSettings = PagedCallSettings.newBuilder(LIST_TASKS_PAGE_STR_FACT); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -582,10 +547,7 @@ protected Builder(ClientContext clientContext) { getTaskSettings, listTasksSettings, listLocationsSettings, - getLocationSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); + getLocationSettings); initDefaults(this); } @@ -601,9 +563,6 @@ protected Builder(BatchServiceStubSettings settings) { listTasksSettings = settings.listTasksSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); - setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); - getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); - testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -614,10 +573,7 @@ protected Builder(BatchServiceStubSettings settings) { getTaskSettings, listTasksSettings, listLocationsSettings, - getLocationSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); + getLocationSettings); } private static Builder createDefault() { @@ -687,21 +643,6 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - builder - .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - builder .deleteJobOperationSettings() .setInitialCallSettings( @@ -795,22 +736,6 @@ public UnaryCallSettings.Builder getLocationSettin return getLocationSettings; } - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - @Override public BatchServiceStubSettings build() throws IOException { return new BatchServiceStubSettings(this); diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java index 553e28d040ab..e16df2c891ba 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java @@ -44,11 +44,6 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.ImmutableMap; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -136,33 +131,6 @@ public class GrpcBatchServiceStub extends BatchServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) .build(); - private static final MethodDescriptor setIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - testIamPermissionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setRequestMarshaller( - ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) - .build(); - private final UnaryCallable createJobCallable; private final UnaryCallable getJobCallable; private final UnaryCallable deleteJobCallable; @@ -177,10 +145,6 @@ public class GrpcBatchServiceStub extends BatchServiceStub { private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -304,37 +268,6 @@ protected GrpcBatchServiceStub( return params.build(); }) .build(); - GrpcCallSettings setIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - }) - .build(); - GrpcCallSettings getIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - }) - .build(); - GrpcCallSettings - testIamPermissionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - }) - .build(); this.createJobCallable = callableFactory.createUnaryCallable( @@ -375,17 +308,6 @@ protected GrpcBatchServiceStub( this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -457,22 +379,6 @@ public UnaryCallable getLocationCallable() { return getLocationCallable; } - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - @Override public final void close() { try { diff --git a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/HttpJsonBatchServiceStub.java b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/HttpJsonBatchServiceStub.java index a79531133550..d333caed5ad4 100644 --- a/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/HttpJsonBatchServiceStub.java +++ b/java-batch/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/HttpJsonBatchServiceStub.java @@ -50,11 +50,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.protobuf.TypeRegistry; @@ -363,114 +358,6 @@ public class HttpJsonBatchServiceStub extends BatchServiceStub { .build()) .build(); - private static final ApiMethodDescriptor - setIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1alpha/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1alpha/{resource=projects/*/locations/*/jobs/*}:getIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - testIamPermissionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1alpha/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - private final UnaryCallable createJobCallable; private final UnaryCallable getJobCallable; private final UnaryCallable deleteJobCallable; @@ -485,10 +372,6 @@ public class HttpJsonBatchServiceStub extends BatchServiceStub { private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -576,22 +459,6 @@ protected HttpJsonBatchServiceStub( .setMethodDescriptor(getLocationMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); - HttpJsonCallSettings setIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - testIamPermissionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); this.createJobCallable = callableFactory.createUnaryCallable( @@ -632,17 +499,6 @@ protected HttpJsonBatchServiceStub( this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -659,9 +515,6 @@ public static List getMethodDescriptors() { methodDescriptors.add(listTasksMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); - methodDescriptors.add(setIamPolicyMethodDescriptor); - methodDescriptors.add(getIamPolicyMethodDescriptor); - methodDescriptors.add(testIamPermissionsMethodDescriptor); return methodDescriptors; } @@ -731,22 +584,6 @@ public UnaryCallable getLocationCallable() { return getLocationCallable; } - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - @Override public final void close() { try { diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java index 1c3885eeed44..b70cb2173dcb 100644 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java +++ b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java @@ -35,19 +35,9 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Any; -import com.google.protobuf.ByteString; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import java.io.IOException; import java.util.ArrayList; @@ -730,166 +720,4 @@ public void getLocationExceptionTest() throws Exception { // Expected exception. } } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } } diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientTest.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientTest.java index f096e5981b70..641a5e118e72 100644 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientTest.java +++ b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientTest.java @@ -33,20 +33,10 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; -import com.google.protobuf.ByteString; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -67,7 +57,6 @@ @Generated("by gapic-generator-java") public class BatchServiceClientTest { private static MockBatchService mockBatchService; - private static MockIAMPolicy mockIAMPolicy; private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -77,11 +66,10 @@ public class BatchServiceClientTest { public static void startStaticServer() { mockBatchService = new MockBatchService(); mockLocations = new MockLocations(); - mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockBatchService, mockLocations, mockIAMPolicy)); + Arrays.asList(mockBatchService, mockLocations)); mockServiceHelper.start(); } @@ -667,152 +655,4 @@ public void getLocationExceptionTest() throws Exception { // Expected exception. } } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockIAMPolicy.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } } diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicy.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicy.java deleted file mode 100644 index db8403251031..000000000000 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.batch.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIAMPolicy implements MockGrpcService { - private final MockIAMPolicyImpl serviceImpl; - - public MockIAMPolicy() { - serviceImpl = new MockIAMPolicyImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicyImpl.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicyImpl.java deleted file mode 100644 index d5980a622c71..000000000000 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/MockIAMPolicyImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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.batch.v1; - -import com.google.api.core.BetaApi; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIAMPolicyImpl extends IAMPolicyImplBase { - private List requests; - private Queue responses; - - public MockIAMPolicyImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void testIamPermissions( - TestIamPermissionsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof TestIamPermissionsResponse) { - requests.add(request); - responseObserver.onNext(((TestIamPermissionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - TestIamPermissionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientHttpJsonTest.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientHttpJsonTest.java index 4a5a75c5b6ee..4fe020c219d8 100644 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientHttpJsonTest.java +++ b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientHttpJsonTest.java @@ -35,19 +35,9 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Any; -import com.google.protobuf.ByteString; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import java.io.IOException; import java.util.ArrayList; @@ -738,166 +728,4 @@ public void getLocationExceptionTest() throws Exception { // Expected exception. } } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } } diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java index e42a3b9e375b..30aa57ae1704 100644 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java +++ b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java @@ -33,20 +33,10 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; -import com.google.protobuf.ByteString; import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -67,7 +57,6 @@ @Generated("by gapic-generator-java") public class BatchServiceClientTest { private static MockBatchService mockBatchService; - private static MockIAMPolicy mockIAMPolicy; private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -77,11 +66,10 @@ public class BatchServiceClientTest { public static void startStaticServer() { mockBatchService = new MockBatchService(); mockLocations = new MockLocations(); - mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockBatchService, mockLocations, mockIAMPolicy)); + Arrays.asList(mockBatchService, mockLocations)); mockServiceHelper.start(); } @@ -675,152 +663,4 @@ public void getLocationExceptionTest() throws Exception { // Expected exception. } } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockIAMPolicy.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } } diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicy.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicy.java deleted file mode 100644 index a26aff385f43..000000000000 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.batch.v1alpha; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIAMPolicy implements MockGrpcService { - private final MockIAMPolicyImpl serviceImpl; - - public MockIAMPolicy() { - serviceImpl = new MockIAMPolicyImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicyImpl.java b/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicyImpl.java deleted file mode 100644 index 604cd3a410b9..000000000000 --- a/java-batch/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockIAMPolicyImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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.batch.v1alpha; - -import com.google.api.core.BetaApi; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIAMPolicyImpl extends IAMPolicyImplBase { - private List requests; - private Queue responses; - - public MockIAMPolicyImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void testIamPermissions( - TestIamPermissionsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof TestIamPermissionsResponse) { - requests.add(request); - responseObserver.onNext(((TestIamPermissionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - TestIamPermissionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java index 40213ddd732f..ac3de4038bdd 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java @@ -4306,7 +4306,7 @@ public interface AcceleratorOrBuilder * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1/job.proto;l=314 + * deprecated. See google/cloud/batch/v1/job.proto;l=315 * @return The installGpuDrivers. */ @java.lang.Deprecated @@ -4444,7 +4444,7 @@ public long getCount() { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1/job.proto;l=314 + * deprecated. See google/cloud/batch/v1/job.proto;l=315 * @return The installGpuDrivers. */ @java.lang.Override @@ -5019,7 +5019,7 @@ public Builder clearCount() { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1/job.proto;l=314 + * deprecated. See google/cloud/batch/v1/job.proto;l=315 * @return The installGpuDrivers. */ @java.lang.Override @@ -5037,7 +5037,7 @@ public boolean getInstallGpuDrivers() { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1/job.proto;l=314 + * deprecated. See google/cloud/batch/v1/job.proto;l=315 * @param value The installGpuDrivers to set. * @return This builder for chaining. */ @@ -5059,7 +5059,7 @@ public Builder setInstallGpuDrivers(boolean value) { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1/job.proto;l=314 + * deprecated. See google/cloud/batch/v1/job.proto;l=315 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java index 3d4a1be3a96a..2db30f4c0a8f 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java @@ -78,67 +78,67 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e/api/field_behavior.proto\032\031google/api/r" + "esource.proto\032\037google/cloud/batch/v1/job" + ".proto\032 google/cloud/batch/v1/task.proto" - + "\032#google/longrunning/operations.proto\032\037g" - + "oogle/protobuf/timestamp.proto\"\233\001\n\020Creat" - + "eJobRequest\0220\n\006parent\030\001 \001(\tB \340A\002\372A\032\022\030bat" - + "ch.googleapis.com/Job\022\016\n\006job_id\030\002 \001(\t\022,\n" - + "\003job\030\003 \001(\0132\032.google.cloud.batch.v1.JobB\003" - + "\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"?\n\rGetJobRe" - + "quest\022.\n\004name\030\001 \001(\tB \340A\002\372A\032\n\030batch.googl" - + "eapis.com/Job\"N\n\020DeleteJobRequest\022\014\n\004nam" - + "e\030\001 \001(\t\022\023\n\006reason\030\002 \001(\tB\003\340A\001\022\027\n\nrequest_" - + "id\030\004 \001(\tB\003\340A\001\"X\n\017ListJobsRequest\022\016\n\006pare" - + "nt\030\001 \001(\t\022\016\n\006filter\030\004 \001(\t\022\021\n\tpage_size\030\002 " - + "\001(\005\022\022\n\npage_token\030\003 \001(\t\"j\n\020ListJobsRespo" - + "nse\022(\n\004jobs\030\001 \003(\0132\032.google.cloud.batch.v" - + "1.Job\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreac" - + "hable\030\003 \003(\t\"\201\001\n\020ListTasksRequest\0226\n\006pare" - + "nt\030\001 \001(\tB&\340A\002\372A \n\036batch.googleapis.com/T" - + "askGroup\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 " - + "\001(\005\022\022\n\npage_token\030\004 \001(\t\"m\n\021ListTasksResp" - + "onse\022*\n\005tasks\030\001 \003(\0132\033.google.cloud.batch" - + ".v1.Task\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unr" - + "eachable\030\003 \003(\t\"A\n\016GetTaskRequest\022/\n\004name" - + "\030\001 \001(\tB!\340A\002\372A\033\n\031batch.googleapis.com/Tas" - + "k\"\200\002\n\021OperationMetadata\0224\n\013create_time\030\001" - + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" - + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timest" - + "ampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 " - + "\001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n" - + "\026requested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013ap" - + "i_version\030\007 \001(\tB\003\340A\0032\266\010\n\014BatchService\022\233\001" - + "\n\tCreateJob\022\'.google.cloud.batch.v1.Crea" - + "teJobRequest\032\032.google.cloud.batch.v1.Job" - + "\"I\202\323\344\223\002/\"(/v1/{parent=projects/*/locatio" - + "ns/*}/jobs:\003job\332A\021parent,job,job_id\022\203\001\n\006" - + "GetJob\022$.google.cloud.batch.v1.GetJobReq" - + "uest\032\032.google.cloud.batch.v1.Job\"7\202\323\344\223\002*" - + "\022(/v1/{name=projects/*/locations/*/jobs/" - + "*}\332A\004name\022\317\001\n\tDeleteJob\022\'.google.cloud.b" - + "atch.v1.DeleteJobRequest\032\035.google.longru" - + "nning.Operation\"z\202\323\344\223\002**(/v1/{name=proje" - + "cts/*/locations/*/jobs/*}\332A\004name\312A@\n\025goo" - + "gle.protobuf.Empty\022\'google.cloud.batch.v" - + "1.OperationMetadata\022\226\001\n\010ListJobs\022&.googl" - + "e.cloud.batch.v1.ListJobsRequest\032\'.googl" - + "e.cloud.batch.v1.ListJobsResponse\"9\202\323\344\223\002" - + "*\022(/v1/{parent=projects/*/locations/*}/j" - + "obs\332A\006parent\022\233\001\n\007GetTask\022%.google.cloud." - + "batch.v1.GetTaskRequest\032\033.google.cloud.b" - + "atch.v1.Task\"L\202\323\344\223\002?\022=/v1/{name=projects" - + "/*/locations/*/jobs/*/taskGroups/*/tasks" - + "/*}\332A\004name\022\256\001\n\tListTasks\022\'.google.cloud." - + "batch.v1.ListTasksRequest\032(.google.cloud" - + ".batch.v1.ListTasksResponse\"N\202\323\344\223\002?\022=/v1" - + "/{parent=projects/*/locations/*/jobs/*/t" - + "askGroups/*}/tasks\332A\006parent\032H\312A\024batch.go" - + "ogleapis.com\322A.https://www.googleapis.co" - + "m/auth/cloud-platformB\253\001\n\031com.google.clo" - + "ud.batch.v1B\nBatchProtoP\001Z/cloud.google." - + "com/go/batch/apiv1/batchpb;batchpb\242\002\003GCB" - + "\252\002\025Google.Cloud.Batch.V1\312\002\025Google\\Cloud\\" - + "Batch\\V1\352\002\030Google::Cloud::Batch::V1b\006pro" - + "to3" + + "\032#google/longrunning/operations.proto\032\033g" + + "oogle/protobuf/empty.proto\032\037google/proto" + + "buf/timestamp.proto\"\233\001\n\020CreateJobRequest" + + "\0220\n\006parent\030\001 \001(\tB \340A\002\372A\032\022\030batch.googleap" + + "is.com/Job\022\016\n\006job_id\030\002 \001(\t\022,\n\003job\030\003 \001(\0132" + + "\032.google.cloud.batch.v1.JobB\003\340A\002\022\027\n\nrequ" + + "est_id\030\004 \001(\tB\003\340A\001\"?\n\rGetJobRequest\022.\n\004na" + + "me\030\001 \001(\tB \340A\002\372A\032\n\030batch.googleapis.com/J" + + "ob\"N\n\020DeleteJobRequest\022\014\n\004name\030\001 \001(\t\022\023\n\006" + + "reason\030\002 \001(\tB\003\340A\001\022\027\n\nrequest_id\030\004 \001(\tB\003\340" + + "A\001\"X\n\017ListJobsRequest\022\016\n\006parent\030\001 \001(\t\022\016\n" + + "\006filter\030\004 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\"j\n\020ListJobsResponse\022(\n\004jobs" + + "\030\001 \003(\0132\032.google.cloud.batch.v1.Job\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t" + + "\"\201\001\n\020ListTasksRequest\0226\n\006parent\030\001 \001(\tB&\340" + + "A\002\372A \n\036batch.googleapis.com/TaskGroup\022\016\n" + + "\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage" + + "_token\030\004 \001(\t\"m\n\021ListTasksResponse\022*\n\005tas" + + "ks\030\001 \003(\0132\033.google.cloud.batch.v1.Task\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 " + + "\003(\t\"A\n\016GetTaskRequest\022/\n\004name\030\001 \001(\tB!\340A\002" + + "\372A\033\n\031batch.googleapis.com/Task\"\200\002\n\021Opera" + + "tionMetadata\0224\n\013create_time\030\001 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n" + + "\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n" + + "\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_" + + "cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007" + + " \001(\tB\003\340A\0032\266\010\n\014BatchService\022\233\001\n\tCreateJob" + + "\022\'.google.cloud.batch.v1.CreateJobReques" + + "t\032\032.google.cloud.batch.v1.Job\"I\202\323\344\223\002/\"(/" + + "v1/{parent=projects/*/locations/*}/jobs:" + + "\003job\332A\021parent,job,job_id\022\203\001\n\006GetJob\022$.go" + + "ogle.cloud.batch.v1.GetJobRequest\032\032.goog" + + "le.cloud.batch.v1.Job\"7\202\323\344\223\002*\022(/v1/{name" + + "=projects/*/locations/*/jobs/*}\332A\004name\022\317" + + "\001\n\tDeleteJob\022\'.google.cloud.batch.v1.Del" + + "eteJobRequest\032\035.google.longrunning.Opera" + + "tion\"z\202\323\344\223\002**(/v1/{name=projects/*/locat" + + "ions/*/jobs/*}\332A\004name\312A@\n\025google.protobu" + + "f.Empty\022\'google.cloud.batch.v1.Operation" + + "Metadata\022\226\001\n\010ListJobs\022&.google.cloud.bat" + + "ch.v1.ListJobsRequest\032\'.google.cloud.bat" + + "ch.v1.ListJobsResponse\"9\202\323\344\223\002*\022(/v1/{par" + + "ent=projects/*/locations/*}/jobs\332A\006paren" + + "t\022\233\001\n\007GetTask\022%.google.cloud.batch.v1.Ge" + + "tTaskRequest\032\033.google.cloud.batch.v1.Tas" + + "k\"L\202\323\344\223\002?\022=/v1/{name=projects/*/location" + + "s/*/jobs/*/taskGroups/*/tasks/*}\332A\004name\022" + + "\256\001\n\tListTasks\022\'.google.cloud.batch.v1.Li" + + "stTasksRequest\032(.google.cloud.batch.v1.L" + + "istTasksResponse\"N\202\323\344\223\002?\022=/v1/{parent=pr" + + "ojects/*/locations/*/jobs/*/taskGroups/*" + + "}/tasks\332A\006parent\032H\312A\024batch.googleapis.co" + + "m\322A.https://www.googleapis.com/auth/clou" + + "d-platformB\253\001\n\031com.google.cloud.batch.v1" + + "B\nBatchProtoP\001Z/cloud.google.com/go/batc" + + "h/apiv1/batchpb;batchpb\242\002\003GCB\252\002\025Google.C" + + "loud.Batch.V1\312\002\025Google\\Cloud\\Batch\\V1\352\002\030" + + "Google::Cloud::Batch::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -151,6 +151,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.batch.v1.JobProto.getDescriptor(), com.google.cloud.batch.v1.TaskProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_batch_v1_CreateJobRequest_descriptor = @@ -249,6 +250,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.batch.v1.JobProto.getDescriptor(); com.google.cloud.batch.v1.TaskProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java index 0ee40b66f7ac..78526df34195 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java @@ -249,8 +249,8 @@ public com.google.cloud.batch.v1.JobOrBuilder getJobOrBuilder() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -282,8 +282,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1178,8 +1178,8 @@ public com.google.cloud.batch.v1.JobOrBuilder getJobOrBuilder() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1210,8 +1210,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1242,8 +1242,8 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1273,8 +1273,8 @@ public Builder setRequestId(java.lang.String value) { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1300,8 +1300,8 @@ public Builder clearRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java index 38d568c4d5b4..c15a1773a238 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java @@ -136,8 +136,8 @@ public interface CreateJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -158,8 +158,8 @@ public interface CreateJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequest.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequest.java index f73768baa2d7..77edb0d5d362 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequest.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequest.java @@ -183,8 +183,8 @@ public com.google.protobuf.ByteString getReasonBytes() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -216,8 +216,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -852,8 +852,8 @@ public Builder setReasonBytes(com.google.protobuf.ByteString value) { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -884,8 +884,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -916,8 +916,8 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -947,8 +947,8 @@ public Builder setRequestId(java.lang.String value) { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -974,8 +974,8 @@ public Builder clearRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequestOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequestOrBuilder.java index 16a28e54f847..79cf75aa2739 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequestOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/DeleteJobRequestOrBuilder.java @@ -81,8 +81,8 @@ public interface DeleteJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -103,8 +103,8 @@ public interface DeleteJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java index 3a2300030f17..34cef09289a7 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java @@ -190,7 +190,8 @@ public com.google.protobuf.ByteString getUidBytes() { * *
    * Priority of the Job.
-   * The valid value range is [0, 100).
+   * The valid value range is [0, 100). Default value is 0.
+   * Higher value indicates higher priority.
    * A job with higher priority value is more likely to run earlier if all other
    * requirements are satisfied.
    * 
@@ -1698,7 +1699,8 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { * *
      * Priority of the Job.
-     * The valid value range is [0, 100).
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
      * A job with higher priority value is more likely to run earlier if all other
      * requirements are satisfied.
      * 
@@ -1716,7 +1718,8 @@ public long getPriority() { * *
      * Priority of the Job.
-     * The valid value range is [0, 100).
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
      * A job with higher priority value is more likely to run earlier if all other
      * requirements are satisfied.
      * 
@@ -1738,7 +1741,8 @@ public Builder setPriority(long value) { * *
      * Priority of the Job.
-     * The valid value range is [0, 100).
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
      * A job with higher priority value is more likely to run earlier if all other
      * requirements are satisfied.
      * 
diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java index bcc56e8cd2f5..9bb43593bdc6 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java @@ -80,7 +80,8 @@ public interface JobOrBuilder * *
    * Priority of the Job.
-   * The valid value range is [0, 100).
+   * The valid value range is [0, 100). Default value is 0.
+   * Higher value indicates higher priority.
    * A job with higher priority value is more likely to run earlier if all other
    * requirements are satisfied.
    * 
diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicy.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicy.java index c281ee127bf0..a76eefbebb3e 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicy.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicy.java @@ -994,6 +994,10 @@ public com.google.cloud.batch.v1.LifecyclePolicy.ActionCondition getDefaultInsta * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -1009,6 +1013,10 @@ public int getActionValue() { * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -1453,6 +1461,10 @@ public Builder mergeFrom( * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -1468,6 +1480,10 @@ public int getActionValue() { * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -1486,6 +1502,10 @@ public Builder setActionValue(int value) { * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -1505,6 +1525,10 @@ public com.google.cloud.batch.v1.LifecyclePolicy.Action getAction() { * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -1526,6 +1550,10 @@ public Builder setAction(com.google.cloud.batch.v1.LifecyclePolicy.Action value) * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicyOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicyOrBuilder.java index 10d4e7b823ab..327253f0a607 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicyOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LifecyclePolicyOrBuilder.java @@ -28,6 +28,10 @@ public interface LifecyclePolicyOrBuilder * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; @@ -40,6 +44,10 @@ public interface LifecyclePolicyOrBuilder * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java index 721946bbfafc..f6338777bd77 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java @@ -2428,6 +2428,13 @@ public interface ScriptOrBuilder * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2440,6 +2447,13 @@ public interface ScriptOrBuilder * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2452,6 +2466,13 @@ public interface ScriptOrBuilder * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2465,6 +2486,11 @@ public interface ScriptOrBuilder * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2477,6 +2503,11 @@ public interface ScriptOrBuilder * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2489,6 +2520,11 @@ public interface ScriptOrBuilder * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2599,6 +2635,13 @@ public CommandCase getCommandCase() { * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2613,6 +2656,13 @@ public boolean hasPath() { * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2640,6 +2690,13 @@ public java.lang.String getPath() { * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2669,6 +2726,11 @@ public com.google.protobuf.ByteString getPathBytes() { * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2683,6 +2745,11 @@ public boolean hasText() { * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2710,6 +2777,11 @@ public java.lang.String getText() { * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -3150,6 +3222,13 @@ public Builder clearCommand() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3165,6 +3244,13 @@ public boolean hasPath() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3193,6 +3279,13 @@ public java.lang.String getPath() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3221,6 +3314,13 @@ public com.google.protobuf.ByteString getPathBytes() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3242,6 +3342,13 @@ public Builder setPath(java.lang.String value) { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3261,6 +3368,13 @@ public Builder clearPath() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3284,6 +3398,11 @@ public Builder setPathBytes(com.google.protobuf.ByteString value) { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3299,6 +3418,11 @@ public boolean hasText() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3327,6 +3451,11 @@ public java.lang.String getText() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3355,6 +3484,11 @@ public com.google.protobuf.ByteString getTextBytes() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3376,6 +3510,11 @@ public Builder setText(java.lang.String value) { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3395,6 +3534,11 @@ public Builder clearText() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEvent.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEvent.java index 4a3d58f05377..287dc0ea5c7f 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEvent.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEvent.java @@ -40,6 +40,7 @@ private StatusEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { private StatusEvent() { type_ = ""; description_ = ""; + taskState_ = 0; } @java.lang.Override @@ -266,6 +267,41 @@ public com.google.cloud.batch.v1.TaskExecutionOrBuilder getTaskExecutionOrBuilde : taskExecution_; } + public static final int TASK_STATE_FIELD_NUMBER = 5; + private int taskState_ = 0; + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return The enum numeric value on the wire for taskState. + */ + @java.lang.Override + public int getTaskStateValue() { + return taskState_; + } + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return The taskState. + */ + @java.lang.Override + public com.google.cloud.batch.v1.TaskStatus.State getTaskState() { + com.google.cloud.batch.v1.TaskStatus.State result = + com.google.cloud.batch.v1.TaskStatus.State.forNumber(taskState_); + return result == null ? com.google.cloud.batch.v1.TaskStatus.State.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -292,6 +328,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (taskExecution_ != null) { output.writeMessage(4, getTaskExecution()); } + if (taskState_ != com.google.cloud.batch.v1.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, taskState_); + } getUnknownFields().writeTo(output); } @@ -313,6 +352,9 @@ public int getSerializedSize() { if (taskExecution_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTaskExecution()); } + if (taskState_ != com.google.cloud.batch.v1.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, taskState_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -338,6 +380,7 @@ public boolean equals(final java.lang.Object obj) { if (hasTaskExecution()) { if (!getTaskExecution().equals(other.getTaskExecution())) return false; } + if (taskState_ != other.taskState_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -361,6 +404,8 @@ public int hashCode() { hash = (37 * hash) + TASK_EXECUTION_FIELD_NUMBER; hash = (53 * hash) + getTaskExecution().hashCode(); } + hash = (37 * hash) + TASK_STATE_FIELD_NUMBER; + hash = (53 * hash) + taskState_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -511,6 +556,7 @@ public Builder clear() { taskExecutionBuilder_.dispose(); taskExecutionBuilder_ = null; } + taskState_ = 0; return this; } @@ -560,6 +606,9 @@ private void buildPartial0(com.google.cloud.batch.v1.StatusEvent result) { result.taskExecution_ = taskExecutionBuilder_ == null ? taskExecution_ : taskExecutionBuilder_.build(); } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.taskState_ = taskState_; + } } @java.lang.Override @@ -623,6 +672,9 @@ public Builder mergeFrom(com.google.cloud.batch.v1.StatusEvent other) { if (other.hasTaskExecution()) { mergeTaskExecution(other.getTaskExecution()); } + if (other.taskState_ != 0) { + setTaskStateValue(other.getTaskStateValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -673,6 +725,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 40: + { + taskState_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1267,6 +1325,96 @@ public com.google.cloud.batch.v1.TaskExecutionOrBuilder getTaskExecutionOrBuilde return taskExecutionBuilder_; } + private int taskState_ = 0; + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return The enum numeric value on the wire for taskState. + */ + @java.lang.Override + public int getTaskStateValue() { + return taskState_; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @param value The enum numeric value on the wire for taskState to set. + * @return This builder for chaining. + */ + public Builder setTaskStateValue(int value) { + taskState_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return The taskState. + */ + @java.lang.Override + public com.google.cloud.batch.v1.TaskStatus.State getTaskState() { + com.google.cloud.batch.v1.TaskStatus.State result = + com.google.cloud.batch.v1.TaskStatus.State.forNumber(taskState_); + return result == null ? com.google.cloud.batch.v1.TaskStatus.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @param value The taskState to set. + * @return This builder for chaining. + */ + public Builder setTaskState(com.google.cloud.batch.v1.TaskStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + taskState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return This builder for chaining. + */ + public Builder clearTaskState() { + bitField0_ = (bitField0_ & ~0x00000010); + taskState_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEventOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEventOrBuilder.java index 1215f25aabe5..f103a1880d87 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEventOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/StatusEventOrBuilder.java @@ -142,4 +142,29 @@ public interface StatusEventOrBuilder * .google.cloud.batch.v1.TaskExecution task_execution = 4; */ com.google.cloud.batch.v1.TaskExecutionOrBuilder getTaskExecutionOrBuilder(); + + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return The enum numeric value on the wire for taskState. + */ + int getTaskStateValue(); + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * + * @return The taskState. + */ + com.google.cloud.batch.v1.TaskStatus.State getTaskState(); } diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java index 5724ec3ec2ea..bdd2be0db4a9 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java @@ -110,72 +110,74 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\032\036google/protobuf/duration.proto\032\037google" + "/protobuf/timestamp.proto\"O\n\017ComputeReso" + "urce\022\021\n\tcpu_milli\030\001 \001(\003\022\022\n\nmemory_mib\030\002 " - + "\001(\003\022\025\n\rboot_disk_mib\030\004 \001(\003\"\236\001\n\013StatusEve" + + "\001(\003\022\025\n\rboot_disk_mib\030\004 \001(\003\"\333\001\n\013StatusEve" + "nt\022\014\n\004type\030\003 \001(\t\022\023\n\013description\030\001 \001(\t\022.\n" + "\nevent_time\030\002 \001(\0132\032.google.protobuf.Time" + "stamp\022<\n\016task_execution\030\004 \001(\0132$.google.c" - + "loud.batch.v1.TaskExecution\"\"\n\rTaskExecu" - + "tion\022\021\n\texit_code\030\001 \001(\005\"\342\001\n\nTaskStatus\0226" - + "\n\005state\030\001 \001(\0162\'.google.cloud.batch.v1.Ta" - + "skStatus.State\0229\n\rstatus_events\030\002 \003(\0132\"." - + "google.cloud.batch.v1.StatusEvent\"a\n\005Sta" - + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PENDING\020\001\022\014" - + "\n\010ASSIGNED\020\002\022\013\n\007RUNNING\020\003\022\n\n\006FAILED\020\004\022\r\n" - + "\tSUCCEEDED\020\005\"\362\004\n\010Runnable\022>\n\tcontainer\030\001" - + " \001(\0132).google.cloud.batch.v1.Runnable.Co" - + "ntainerH\000\0228\n\006script\030\002 \001(\0132&.google.cloud" - + ".batch.v1.Runnable.ScriptH\000\022:\n\007barrier\030\006" - + " \001(\0132\'.google.cloud.batch.v1.Runnable.Ba" - + "rrierH\000\022\032\n\022ignore_exit_status\030\003 \001(\010\022\022\n\nb" - + "ackground\030\004 \001(\010\022\022\n\nalways_run\030\005 \001(\010\0227\n\013e" - + "nvironment\030\007 \001(\0132\".google.cloud.batch.v1" - + ".Environment\022*\n\007timeout\030\010 \001(\0132\031.google.p" - + "rotobuf.Duration\032\252\001\n\tContainer\022\021\n\timage_" - + "uri\030\001 \001(\t\022\020\n\010commands\030\002 \003(\t\022\022\n\nentrypoin" - + "t\030\003 \001(\t\022\017\n\007volumes\030\007 \003(\t\022\017\n\007options\030\010 \001(" - + "\t\022\036\n\026block_external_network\030\t \001(\010\022\020\n\010use" - + "rname\030\n \001(\t\022\020\n\010password\030\013 \001(\t\0323\n\006Script\022" - + "\016\n\004path\030\001 \001(\tH\000\022\016\n\004text\030\002 \001(\tH\000B\t\n\007comma" - + "nd\032\027\n\007Barrier\022\014\n\004name\030\001 \001(\tB\014\n\nexecutabl" - + "e\"\375\003\n\010TaskSpec\0222\n\trunnables\030\010 \003(\0132\037.goog" - + "le.cloud.batch.v1.Runnable\022@\n\020compute_re" - + "source\030\003 \001(\0132&.google.cloud.batch.v1.Com" - + "puteResource\0223\n\020max_run_duration\030\004 \001(\0132\031" - + ".google.protobuf.Duration\022\027\n\017max_retry_c" - + "ount\030\005 \001(\005\022B\n\022lifecycle_policies\030\t \003(\0132&" - + ".google.cloud.batch.v1.LifecyclePolicy\022K" - + "\n\014environments\030\006 \003(\01321.google.cloud.batc" - + "h.v1.TaskSpec.EnvironmentsEntryB\002\030\001\022.\n\007v" - + "olumes\030\007 \003(\0132\035.google.cloud.batch.v1.Vol" - + "ume\0227\n\013environment\030\n \001(\0132\".google.cloud." - + "batch.v1.Environment\0323\n\021EnvironmentsEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\212\002\n\017Li" - + "fecyclePolicy\022=\n\006action\030\001 \001(\0162-.google.c" - + "loud.batch.v1.LifecyclePolicy.Action\022P\n\020" - + "action_condition\030\002 \001(\01326.google.cloud.ba" - + "tch.v1.LifecyclePolicy.ActionCondition\032%" - + "\n\017ActionCondition\022\022\n\nexit_codes\030\001 \003(\005\"?\n" - + "\006Action\022\026\n\022ACTION_UNSPECIFIED\020\000\022\016\n\nRETRY" - + "_TASK\020\001\022\r\n\tFAIL_TASK\020\002\"\300\001\n\004Task\022\014\n\004name\030" - + "\001 \001(\t\0221\n\006status\030\002 \001(\0132!.google.cloud.bat" - + "ch.v1.TaskStatus:w\352At\n\031batch.googleapis." - + "com/Task\022Wprojects/{project}/locations/{" - + "location}/jobs/{job}/taskGroups/{task_gr" - + "oup}/tasks/{task}\"\217\003\n\013Environment\022D\n\tvar" - + "iables\030\001 \003(\01321.google.cloud.batch.v1.Env" - + "ironment.VariablesEntry\022Q\n\020secret_variab" - + "les\030\002 \003(\01327.google.cloud.batch.v1.Enviro" - + "nment.SecretVariablesEntry\022I\n\023encrypted_" - + "variables\030\003 \001(\0132,.google.cloud.batch.v1." - + "Environment.KMSEnvMap\0322\n\tKMSEnvMap\022\020\n\010ke" - + "y_name\030\001 \001(\t\022\023\n\013cipher_text\030\002 \001(\t\0320\n\016Var" - + "iablesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" - + "\0028\001\0326\n\024SecretVariablesEntry\022\013\n\003key\030\001 \001(\t" - + "\022\r\n\005value\030\002 \001(\t:\0028\001B\252\001\n\031com.google.cloud" - + ".batch.v1B\tTaskProtoP\001Z/cloud.google.com" - + "/go/batch/apiv1/batchpb;batchpb\242\002\003GCB\252\002\025" - + "Google.Cloud.Batch.V1\312\002\025Google\\Cloud\\Bat" - + "ch\\V1\352\002\030Google::Cloud::Batch::V1b\006proto3" + + "loud.batch.v1.TaskExecution\022;\n\ntask_stat" + + "e\030\005 \001(\0162\'.google.cloud.batch.v1.TaskStat" + + "us.State\"\"\n\rTaskExecution\022\021\n\texit_code\030\001" + + " \001(\005\"\342\001\n\nTaskStatus\0226\n\005state\030\001 \001(\0162\'.goo" + + "gle.cloud.batch.v1.TaskStatus.State\0229\n\rs" + + "tatus_events\030\002 \003(\0132\".google.cloud.batch." + + "v1.StatusEvent\"a\n\005State\022\025\n\021STATE_UNSPECI" + + "FIED\020\000\022\013\n\007PENDING\020\001\022\014\n\010ASSIGNED\020\002\022\013\n\007RUN" + + "NING\020\003\022\n\n\006FAILED\020\004\022\r\n\tSUCCEEDED\020\005\"\362\004\n\010Ru" + + "nnable\022>\n\tcontainer\030\001 \001(\0132).google.cloud" + + ".batch.v1.Runnable.ContainerH\000\0228\n\006script" + + "\030\002 \001(\0132&.google.cloud.batch.v1.Runnable." + + "ScriptH\000\022:\n\007barrier\030\006 \001(\0132\'.google.cloud" + + ".batch.v1.Runnable.BarrierH\000\022\032\n\022ignore_e" + + "xit_status\030\003 \001(\010\022\022\n\nbackground\030\004 \001(\010\022\022\n\n" + + "always_run\030\005 \001(\010\0227\n\013environment\030\007 \001(\0132\"." + + "google.cloud.batch.v1.Environment\022*\n\007tim" + + "eout\030\010 \001(\0132\031.google.protobuf.Duration\032\252\001" + + "\n\tContainer\022\021\n\timage_uri\030\001 \001(\t\022\020\n\010comman" + + "ds\030\002 \003(\t\022\022\n\nentrypoint\030\003 \001(\t\022\017\n\007volumes\030" + + "\007 \003(\t\022\017\n\007options\030\010 \001(\t\022\036\n\026block_external" + + "_network\030\t \001(\010\022\020\n\010username\030\n \001(\t\022\020\n\010pass" + + "word\030\013 \001(\t\0323\n\006Script\022\016\n\004path\030\001 \001(\tH\000\022\016\n\004" + + "text\030\002 \001(\tH\000B\t\n\007command\032\027\n\007Barrier\022\014\n\004na" + + "me\030\001 \001(\tB\014\n\nexecutable\"\375\003\n\010TaskSpec\0222\n\tr" + + "unnables\030\010 \003(\0132\037.google.cloud.batch.v1.R" + + "unnable\022@\n\020compute_resource\030\003 \001(\0132&.goog" + + "le.cloud.batch.v1.ComputeResource\0223\n\020max" + + "_run_duration\030\004 \001(\0132\031.google.protobuf.Du" + + "ration\022\027\n\017max_retry_count\030\005 \001(\005\022B\n\022lifec" + + "ycle_policies\030\t \003(\0132&.google.cloud.batch" + + ".v1.LifecyclePolicy\022K\n\014environments\030\006 \003(" + + "\01321.google.cloud.batch.v1.TaskSpec.Envir" + + "onmentsEntryB\002\030\001\022.\n\007volumes\030\007 \003(\0132\035.goog" + + "le.cloud.batch.v1.Volume\0227\n\013environment\030" + + "\n \001(\0132\".google.cloud.batch.v1.Environmen" + + "t\0323\n\021EnvironmentsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001\"\212\002\n\017LifecyclePolicy\022=\n\006ac" + + "tion\030\001 \001(\0162-.google.cloud.batch.v1.Lifec" + + "yclePolicy.Action\022P\n\020action_condition\030\002 " + + "\001(\01326.google.cloud.batch.v1.LifecyclePol" + + "icy.ActionCondition\032%\n\017ActionCondition\022\022" + + "\n\nexit_codes\030\001 \003(\005\"?\n\006Action\022\026\n\022ACTION_U" + + "NSPECIFIED\020\000\022\016\n\nRETRY_TASK\020\001\022\r\n\tFAIL_TAS" + + "K\020\002\"\300\001\n\004Task\022\014\n\004name\030\001 \001(\t\0221\n\006status\030\002 \001" + + "(\0132!.google.cloud.batch.v1.TaskStatus:w\352" + + "At\n\031batch.googleapis.com/Task\022Wprojects/" + + "{project}/locations/{location}/jobs/{job" + + "}/taskGroups/{task_group}/tasks/{task}\"\217" + + "\003\n\013Environment\022D\n\tvariables\030\001 \003(\01321.goog" + + "le.cloud.batch.v1.Environment.VariablesE" + + "ntry\022Q\n\020secret_variables\030\002 \003(\01327.google." + + "cloud.batch.v1.Environment.SecretVariabl" + + "esEntry\022I\n\023encrypted_variables\030\003 \001(\0132,.g" + + "oogle.cloud.batch.v1.Environment.KMSEnvM" + + "ap\0322\n\tKMSEnvMap\022\020\n\010key_name\030\001 \001(\t\022\023\n\013cip" + + "her_text\030\002 \001(\t\0320\n\016VariablesEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0326\n\024SecretVariab" + + "lesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "B\252\001\n\031com.google.cloud.batch.v1B\tTaskProt" + + "oP\001Z/cloud.google.com/go/batch/apiv1/bat" + + "chpb;batchpb\242\002\003GCB\252\002\025Google.Cloud.Batch." + + "V1\312\002\025Google\\Cloud\\Batch\\V1\352\002\030Google::Clo" + + "ud::Batch::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -200,7 +202,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1_StatusEvent_descriptor, new java.lang.String[] { - "Type", "Description", "EventTime", "TaskExecution", + "Type", "Description", "EventTime", "TaskExecution", "TaskState", }); internal_static_google_cloud_batch_v1_TaskExecution_descriptor = getDescriptor().getMessageTypes().get(2); diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java index 9fdce9569c70..e46439d9514d 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java @@ -323,13 +323,12 @@ public int getMaxRetryCount() { * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -344,13 +343,12 @@ public java.util.List getLifecyclePol * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -366,13 +364,12 @@ public java.util.List getLifecyclePol * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -387,13 +384,12 @@ public int getLifecyclePoliciesCount() { * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -408,13 +404,12 @@ public com.google.cloud.batch.v1.LifecyclePolicy getLifecyclePolicies(int index) * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -2298,13 +2293,12 @@ private void ensureLifecyclePoliciesIsMutable() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2322,13 +2316,12 @@ public java.util.List getLifecyclePol * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2346,13 +2339,12 @@ public int getLifecyclePoliciesCount() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2370,13 +2362,12 @@ public com.google.cloud.batch.v1.LifecyclePolicy getLifecyclePolicies(int index) * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2401,13 +2392,12 @@ public Builder setLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2429,13 +2419,12 @@ public Builder setLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2459,13 +2448,12 @@ public Builder addLifecyclePolicies(com.google.cloud.batch.v1.LifecyclePolicy va * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2490,13 +2478,12 @@ public Builder addLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2518,13 +2505,12 @@ public Builder addLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2546,13 +2532,12 @@ public Builder addLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2574,13 +2559,12 @@ public Builder addAllLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2601,13 +2585,12 @@ public Builder clearLifecyclePolicies() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2628,13 +2611,12 @@ public Builder removeLifecyclePolicies(int index) { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2649,13 +2631,12 @@ public com.google.cloud.batch.v1.LifecyclePolicy.Builder getLifecyclePoliciesBui * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2674,13 +2655,12 @@ public com.google.cloud.batch.v1.LifecyclePolicyOrBuilder getLifecyclePoliciesOr * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2699,13 +2679,12 @@ public com.google.cloud.batch.v1.LifecyclePolicyOrBuilder getLifecyclePoliciesOr * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2720,13 +2699,12 @@ public com.google.cloud.batch.v1.LifecyclePolicy.Builder addLifecyclePoliciesBui * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2742,13 +2720,12 @@ public com.google.cloud.batch.v1.LifecyclePolicy.Builder addLifecyclePoliciesBui * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java index 02a967fc5bc1..b6a5f44f6958 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java @@ -207,13 +207,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -225,13 +224,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -243,13 +241,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -261,13 +258,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -280,13 +276,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto index c6bad651548c..4e2e0d9c35dc 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto +++ b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/cloud/batch/v1/job.proto"; import "google/cloud/batch/v1/task.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Batch.V1"; @@ -124,8 +125,8 @@ message CreateJobRequest { // ignore the request if it has already been completed. The server will // guarantee that for at least 60 minutes since the first request. // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request // ID, the server can check if original operation with the same request ID // was received, and if so, will ignore the second request. This prevents // clients from accidentally creating duplicate commitments. @@ -157,8 +158,8 @@ message DeleteJobRequest { // ignore the request if it has already been completed. The server will // guarantee that for at least 60 minutes after the first request. // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request // ID, the server can check if original operation with the same request ID // was received, and if so, will ignore the second request. This prevents // clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto index d43f229dd6f1..d41b2e1fe61c 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto +++ b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto @@ -46,7 +46,8 @@ message Job { string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Priority of the Job. - // The valid value range is [0, 100). + // The valid value range is [0, 100). Default value is 0. + // Higher value indicates higher priority. // A job with higher priority value is more likely to run earlier if all other // requirements are satisfied. int64 priority = 3; diff --git a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto index a468c3fcf0e2..a4d4ba45c213 100644 --- a/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto +++ b/java-batch/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto @@ -55,6 +55,9 @@ message StatusEvent { // Task Execution TaskExecution task_execution = 4; + + // Task State + TaskStatus.State task_state = 5; } // This Task Execution field includes detail information for @@ -140,9 +143,23 @@ message Runnable { message Script { oneof command { // Script file path on the host VM. + // + // To specify an interpreter, please add a `#!`(also known as + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + // first line of the file.(For example, to execute the script using bash, + // `#!/bin/bash` should be the first line of the file. To execute the + // script using`Python3`, `#!/usr/bin/env python3` should be the first + // line of the file.) Otherwise, the file will by default be excuted by + // `/bin/sh`. string path = 1; // Shell script text. + // + // To specify an interpreter, please add a `#!\n` at the + // beginning of the text.(For example, to execute the script using bash, + // `#!/bin/bash\n` should be added. To execute the script using`Python3`, + // `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + // by default be excuted by `/bin/sh`. string text = 2; } } @@ -220,13 +237,12 @@ message TaskSpec { int32 max_retry_count = 5; // Lifecycle management schema when any task in a task group is failed. - // The valid size of lifecycle policies are [0, 10]. - // For each lifecycle policy, when the condition is met, - // the action in that policy will execute. - // If there are multiple policies that the task execution result matches, - // we use the action from the first matched policy. If task execution result - // does not meet with any of the defined lifecycle policy, we consider it as - // the default policy. Default policy means if the exit code is 0, exit task. + // Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, + // the action in the policy will execute. + // If task execution result does not meet with the defined lifecycle + // policy, we consider it as the default policy. + // Default policy means if the exit code is 0, exit task. // If task ends with non-zero exit code, retry the task with max_retry_count. repeated LifecyclePolicy lifecycle_policies = 9; @@ -265,6 +281,10 @@ message LifecyclePolicy { } // Action to execute when ActionCondition is true. + // When RETRY_TASK is specified, we will retry failed tasks + // if we notice any exit code match and fail tasks if no match is found. + // Likewise, when FAIL_TASK is specified, we will fail tasks + // if we notice any exit code match and retry tasks if no match is found. Action action = 1; // Conditions that decide why a task failure is dealt with a specific action. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java index 6f0ffbd57215..725e9580c30b 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java @@ -4664,7 +4664,7 @@ public interface AcceleratorOrBuilder * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=369 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=379 * @return The installGpuDrivers. */ @java.lang.Deprecated @@ -4802,7 +4802,7 @@ public long getCount() { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=369 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=379 * @return The installGpuDrivers. */ @java.lang.Override @@ -5380,7 +5380,7 @@ public Builder clearCount() { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=369 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=379 * @return The installGpuDrivers. */ @java.lang.Override @@ -5398,7 +5398,7 @@ public boolean getInstallGpuDrivers() { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=369 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=379 * @param value The installGpuDrivers to set. * @return This builder for chaining. */ @@ -5420,7 +5420,7 @@ public Builder setInstallGpuDrivers(boolean value) { * bool install_gpu_drivers = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.install_gpu_drivers is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=369 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=379 * @return This builder for chaining. */ @java.lang.Deprecated @@ -5511,7 +5511,7 @@ public interface InstancePolicyOrBuilder * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return A list containing the allowedMachineTypes. */ @java.lang.Deprecated @@ -5526,7 +5526,7 @@ public interface InstancePolicyOrBuilder * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return The count of allowedMachineTypes. */ @java.lang.Deprecated @@ -5541,7 +5541,7 @@ public interface InstancePolicyOrBuilder * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index of the element to return. * @return The allowedMachineTypes at the given index. */ @@ -5557,7 +5557,7 @@ public interface InstancePolicyOrBuilder * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index of the value to return. * @return The bytes of the allowedMachineTypes at the given index. */ @@ -5897,7 +5897,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return A list containing the allowedMachineTypes. */ @java.lang.Deprecated @@ -5914,7 +5914,7 @@ public com.google.protobuf.ProtocolStringList getAllowedMachineTypesList() { * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return The count of allowedMachineTypes. */ @java.lang.Deprecated @@ -5931,7 +5931,7 @@ public int getAllowedMachineTypesCount() { * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index of the element to return. * @return The allowedMachineTypes at the given index. */ @@ -5949,7 +5949,7 @@ public java.lang.String getAllowedMachineTypes(int index) { * repeated string allowed_machine_types = 1 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types - * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * is deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index of the value to return. * @return The bytes of the allowedMachineTypes at the given index. */ @@ -7031,7 +7031,7 @@ private void ensureAllowedMachineTypesIsMutable() { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return A list containing the allowedMachineTypes. */ @java.lang.Deprecated @@ -7049,7 +7049,7 @@ public com.google.protobuf.ProtocolStringList getAllowedMachineTypesList() { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return The count of allowedMachineTypes. */ @java.lang.Deprecated @@ -7067,7 +7067,7 @@ public int getAllowedMachineTypesCount() { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index of the element to return. * @return The allowedMachineTypes at the given index. */ @@ -7086,7 +7086,7 @@ public java.lang.String getAllowedMachineTypes(int index) { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index of the value to return. * @return The bytes of the allowedMachineTypes at the given index. */ @@ -7105,7 +7105,7 @@ public com.google.protobuf.ByteString getAllowedMachineTypesBytes(int index) { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param index The index to set the value at. * @param value The allowedMachineTypes to set. * @return This builder for chaining. @@ -7131,7 +7131,7 @@ public Builder setAllowedMachineTypes(int index, java.lang.String value) { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param value The allowedMachineTypes to add. * @return This builder for chaining. */ @@ -7156,7 +7156,7 @@ public Builder addAllowedMachineTypes(java.lang.String value) { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param values The allowedMachineTypes to add. * @return This builder for chaining. */ @@ -7178,7 +7178,7 @@ public Builder addAllAllowedMachineTypes(java.lang.Iterable va * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @return This builder for chaining. */ @java.lang.Deprecated @@ -7199,7 +7199,7 @@ public Builder clearAllowedMachineTypes() { * * @deprecated * google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowed_machine_types is - * deprecated. See google/cloud/batch/v1alpha/job.proto;l=376 + * deprecated. See google/cloud/batch/v1alpha/job.proto;l=386 * @param value The bytes of the allowedMachineTypes to add. * @return This builder for chaining. */ @@ -12237,7 +12237,7 @@ public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy getLocatio * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=482 + * google/cloud/batch/v1alpha/job.proto;l=492 * @return Whether the instance field is set. */ @java.lang.Override @@ -12257,7 +12257,7 @@ public boolean hasInstance() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=482 + * google/cloud/batch/v1alpha/job.proto;l=492 * @return The instance. */ @java.lang.Override @@ -12393,7 +12393,7 @@ public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return A list containing the instanceTemplates. */ @java.lang.Deprecated @@ -12410,7 +12410,7 @@ public com.google.protobuf.ProtocolStringList getInstanceTemplatesList() { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return The count of instanceTemplates. */ @java.lang.Deprecated @@ -12427,7 +12427,7 @@ public int getInstanceTemplatesCount() { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index of the element to return. * @return The instanceTemplates at the given index. */ @@ -12445,7 +12445,7 @@ public java.lang.String getInstanceTemplates(int index) { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index of the value to return. * @return The bytes of the instanceTemplates at the given index. */ @@ -12486,7 +12486,7 @@ public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel convert * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @return A list containing the provisioningModels. */ @java.lang.Override @@ -12509,7 +12509,7 @@ public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel convert * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @return The count of provisioningModels. */ @java.lang.Override @@ -12529,7 +12529,7 @@ public int getProvisioningModelsCount() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index of the element to return. * @return The provisioningModels at the given index. */ @@ -12551,7 +12551,7 @@ public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProv * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @return A list containing the enum numeric values on the wire for provisioningModels. */ @java.lang.Override @@ -12571,7 +12571,7 @@ public java.util.List getProvisioningModelsValueList() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index of the value to return. * @return The enum numeric value on the wire of provisioningModels at the given index. */ @@ -12597,7 +12597,7 @@ public int getProvisioningModelsValue(int index) { * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return The serviceAccountEmail. */ @java.lang.Override @@ -12623,7 +12623,7 @@ public java.lang.String getServiceAccountEmail() { * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return The bytes for serviceAccountEmail. */ @java.lang.Override @@ -13775,7 +13775,7 @@ public Builder clearLocation() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=482 + * google/cloud/batch/v1alpha/job.proto;l=492 * @return Whether the instance field is set. */ @java.lang.Deprecated @@ -13794,7 +13794,7 @@ public boolean hasInstance() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=482 + * google/cloud/batch/v1alpha/job.proto;l=492 * @return The instance. */ @java.lang.Deprecated @@ -14427,7 +14427,7 @@ private void ensureInstanceTemplatesIsMutable() { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return A list containing the instanceTemplates. */ @java.lang.Deprecated @@ -14444,7 +14444,7 @@ public com.google.protobuf.ProtocolStringList getInstanceTemplatesList() { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return The count of instanceTemplates. */ @java.lang.Deprecated @@ -14461,7 +14461,7 @@ public int getInstanceTemplatesCount() { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index of the element to return. * @return The instanceTemplates at the given index. */ @@ -14479,7 +14479,7 @@ public java.lang.String getInstanceTemplates(int index) { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index of the value to return. * @return The bytes of the instanceTemplates at the given index. */ @@ -14497,7 +14497,7 @@ public com.google.protobuf.ByteString getInstanceTemplatesBytes(int index) { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index to set the value at. * @param value The instanceTemplates to set. * @return This builder for chaining. @@ -14522,7 +14522,7 @@ public Builder setInstanceTemplates(int index, java.lang.String value) { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param value The instanceTemplates to add. * @return This builder for chaining. */ @@ -14546,7 +14546,7 @@ public Builder addInstanceTemplates(java.lang.String value) { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param values The instanceTemplates to add. * @return This builder for chaining. */ @@ -14567,7 +14567,7 @@ public Builder addAllInstanceTemplates(java.lang.Iterable valu * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return This builder for chaining. */ @java.lang.Deprecated @@ -14587,7 +14587,7 @@ public Builder clearInstanceTemplates() { * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param value The bytes of the instanceTemplates to add. * @return This builder for chaining. */ @@ -14624,7 +14624,7 @@ private void ensureProvisioningModelsIsMutable() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @return A list containing the provisioningModels. */ @java.lang.Deprecated @@ -14646,7 +14646,7 @@ private void ensureProvisioningModelsIsMutable() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @return The count of provisioningModels. */ @java.lang.Deprecated @@ -14665,7 +14665,7 @@ public int getProvisioningModelsCount() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index of the element to return. * @return The provisioningModels at the given index. */ @@ -14686,7 +14686,7 @@ public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProv * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index to set the value at. * @param value The provisioningModels to set. * @return This builder for chaining. @@ -14714,7 +14714,7 @@ public Builder setProvisioningModels( * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param value The provisioningModels to add. * @return This builder for chaining. */ @@ -14741,7 +14741,7 @@ public Builder addProvisioningModels( * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param values The provisioningModels to add. * @return This builder for chaining. */ @@ -14769,7 +14769,7 @@ public Builder addAllProvisioningModels( * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @return This builder for chaining. */ @java.lang.Deprecated @@ -14791,7 +14791,7 @@ public Builder clearProvisioningModels() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @return A list containing the enum numeric values on the wire for provisioningModels. */ @java.lang.Deprecated @@ -14810,7 +14810,7 @@ public java.util.List getProvisioningModelsValueList() { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index of the value to return. * @return The enum numeric value on the wire of provisioningModels at the given index. */ @@ -14830,7 +14830,7 @@ public int getProvisioningModelsValue(int index) { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index to set the value at. * @param value The enum numeric value on the wire for provisioningModels to set. * @return This builder for chaining. @@ -14854,7 +14854,7 @@ public Builder setProvisioningModelsValue(int index, int value) { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param value The enum numeric value on the wire for provisioningModels to add. * @return This builder for chaining. */ @@ -14877,7 +14877,7 @@ public Builder addProvisioningModelsValue(int value) { * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=492 + * See google/cloud/batch/v1alpha/job.proto;l=502 * @param values The enum numeric values on the wire for provisioningModels to add. * @return This builder for chaining. */ @@ -14902,7 +14902,7 @@ public Builder addAllProvisioningModelsValue(java.lang.Iterablestring service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return The serviceAccountEmail. */ @java.lang.Deprecated @@ -14927,7 +14927,7 @@ public java.lang.String getServiceAccountEmail() { * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return The bytes for serviceAccountEmail. */ @java.lang.Deprecated @@ -14952,7 +14952,7 @@ public com.google.protobuf.ByteString getServiceAccountEmailBytes() { * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @param value The serviceAccountEmail to set. * @return This builder for chaining. */ @@ -14976,7 +14976,7 @@ public Builder setServiceAccountEmail(java.lang.String value) { * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return This builder for chaining. */ @java.lang.Deprecated @@ -14996,7 +14996,7 @@ public Builder clearServiceAccountEmail() { * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @param value The bytes for serviceAccountEmail to set. * @return This builder for chaining. */ diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java index 25695a649a94..7733e1347208 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java @@ -70,7 +70,7 @@ public interface AllocationPolicyOrBuilder * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=482 + * google/cloud/batch/v1alpha/job.proto;l=492 * @return Whether the instance field is set. */ @java.lang.Deprecated @@ -87,7 +87,7 @@ public interface AllocationPolicyOrBuilder * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=482 + * google/cloud/batch/v1alpha/job.proto;l=492 * @return The instance. */ @java.lang.Deprecated @@ -187,7 +187,7 @@ public interface AllocationPolicyOrBuilder * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return A list containing the instanceTemplates. */ @java.lang.Deprecated @@ -202,7 +202,7 @@ public interface AllocationPolicyOrBuilder * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @return The count of instanceTemplates. */ @java.lang.Deprecated @@ -217,7 +217,7 @@ public interface AllocationPolicyOrBuilder * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index of the element to return. * @return The instanceTemplates at the given index. */ @@ -233,7 +233,7 @@ public interface AllocationPolicyOrBuilder * repeated string instance_templates = 3 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=489 + * google/cloud/batch/v1alpha/job.proto;l=499 * @param index The index of the value to return. * @return The bytes of the instanceTemplates at the given index. */ @@ -252,7 +252,7 @@ public interface AllocationPolicyOrBuilder * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @return A list containing the provisioningModels. */ @java.lang.Deprecated @@ -270,7 +270,7 @@ public interface AllocationPolicyOrBuilder * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @return The count of provisioningModels. */ @java.lang.Deprecated @@ -287,7 +287,7 @@ public interface AllocationPolicyOrBuilder * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index of the element to return. * @return The provisioningModels at the given index. */ @@ -306,7 +306,7 @@ com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisionin * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @return A list containing the enum numeric values on the wire for provisioningModels. */ @java.lang.Deprecated @@ -323,7 +323,7 @@ com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisionin * * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=492 + * google/cloud/batch/v1alpha/job.proto;l=502 * @param index The index of the value to return. * @return The enum numeric value on the wire of provisioningModels at the given index. */ @@ -340,7 +340,7 @@ com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisionin * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return The serviceAccountEmail. */ @java.lang.Deprecated @@ -355,7 +355,7 @@ com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisionin * string service_account_email = 5 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. - * See google/cloud/batch/v1alpha/job.proto;l=495 + * See google/cloud/batch/v1alpha/job.proto;l=505 * @return The bytes for serviceAccountEmail. */ @java.lang.Deprecated diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java index cb647ccdaecc..300c4db24566 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java @@ -79,69 +79,70 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ogle/api/resource.proto\032$google/cloud/ba" + "tch/v1alpha/job.proto\032%google/cloud/batc" + "h/v1alpha/task.proto\032#google/longrunning" - + "/operations.proto\032\037google/protobuf/times" - + "tamp.proto\"\240\001\n\020CreateJobRequest\0220\n\006paren" - + "t\030\001 \001(\tB \340A\002\372A\032\022\030batch.googleapis.com/Jo" - + "b\022\016\n\006job_id\030\002 \001(\t\0221\n\003job\030\003 \001(\0132\037.google." - + "cloud.batch.v1alpha.JobB\003\340A\002\022\027\n\nrequest_" - + "id\030\004 \001(\tB\003\340A\001\"?\n\rGetJobRequest\022.\n\004name\030\001" - + " \001(\tB \340A\002\372A\032\n\030batch.googleapis.com/Job\"N" - + "\n\020DeleteJobRequest\022\014\n\004name\030\001 \001(\t\022\023\n\006reas" - + "on\030\002 \001(\tB\003\340A\001\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"X" - + "\n\017ListJobsRequest\022\016\n\006parent\030\001 \001(\t\022\016\n\006fil" - + "ter\030\004 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_tok" - + "en\030\003 \001(\t\"o\n\020ListJobsResponse\022-\n\004jobs\030\001 \003" - + "(\0132\037.google.cloud.batch.v1alpha.Job\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(" - + "\t\"\201\001\n\020ListTasksRequest\0226\n\006parent\030\001 \001(\tB&" - + "\340A\002\372A \n\036batch.googleapis.com/TaskGroup\022\016" - + "\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npag" - + "e_token\030\004 \001(\t\"r\n\021ListTasksResponse\022/\n\005ta" - + "sks\030\001 \003(\0132 .google.cloud.batch.v1alpha.T" - + "ask\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreacha" - + "ble\030\003 \003(\t\"A\n\016GetTaskRequest\022/\n\004name\030\001 \001(" - + "\tB!\340A\002\372A\033\n\031batch.googleapis.com/Task\"\200\002\n" - + "\021OperationMetadata\0224\n\013create_time\030\001 \001(\0132" - + "\032.google.protobuf.TimestampB\003\340A\003\0221\n\010end_" - + "time\030\002 \001(\0132\032.google.protobuf.TimestampB\003" - + "\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003" - + "\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026requ" - + "ested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_ver" - + "sion\030\007 \001(\tB\003\340A\0032\221\t\n\014BatchService\022\252\001\n\tCre" - + "ateJob\022,.google.cloud.batch.v1alpha.Crea" - + "teJobRequest\032\037.google.cloud.batch.v1alph" - + "a.Job\"N\202\323\344\223\0024\"-/v1alpha/{parent=projects" - + "/*/locations/*}/jobs:\003job\332A\021parent,job,j" - + "ob_id\022\222\001\n\006GetJob\022).google.cloud.batch.v1" - + "alpha.GetJobRequest\032\037.google.cloud.batch" - + ".v1alpha.Job\"<\202\323\344\223\002/\022-/v1alpha/{name=pro" - + "jects/*/locations/*/jobs/*}\332A\004name\022\337\001\n\tD" - + "eleteJob\022,.google.cloud.batch.v1alpha.De" - + "leteJobRequest\032\035.google.longrunning.Oper" - + "ation\"\204\001\202\323\344\223\002/*-/v1alpha/{name=projects/" - + "*/locations/*/jobs/*}\332A\004name\312AE\n\025google." - + "protobuf.Empty\022,google.cloud.batch.v1alp" - + "ha.OperationMetadata\022\245\001\n\010ListJobs\022+.goog" - + "le.cloud.batch.v1alpha.ListJobsRequest\032," - + ".google.cloud.batch.v1alpha.ListJobsResp" - + "onse\">\202\323\344\223\002/\022-/v1alpha/{parent=projects/" - + "*/locations/*}/jobs\332A\006parent\022\252\001\n\007GetTask" - + "\022*.google.cloud.batch.v1alpha.GetTaskReq" - + "uest\032 .google.cloud.batch.v1alpha.Task\"Q" - + "\202\323\344\223\002D\022B/v1alpha/{name=projects/*/locati" - + "ons/*/jobs/*/taskGroups/*/tasks/*}\332A\004nam" - + "e\022\275\001\n\tListTasks\022,.google.cloud.batch.v1a" - + "lpha.ListTasksRequest\032-.google.cloud.bat" - + "ch.v1alpha.ListTasksResponse\"S\202\323\344\223\002D\022B/v" - + "1alpha/{parent=projects/*/locations/*/jo" - + "bs/*/taskGroups/*}/tasks\332A\006parent\032H\312A\024ba" - + "tch.googleapis.com\322A.https://www.googlea" - + "pis.com/auth/cloud-platformB\304\001\n\036com.goog" - + "le.cloud.batch.v1alphaB\nBatchProtoP\001Z4cl" - + "oud.google.com/go/batch/apiv1alpha/batch" - + "pb;batchpb\242\002\003GCB\252\002\032Google.Cloud.Batch.V1" - + "Alpha\312\002\032Google\\Cloud\\Batch\\V1alpha\352\002\035Goo" - + "gle::Cloud::Batch::V1alphab\006proto3" + + "/operations.proto\032\033google/protobuf/empty" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\240\001\n\020CreateJobRequest\0220\n\006parent\030\001 \001(\tB \340A" + + "\002\372A\032\022\030batch.googleapis.com/Job\022\016\n\006job_id" + + "\030\002 \001(\t\0221\n\003job\030\003 \001(\0132\037.google.cloud.batch" + + ".v1alpha.JobB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340" + + "A\001\"?\n\rGetJobRequest\022.\n\004name\030\001 \001(\tB \340A\002\372A" + + "\032\n\030batch.googleapis.com/Job\"N\n\020DeleteJob" + + "Request\022\014\n\004name\030\001 \001(\t\022\023\n\006reason\030\002 \001(\tB\003\340" + + "A\001\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"X\n\017ListJobsR" + + "equest\022\016\n\006parent\030\001 \001(\t\022\016\n\006filter\030\004 \001(\t\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"o\n" + + "\020ListJobsResponse\022-\n\004jobs\030\001 \003(\0132\037.google" + + ".cloud.batch.v1alpha.Job\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\201\001\n\020ListT" + + "asksRequest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \n\036bat" + + "ch.googleapis.com/TaskGroup\022\016\n\006filter\030\002 " + + "\001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001" + + "(\t\"r\n\021ListTasksResponse\022/\n\005tasks\030\001 \003(\0132 " + + ".google.cloud.batch.v1alpha.Task\022\027\n\017next" + + "_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"A" + + "\n\016GetTaskRequest\022/\n\004name\030\001 \001(\tB!\340A\002\372A\033\n\031" + + "batch.googleapis.com/Task\"\200\002\n\021OperationM" + + "etadata\0224\n\013create_time\030\001 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132" + + "\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006targ" + + "et\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016stat" + + "us_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_cance" + + "llation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB" + + "\003\340A\0032\221\t\n\014BatchService\022\252\001\n\tCreateJob\022,.go" + + "ogle.cloud.batch.v1alpha.CreateJobReques" + + "t\032\037.google.cloud.batch.v1alpha.Job\"N\202\323\344\223" + + "\0024\"-/v1alpha/{parent=projects/*/location" + + "s/*}/jobs:\003job\332A\021parent,job,job_id\022\222\001\n\006G" + + "etJob\022).google.cloud.batch.v1alpha.GetJo" + + "bRequest\032\037.google.cloud.batch.v1alpha.Jo" + + "b\"<\202\323\344\223\002/\022-/v1alpha/{name=projects/*/loc" + + "ations/*/jobs/*}\332A\004name\022\337\001\n\tDeleteJob\022,." + + "google.cloud.batch.v1alpha.DeleteJobRequ" + + "est\032\035.google.longrunning.Operation\"\204\001\202\323\344" + + "\223\002/*-/v1alpha/{name=projects/*/locations" + + "/*/jobs/*}\332A\004name\312AE\n\025google.protobuf.Em" + + "pty\022,google.cloud.batch.v1alpha.Operatio" + + "nMetadata\022\245\001\n\010ListJobs\022+.google.cloud.ba" + + "tch.v1alpha.ListJobsRequest\032,.google.clo" + + "ud.batch.v1alpha.ListJobsResponse\">\202\323\344\223\002" + + "/\022-/v1alpha/{parent=projects/*/locations" + + "/*}/jobs\332A\006parent\022\252\001\n\007GetTask\022*.google.c" + + "loud.batch.v1alpha.GetTaskRequest\032 .goog" + + "le.cloud.batch.v1alpha.Task\"Q\202\323\344\223\002D\022B/v1" + + "alpha/{name=projects/*/locations/*/jobs/" + + "*/taskGroups/*/tasks/*}\332A\004name\022\275\001\n\tListT" + + "asks\022,.google.cloud.batch.v1alpha.ListTa" + + "sksRequest\032-.google.cloud.batch.v1alpha." + + "ListTasksResponse\"S\202\323\344\223\002D\022B/v1alpha/{par" + + "ent=projects/*/locations/*/jobs/*/taskGr" + + "oups/*}/tasks\332A\006parent\032H\312A\024batch.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformB\304\001\n\036com.google.cloud.ba" + + "tch.v1alphaB\nBatchProtoP\001Z4cloud.google." + + "com/go/batch/apiv1alpha/batchpb;batchpb\242" + + "\002\003GCB\252\002\032Google.Cloud.Batch.V1Alpha\312\002\032Goo" + + "gle\\Cloud\\Batch\\V1alpha\352\002\035Google::Cloud:" + + ":Batch::V1alphab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -154,6 +155,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.batch.v1alpha.JobProto.getDescriptor(), com.google.cloud.batch.v1alpha.TaskProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor = @@ -252,6 +254,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.batch.v1alpha.JobProto.getDescriptor(); com.google.cloud.batch.v1alpha.TaskProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java index 6ff855751fc7..46d8968ce4d3 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java @@ -249,8 +249,8 @@ public com.google.cloud.batch.v1alpha.JobOrBuilder getJobOrBuilder() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -282,8 +282,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1188,8 +1188,8 @@ public com.google.cloud.batch.v1alpha.JobOrBuilder getJobOrBuilder() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1220,8 +1220,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1252,8 +1252,8 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1283,8 +1283,8 @@ public Builder setRequestId(java.lang.String value) { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -1310,8 +1310,8 @@ public Builder clearRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java index 7748e88d4bc4..a5955d5df28c 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java @@ -136,8 +136,8 @@ public interface CreateJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -158,8 +158,8 @@ public interface CreateJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java index 3247bfaad04f..d54a584105c8 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java @@ -183,8 +183,8 @@ public com.google.protobuf.ByteString getReasonBytes() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -216,8 +216,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -853,8 +853,8 @@ public Builder setReasonBytes(com.google.protobuf.ByteString value) { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -885,8 +885,8 @@ public java.lang.String getRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -917,8 +917,8 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -948,8 +948,8 @@ public Builder setRequestId(java.lang.String value) { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -975,8 +975,8 @@ public Builder clearRequestId() { * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java index 827054f17a76..b7cc40ee22c8 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java @@ -81,8 +81,8 @@ public interface DeleteJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -103,8 +103,8 @@ public interface DeleteJobRequestOrBuilder * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java index 079126609625..90138d114e28 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java @@ -332,7 +332,8 @@ public com.google.protobuf.ByteString getUidBytes() { * *
    * Priority of the Job.
-   * The valid value range is [0, 100).
+   * The valid value range is [0, 100). Default value is 0.
+   * Higher value indicates higher priority.
    * A job with higher priority value is more likely to run earlier if all other
    * requirements are satisfied.
    * 
@@ -806,7 +807,7 @@ public com.google.cloud.batch.v1alpha.JobStatusOrBuilder getStatusOrBuilder() { * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.Job.notification is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=95 + * google/cloud/batch/v1alpha/job.proto;l=96 * @return Whether the notification field is set. */ @java.lang.Override @@ -824,7 +825,7 @@ public boolean hasNotification() { * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.Job.notification is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=95 + * google/cloud/batch/v1alpha/job.proto;l=96 * @return The notification. */ @java.lang.Override @@ -2154,7 +2155,8 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { * *
      * Priority of the Job.
-     * The valid value range is [0, 100).
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
      * A job with higher priority value is more likely to run earlier if all other
      * requirements are satisfied.
      * 
@@ -2172,7 +2174,8 @@ public long getPriority() { * *
      * Priority of the Job.
-     * The valid value range is [0, 100).
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
      * A job with higher priority value is more likely to run earlier if all other
      * requirements are satisfied.
      * 
@@ -2194,7 +2197,8 @@ public Builder setPriority(long value) { * *
      * Priority of the Job.
-     * The valid value range is [0, 100).
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
      * A job with higher priority value is more likely to run earlier if all other
      * requirements are satisfied.
      * 
@@ -3723,7 +3727,7 @@ public com.google.cloud.batch.v1alpha.JobStatusOrBuilder getStatusOrBuilder() { * * * @deprecated google.cloud.batch.v1alpha.Job.notification is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=95 + * google/cloud/batch/v1alpha/job.proto;l=96 * @return Whether the notification field is set. */ @java.lang.Deprecated @@ -3741,7 +3745,7 @@ public boolean hasNotification() { * * * @deprecated google.cloud.batch.v1alpha.Job.notification is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=95 + * google/cloud/batch/v1alpha/job.proto;l=96 * @return The notification. */ @java.lang.Deprecated diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java index 7b75304b80a7..76a5f2d65795 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java @@ -80,7 +80,8 @@ public interface JobOrBuilder * *
    * Priority of the Job.
-   * The valid value range is [0, 100).
+   * The valid value range is [0, 100). Default value is 0.
+   * Higher value indicates higher priority.
    * A job with higher priority value is more likely to run earlier if all other
    * requirements are satisfied.
    * 
@@ -434,7 +435,7 @@ java.lang.String getLabelsOrDefault( * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.Job.notification is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=95 + * google/cloud/batch/v1alpha/job.proto;l=96 * @return Whether the notification field is set. */ @java.lang.Deprecated @@ -449,7 +450,7 @@ java.lang.String getLabelsOrDefault( * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; * * @deprecated google.cloud.batch.v1alpha.Job.notification is deprecated. See - * google/cloud/batch/v1alpha/job.proto;l=95 + * google/cloud/batch/v1alpha/job.proto;l=96 * @return The notification. */ @java.lang.Deprecated diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java index a42e2c56ad7e..6612977cfb40 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java @@ -67,6 +67,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_ResourceUsage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_ResourceUsage_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -177,116 +181,119 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\0162..google.cloud.batch.v1alpha.JobDepend" + "ency.Type:\0028\001\"E\n\004Type\022\024\n\020TYPE_UNSPECIFIE" + "D\020\000\022\r\n\tSUCCEEDED\020\001\022\n\n\006FAILED\020\002\022\014\n\010FINISH" - + "ED\020\003\"\250\007\n\tJobStatus\022:\n\005state\030\001 \001(\0162+.goog" + + "ED\020\003\"\353\007\n\tJobStatus\022:\n\005state\030\001 \001(\0162+.goog" + "le.cloud.batch.v1alpha.JobStatus.State\022>" + "\n\rstatus_events\030\002 \003(\0132\'.google.cloud.bat" + "ch.v1alpha.StatusEvent\022J\n\013task_groups\030\004 " + "\003(\01325.google.cloud.batch.v1alpha.JobStat" + "us.TaskGroupsEntry\022/\n\014run_duration\030\005 \001(\013" - + "2\031.google.protobuf.Duration\032\333\001\n\016Instance" - + "Status\022\024\n\014machine_type\030\001 \001(\t\022Z\n\022provisio" - + "ning_model\030\002 \001(\0162>.google.cloud.batch.v1" - + "alpha.AllocationPolicy.ProvisioningModel" - + "\022\021\n\ttask_pack\030\003 \001(\003\022D\n\tboot_disk\030\004 \001(\01321" - + ".google.cloud.batch.v1alpha.AllocationPo" - + "licy.Disk\032\334\001\n\017TaskGroupStatus\022Q\n\006counts\030" - + "\001 \003(\0132A.google.cloud.batch.v1alpha.JobSt" - + "atus.TaskGroupStatus.CountsEntry\022G\n\tinst" - + "ances\030\002 \003(\01324.google.cloud.batch.v1alpha" - + ".JobStatus.InstanceStatus\032-\n\013CountsEntry" - + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001\032h\n\017Task" - + "GroupsEntry\022\013\n\003key\030\001 \001(\t\022D\n\005value\030\002 \001(\0132" - + "5.google.cloud.batch.v1alpha.JobStatus.T" - + "askGroupStatus:\0028\001\"{\n\005State\022\025\n\021STATE_UNS" - + "PECIFIED\020\000\022\n\n\006QUEUED\020\001\022\r\n\tSCHEDULED\020\002\022\013\n" - + "\007RUNNING\020\003\022\r\n\tSUCCEEDED\020\004\022\n\n\006FAILED\020\005\022\030\n" - + "\024DELETION_IN_PROGRESS\020\006\"\220\003\n\017JobNotificat" - + "ion\022\024\n\014pubsub_topic\030\001 \001(\t\022D\n\007message\030\002 \001" - + "(\01323.google.cloud.batch.v1alpha.JobNotif" - + "ication.Message\032\323\001\n\007Message\022>\n\004type\030\001 \001(" - + "\01620.google.cloud.batch.v1alpha.JobNotifi" - + "cation.Type\022B\n\rnew_job_state\030\002 \001(\0162+.goo" - + "gle.cloud.batch.v1alpha.JobStatus.State\022" - + "D\n\016new_task_state\030\003 \001(\0162,.google.cloud.b" - + "atch.v1alpha.TaskStatus.State\"K\n\004Type\022\024\n" - + "\020TYPE_UNSPECIFIED\020\000\022\025\n\021JOB_STATE_CHANGED" - + "\020\001\022\026\n\022TASK_STATE_CHANGED\020\002\"\355\017\n\020Allocatio" - + "nPolicy\022M\n\010location\030\001 \001(\0132;.google.cloud" - + ".batch.v1alpha.AllocationPolicy.Location" - + "Policy\022Q\n\010instance\030\002 \001(\0132;.google.cloud." - + "batch.v1alpha.AllocationPolicy.InstanceP" - + "olicyB\002\030\001\022X\n\tinstances\030\010 \003(\0132E.google.cl" - + "oud.batch.v1alpha.AllocationPolicy.Insta" - + "ncePolicyOrTemplate\022\036\n\022instance_template" - + "s\030\003 \003(\tB\002\030\001\022_\n\023provisioning_models\030\004 \003(\016" - + "2>.google.cloud.batch.v1alpha.Allocation" - + "Policy.ProvisioningModelB\002\030\001\022!\n\025service_" - + "account_email\030\005 \001(\tB\002\030\001\022C\n\017service_accou" - + "nt\030\t \001(\0132*.google.cloud.batch.v1alpha.Se" - + "rviceAccount\022H\n\006labels\030\006 \003(\01328.google.cl" - + "oud.batch.v1alpha.AllocationPolicy.Label" - + "sEntry\022K\n\007network\030\007 \001(\0132:.google.cloud.b" - + "atch.v1alpha.AllocationPolicy.NetworkPol" - + "icy\032E\n\016LocationPolicy\022\031\n\021allowed_locatio" - + "ns\030\001 \003(\t\022\030\n\020denied_locations\030\002 \003(\t\032q\n\004Di" - + "sk\022\017\n\005image\030\004 \001(\tH\000\022\022\n\010snapshot\030\005 \001(\tH\000\022" - + "\014\n\004type\030\001 \001(\t\022\017\n\007size_gb\030\002 \001(\003\022\026\n\016disk_i" - + "nterface\030\006 \001(\tB\r\n\013data_source\032\217\001\n\014Attach" - + "edDisk\022E\n\010new_disk\030\001 \001(\01321.google.cloud." - + "batch.v1alpha.AllocationPolicy.DiskH\000\022\027\n" - + "\rexisting_disk\030\002 \001(\tH\000\022\023\n\013device_name\030\003 " - + "\001(\tB\n\n\010attached\032K\n\013Accelerator\022\014\n\004type\030\001" - + " \001(\t\022\r\n\005count\030\002 \001(\003\022\037\n\023install_gpu_drive" - + "rs\030\003 \001(\010B\002\030\001\032\264\003\n\016InstancePolicy\022!\n\025allow" - + "ed_machine_types\030\001 \003(\tB\002\030\001\022\024\n\014machine_ty" - + "pe\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 \001(\t\022Z\n\022pr" - + "ovisioning_model\030\004 \001(\0162>.google.cloud.ba" - + "tch.v1alpha.AllocationPolicy.Provisionin" - + "gModel\022N\n\014accelerators\030\005 \003(\01328.google.cl" - + "oud.batch.v1alpha.AllocationPolicy.Accel" - + "erator\022D\n\tboot_disk\030\010 \001(\01321.google.cloud" - + ".batch.v1alpha.AllocationPolicy.Disk\022H\n\005" - + "disks\030\006 \003(\01329.google.cloud.batch.v1alpha" - + ".AllocationPolicy.AttachedDisk\022\023\n\013reserv" - + "ation\030\007 \001(\t\032\266\001\n\030InstancePolicyOrTemplate" - + "\022M\n\006policy\030\001 \001(\0132;.google.cloud.batch.v1" - + "alpha.AllocationPolicy.InstancePolicyH\000\022" - + "\033\n\021instance_template\030\002 \001(\tH\000\022\033\n\023install_" - + "gpu_drivers\030\003 \001(\010B\021\n\017policy_template\032W\n\020" - + "NetworkInterface\022\017\n\007network\030\001 \001(\t\022\022\n\nsub" - + "network\030\002 \001(\t\022\036\n\026no_external_ip_address\030" - + "\003 \001(\010\032j\n\rNetworkPolicy\022Y\n\022network_interf" - + "aces\030\001 \003(\0132=.google.cloud.batch.v1alpha." - + "AllocationPolicy.NetworkInterface\032-\n\013Lab" - + "elsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + "\"`\n\021ProvisioningModel\022\"\n\036PROVISIONING_MO" - + "DEL_UNSPECIFIED\020\000\022\014\n\010STANDARD\020\001\022\010\n\004SPOT\020" - + "\002\022\017\n\013PREEMPTIBLE\020\003\"\351\005\n\tTaskGroup\022\021\n\004name" - + "\030\001 \001(\tB\003\340A\003\022<\n\ttask_spec\030\003 \001(\0132$.google." - + "cloud.batch.v1alpha.TaskSpecB\003\340A\002\022\022\n\ntas" - + "k_count\030\004 \001(\003\022\023\n\013parallelism\030\005 \001(\003\022Q\n\021sc" - + "heduling_policy\030\006 \001(\01626.google.cloud.bat" - + "ch.v1alpha.TaskGroup.SchedulingPolicy\022G\n" - + "\021allocation_policy\030\007 \001(\0132,.google.cloud." - + "batch.v1alpha.AllocationPolicy\022A\n\006labels" - + "\030\010 \003(\01321.google.cloud.batch.v1alpha.Task" - + "Group.LabelsEntry\022B\n\021task_environments\030\t" - + " \003(\0132\'.google.cloud.batch.v1alpha.Enviro" - + "nment\022\033\n\023task_count_per_node\030\n \001(\003\022\032\n\022re" - + "quire_hosts_file\030\013 \001(\010\022\026\n\016permissive_ssh" - + "\030\014 \001(\010\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" - + "lue\030\002 \001(\t:\0028\001\"N\n\020SchedulingPolicy\022!\n\035SCH" - + "EDULING_POLICY_UNSPECIFIED\020\000\022\027\n\023AS_SOON_" - + "AS_POSSIBLE\020\001:o\352Al\n\036batch.googleapis.com" - + "/TaskGroup\022Jprojects/{project}/locations" - + "/{location}/jobs/{job}/taskGroups/{task_" - + "group}\"/\n\016ServiceAccount\022\r\n\005email\030\001 \001(\t\022" - + "\016\n\006scopes\030\002 \003(\tB\302\001\n\036com.google.cloud.bat" - + "ch.v1alphaB\010JobProtoP\001Z4cloud.google.com" - + "/go/batch/apiv1alpha/batchpb;batchpb\242\002\003G" - + "CB\252\002\032Google.Cloud.Batch.V1Alpha\312\002\032Google" - + "\\Cloud\\Batch\\V1alpha\352\002\035Google::Cloud::Ba" - + "tch::V1alphab\006proto3" + + "2\031.google.protobuf.Duration\022A\n\016resource_" + + "usage\030\006 \001(\0132).google.cloud.batch.v1alpha" + + ".ResourceUsage\032\333\001\n\016InstanceStatus\022\024\n\014mac" + + "hine_type\030\001 \001(\t\022Z\n\022provisioning_model\030\002 " + + "\001(\0162>.google.cloud.batch.v1alpha.Allocat" + + "ionPolicy.ProvisioningModel\022\021\n\ttask_pack" + + "\030\003 \001(\003\022D\n\tboot_disk\030\004 \001(\01321.google.cloud" + + ".batch.v1alpha.AllocationPolicy.Disk\032\334\001\n" + + "\017TaskGroupStatus\022Q\n\006counts\030\001 \003(\0132A.googl" + + "e.cloud.batch.v1alpha.JobStatus.TaskGrou" + + "pStatus.CountsEntry\022G\n\tinstances\030\002 \003(\01324" + + ".google.cloud.batch.v1alpha.JobStatus.In" + + "stanceStatus\032-\n\013CountsEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\003:\0028\001\032h\n\017TaskGroupsEntry\022\013" + + "\n\003key\030\001 \001(\t\022D\n\005value\030\002 \001(\01325.google.clou" + + "d.batch.v1alpha.JobStatus.TaskGroupStatu" + + "s:\0028\001\"{\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n" + + "\006QUEUED\020\001\022\r\n\tSCHEDULED\020\002\022\013\n\007RUNNING\020\003\022\r\n" + + "\tSUCCEEDED\020\004\022\n\n\006FAILED\020\005\022\030\n\024DELETION_IN_" + + "PROGRESS\020\006\"#\n\rResourceUsage\022\022\n\ncore_hour" + + "s\030\001 \001(\001\"\220\003\n\017JobNotification\022\024\n\014pubsub_to" + + "pic\030\001 \001(\t\022D\n\007message\030\002 \001(\01323.google.clou" + + "d.batch.v1alpha.JobNotification.Message\032" + + "\323\001\n\007Message\022>\n\004type\030\001 \001(\01620.google.cloud" + + ".batch.v1alpha.JobNotification.Type\022B\n\rn" + + "ew_job_state\030\002 \001(\0162+.google.cloud.batch." + + "v1alpha.JobStatus.State\022D\n\016new_task_stat" + + "e\030\003 \001(\0162,.google.cloud.batch.v1alpha.Tas" + + "kStatus.State\"K\n\004Type\022\024\n\020TYPE_UNSPECIFIE" + + "D\020\000\022\025\n\021JOB_STATE_CHANGED\020\001\022\026\n\022TASK_STATE" + + "_CHANGED\020\002\"\355\017\n\020AllocationPolicy\022M\n\010locat" + + "ion\030\001 \001(\0132;.google.cloud.batch.v1alpha.A" + + "llocationPolicy.LocationPolicy\022Q\n\010instan" + + "ce\030\002 \001(\0132;.google.cloud.batch.v1alpha.Al" + + "locationPolicy.InstancePolicyB\002\030\001\022X\n\tins" + + "tances\030\010 \003(\0132E.google.cloud.batch.v1alph" + + "a.AllocationPolicy.InstancePolicyOrTempl" + + "ate\022\036\n\022instance_templates\030\003 \003(\tB\002\030\001\022_\n\023p" + + "rovisioning_models\030\004 \003(\0162>.google.cloud." + + "batch.v1alpha.AllocationPolicy.Provision" + + "ingModelB\002\030\001\022!\n\025service_account_email\030\005 " + + "\001(\tB\002\030\001\022C\n\017service_account\030\t \001(\0132*.googl" + + "e.cloud.batch.v1alpha.ServiceAccount\022H\n\006" + + "labels\030\006 \003(\01328.google.cloud.batch.v1alph" + + "a.AllocationPolicy.LabelsEntry\022K\n\007networ" + + "k\030\007 \001(\0132:.google.cloud.batch.v1alpha.All" + + "ocationPolicy.NetworkPolicy\032E\n\016LocationP" + + "olicy\022\031\n\021allowed_locations\030\001 \003(\t\022\030\n\020deni" + + "ed_locations\030\002 \003(\t\032q\n\004Disk\022\017\n\005image\030\004 \001(" + + "\tH\000\022\022\n\010snapshot\030\005 \001(\tH\000\022\014\n\004type\030\001 \001(\t\022\017\n" + + "\007size_gb\030\002 \001(\003\022\026\n\016disk_interface\030\006 \001(\tB\r" + + "\n\013data_source\032\217\001\n\014AttachedDisk\022E\n\010new_di" + + "sk\030\001 \001(\01321.google.cloud.batch.v1alpha.Al" + + "locationPolicy.DiskH\000\022\027\n\rexisting_disk\030\002" + + " \001(\tH\000\022\023\n\013device_name\030\003 \001(\tB\n\n\010attached\032" + + "K\n\013Accelerator\022\014\n\004type\030\001 \001(\t\022\r\n\005count\030\002 " + + "\001(\003\022\037\n\023install_gpu_drivers\030\003 \001(\010B\002\030\001\032\264\003\n" + + "\016InstancePolicy\022!\n\025allowed_machine_types" + + "\030\001 \003(\tB\002\030\001\022\024\n\014machine_type\030\002 \001(\t\022\030\n\020min_" + + "cpu_platform\030\003 \001(\t\022Z\n\022provisioning_model" + + "\030\004 \001(\0162>.google.cloud.batch.v1alpha.Allo" + + "cationPolicy.ProvisioningModel\022N\n\014accele" + + "rators\030\005 \003(\01328.google.cloud.batch.v1alph" + + "a.AllocationPolicy.Accelerator\022D\n\tboot_d" + + "isk\030\010 \001(\01321.google.cloud.batch.v1alpha.A" + + "llocationPolicy.Disk\022H\n\005disks\030\006 \003(\01329.go" + + "ogle.cloud.batch.v1alpha.AllocationPolic" + + "y.AttachedDisk\022\023\n\013reservation\030\007 \001(\t\032\266\001\n\030" + + "InstancePolicyOrTemplate\022M\n\006policy\030\001 \001(\013" + + "2;.google.cloud.batch.v1alpha.Allocation" + + "Policy.InstancePolicyH\000\022\033\n\021instance_temp" + + "late\030\002 \001(\tH\000\022\033\n\023install_gpu_drivers\030\003 \001(" + + "\010B\021\n\017policy_template\032W\n\020NetworkInterface" + + "\022\017\n\007network\030\001 \001(\t\022\022\n\nsubnetwork\030\002 \001(\t\022\036\n" + + "\026no_external_ip_address\030\003 \001(\010\032j\n\rNetwork" + + "Policy\022Y\n\022network_interfaces\030\001 \003(\0132=.goo" + + "gle.cloud.batch.v1alpha.AllocationPolicy" + + ".NetworkInterface\032-\n\013LabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\021Provisioning" + + "Model\022\"\n\036PROVISIONING_MODEL_UNSPECIFIED\020" + + "\000\022\014\n\010STANDARD\020\001\022\010\n\004SPOT\020\002\022\017\n\013PREEMPTIBLE" + + "\020\003\"\351\005\n\tTaskGroup\022\021\n\004name\030\001 \001(\tB\003\340A\003\022<\n\tt" + + "ask_spec\030\003 \001(\0132$.google.cloud.batch.v1al" + + "pha.TaskSpecB\003\340A\002\022\022\n\ntask_count\030\004 \001(\003\022\023\n" + + "\013parallelism\030\005 \001(\003\022Q\n\021scheduling_policy\030" + + "\006 \001(\01626.google.cloud.batch.v1alpha.TaskG" + + "roup.SchedulingPolicy\022G\n\021allocation_poli" + + "cy\030\007 \001(\0132,.google.cloud.batch.v1alpha.Al" + + "locationPolicy\022A\n\006labels\030\010 \003(\01321.google." + + "cloud.batch.v1alpha.TaskGroup.LabelsEntr" + + "y\022B\n\021task_environments\030\t \003(\0132\'.google.cl" + + "oud.batch.v1alpha.Environment\022\033\n\023task_co" + + "unt_per_node\030\n \001(\003\022\032\n\022require_hosts_file" + + "\030\013 \001(\010\022\026\n\016permissive_ssh\030\014 \001(\010\032-\n\013Labels" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"N\n" + + "\020SchedulingPolicy\022!\n\035SCHEDULING_POLICY_U" + + "NSPECIFIED\020\000\022\027\n\023AS_SOON_AS_POSSIBLE\020\001:o\352" + + "Al\n\036batch.googleapis.com/TaskGroup\022Jproj" + + "ects/{project}/locations/{location}/jobs" + + "/{job}/taskGroups/{task_group}\"/\n\016Servic" + + "eAccount\022\r\n\005email\030\001 \001(\t\022\016\n\006scopes\030\002 \003(\tB" + + "\302\001\n\036com.google.cloud.batch.v1alphaB\010JobP" + + "rotoP\001Z4cloud.google.com/go/batch/apiv1a" + + "lpha/batchpb;batchpb\242\002\003GCB\252\002\032Google.Clou" + + "d.Batch.V1Alpha\312\002\032Google\\Cloud\\Batch\\V1a" + + "lpha\352\002\035Google::Cloud::Batch::V1alphab\006pr" + + "oto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -357,7 +364,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor, new java.lang.String[] { - "State", "StatusEvents", "TaskGroups", "RunDuration", + "State", "StatusEvents", "TaskGroups", "RunDuration", "ResourceUsage", }); internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_descriptor = internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor.getNestedTypes().get(0); @@ -393,8 +400,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); - internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor = + internal_static_google_cloud_batch_v1alpha_ResourceUsage_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_batch_v1alpha_ResourceUsage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_ResourceUsage_descriptor, + new java.lang.String[] { + "CoreHours", + }); + internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor = + getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_batch_v1alpha_JobNotification_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor, @@ -412,7 +427,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Type", "NewJobState", "NewTaskState", }); internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_google_cloud_batch_v1alpha_AllocationPolicy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor, @@ -525,7 +540,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_batch_v1alpha_TaskGroup_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor, @@ -551,7 +566,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_batch_v1alpha_ServiceAccount_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_batch_v1alpha_ServiceAccount_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_ServiceAccount_descriptor, diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java index 86a3260da1d4..fbe42af764b1 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java @@ -3249,6 +3249,56 @@ public com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder() { return runDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : runDuration_; } + public static final int RESOURCE_USAGE_FIELD_NUMBER = 6; + private com.google.cloud.batch.v1alpha.ResourceUsage resourceUsage_; + /** + * + * + *
+   * The resource usage of the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + * + * @return Whether the resourceUsage field is set. + */ + @java.lang.Override + public boolean hasResourceUsage() { + return resourceUsage_ != null; + } + /** + * + * + *
+   * The resource usage of the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + * + * @return The resourceUsage. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.ResourceUsage getResourceUsage() { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance() + : resourceUsage_; + } + /** + * + * + *
+   * The resource usage of the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder getResourceUsageOrBuilder() { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance() + : resourceUsage_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -3274,6 +3324,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (runDuration_ != null) { output.writeMessage(5, getRunDuration()); } + if (resourceUsage_ != null) { + output.writeMessage(6, getResourceUsage()); + } getUnknownFields().writeTo(output); } @@ -3305,6 +3358,9 @@ public int getSerializedSize() { if (runDuration_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRunDuration()); } + if (resourceUsage_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getResourceUsage()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3327,6 +3383,10 @@ public boolean equals(final java.lang.Object obj) { if (hasRunDuration()) { if (!getRunDuration().equals(other.getRunDuration())) return false; } + if (hasResourceUsage() != other.hasResourceUsage()) return false; + if (hasResourceUsage()) { + if (!getResourceUsage().equals(other.getResourceUsage())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3352,6 +3412,10 @@ public int hashCode() { hash = (37 * hash) + RUN_DURATION_FIELD_NUMBER; hash = (53 * hash) + getRunDuration().hashCode(); } + if (hasResourceUsage()) { + hash = (37 * hash) + RESOURCE_USAGE_FIELD_NUMBER; + hash = (53 * hash) + getResourceUsage().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -3525,6 +3589,11 @@ public Builder clear() { runDurationBuilder_.dispose(); runDurationBuilder_ = null; } + resourceUsage_ = null; + if (resourceUsageBuilder_ != null) { + resourceUsageBuilder_.dispose(); + resourceUsageBuilder_ = null; + } return this; } @@ -3585,6 +3654,10 @@ private void buildPartial0(com.google.cloud.batch.v1alpha.JobStatus result) { result.runDuration_ = runDurationBuilder_ == null ? runDuration_ : runDurationBuilder_.build(); } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.resourceUsage_ = + resourceUsageBuilder_ == null ? resourceUsage_ : resourceUsageBuilder_.build(); + } } @java.lang.Override @@ -3667,6 +3740,9 @@ public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobStatus other) { if (other.hasRunDuration()) { mergeRunDuration(other.getRunDuration()); } + if (other.hasResourceUsage()) { + mergeResourceUsage(other.getResourceUsage()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -3732,6 +3808,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 42 + case 50: + { + input.readMessage(getResourceUsageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -4576,6 +4658,191 @@ public com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder() { return runDurationBuilder_; } + private com.google.cloud.batch.v1alpha.ResourceUsage resourceUsage_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.ResourceUsage, + com.google.cloud.batch.v1alpha.ResourceUsage.Builder, + com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder> + resourceUsageBuilder_; + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + * + * @return Whether the resourceUsage field is set. + */ + public boolean hasResourceUsage() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + * + * @return The resourceUsage. + */ + public com.google.cloud.batch.v1alpha.ResourceUsage getResourceUsage() { + if (resourceUsageBuilder_ == null) { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance() + : resourceUsage_; + } else { + return resourceUsageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + public Builder setResourceUsage(com.google.cloud.batch.v1alpha.ResourceUsage value) { + if (resourceUsageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourceUsage_ = value; + } else { + resourceUsageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + public Builder setResourceUsage( + com.google.cloud.batch.v1alpha.ResourceUsage.Builder builderForValue) { + if (resourceUsageBuilder_ == null) { + resourceUsage_ = builderForValue.build(); + } else { + resourceUsageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + public Builder mergeResourceUsage(com.google.cloud.batch.v1alpha.ResourceUsage value) { + if (resourceUsageBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && resourceUsage_ != null + && resourceUsage_ + != com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance()) { + getResourceUsageBuilder().mergeFrom(value); + } else { + resourceUsage_ = value; + } + } else { + resourceUsageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + public Builder clearResourceUsage() { + bitField0_ = (bitField0_ & ~0x00000010); + resourceUsage_ = null; + if (resourceUsageBuilder_ != null) { + resourceUsageBuilder_.dispose(); + resourceUsageBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + public com.google.cloud.batch.v1alpha.ResourceUsage.Builder getResourceUsageBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getResourceUsageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + public com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder getResourceUsageOrBuilder() { + if (resourceUsageBuilder_ != null) { + return resourceUsageBuilder_.getMessageOrBuilder(); + } else { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance() + : resourceUsage_; + } + } + /** + * + * + *
+     * The resource usage of the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.ResourceUsage, + com.google.cloud.batch.v1alpha.ResourceUsage.Builder, + com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder> + getResourceUsageFieldBuilder() { + if (resourceUsageBuilder_ == null) { + resourceUsageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.ResourceUsage, + com.google.cloud.batch.v1alpha.ResourceUsage.Builder, + com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder>( + getResourceUsage(), getParentForChildren(), isClean()); + resourceUsage_ = null; + } + return resourceUsageBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java index 8e859319439f..5c2441118b02 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java @@ -205,4 +205,39 @@ com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrThrow( * .google.protobuf.Duration run_duration = 5; */ com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder(); + + /** + * + * + *
+   * The resource usage of the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + * + * @return Whether the resourceUsage field is set. + */ + boolean hasResourceUsage(); + /** + * + * + *
+   * The resource usage of the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + * + * @return The resourceUsage. + */ + com.google.cloud.batch.v1alpha.ResourceUsage getResourceUsage(); + /** + * + * + *
+   * The resource usage of the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.ResourceUsage resource_usage = 6; + */ + com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder getResourceUsageOrBuilder(); } diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java index f34e3d40f7b6..81835d324db8 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java @@ -1001,6 +1001,10 @@ public com.google.protobuf.Parser getParserForType() { * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -1016,6 +1020,10 @@ public int getActionValue() { * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -1462,6 +1470,10 @@ public Builder mergeFrom( * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -1477,6 +1489,10 @@ public int getActionValue() { * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -1495,6 +1511,10 @@ public Builder setActionValue(int value) { * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -1514,6 +1534,10 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicy.Action getAction() { * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -1535,6 +1559,10 @@ public Builder setAction(com.google.cloud.batch.v1alpha.LifecyclePolicy.Action v * *
      * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
      * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java index ec4f328d389a..4b9fdd8a8c6f 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java @@ -28,6 +28,10 @@ public interface LifecyclePolicyOrBuilder * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; @@ -40,6 +44,10 @@ public interface LifecyclePolicyOrBuilder * *
    * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
    * 
* * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsage.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsage.java new file mode 100644 index 000000000000..cd75f90d92f6 --- /dev/null +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsage.java @@ -0,0 +1,542 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/batch/v1alpha/job.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * ResourceUsage describes the resource usage of the job.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ResourceUsage} + */ +public final class ResourceUsage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.ResourceUsage) + ResourceUsageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceUsage.newBuilder() to construct. + private ResourceUsage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceUsage() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceUsage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_ResourceUsage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_ResourceUsage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ResourceUsage.class, + com.google.cloud.batch.v1alpha.ResourceUsage.Builder.class); + } + + public static final int CORE_HOURS_FIELD_NUMBER = 1; + private double coreHours_ = 0D; + /** + * + * + *
+   * The CPU core hours that the job consumes.
+   * 
+ * + * double core_hours = 1; + * + * @return The coreHours. + */ + @java.lang.Override + public double getCoreHours() { + return coreHours_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(coreHours_) != 0) { + output.writeDouble(1, coreHours_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(coreHours_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, coreHours_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.batch.v1alpha.ResourceUsage)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.ResourceUsage other = + (com.google.cloud.batch.v1alpha.ResourceUsage) obj; + + if (java.lang.Double.doubleToLongBits(getCoreHours()) + != java.lang.Double.doubleToLongBits(other.getCoreHours())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CORE_HOURS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCoreHours())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.batch.v1alpha.ResourceUsage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ResourceUsage describes the resource usage of the job.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ResourceUsage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.ResourceUsage) + com.google.cloud.batch.v1alpha.ResourceUsageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_ResourceUsage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_ResourceUsage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ResourceUsage.class, + com.google.cloud.batch.v1alpha.ResourceUsage.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.ResourceUsage.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + coreHours_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_ResourceUsage_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ResourceUsage getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ResourceUsage build() { + com.google.cloud.batch.v1alpha.ResourceUsage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ResourceUsage buildPartial() { + com.google.cloud.batch.v1alpha.ResourceUsage result = + new com.google.cloud.batch.v1alpha.ResourceUsage(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.batch.v1alpha.ResourceUsage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.coreHours_ = coreHours_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.batch.v1alpha.ResourceUsage) { + return mergeFrom((com.google.cloud.batch.v1alpha.ResourceUsage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.ResourceUsage other) { + if (other == com.google.cloud.batch.v1alpha.ResourceUsage.getDefaultInstance()) return this; + if (other.getCoreHours() != 0D) { + setCoreHours(other.getCoreHours()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + coreHours_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double coreHours_; + /** + * + * + *
+     * The CPU core hours that the job consumes.
+     * 
+ * + * double core_hours = 1; + * + * @return The coreHours. + */ + @java.lang.Override + public double getCoreHours() { + return coreHours_; + } + /** + * + * + *
+     * The CPU core hours that the job consumes.
+     * 
+ * + * double core_hours = 1; + * + * @param value The coreHours to set. + * @return This builder for chaining. + */ + public Builder setCoreHours(double value) { + + coreHours_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The CPU core hours that the job consumes.
+     * 
+ * + * double core_hours = 1; + * + * @return This builder for chaining. + */ + public Builder clearCoreHours() { + bitField0_ = (bitField0_ & ~0x00000001); + coreHours_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.batch.v1alpha.ResourceUsage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.ResourceUsage) + private static final com.google.cloud.batch.v1alpha.ResourceUsage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.ResourceUsage(); + } + + public static com.google.cloud.batch.v1alpha.ResourceUsage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceUsage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ResourceUsage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsageOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsageOrBuilder.java new file mode 100644 index 000000000000..4796f1064ff5 --- /dev/null +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ResourceUsageOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/batch/v1alpha/job.proto + +package com.google.cloud.batch.v1alpha; + +public interface ResourceUsageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.ResourceUsage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The CPU core hours that the job consumes.
+   * 
+ * + * double core_hours = 1; + * + * @return The coreHours. + */ + double getCoreHours(); +} diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java index 0aeadfeb1a4d..571b0ebd3e95 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java @@ -2441,6 +2441,13 @@ public interface ScriptOrBuilder * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2453,6 +2460,13 @@ public interface ScriptOrBuilder * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2465,6 +2479,13 @@ public interface ScriptOrBuilder * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2478,6 +2499,11 @@ public interface ScriptOrBuilder * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2490,6 +2516,11 @@ public interface ScriptOrBuilder * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2502,6 +2533,11 @@ public interface ScriptOrBuilder * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2612,6 +2648,13 @@ public CommandCase getCommandCase() { * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2626,6 +2669,13 @@ public boolean hasPath() { * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2653,6 +2703,13 @@ public java.lang.String getPath() { * *
      * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
      * 
* * string path = 1; @@ -2682,6 +2739,11 @@ public com.google.protobuf.ByteString getPathBytes() { * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2696,6 +2758,11 @@ public boolean hasText() { * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -2723,6 +2790,11 @@ public java.lang.String getText() { * *
      * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
      * 
* * string text = 2; @@ -3164,6 +3236,13 @@ public Builder clearCommand() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3179,6 +3258,13 @@ public boolean hasPath() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3207,6 +3293,13 @@ public java.lang.String getPath() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3235,6 +3328,13 @@ public com.google.protobuf.ByteString getPathBytes() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3256,6 +3356,13 @@ public Builder setPath(java.lang.String value) { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3275,6 +3382,13 @@ public Builder clearPath() { * *
        * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
        * 
* * string path = 1; @@ -3298,6 +3412,11 @@ public Builder setPathBytes(com.google.protobuf.ByteString value) { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3313,6 +3432,11 @@ public boolean hasText() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3341,6 +3465,11 @@ public java.lang.String getText() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3369,6 +3498,11 @@ public com.google.protobuf.ByteString getTextBytes() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3390,6 +3524,11 @@ public Builder setText(java.lang.String value) { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; @@ -3409,6 +3548,11 @@ public Builder clearText() { * *
        * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
        * 
* * string text = 2; diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEvent.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEvent.java index 7733a3e3ca17..1f0571f01d3d 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEvent.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEvent.java @@ -40,6 +40,7 @@ private StatusEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { private StatusEvent() { type_ = ""; description_ = ""; + taskState_ = 0; } @java.lang.Override @@ -266,6 +267,41 @@ public com.google.cloud.batch.v1alpha.TaskExecutionOrBuilder getTaskExecutionOrB : taskExecution_; } + public static final int TASK_STATE_FIELD_NUMBER = 5; + private int taskState_ = 0; + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return The enum numeric value on the wire for taskState. + */ + @java.lang.Override + public int getTaskStateValue() { + return taskState_; + } + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return The taskState. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskStatus.State getTaskState() { + com.google.cloud.batch.v1alpha.TaskStatus.State result = + com.google.cloud.batch.v1alpha.TaskStatus.State.forNumber(taskState_); + return result == null ? com.google.cloud.batch.v1alpha.TaskStatus.State.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -292,6 +328,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (taskExecution_ != null) { output.writeMessage(4, getTaskExecution()); } + if (taskState_ + != com.google.cloud.batch.v1alpha.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, taskState_); + } getUnknownFields().writeTo(output); } @@ -313,6 +353,10 @@ public int getSerializedSize() { if (taskExecution_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTaskExecution()); } + if (taskState_ + != com.google.cloud.batch.v1alpha.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, taskState_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -339,6 +383,7 @@ public boolean equals(final java.lang.Object obj) { if (hasTaskExecution()) { if (!getTaskExecution().equals(other.getTaskExecution())) return false; } + if (taskState_ != other.taskState_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -362,6 +407,8 @@ public int hashCode() { hash = (37 * hash) + TASK_EXECUTION_FIELD_NUMBER; hash = (53 * hash) + getTaskExecution().hashCode(); } + hash = (37 * hash) + TASK_STATE_FIELD_NUMBER; + hash = (53 * hash) + taskState_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -513,6 +560,7 @@ public Builder clear() { taskExecutionBuilder_.dispose(); taskExecutionBuilder_ = null; } + taskState_ = 0; return this; } @@ -562,6 +610,9 @@ private void buildPartial0(com.google.cloud.batch.v1alpha.StatusEvent result) { result.taskExecution_ = taskExecutionBuilder_ == null ? taskExecution_ : taskExecutionBuilder_.build(); } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.taskState_ = taskState_; + } } @java.lang.Override @@ -625,6 +676,9 @@ public Builder mergeFrom(com.google.cloud.batch.v1alpha.StatusEvent other) { if (other.hasTaskExecution()) { mergeTaskExecution(other.getTaskExecution()); } + if (other.taskState_ != 0) { + setTaskStateValue(other.getTaskStateValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -675,6 +729,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 40: + { + taskState_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1270,6 +1330,96 @@ public com.google.cloud.batch.v1alpha.TaskExecutionOrBuilder getTaskExecutionOrB return taskExecutionBuilder_; } + private int taskState_ = 0; + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return The enum numeric value on the wire for taskState. + */ + @java.lang.Override + public int getTaskStateValue() { + return taskState_; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @param value The enum numeric value on the wire for taskState to set. + * @return This builder for chaining. + */ + public Builder setTaskStateValue(int value) { + taskState_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return The taskState. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskStatus.State getTaskState() { + com.google.cloud.batch.v1alpha.TaskStatus.State result = + com.google.cloud.batch.v1alpha.TaskStatus.State.forNumber(taskState_); + return result == null ? com.google.cloud.batch.v1alpha.TaskStatus.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @param value The taskState to set. + * @return This builder for chaining. + */ + public Builder setTaskState(com.google.cloud.batch.v1alpha.TaskStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + taskState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Task State
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return This builder for chaining. + */ + public Builder clearTaskState() { + bitField0_ = (bitField0_ & ~0x00000010); + taskState_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEventOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEventOrBuilder.java index 05c5d54070e0..0a83c12fc144 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEventOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEventOrBuilder.java @@ -142,4 +142,29 @@ public interface StatusEventOrBuilder * .google.cloud.batch.v1alpha.TaskExecution task_execution = 4; */ com.google.cloud.batch.v1alpha.TaskExecutionOrBuilder getTaskExecutionOrBuilder(); + + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return The enum numeric value on the wire for taskState. + */ + int getTaskStateValue(); + /** + * + * + *
+   * Task State
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State task_state = 5; + * + * @return The taskState. + */ + com.google.cloud.batch.v1alpha.TaskStatus.State getTaskState(); } diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskProto.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskProto.java index 0264346fe9cf..322e7314a7db 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskProto.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskProto.java @@ -43,6 +43,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_batch_v1alpha_TaskStatus_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_batch_v1alpha_TaskStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_batch_v1alpha_Runnable_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -115,78 +119,83 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "n.proto\032\037google/protobuf/timestamp.proto" + "\"b\n\017ComputeResource\022\021\n\tcpu_milli\030\001 \001(\003\022\022" + "\n\nmemory_mib\030\002 \001(\003\022\021\n\tgpu_count\030\003 \001(\003\022\025\n" - + "\rboot_disk_mib\030\004 \001(\003\"\243\001\n\013StatusEvent\022\014\n\004" + + "\rboot_disk_mib\030\004 \001(\003\"\345\001\n\013StatusEvent\022\014\n\004" + "type\030\003 \001(\t\022\023\n\013description\030\001 \001(\t\022.\n\nevent" + "_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022" + "A\n\016task_execution\030\004 \001(\0132).google.cloud.b" - + "atch.v1alpha.TaskExecution\"\"\n\rTaskExecut" - + "ion\022\021\n\texit_code\030\001 \001(\005\"\354\001\n\nTaskStatus\022;\n" - + "\005state\030\001 \001(\0162,.google.cloud.batch.v1alph" - + "a.TaskStatus.State\022>\n\rstatus_events\030\002 \003(" - + "\0132\'.google.cloud.batch.v1alpha.StatusEve" - + "nt\"a\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PE" - + "NDING\020\001\022\014\n\010ASSIGNED\020\002\022\013\n\007RUNNING\020\003\022\n\n\006FA" - + "ILED\020\004\022\r\n\tSUCCEEDED\020\005\"\367\005\n\010Runnable\022C\n\tco" - + "ntainer\030\001 \001(\0132..google.cloud.batch.v1alp" - + "ha.Runnable.ContainerH\000\022=\n\006script\030\002 \001(\0132" - + "+.google.cloud.batch.v1alpha.Runnable.Sc" - + "riptH\000\022?\n\007barrier\030\006 \001(\0132,.google.cloud.b" - + "atch.v1alpha.Runnable.BarrierH\000\022\032\n\022ignor" - + "e_exit_status\030\003 \001(\010\022\022\n\nbackground\030\004 \001(\010\022" - + "\022\n\nalways_run\030\005 \001(\010\022<\n\013environment\030\007 \001(\013" - + "2\'.google.cloud.batch.v1alpha.Environmen" - + "t\022*\n\007timeout\030\010 \001(\0132\031.google.protobuf.Dur" - + "ation\022@\n\006labels\030\t \003(\01320.google.cloud.bat" - + "ch.v1alpha.Runnable.LabelsEntry\032\252\001\n\tCont" - + "ainer\022\021\n\timage_uri\030\001 \001(\t\022\020\n\010commands\030\002 \003" - + "(\t\022\022\n\nentrypoint\030\003 \001(\t\022\017\n\007volumes\030\007 \003(\t\022" - + "\017\n\007options\030\010 \001(\t\022\036\n\026block_external_netwo" - + "rk\030\t \001(\010\022\020\n\010username\030\n \001(\t\022\020\n\010password\030\013" - + " \001(\t\0323\n\006Script\022\016\n\004path\030\001 \001(\tH\000\022\016\n\004text\030\002" - + " \001(\tH\000B\t\n\007command\032\027\n\007Barrier\022\014\n\004name\030\001 \001" - + "(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" - + "\002 \001(\t:\0028\001B\014\n\nexecutable\"\233\004\n\010TaskSpec\0227\n\t" - + "runnables\030\010 \003(\0132$.google.cloud.batch.v1a" - + "lpha.Runnable\022E\n\020compute_resource\030\003 \001(\0132" - + "+.google.cloud.batch.v1alpha.ComputeReso" - + "urce\0223\n\020max_run_duration\030\004 \001(\0132\031.google." - + "protobuf.Duration\022\027\n\017max_retry_count\030\005 \001" - + "(\005\022G\n\022lifecycle_policies\030\t \003(\0132+.google." - + "cloud.batch.v1alpha.LifecyclePolicy\022P\n\014e" - + "nvironments\030\006 \003(\01326.google.cloud.batch.v" - + "1alpha.TaskSpec.EnvironmentsEntryB\002\030\001\0223\n" - + "\007volumes\030\007 \003(\0132\".google.cloud.batch.v1al" - + "pha.Volume\022<\n\013environment\030\n \001(\0132\'.google" - + ".cloud.batch.v1alpha.Environment\0323\n\021Envi" - + "ronmentsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" - + "\t:\0028\001\"\224\002\n\017LifecyclePolicy\022B\n\006action\030\001 \001(" - + "\01622.google.cloud.batch.v1alpha.Lifecycle" - + "Policy.Action\022U\n\020action_condition\030\002 \001(\0132" - + ";.google.cloud.batch.v1alpha.LifecyclePo" - + "licy.ActionCondition\032%\n\017ActionCondition\022" - + "\022\n\nexit_codes\030\001 \003(\005\"?\n\006Action\022\026\n\022ACTION_" - + "UNSPECIFIED\020\000\022\016\n\nRETRY_TASK\020\001\022\r\n\tFAIL_TA" - + "SK\020\002\"\305\001\n\004Task\022\014\n\004name\030\001 \001(\t\0226\n\006status\030\002 " - + "\001(\0132&.google.cloud.batch.v1alpha.TaskSta" - + "tus:w\352At\n\031batch.googleapis.com/Task\022Wpro" - + "jects/{project}/locations/{location}/job" - + "s/{job}/taskGroups/{task_group}/tasks/{t" - + "ask}\"\236\003\n\013Environment\022I\n\tvariables\030\001 \003(\0132" - + "6.google.cloud.batch.v1alpha.Environment" - + ".VariablesEntry\022V\n\020secret_variables\030\002 \003(" - + "\0132<.google.cloud.batch.v1alpha.Environme" - + "nt.SecretVariablesEntry\022N\n\023encrypted_var" - + "iables\030\003 \001(\01321.google.cloud.batch.v1alph" - + "a.Environment.KMSEnvMap\0322\n\tKMSEnvMap\022\020\n\010" - + "key_name\030\001 \001(\t\022\023\n\013cipher_text\030\002 \001(\t\0320\n\016V" - + "ariablesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" - + "\t:\0028\001\0326\n\024SecretVariablesEntry\022\013\n\003key\030\001 \001" - + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\303\001\n\036com.google.clo" - + "ud.batch.v1alphaB\tTaskProtoP\001Z4cloud.goo" - + "gle.com/go/batch/apiv1alpha/batchpb;batc" - + "hpb\242\002\003GCB\252\002\032Google.Cloud.Batch.V1Alpha\312\002" - + "\032Google\\Cloud\\Batch\\V1alpha\352\002\035Google::Cl" - + "oud::Batch::V1alphab\006proto3" + + "atch.v1alpha.TaskExecution\022@\n\ntask_state" + + "\030\005 \001(\0162,.google.cloud.batch.v1alpha.Task" + + "Status.State\"\"\n\rTaskExecution\022\021\n\texit_co" + + "de\030\001 \001(\005\"\263\002\n\nTaskStatus\022;\n\005state\030\001 \001(\0162," + + ".google.cloud.batch.v1alpha.TaskStatus.S" + + "tate\022>\n\rstatus_events\030\002 \003(\0132\'.google.clo" + + "ud.batch.v1alpha.StatusEvent\022E\n\016resource" + + "_usage\030\003 \001(\0132-.google.cloud.batch.v1alph" + + "a.TaskResourceUsage\"a\n\005State\022\025\n\021STATE_UN" + + "SPECIFIED\020\000\022\013\n\007PENDING\020\001\022\014\n\010ASSIGNED\020\002\022\013" + + "\n\007RUNNING\020\003\022\n\n\006FAILED\020\004\022\r\n\tSUCCEEDED\020\005\"\'" + + "\n\021TaskResourceUsage\022\022\n\ncore_hours\030\001 \001(\001\"" + + "\367\005\n\010Runnable\022C\n\tcontainer\030\001 \001(\0132..google" + + ".cloud.batch.v1alpha.Runnable.ContainerH" + + "\000\022=\n\006script\030\002 \001(\0132+.google.cloud.batch.v" + + "1alpha.Runnable.ScriptH\000\022?\n\007barrier\030\006 \001(" + + "\0132,.google.cloud.batch.v1alpha.Runnable." + + "BarrierH\000\022\032\n\022ignore_exit_status\030\003 \001(\010\022\022\n" + + "\nbackground\030\004 \001(\010\022\022\n\nalways_run\030\005 \001(\010\022<\n" + + "\013environment\030\007 \001(\0132\'.google.cloud.batch." + + "v1alpha.Environment\022*\n\007timeout\030\010 \001(\0132\031.g" + + "oogle.protobuf.Duration\022@\n\006labels\030\t \003(\0132" + + "0.google.cloud.batch.v1alpha.Runnable.La" + + "belsEntry\032\252\001\n\tContainer\022\021\n\timage_uri\030\001 \001" + + "(\t\022\020\n\010commands\030\002 \003(\t\022\022\n\nentrypoint\030\003 \001(\t" + + "\022\017\n\007volumes\030\007 \003(\t\022\017\n\007options\030\010 \001(\t\022\036\n\026bl" + + "ock_external_network\030\t \001(\010\022\020\n\010username\030\n" + + " \001(\t\022\020\n\010password\030\013 \001(\t\0323\n\006Script\022\016\n\004path" + + "\030\001 \001(\tH\000\022\016\n\004text\030\002 \001(\tH\000B\t\n\007command\032\027\n\007B" + + "arrier\022\014\n\004name\030\001 \001(\t\032-\n\013LabelsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\014\n\nexecutabl" + + "e\"\233\004\n\010TaskSpec\0227\n\trunnables\030\010 \003(\0132$.goog" + + "le.cloud.batch.v1alpha.Runnable\022E\n\020compu" + + "te_resource\030\003 \001(\0132+.google.cloud.batch.v" + + "1alpha.ComputeResource\0223\n\020max_run_durati" + + "on\030\004 \001(\0132\031.google.protobuf.Duration\022\027\n\017m" + + "ax_retry_count\030\005 \001(\005\022G\n\022lifecycle_polici" + + "es\030\t \003(\0132+.google.cloud.batch.v1alpha.Li" + + "fecyclePolicy\022P\n\014environments\030\006 \003(\01326.go" + + "ogle.cloud.batch.v1alpha.TaskSpec.Enviro" + + "nmentsEntryB\002\030\001\0223\n\007volumes\030\007 \003(\0132\".googl" + + "e.cloud.batch.v1alpha.Volume\022<\n\013environm" + + "ent\030\n \001(\0132\'.google.cloud.batch.v1alpha.E" + + "nvironment\0323\n\021EnvironmentsEntry\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\224\002\n\017LifecyclePol" + + "icy\022B\n\006action\030\001 \001(\01622.google.cloud.batch" + + ".v1alpha.LifecyclePolicy.Action\022U\n\020actio" + + "n_condition\030\002 \001(\0132;.google.cloud.batch.v" + + "1alpha.LifecyclePolicy.ActionCondition\032%" + + "\n\017ActionCondition\022\022\n\nexit_codes\030\001 \003(\005\"?\n" + + "\006Action\022\026\n\022ACTION_UNSPECIFIED\020\000\022\016\n\nRETRY" + + "_TASK\020\001\022\r\n\tFAIL_TASK\020\002\"\305\001\n\004Task\022\014\n\004name\030" + + "\001 \001(\t\0226\n\006status\030\002 \001(\0132&.google.cloud.bat" + + "ch.v1alpha.TaskStatus:w\352At\n\031batch.google" + + "apis.com/Task\022Wprojects/{project}/locati" + + "ons/{location}/jobs/{job}/taskGroups/{ta" + + "sk_group}/tasks/{task}\"\236\003\n\013Environment\022I" + + "\n\tvariables\030\001 \003(\01326.google.cloud.batch.v" + + "1alpha.Environment.VariablesEntry\022V\n\020sec" + + "ret_variables\030\002 \003(\0132<.google.cloud.batch" + + ".v1alpha.Environment.SecretVariablesEntr" + + "y\022N\n\023encrypted_variables\030\003 \001(\01321.google." + + "cloud.batch.v1alpha.Environment.KMSEnvMa" + + "p\0322\n\tKMSEnvMap\022\020\n\010key_name\030\001 \001(\t\022\023\n\013ciph" + + "er_text\030\002 \001(\t\0320\n\016VariablesEntry\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0326\n\024SecretVariabl" + + "esEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B" + + "\303\001\n\036com.google.cloud.batch.v1alphaB\tTask" + + "ProtoP\001Z4cloud.google.com/go/batch/apiv1" + + "alpha/batchpb;batchpb\242\002\003GCB\252\002\032Google.Clo" + + "ud.Batch.V1Alpha\312\002\032Google\\Cloud\\Batch\\V1" + + "alpha\352\002\035Google::Cloud::Batch::V1alphab\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -211,7 +220,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_StatusEvent_descriptor, new java.lang.String[] { - "Type", "Description", "EventTime", "TaskExecution", + "Type", "Description", "EventTime", "TaskExecution", "TaskState", }); internal_static_google_cloud_batch_v1alpha_TaskExecution_descriptor = getDescriptor().getMessageTypes().get(2); @@ -227,10 +236,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_TaskStatus_descriptor, new java.lang.String[] { - "State", "StatusEvents", + "State", "StatusEvents", "ResourceUsage", }); - internal_static_google_cloud_batch_v1alpha_Runnable_descriptor = + internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_descriptor, + new java.lang.String[] { + "CoreHours", + }); + internal_static_google_cloud_batch_v1alpha_Runnable_descriptor = + getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_batch_v1alpha_Runnable_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_Runnable_descriptor, @@ -286,7 +303,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_batch_v1alpha_TaskSpec_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_google_cloud_batch_v1alpha_TaskSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_TaskSpec_descriptor, @@ -309,7 +326,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_descriptor, @@ -327,7 +344,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExitCodes", }); internal_static_google_cloud_batch_v1alpha_Task_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_batch_v1alpha_Task_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_Task_descriptor, @@ -335,7 +352,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Status", }); internal_static_google_cloud_batch_v1alpha_Environment_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_batch_v1alpha_Environment_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_batch_v1alpha_Environment_descriptor, diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsage.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsage.java new file mode 100644 index 000000000000..1a9b24734b2d --- /dev/null +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsage.java @@ -0,0 +1,547 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/batch/v1alpha/task.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * TaskResourceUsage describes the resource usage of the task.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.TaskResourceUsage} + */ +public final class TaskResourceUsage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.TaskResourceUsage) + TaskResourceUsageOrBuilder { + private static final long serialVersionUID = 0L; + // Use TaskResourceUsage.newBuilder() to construct. + private TaskResourceUsage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TaskResourceUsage() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TaskResourceUsage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.TaskResourceUsage.class, + com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder.class); + } + + public static final int CORE_HOURS_FIELD_NUMBER = 1; + private double coreHours_ = 0D; + /** + * + * + *
+   * The CPU core hours the task consumes based on task requirement and run
+   * time.
+   * 
+ * + * double core_hours = 1; + * + * @return The coreHours. + */ + @java.lang.Override + public double getCoreHours() { + return coreHours_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(coreHours_) != 0) { + output.writeDouble(1, coreHours_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(coreHours_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, coreHours_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.batch.v1alpha.TaskResourceUsage)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.TaskResourceUsage other = + (com.google.cloud.batch.v1alpha.TaskResourceUsage) obj; + + if (java.lang.Double.doubleToLongBits(getCoreHours()) + != java.lang.Double.doubleToLongBits(other.getCoreHours())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CORE_HOURS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCoreHours())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.batch.v1alpha.TaskResourceUsage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * TaskResourceUsage describes the resource usage of the task.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.TaskResourceUsage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.TaskResourceUsage) + com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.TaskResourceUsage.class, + com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.TaskResourceUsage.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + coreHours_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_TaskResourceUsage_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskResourceUsage getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskResourceUsage build() { + com.google.cloud.batch.v1alpha.TaskResourceUsage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskResourceUsage buildPartial() { + com.google.cloud.batch.v1alpha.TaskResourceUsage result = + new com.google.cloud.batch.v1alpha.TaskResourceUsage(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.batch.v1alpha.TaskResourceUsage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.coreHours_ = coreHours_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.batch.v1alpha.TaskResourceUsage) { + return mergeFrom((com.google.cloud.batch.v1alpha.TaskResourceUsage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.TaskResourceUsage other) { + if (other == com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance()) + return this; + if (other.getCoreHours() != 0D) { + setCoreHours(other.getCoreHours()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + coreHours_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double coreHours_; + /** + * + * + *
+     * The CPU core hours the task consumes based on task requirement and run
+     * time.
+     * 
+ * + * double core_hours = 1; + * + * @return The coreHours. + */ + @java.lang.Override + public double getCoreHours() { + return coreHours_; + } + /** + * + * + *
+     * The CPU core hours the task consumes based on task requirement and run
+     * time.
+     * 
+ * + * double core_hours = 1; + * + * @param value The coreHours to set. + * @return This builder for chaining. + */ + public Builder setCoreHours(double value) { + + coreHours_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The CPU core hours the task consumes based on task requirement and run
+     * time.
+     * 
+ * + * double core_hours = 1; + * + * @return This builder for chaining. + */ + public Builder clearCoreHours() { + bitField0_ = (bitField0_ & ~0x00000001); + coreHours_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.batch.v1alpha.TaskResourceUsage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.TaskResourceUsage) + private static final com.google.cloud.batch.v1alpha.TaskResourceUsage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.TaskResourceUsage(); + } + + public static com.google.cloud.batch.v1alpha.TaskResourceUsage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskResourceUsage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskResourceUsage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsageOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsageOrBuilder.java new file mode 100644 index 000000000000..9857d2d23afd --- /dev/null +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskResourceUsageOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/batch/v1alpha/task.proto + +package com.google.cloud.batch.v1alpha; + +public interface TaskResourceUsageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.TaskResourceUsage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The CPU core hours the task consumes based on task requirement and run
+   * time.
+   * 
+ * + * double core_hours = 1; + * + * @return The coreHours. + */ + double getCoreHours(); +} diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java index 609f41afa039..193ed97bc2be 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java @@ -323,13 +323,12 @@ public int getMaxRetryCount() { * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -344,13 +343,12 @@ public java.util.List getLifecyc * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -366,13 +364,12 @@ public java.util.List getLifecyc * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -387,13 +384,12 @@ public int getLifecyclePoliciesCount() { * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -408,13 +404,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicy getLifecyclePolicies(int i * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -2304,13 +2299,12 @@ private void ensureLifecyclePoliciesIsMutable() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2329,13 +2323,12 @@ private void ensureLifecyclePoliciesIsMutable() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2353,13 +2346,12 @@ public int getLifecyclePoliciesCount() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2377,13 +2369,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicy getLifecyclePolicies(int i * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2408,13 +2399,12 @@ public Builder setLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2436,13 +2426,12 @@ public Builder setLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2466,13 +2455,12 @@ public Builder addLifecyclePolicies(com.google.cloud.batch.v1alpha.LifecyclePoli * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2497,13 +2485,12 @@ public Builder addLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2525,13 +2512,12 @@ public Builder addLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2553,13 +2539,12 @@ public Builder addLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2581,13 +2566,12 @@ public Builder addAllLifecyclePolicies( * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2608,13 +2592,12 @@ public Builder clearLifecyclePolicies() { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2635,13 +2618,12 @@ public Builder removeLifecyclePolicies(int index) { * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2656,13 +2638,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicy.Builder getLifecyclePolici * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2681,13 +2662,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicyOrBuilder getLifecyclePolic * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2706,13 +2686,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicyOrBuilder getLifecyclePolic * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2727,13 +2706,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicy.Builder addLifecyclePolici * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* @@ -2749,13 +2727,12 @@ public com.google.cloud.batch.v1alpha.LifecyclePolicy.Builder addLifecyclePolici * *
      * Lifecycle management schema when any task in a task group is failed.
-     * The valid size of lifecycle policies are [0, 10].
-     * For each lifecycle policy, when the condition is met,
-     * the action in that policy will execute.
-     * If there are multiple policies that the task execution result matches,
-     * we use the action from the first matched policy. If task execution result
-     * does not meet with any of the defined lifecycle policy, we consider it as
-     * the default policy. Default policy means if the exit code is 0, exit task.
+     * Currently we only support one lifecycle policy.
+     * When the lifecycle policy condition is met,
+     * the action in the policy will execute.
+     * If task execution result does not meet with the defined lifecycle
+     * policy, we consider it as the default policy.
+     * Default policy means if the exit code is 0, exit task.
      * If task ends with non-zero exit code, retry the task with max_retry_count.
      * 
* diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java index a26581fc5824..c90588909a3b 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java @@ -208,13 +208,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -226,13 +225,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -244,13 +242,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -262,13 +259,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* @@ -281,13 +277,12 @@ public interface TaskSpecOrBuilder * *
    * Lifecycle management schema when any task in a task group is failed.
-   * The valid size of lifecycle policies are [0, 10].
-   * For each lifecycle policy, when the condition is met,
-   * the action in that policy will execute.
-   * If there are multiple policies that the task execution result matches,
-   * we use the action from the first matched policy. If task execution result
-   * does not meet with any of the defined lifecycle policy, we consider it as
-   * the default policy. Default policy means if the exit code is 0, exit task.
+   * Currently we only support one lifecycle policy.
+   * When the lifecycle policy condition is met,
+   * the action in the policy will execute.
+   * If task execution result does not meet with the defined lifecycle
+   * policy, we consider it as the default policy.
+   * Default policy means if the exit code is 0, exit task.
    * If task ends with non-zero exit code, retry the task with max_retry_count.
    * 
* diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatus.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatus.java index 857f3e0f5161..0e1978ddd7a5 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatus.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatus.java @@ -397,6 +397,56 @@ public com.google.cloud.batch.v1alpha.StatusEventOrBuilder getStatusEventsOrBuil return statusEvents_.get(index); } + public static final int RESOURCE_USAGE_FIELD_NUMBER = 3; + private com.google.cloud.batch.v1alpha.TaskResourceUsage resourceUsage_; + /** + * + * + *
+   * The resource usage of the task.
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + * + * @return Whether the resourceUsage field is set. + */ + @java.lang.Override + public boolean hasResourceUsage() { + return resourceUsage_ != null; + } + /** + * + * + *
+   * The resource usage of the task.
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + * + * @return The resourceUsage. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskResourceUsage getResourceUsage() { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance() + : resourceUsage_; + } + /** + * + * + *
+   * The resource usage of the task.
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder getResourceUsageOrBuilder() { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance() + : resourceUsage_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -417,6 +467,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < statusEvents_.size(); i++) { output.writeMessage(2, statusEvents_.get(i)); } + if (resourceUsage_ != null) { + output.writeMessage(3, getResourceUsage()); + } getUnknownFields().writeTo(output); } @@ -432,6 +485,9 @@ public int getSerializedSize() { for (int i = 0; i < statusEvents_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, statusEvents_.get(i)); } + if (resourceUsage_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResourceUsage()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -450,6 +506,10 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (!getStatusEventsList().equals(other.getStatusEventsList())) return false; + if (hasResourceUsage() != other.hasResourceUsage()) return false; + if (hasResourceUsage()) { + if (!getResourceUsage().equals(other.getResourceUsage())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -467,6 +527,10 @@ public int hashCode() { hash = (37 * hash) + STATUS_EVENTS_FIELD_NUMBER; hash = (53 * hash) + getStatusEventsList().hashCode(); } + if (hasResourceUsage()) { + hash = (37 * hash) + RESOURCE_USAGE_FIELD_NUMBER; + hash = (53 * hash) + getResourceUsage().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -614,6 +678,11 @@ public Builder clear() { statusEventsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); + resourceUsage_ = null; + if (resourceUsageBuilder_ != null) { + resourceUsageBuilder_.dispose(); + resourceUsageBuilder_ = null; + } return this; } @@ -666,6 +735,10 @@ private void buildPartial0(com.google.cloud.batch.v1alpha.TaskStatus result) { if (((from_bitField0_ & 0x00000001) != 0)) { result.state_ = state_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceUsage_ = + resourceUsageBuilder_ == null ? resourceUsage_ : resourceUsageBuilder_.build(); + } } @java.lang.Override @@ -743,6 +816,9 @@ public Builder mergeFrom(com.google.cloud.batch.v1alpha.TaskStatus other) { } } } + if (other.hasResourceUsage()) { + mergeResourceUsage(other.getResourceUsage()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -788,6 +864,12 @@ public Builder mergeFrom( } break; } // case 18 + case 26: + { + input.readMessage(getResourceUsageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1248,6 +1330,191 @@ public com.google.cloud.batch.v1alpha.StatusEvent.Builder addStatusEventsBuilder return statusEventsBuilder_; } + private com.google.cloud.batch.v1alpha.TaskResourceUsage resourceUsage_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.TaskResourceUsage, + com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder, + com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder> + resourceUsageBuilder_; + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + * + * @return Whether the resourceUsage field is set. + */ + public boolean hasResourceUsage() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + * + * @return The resourceUsage. + */ + public com.google.cloud.batch.v1alpha.TaskResourceUsage getResourceUsage() { + if (resourceUsageBuilder_ == null) { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance() + : resourceUsage_; + } else { + return resourceUsageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + public Builder setResourceUsage(com.google.cloud.batch.v1alpha.TaskResourceUsage value) { + if (resourceUsageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourceUsage_ = value; + } else { + resourceUsageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + public Builder setResourceUsage( + com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder builderForValue) { + if (resourceUsageBuilder_ == null) { + resourceUsage_ = builderForValue.build(); + } else { + resourceUsageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + public Builder mergeResourceUsage(com.google.cloud.batch.v1alpha.TaskResourceUsage value) { + if (resourceUsageBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && resourceUsage_ != null + && resourceUsage_ + != com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance()) { + getResourceUsageBuilder().mergeFrom(value); + } else { + resourceUsage_ = value; + } + } else { + resourceUsageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + public Builder clearResourceUsage() { + bitField0_ = (bitField0_ & ~0x00000004); + resourceUsage_ = null; + if (resourceUsageBuilder_ != null) { + resourceUsageBuilder_.dispose(); + resourceUsageBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + public com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder getResourceUsageBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getResourceUsageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + public com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder getResourceUsageOrBuilder() { + if (resourceUsageBuilder_ != null) { + return resourceUsageBuilder_.getMessageOrBuilder(); + } else { + return resourceUsage_ == null + ? com.google.cloud.batch.v1alpha.TaskResourceUsage.getDefaultInstance() + : resourceUsage_; + } + } + /** + * + * + *
+     * The resource usage of the task.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.TaskResourceUsage, + com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder, + com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder> + getResourceUsageFieldBuilder() { + if (resourceUsageBuilder_ == null) { + resourceUsageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.TaskResourceUsage, + com.google.cloud.batch.v1alpha.TaskResourceUsage.Builder, + com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder>( + getResourceUsage(), getParentForChildren(), isClean()); + resourceUsage_ = null; + } + return resourceUsageBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatusOrBuilder.java b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatusOrBuilder.java index 92a73e270eda..f71c5a27e5a4 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatusOrBuilder.java +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatusOrBuilder.java @@ -99,4 +99,39 @@ public interface TaskStatusOrBuilder * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; */ com.google.cloud.batch.v1alpha.StatusEventOrBuilder getStatusEventsOrBuilder(int index); + + /** + * + * + *
+   * The resource usage of the task.
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + * + * @return Whether the resourceUsage field is set. + */ + boolean hasResourceUsage(); + /** + * + * + *
+   * The resource usage of the task.
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + * + * @return The resourceUsage. + */ + com.google.cloud.batch.v1alpha.TaskResourceUsage getResourceUsage(); + /** + * + * + *
+   * The resource usage of the task.
+   * 
+ * + * .google.cloud.batch.v1alpha.TaskResourceUsage resource_usage = 3; + */ + com.google.cloud.batch.v1alpha.TaskResourceUsageOrBuilder getResourceUsageOrBuilder(); } diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/batch.proto b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/batch.proto index c92e60e18d9e..d26b4c9e5542 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/batch.proto +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/batch.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/cloud/batch/v1alpha/job.proto"; import "google/cloud/batch/v1alpha/task.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; @@ -124,8 +125,8 @@ message CreateJobRequest { // ignore the request if it has already been completed. The server will // guarantee that for at least 60 minutes since the first request. // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request // ID, the server can check if original operation with the same request ID // was received, and if so, will ignore the second request. This prevents // clients from accidentally creating duplicate commitments. @@ -157,8 +158,8 @@ message DeleteJobRequest { // ignore the request if it has already been completed. The server will // guarantee that for at least 60 minutes after the first request. // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request // ID, the server can check if original operation with the same request ID // was received, and if so, will ignore the second request. This prevents // clients from accidentally creating duplicate commitments. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/job.proto b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/job.proto index d8fc803e8525..8edd462eadde 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/job.proto +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/job.proto @@ -57,7 +57,8 @@ message Job { string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Priority of the Job. - // The valid value range is [0, 100). + // The valid value range is [0, 100). Default value is 0. + // Higher value indicates higher priority. // A job with higher priority value is more likely to run earlier if all other // requirements are satisfied. int64 priority = 3; @@ -227,6 +228,15 @@ message JobStatus { // The duration of time that the Job spent in status RUNNING. google.protobuf.Duration run_duration = 5; + + // The resource usage of the job. + ResourceUsage resource_usage = 6; +} + +// ResourceUsage describes the resource usage of the job. +message ResourceUsage { + // The CPU core hours that the job consumes. + double core_hours = 1; } // Notification configurations. diff --git a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto index d43795bce8ea..3896949746f0 100644 --- a/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto +++ b/java-batch/proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto @@ -60,6 +60,9 @@ message StatusEvent { // Task Execution TaskExecution task_execution = 4; + + // Task State + TaskStatus.State task_state = 5; } // This Task Execution field includes detail information for @@ -98,6 +101,16 @@ message TaskStatus { // Detailed info about why the state is reached. repeated StatusEvent status_events = 2; + + // The resource usage of the task. + TaskResourceUsage resource_usage = 3; +} + +// TaskResourceUsage describes the resource usage of the task. +message TaskResourceUsage { + // The CPU core hours the task consumes based on task requirement and run + // time. + double core_hours = 1; } // Runnable describes instructions for executing a specific script or container @@ -145,9 +158,23 @@ message Runnable { message Script { oneof command { // Script file path on the host VM. + // + // To specify an interpreter, please add a `#!`(also known as + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + // first line of the file.(For example, to execute the script using bash, + // `#!/bin/bash` should be the first line of the file. To execute the + // script using`Python3`, `#!/usr/bin/env python3` should be the first + // line of the file.) Otherwise, the file will by default be excuted by + // `/bin/sh`. string path = 1; // Shell script text. + // + // To specify an interpreter, please add a `#!\n` at the + // beginning of the text.(For example, to execute the script using bash, + // `#!/bin/bash\n` should be added. To execute the script using`Python3`, + // `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + // by default be excuted by `/bin/sh`. string text = 2; } } @@ -228,13 +255,12 @@ message TaskSpec { int32 max_retry_count = 5; // Lifecycle management schema when any task in a task group is failed. - // The valid size of lifecycle policies are [0, 10]. - // For each lifecycle policy, when the condition is met, - // the action in that policy will execute. - // If there are multiple policies that the task execution result matches, - // we use the action from the first matched policy. If task execution result - // does not meet with any of the defined lifecycle policy, we consider it as - // the default policy. Default policy means if the exit code is 0, exit task. + // Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, + // the action in the policy will execute. + // If task execution result does not meet with the defined lifecycle + // policy, we consider it as the default policy. + // Default policy means if the exit code is 0, exit task. // If task ends with non-zero exit code, retry the task with max_retry_count. repeated LifecyclePolicy lifecycle_policies = 9; @@ -273,6 +299,10 @@ message LifecyclePolicy { } // Action to execute when ActionCondition is true. + // When RETRY_TASK is specified, we will retry failed tasks + // if we notice any exit code match and fail tasks if no match is found. + // Likewise, when FAIL_TASK is specified, we will fail tasks + // if we notice any exit code match and retry tasks if no match is found. Action action = 1; // Conditions that decide why a task failure is dealt with a specific action. diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/AsyncGetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/AsyncGetIamPolicy.java deleted file mode 100644 index c1f2792ea040..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/AsyncGetIamPolicy.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.batch.v1.samples; - -// [START batch_v1_generated_BatchService_GetIamPolicy_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.batch.v1.BatchServiceClient; -import com.google.cloud.batch.v1.JobName; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; - -public class AsyncGetIamPolicy { - - public static void main(String[] args) throws Exception { - asyncGetIamPolicy(); - } - - public static void asyncGetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - ApiFuture future = batchServiceClient.getIamPolicyCallable().futureCall(request); - // Do something. - Policy response = future.get(); - } - } -} -// [END batch_v1_generated_BatchService_GetIamPolicy_async] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/SyncGetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/SyncGetIamPolicy.java deleted file mode 100644 index 1e158f7f33e9..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/getiampolicy/SyncGetIamPolicy.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.batch.v1.samples; - -// [START batch_v1_generated_BatchService_GetIamPolicy_sync] -import com.google.cloud.batch.v1.BatchServiceClient; -import com.google.cloud.batch.v1.JobName; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; - -public class SyncGetIamPolicy { - - public static void main(String[] args) throws Exception { - syncGetIamPolicy(); - } - - public static void syncGetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - Policy response = batchServiceClient.getIamPolicy(request); - } - } -} -// [END batch_v1_generated_BatchService_GetIamPolicy_sync] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/AsyncSetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/AsyncSetIamPolicy.java deleted file mode 100644 index ad5dd08c4aea..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/AsyncSetIamPolicy.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.batch.v1.samples; - -// [START batch_v1_generated_BatchService_SetIamPolicy_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.batch.v1.BatchServiceClient; -import com.google.cloud.batch.v1.JobName; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.protobuf.FieldMask; - -public class AsyncSetIamPolicy { - - public static void main(String[] args) throws Exception { - asyncSetIamPolicy(); - } - - public static void asyncSetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = batchServiceClient.setIamPolicyCallable().futureCall(request); - // Do something. - Policy response = future.get(); - } - } -} -// [END batch_v1_generated_BatchService_SetIamPolicy_async] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/SyncSetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/SyncSetIamPolicy.java deleted file mode 100644 index f8673eb83c13..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/setiampolicy/SyncSetIamPolicy.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.batch.v1.samples; - -// [START batch_v1_generated_BatchService_SetIamPolicy_sync] -import com.google.cloud.batch.v1.BatchServiceClient; -import com.google.cloud.batch.v1.JobName; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.protobuf.FieldMask; - -public class SyncSetIamPolicy { - - public static void main(String[] args) throws Exception { - syncSetIamPolicy(); - } - - public static void syncSetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - Policy response = batchServiceClient.setIamPolicy(request); - } - } -} -// [END batch_v1_generated_BatchService_SetIamPolicy_sync] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/AsyncTestIamPermissions.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/AsyncTestIamPermissions.java deleted file mode 100644 index 984972a0f1f6..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/AsyncTestIamPermissions.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.batch.v1.samples; - -// [START batch_v1_generated_BatchService_TestIamPermissions_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.batch.v1.BatchServiceClient; -import com.google.cloud.batch.v1.JobName; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import java.util.ArrayList; - -public class AsyncTestIamPermissions { - - public static void main(String[] args) throws Exception { - asyncTestIamPermissions(); - } - - public static void asyncTestIamPermissions() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - ApiFuture future = - batchServiceClient.testIamPermissionsCallable().futureCall(request); - // Do something. - TestIamPermissionsResponse response = future.get(); - } - } -} -// [END batch_v1_generated_BatchService_TestIamPermissions_async] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/SyncTestIamPermissions.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/SyncTestIamPermissions.java deleted file mode 100644 index 77bcc803be50..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1/batchservice/testiampermissions/SyncTestIamPermissions.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.batch.v1.samples; - -// [START batch_v1_generated_BatchService_TestIamPermissions_sync] -import com.google.cloud.batch.v1.BatchServiceClient; -import com.google.cloud.batch.v1.JobName; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import java.util.ArrayList; - -public class SyncTestIamPermissions { - - public static void main(String[] args) throws Exception { - syncTestIamPermissions(); - } - - public static void syncTestIamPermissions() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - TestIamPermissionsResponse response = batchServiceClient.testIamPermissions(request); - } - } -} -// [END batch_v1_generated_BatchService_TestIamPermissions_sync] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/AsyncGetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/AsyncGetIamPolicy.java deleted file mode 100644 index 44bb80a3d09b..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/AsyncGetIamPolicy.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.batch.v1alpha.samples; - -// [START batch_v1alpha_generated_BatchService_GetIamPolicy_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.batch.v1alpha.BatchServiceClient; -import com.google.cloud.batch.v1alpha.JobName; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; - -public class AsyncGetIamPolicy { - - public static void main(String[] args) throws Exception { - asyncGetIamPolicy(); - } - - public static void asyncGetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - ApiFuture future = batchServiceClient.getIamPolicyCallable().futureCall(request); - // Do something. - Policy response = future.get(); - } - } -} -// [END batch_v1alpha_generated_BatchService_GetIamPolicy_async] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/SyncGetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/SyncGetIamPolicy.java deleted file mode 100644 index ebad602122f9..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/getiampolicy/SyncGetIamPolicy.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.batch.v1alpha.samples; - -// [START batch_v1alpha_generated_BatchService_GetIamPolicy_sync] -import com.google.cloud.batch.v1alpha.BatchServiceClient; -import com.google.cloud.batch.v1alpha.JobName; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; - -public class SyncGetIamPolicy { - - public static void main(String[] args) throws Exception { - syncGetIamPolicy(); - } - - public static void syncGetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - Policy response = batchServiceClient.getIamPolicy(request); - } - } -} -// [END batch_v1alpha_generated_BatchService_GetIamPolicy_sync] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/AsyncSetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/AsyncSetIamPolicy.java deleted file mode 100644 index 55089baf27e1..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/AsyncSetIamPolicy.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.batch.v1alpha.samples; - -// [START batch_v1alpha_generated_BatchService_SetIamPolicy_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.batch.v1alpha.BatchServiceClient; -import com.google.cloud.batch.v1alpha.JobName; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.protobuf.FieldMask; - -public class AsyncSetIamPolicy { - - public static void main(String[] args) throws Exception { - asyncSetIamPolicy(); - } - - public static void asyncSetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = batchServiceClient.setIamPolicyCallable().futureCall(request); - // Do something. - Policy response = future.get(); - } - } -} -// [END batch_v1alpha_generated_BatchService_SetIamPolicy_async] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/SyncSetIamPolicy.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/SyncSetIamPolicy.java deleted file mode 100644 index deedbe8de37a..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/setiampolicy/SyncSetIamPolicy.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.batch.v1alpha.samples; - -// [START batch_v1alpha_generated_BatchService_SetIamPolicy_sync] -import com.google.cloud.batch.v1alpha.BatchServiceClient; -import com.google.cloud.batch.v1alpha.JobName; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.protobuf.FieldMask; - -public class SyncSetIamPolicy { - - public static void main(String[] args) throws Exception { - syncSetIamPolicy(); - } - - public static void syncSetIamPolicy() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - Policy response = batchServiceClient.setIamPolicy(request); - } - } -} -// [END batch_v1alpha_generated_BatchService_SetIamPolicy_sync] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/AsyncTestIamPermissions.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/AsyncTestIamPermissions.java deleted file mode 100644 index 51732e02a309..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/AsyncTestIamPermissions.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.batch.v1alpha.samples; - -// [START batch_v1alpha_generated_BatchService_TestIamPermissions_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.batch.v1alpha.BatchServiceClient; -import com.google.cloud.batch.v1alpha.JobName; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import java.util.ArrayList; - -public class AsyncTestIamPermissions { - - public static void main(String[] args) throws Exception { - asyncTestIamPermissions(); - } - - public static void asyncTestIamPermissions() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - ApiFuture future = - batchServiceClient.testIamPermissionsCallable().futureCall(request); - // Do something. - TestIamPermissionsResponse response = future.get(); - } - } -} -// [END batch_v1alpha_generated_BatchService_TestIamPermissions_async] diff --git a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/SyncTestIamPermissions.java b/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/SyncTestIamPermissions.java deleted file mode 100644 index 9bece58963c7..000000000000 --- a/java-batch/samples/snippets/generated/com/google/cloud/batch/v1alpha/batchservice/testiampermissions/SyncTestIamPermissions.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.batch.v1alpha.samples; - -// [START batch_v1alpha_generated_BatchService_TestIamPermissions_sync] -import com.google.cloud.batch.v1alpha.BatchServiceClient; -import com.google.cloud.batch.v1alpha.JobName; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import java.util.ArrayList; - -public class SyncTestIamPermissions { - - public static void main(String[] args) throws Exception { - syncTestIamPermissions(); - } - - public static void syncTestIamPermissions() throws Exception { - // 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 (BatchServiceClient batchServiceClient = BatchServiceClient.create()) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - TestIamPermissionsResponse response = batchServiceClient.testIamPermissions(request); - } - } -} -// [END batch_v1alpha_generated_BatchService_TestIamPermissions_sync]