From ca7e9fa43e64d378edf2fd0917585ab33135fc81 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:58:14 +0000 Subject: [PATCH] feat: Enable REST transport for most of Java and Go clients (#6) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 456641589 Source-Link: https://github.com/googleapis/googleapis/commit/8a251f5225b789b2383207ffd978f6aa3d77fcf7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9 feat: add client library BUILD rules, API proto option, v1alpha service config file and service YAML file PiperOrigin-RevId: 456598021 Source-Link: https://github.com/googleapis/googleapis/commit/bf12acd0d54ea61ea15ffaa3078f3497f35d6751 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e0e994c3d7c01652ae59870da7b7ece1a9532c5b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTBlOTk0YzNkN2MwMTY1MmFlNTk4NzBkYTdiN2VjZTFhOTUzMmM1YiJ9 --- google-cloud-batch-bom/pom.xml | 10 + google-cloud-batch/pom.xml | 25 + .../cloud/batch/v1/BatchServiceClient.java | 63 +- .../cloud/batch/v1/BatchServiceSettings.java | 23 +- .../google/cloud/batch/v1/package-info.java | 4 +- .../cloud/batch/v1/stub/BatchServiceStub.java | 6 +- .../v1/stub/BatchServiceStubSettings.java | 53 +- .../HttpJsonBatchServiceCallableFactory.java | 105 + .../v1/stub/HttpJsonBatchServiceStub.java | 501 + .../batch/v1alpha/BatchServiceClient.java | 1028 ++ .../batch/v1alpha/BatchServiceSettings.java | 256 + .../cloud/batch/v1alpha/gapic_metadata.json | 36 + .../cloud/batch/v1alpha/package-info.java | 41 + .../batch/v1alpha/stub/BatchServiceStub.java | 95 + .../stub/BatchServiceStubSettings.java | 582 + .../stub/GrpcBatchServiceCallableFactory.java | 115 + .../v1alpha/stub/GrpcBatchServiceStub.java | 344 + .../v1/BatchServiceClientHttpJsonTest.java | 602 + .../batch/v1alpha/BatchServiceClientTest.java | 557 + .../cloud/batch/v1alpha/MockBatchService.java | 59 + .../batch/v1alpha/MockBatchServiceImpl.java | 182 + .../cloud/batch/v1/BatchServiceGrpc.java | 18 +- grpc-google-cloud-batch-v1alpha/pom.xml | 69 + .../cloud/batch/v1alpha/BatchServiceGrpc.java | 909 + pom.xml | 12 + .../cloud/batch/v1/AllocationPolicy.java | 178 +- .../com/google/cloud/batch/v1/BatchProto.java | 10 +- .../cloud/batch/v1/CreateJobRequest.java | 14 +- .../batch/v1/CreateJobRequestOrBuilder.java | 4 +- .../java/com/google/cloud/batch/v1/Job.java | 199 +- .../cloud/batch/v1/JobNotification.java | 120 +- .../batch/v1/JobNotificationOrBuilder.java | 31 +- .../google/cloud/batch/v1/JobOrBuilder.java | 47 +- .../com/google/cloud/batch/v1/JobProto.java | 202 +- .../com/google/cloud/batch/v1/JobStatus.java | 66 +- .../cloud/batch/v1/JobStatusOrBuilder.java | 15 +- .../cloud/batch/v1/ListTasksRequest.java | 28 +- .../batch/v1/ListTasksRequestOrBuilder.java | 8 +- .../cloud/batch/v1/ListTasksResponse.java | 4 +- .../com/google/cloud/batch/v1/LogsPolicy.java | 18 +- .../cloud/batch/v1/LogsPolicyOrBuilder.java | 4 +- .../com/google/cloud/batch/v1/Runnable.java | 24 +- .../com/google/cloud/batch/v1/TaskGroup.java | 30 +- .../cloud/batch/v1/TaskGroupOrBuilder.java | 8 +- .../com/google/cloud/batch/v1/TaskProto.java | 10 +- .../com/google/cloud/batch/v1/TaskSpec.java | 46 +- .../cloud/batch/v1/TaskSpecOrBuilder.java | 10 +- .../google/cloud/batch/v1/VolumeProto.java | 10 +- .../proto/google/cloud/batch/v1/batch.proto | 15 +- .../proto/google/cloud/batch/v1/job.proto | 65 +- .../proto/google/cloud/batch/v1/task.proto | 7 +- .../proto/google/cloud/batch/v1/volume.proto | 3 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-batch-v1alpha/pom.xml | 42 + .../cloud/batch/v1alpha/AllocationPolicy.java | 14418 ++++++++++++++++ .../v1alpha/AllocationPolicyOrBuilder.java | 538 + .../cloud/batch/v1alpha/BatchProto.java | 260 + .../cloud/batch/v1alpha/ComputeResource.java | 820 + .../v1alpha/ComputeResourceOrBuilder.java | 78 + .../cloud/batch/v1alpha/CreateJobRequest.java | 1405 ++ .../v1alpha/CreateJobRequestOrBuilder.java | 173 + .../cloud/batch/v1alpha/DeleteJobRequest.java | 1065 ++ .../v1alpha/DeleteJobRequestOrBuilder.java | 120 + .../cloud/batch/v1alpha/Environment.java | 2256 +++ .../batch/v1alpha/EnvironmentOrBuilder.java | 191 + .../com/google/cloud/batch/v1alpha/GCS.java | 640 + .../cloud/batch/v1alpha/GCSOrBuilder.java | 52 + .../cloud/batch/v1alpha/GetJobRequest.java | 650 + .../batch/v1alpha/GetJobRequestOrBuilder.java | 54 + .../cloud/batch/v1alpha/GetTaskRequest.java | 650 + .../v1alpha/GetTaskRequestOrBuilder.java | 54 + .../com/google/cloud/batch/v1alpha/Job.java | 4984 ++++++ .../cloud/batch/v1alpha/JobDependency.java | 1211 ++ .../batch/v1alpha/JobDependencyOrBuilder.java | 148 + .../google/cloud/batch/v1alpha/JobName.java | 216 + .../cloud/batch/v1alpha/JobNotification.java | 2106 +++ .../v1alpha/JobNotificationOrBuilder.java | 96 + .../cloud/batch/v1alpha/JobOrBuilder.java | 632 + .../google/cloud/batch/v1alpha/JobProto.java | 567 + .../google/cloud/batch/v1alpha/JobStatus.java | 4368 +++++ .../batch/v1alpha/JobStatusOrBuilder.java | 209 + .../cloud/batch/v1alpha/LifecyclePolicy.java | 1851 ++ .../v1alpha/LifecyclePolicyOrBuilder.java | 86 + .../cloud/batch/v1alpha/ListJobsRequest.java | 1084 ++ .../v1alpha/ListJobsRequestOrBuilder.java | 113 + .../cloud/batch/v1alpha/ListJobsResponse.java | 1402 ++ .../v1alpha/ListJobsResponseOrBuilder.java | 152 + .../cloud/batch/v1alpha/ListTasksRequest.java | 1127 ++ .../v1alpha/ListTasksRequestOrBuilder.java | 125 + .../batch/v1alpha/ListTasksResponse.java | 1404 ++ .../v1alpha/ListTasksResponseOrBuilder.java | 152 + .../cloud/batch/v1alpha/LocationName.java | 192 + .../cloud/batch/v1alpha/LogsPolicy.java | 967 ++ .../batch/v1alpha/LogsPolicyOrBuilder.java | 79 + .../com/google/cloud/batch/v1alpha/NFS.java | 812 + .../cloud/batch/v1alpha/NFSOrBuilder.java | 75 + .../batch/v1alpha/OperationMetadata.java | 1849 ++ .../v1alpha/OperationMetadataOrBuilder.java | 217 + .../com/google/cloud/batch/v1alpha/PD.java | 926 + .../cloud/batch/v1alpha/PDOrBuilder.java | 94 + .../google/cloud/batch/v1alpha/Runnable.java | 6735 ++++++++ .../batch/v1alpha/RunnableOrBuilder.java | 312 + .../cloud/batch/v1alpha/ServiceAccount.java | 936 + .../v1alpha/ServiceAccountOrBuilder.java | 107 + .../cloud/batch/v1alpha/StatusEvent.java | 1361 ++ .../batch/v1alpha/StatusEventOrBuilder.java | 145 + .../com/google/cloud/batch/v1alpha/Task.java | 931 + .../cloud/batch/v1alpha/TaskExecution.java | 552 + .../batch/v1alpha/TaskExecutionOrBuilder.java | 39 + .../google/cloud/batch/v1alpha/TaskGroup.java | 3087 ++++ .../cloud/batch/v1alpha/TaskGroupName.java | 257 + .../batch/v1alpha/TaskGroupOrBuilder.java | 408 + .../google/cloud/batch/v1alpha/TaskName.java | 298 + .../cloud/batch/v1alpha/TaskOrBuilder.java | 91 + .../google/cloud/batch/v1alpha/TaskProto.java | 381 + .../google/cloud/batch/v1alpha/TaskSpec.java | 3600 ++++ .../batch/v1alpha/TaskSpecOrBuilder.java | 452 + .../cloud/batch/v1alpha/TaskStatus.java | 1325 ++ .../batch/v1alpha/TaskStatusOrBuilder.java | 102 + .../google/cloud/batch/v1alpha/Volume.java | 2259 +++ .../cloud/batch/v1alpha/VolumeOrBuilder.java | 280 + .../cloud/batch/v1alpha/VolumeProto.java | 111 + .../google/cloud/batch/v1alpha/batch.proto | 272 + .../google/cloud/batch/v1alpha/job.proto | 539 + .../google/cloud/batch/v1alpha/task.proto | 322 + .../google/cloud/batch/v1alpha/volume.proto | 90 + versions.txt | 2 + 127 files changed, 82017 insertions(+), 577 deletions(-) create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceCallableFactory.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/package-info.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceCallableFactory.java create mode 100644 google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java create mode 100644 google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java create mode 100644 google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java create mode 100644 google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchService.java create mode 100644 google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchServiceImpl.java create mode 100644 grpc-google-cloud-batch-v1alpha/pom.xml create mode 100644 grpc-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceGrpc.java create mode 100644 proto-google-cloud-batch-v1alpha/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-batch-v1alpha/pom.xml create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResource.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResourceOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Environment.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/EnvironmentOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCS.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCSOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequest.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequestOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequest.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequestOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependency.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependencyOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobName.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotification.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotificationOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequest.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequestOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponse.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponseOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequest.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequestOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponse.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponseOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LocationName.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicy.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicyOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFS.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFSOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadata.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PD.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PDOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/RunnableOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ServiceAccount.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ServiceAccountOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEvent.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/StatusEventOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Task.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskExecution.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskExecutionOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskGroup.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskGroupName.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskGroupOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskName.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskProto.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpec.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskSpecOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatus.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/TaskStatusOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Volume.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/VolumeOrBuilder.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/VolumeProto.java create mode 100644 proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/batch.proto create mode 100644 proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/job.proto create mode 100644 proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/task.proto create mode 100644 proto-google-cloud-batch-v1alpha/src/main/proto/google/cloud/batch/v1alpha/volume.proto diff --git a/google-cloud-batch-bom/pom.xml b/google-cloud-batch-bom/pom.xml index 657c119..9869ee9 100644 --- a/google-cloud-batch-bom/pom.xml +++ b/google-cloud-batch-bom/pom.xml @@ -72,11 +72,21 @@ grpc-google-cloud-batch-v1 0.1.2-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-batch-v1alpha + 0.1.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-batch-v1 0.1.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-batch-v1alpha + 0.1.2-SNAPSHOT + diff --git a/google-cloud-batch/pom.xml b/google-cloud-batch/pom.xml index c33fdea..15b6bb3 100644 --- a/google-cloud-batch/pom.xml +++ b/google-cloud-batch/pom.xml @@ -41,10 +41,19 @@ com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-batch-v1alpha + com.google.api.grpc grpc-google-common-protos + + com.google.api.grpc + grpc-google-cloud-batch-v1alpha + test + com.google.api.grpc grpc-google-iam-v1 @@ -65,6 +74,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -84,12 +97,24 @@ test + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java index d88b6e9..13fe161 100644 --- a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceClient.java @@ -19,6 +19,7 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -30,7 +31,6 @@ import com.google.cloud.batch.v1.stub.BatchServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; @@ -39,8 +39,8 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Service Description: Google Cloud Batch Service. The service manages user submitted batch jobs - * and allocates Google Compute Engine VM instances to run the jobs. + * Service Description: Google Batch Service. The service manages user submitted batch jobs and + * allocates Google Compute Engine VM instances to run the jobs. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -104,13 +104,28 @@ * BatchServiceClient batchServiceClient = BatchServiceClient.create(batchServiceSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * BatchServiceSettings batchServiceSettings =
+ *     BatchServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             BatchServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * BatchServiceClient batchServiceClient = BatchServiceClient.create(batchServiceSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class BatchServiceClient implements BackgroundResource { private final BatchServiceSettings settings; private final BatchServiceStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of BatchServiceClient with default settings. */ public static final BatchServiceClient create() throws IOException { @@ -141,13 +156,17 @@ public static final BatchServiceClient create(BatchServiceStub stub) { protected BatchServiceClient(BatchServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((BatchServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected BatchServiceClient(BatchServiceStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final BatchServiceSettings getSettings() { @@ -162,10 +181,18 @@ public BatchServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a Job. @@ -183,8 +210,8 @@ public final OperationsClient getOperationsClient() { * } * } * - * @param parent Required. The parent resource name where the Job will be created. Format: - * projects/{project}/locations/{location} + * @param parent Required. The parent resource name where the Job will be created. Pattern: + * "projects/{project}/locations/{location}" * @param job Required. The Job to create. * @param jobId ID used to uniquely identify the Job within its parent scope. This field should * contain at most 63 characters. Only alphanumeric characters or '-' are accepted. The '-' @@ -221,8 +248,8 @@ public final Job createJob(LocationName parent, Job job, String jobId) { * } * } * - * @param parent Required. The parent resource name where the Job will be created. Format: - * projects/{project}/locations/{location} + * @param parent Required. The parent resource name where the Job will be created. Pattern: + * "projects/{project}/locations/{location}" * @param job Required. The Job to create. * @param jobId ID used to uniquely identify the Job within its parent scope. This field should * contain at most 63 characters. Only alphanumeric characters or '-' are accepted. The '-' @@ -495,7 +522,7 @@ public final UnaryCallable deleteJobCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * List all Jobs for a project. + * List all Jobs for a project within a region. * *

Sample code: * @@ -520,7 +547,7 @@ public final ListJobsPagedResponse listJobs(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * List all Jobs for a project. + * List all Jobs for a project within a region. * *

Sample code: * @@ -550,7 +577,7 @@ public final ListJobsPagedResponse listJobs(ListJobsRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * List all Jobs for a project. + * List all Jobs for a project within a region. * *

Sample code: * @@ -579,7 +606,7 @@ public final UnaryCallable listJobsPaged // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * List all Jobs for a project. + * List all Jobs for a project within a region. * *

Sample code: * @@ -731,7 +758,8 @@ public final UnaryCallable getTaskCallable() { * } * } * - * @param parent Required. Path of the TaskGroup from which Tasks are being requested. + * @param parent Required. Name of a TaskGroup from which Tasks are being requested. Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTasksPagedResponse listTasks(TaskGroupName parent) { @@ -758,7 +786,8 @@ public final ListTasksPagedResponse listTasks(TaskGroupName parent) { * } * } * - * @param parent Required. Path of the TaskGroup from which Tasks are being requested. + * @param parent Required. Name of a TaskGroup from which Tasks are being requested. Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTasksPagedResponse listTasks(String parent) { diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java index c59f366..eec86fe 100644 --- a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/BatchServiceSettings.java @@ -24,6 +24,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -137,11 +138,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return BatchServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return BatchServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return BatchServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return BatchServiceStubSettings.defaultTransportChannelProvider(); } @@ -151,11 +159,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return BatchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -193,6 +207,11 @@ private static Builder createDefault() { return new Builder(BatchServiceStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(BatchServiceStubSettings.newHttpJsonBuilder()); + } + public BatchServiceStubSettings.Builder getStubSettingsBuilder() { return ((BatchServiceStubSettings.Builder) getStubSettings()); } diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/package-info.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/package-info.java index 5cb6b88..e675510 100644 --- a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/package-info.java +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/package-info.java @@ -21,8 +21,8 @@ * *

======================= BatchServiceClient ======================= * - *

Service Description: Google Cloud Batch Service. The service manages user submitted batch jobs - * and allocates Google Compute Engine VM instances to run the jobs. + *

Service Description: Google Batch Service. The service manages user submitted batch jobs and + * allocates Google Compute Engine VM instances to run the jobs. * *

Sample for BatchServiceClient: * diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java index 90b37c9..f10d790 100644 --- a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStub.java @@ -48,7 +48,11 @@ public abstract class BatchServiceStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable createJobCallable() { diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java index be72d6b..c729398 100644 --- a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/BatchServiceStubSettings.java @@ -29,6 +29,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -267,6 +270,11 @@ public BatchServiceStub createStub() throws IOException { .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcBatchServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonBatchServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -299,18 +307,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(BatchServiceStubSettings.class)) @@ -318,11 +333,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(BatchServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BatchServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -461,6 +495,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .createJobSettings() diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceCallableFactory.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceCallableFactory.java new file mode 100644 index 0000000..9bae796 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the BatchService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonBatchServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java new file mode 100644 index 0000000..2543029 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1/stub/HttpJsonBatchServiceStub.java @@ -0,0 +1,501 @@ +/* + * 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.stub; + +import static com.google.cloud.batch.v1.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.batch.v1.CreateJobRequest; +import com.google.cloud.batch.v1.DeleteJobRequest; +import com.google.cloud.batch.v1.GetJobRequest; +import com.google.cloud.batch.v1.GetTaskRequest; +import com.google.cloud.batch.v1.Job; +import com.google.cloud.batch.v1.ListJobsRequest; +import com.google.cloud.batch.v1.ListJobsResponse; +import com.google.cloud.batch.v1.ListTasksRequest; +import com.google.cloud.batch.v1.ListTasksResponse; +import com.google.cloud.batch.v1.OperationMetadata; +import com.google.cloud.batch.v1.Task; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the BatchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonBatchServiceStub extends BatchServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor createJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.batch.v1.BatchService/CreateJob") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/jobs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "jobId", request.getJobId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("job", request.getJob())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.batch.v1.BatchService/GetJob") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/jobs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.batch.v1.BatchService/DeleteJob") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/jobs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "reason", request.getReason()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteJobRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listJobsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.batch.v1.BatchService/ListJobs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/jobs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListJobsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getTaskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.batch.v1.BatchService/GetTask") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Task.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listTasksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.batch.v1.BatchService/ListTasks") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTasksResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createJobCallable; + private final UnaryCallable getJobCallable; + private final UnaryCallable deleteJobCallable; + private final OperationCallable + deleteJobOperationCallable; + private final UnaryCallable listJobsCallable; + private final UnaryCallable listJobsPagedCallable; + private final UnaryCallable getTaskCallable; + private final UnaryCallable listTasksCallable; + private final UnaryCallable listTasksPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonBatchServiceStub create(BatchServiceStubSettings settings) + throws IOException { + return new HttpJsonBatchServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonBatchServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonBatchServiceStub( + BatchServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonBatchServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonBatchServiceStub( + BatchServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonBatchServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonBatchServiceStub(BatchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonBatchServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonBatchServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonBatchServiceStub( + BatchServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listJobsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listJobsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getTaskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTaskMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listTasksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTasksMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createJobCallable = + callableFactory.createUnaryCallable( + createJobTransportSettings, settings.createJobSettings(), clientContext); + this.getJobCallable = + callableFactory.createUnaryCallable( + getJobTransportSettings, settings.getJobSettings(), clientContext); + this.deleteJobCallable = + callableFactory.createUnaryCallable( + deleteJobTransportSettings, settings.deleteJobSettings(), clientContext); + this.deleteJobOperationCallable = + callableFactory.createOperationCallable( + deleteJobTransportSettings, + settings.deleteJobOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listJobsCallable = + callableFactory.createUnaryCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.listJobsPagedCallable = + callableFactory.createPagedCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.getTaskCallable = + callableFactory.createUnaryCallable( + getTaskTransportSettings, settings.getTaskSettings(), clientContext); + this.listTasksCallable = + callableFactory.createUnaryCallable( + listTasksTransportSettings, settings.listTasksSettings(), clientContext); + this.listTasksPagedCallable = + callableFactory.createPagedCallable( + listTasksTransportSettings, settings.listTasksSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createJobMethodDescriptor); + methodDescriptors.add(getJobMethodDescriptor); + methodDescriptors.add(deleteJobMethodDescriptor); + methodDescriptors.add(listJobsMethodDescriptor); + methodDescriptors.add(getTaskMethodDescriptor); + methodDescriptors.add(listTasksMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createJobCallable() { + return createJobCallable; + } + + @Override + public UnaryCallable getJobCallable() { + return getJobCallable; + } + + @Override + public UnaryCallable deleteJobCallable() { + return deleteJobCallable; + } + + @Override + public OperationCallable + deleteJobOperationCallable() { + return deleteJobOperationCallable; + } + + @Override + public UnaryCallable listJobsCallable() { + return listJobsCallable; + } + + @Override + public UnaryCallable listJobsPagedCallable() { + return listJobsPagedCallable; + } + + @Override + public UnaryCallable getTaskCallable() { + return getTaskCallable; + } + + @Override + public UnaryCallable listTasksCallable() { + return listTasksCallable; + } + + @Override + public UnaryCallable listTasksPagedCallable() { + return listTasksPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java new file mode 100644 index 0000000..02e9478 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceClient.java @@ -0,0 +1,1028 @@ +/* + * 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.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.batch.v1alpha.stub.BatchServiceStub; +import com.google.cloud.batch.v1alpha.stub.BatchServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Google Batch Service. The service manages user submitted batch jobs and + * allocates Google Compute Engine VM instances to run the jobs. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Job job = Job.newBuilder().build();
+ *   String jobId = "jobId101296568";
+ *   Job response = batchServiceClient.createJob(parent, job, jobId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the BatchServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of BatchServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * BatchServiceSettings batchServiceSettings =
+ *     BatchServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BatchServiceClient batchServiceClient = BatchServiceClient.create(batchServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * BatchServiceSettings batchServiceSettings =
+ *     BatchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BatchServiceClient batchServiceClient = BatchServiceClient.create(batchServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class BatchServiceClient implements BackgroundResource { + private final BatchServiceSettings settings; + private final BatchServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of BatchServiceClient with default settings. */ + public static final BatchServiceClient create() throws IOException { + return create(BatchServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of BatchServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final BatchServiceClient create(BatchServiceSettings settings) throws IOException { + return new BatchServiceClient(settings); + } + + /** + * Constructs an instance of BatchServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(BatchServiceSettings). + */ + public static final BatchServiceClient create(BatchServiceStub stub) { + return new BatchServiceClient(stub); + } + + /** + * Constructs an instance of BatchServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected BatchServiceClient(BatchServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((BatchServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected BatchServiceClient(BatchServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final BatchServiceSettings getSettings() { + return settings; + } + + public BatchServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Job job = Job.newBuilder().build();
+   *   String jobId = "jobId101296568";
+   *   Job response = batchServiceClient.createJob(parent, job, jobId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource name where the Job will be created. Pattern: + * "projects/{project}/locations/{location}" + * @param job Required. The Job to create. + * @param jobId ID used to uniquely identify the Job within its parent scope. This field should + * contain at most 63 characters. Only alphanumeric characters or '-' are accepted. The '-' + * character cannot be the first or the last one. A system generated ID will be used if the + * field is not set. + *

The job.name field in the request will be ignored and the created resource name of the + * Job will be "{parent}/jobs/{job_id}". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job createJob(LocationName parent, Job job, String jobId) { + CreateJobRequest request = + CreateJobRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setJob(job) + .setJobId(jobId) + .build(); + return createJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Job job = Job.newBuilder().build();
+   *   String jobId = "jobId101296568";
+   *   Job response = batchServiceClient.createJob(parent, job, jobId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource name where the Job will be created. Pattern: + * "projects/{project}/locations/{location}" + * @param job Required. The Job to create. + * @param jobId ID used to uniquely identify the Job within its parent scope. This field should + * contain at most 63 characters. Only alphanumeric characters or '-' are accepted. The '-' + * character cannot be the first or the last one. A system generated ID will be used if the + * field is not set. + *

The job.name field in the request will be ignored and the created resource name of the + * Job will be "{parent}/jobs/{job_id}". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job createJob(String parent, Job job, String jobId) { + CreateJobRequest request = + CreateJobRequest.newBuilder().setParent(parent).setJob(job).setJobId(jobId).build(); + return createJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   CreateJobRequest request =
+   *       CreateJobRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setJobId("jobId101296568")
+   *           .setJob(Job.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Job response = batchServiceClient.createJob(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job createJob(CreateJobRequest request) { + return createJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   CreateJobRequest request =
+   *       CreateJobRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setJobId("jobId101296568")
+   *           .setJob(Job.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = batchServiceClient.createJobCallable().futureCall(request);
+   *   // Do something.
+   *   Job response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createJobCallable() { + return stub.createJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a Job specified by its resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   Job response = batchServiceClient.getJob(name);
+   * }
+   * }
+ * + * @param name Required. Job name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job getJob(JobName name) { + GetJobRequest request = + GetJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a Job specified by its resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   String name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString();
+   *   Job response = batchServiceClient.getJob(name);
+   * }
+   * }
+ * + * @param name Required. Job name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job getJob(String name) { + GetJobRequest request = GetJobRequest.newBuilder().setName(name).build(); + return getJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a Job specified by its resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   GetJobRequest request =
+   *       GetJobRequest.newBuilder()
+   *           .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+   *           .build();
+   *   Job response = batchServiceClient.getJob(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job getJob(GetJobRequest request) { + return getJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a Job specified by its resource name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   GetJobRequest request =
+   *       GetJobRequest.newBuilder()
+   *           .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
+   *           .build();
+   *   ApiFuture future = batchServiceClient.getJobCallable().futureCall(request);
+   *   // Do something.
+   *   Job response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getJobCallable() { + return stub.getJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   String name = "name3373707";
+   *   batchServiceClient.deleteJobAsync(name).get();
+   * }
+   * }
+ * + * @param name Job name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteJobAsync(String name) { + DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name).build(); + return deleteJobAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   DeleteJobRequest request =
+   *       DeleteJobRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setReason("reason-934964668")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   batchServiceClient.deleteJobAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteJobAsync(DeleteJobRequest request) { + return deleteJobOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   DeleteJobRequest request =
+   *       DeleteJobRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setReason("reason-934964668")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       batchServiceClient.deleteJobOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteJobOperationCallable() { + return stub.deleteJobOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a Job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   DeleteJobRequest request =
+   *       DeleteJobRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setReason("reason-934964668")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = batchServiceClient.deleteJobCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteJobCallable() { + return stub.deleteJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all Jobs for a project within a region. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   String parent = "parent-995424086";
+   *   for (Job element : batchServiceClient.listJobs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Parent path. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListJobsPagedResponse listJobs(String parent) { + ListJobsRequest request = ListJobsRequest.newBuilder().setParent(parent).build(); + return listJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all Jobs for a project within a region. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   ListJobsRequest request =
+   *       ListJobsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Job element : batchServiceClient.listJobs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListJobsPagedResponse listJobs(ListJobsRequest request) { + return listJobsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all Jobs for a project within a region. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   ListJobsRequest request =
+   *       ListJobsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = batchServiceClient.listJobsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Job element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listJobsPagedCallable() { + return stub.listJobsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all Jobs for a project within a region. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   ListJobsRequest request =
+   *       ListJobsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListJobsResponse response = batchServiceClient.listJobsCallable().call(request);
+   *     for (Job element : response.getJobsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listJobsCallable() { + return stub.listJobsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return a single Task. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]");
+   *   Task response = batchServiceClient.getTask(name);
+   * }
+   * }
+ * + * @param name Required. Task name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task getTask(TaskName name) { + GetTaskRequest request = + GetTaskRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTask(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return a single Task. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   String name =
+   *       TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]").toString();
+   *   Task response = batchServiceClient.getTask(name);
+   * }
+   * }
+ * + * @param name Required. Task name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task getTask(String name) { + GetTaskRequest request = GetTaskRequest.newBuilder().setName(name).build(); + return getTask(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return a single Task. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   GetTaskRequest request =
+   *       GetTaskRequest.newBuilder()
+   *           .setName(
+   *               TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]")
+   *                   .toString())
+   *           .build();
+   *   Task response = batchServiceClient.getTask(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task getTask(GetTaskRequest request) { + return getTaskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Return a single Task. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   GetTaskRequest request =
+   *       GetTaskRequest.newBuilder()
+   *           .setName(
+   *               TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = batchServiceClient.getTaskCallable().futureCall(request);
+   *   // Do something.
+   *   Task response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getTaskCallable() { + return stub.getTaskCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List Tasks associated with a job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   TaskGroupName parent = TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]");
+   *   for (Task element : batchServiceClient.listTasks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of a TaskGroup from which Tasks are being requested. Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTasksPagedResponse listTasks(TaskGroupName parent) { + ListTasksRequest request = + ListTasksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listTasks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List Tasks associated with a job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   String parent =
+   *       TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]").toString();
+   *   for (Task element : batchServiceClient.listTasks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of a TaskGroup from which Tasks are being requested. Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTasksPagedResponse listTasks(String parent) { + ListTasksRequest request = ListTasksRequest.newBuilder().setParent(parent).build(); + return listTasks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List Tasks associated with a job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   ListTasksRequest request =
+   *       ListTasksRequest.newBuilder()
+   *           .setParent(
+   *               TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Task element : batchServiceClient.listTasks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTasksPagedResponse listTasks(ListTasksRequest request) { + return listTasksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List Tasks associated with a job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   ListTasksRequest request =
+   *       ListTasksRequest.newBuilder()
+   *           .setParent(
+   *               TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = batchServiceClient.listTasksPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Task element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTasksPagedCallable() { + return stub.listTasksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List Tasks associated with a job. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+   *   ListTasksRequest request =
+   *       ListTasksRequest.newBuilder()
+   *           .setParent(
+   *               TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListTasksResponse response = batchServiceClient.listTasksCallable().call(request);
+   *     for (Task element : response.getTasksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTasksCallable() { + return stub.listTasksCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListJobsPagedResponse + extends AbstractPagedListResponse< + ListJobsRequest, ListJobsResponse, Job, ListJobsPage, ListJobsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListJobsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListJobsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListJobsPagedResponse(ListJobsPage page) { + super(page, ListJobsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListJobsPage + extends AbstractPage { + + private ListJobsPage( + PageContext context, ListJobsResponse response) { + super(context, response); + } + + private static ListJobsPage createEmptyPage() { + return new ListJobsPage(null, null); + } + + @Override + protected ListJobsPage createPage( + PageContext context, ListJobsResponse response) { + return new ListJobsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListJobsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListJobsRequest, ListJobsResponse, Job, ListJobsPage, ListJobsFixedSizeCollection> { + + private ListJobsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListJobsFixedSizeCollection createEmptyCollection() { + return new ListJobsFixedSizeCollection(null, 0); + } + + @Override + protected ListJobsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListJobsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListTasksPagedResponse + extends AbstractPagedListResponse< + ListTasksRequest, ListTasksResponse, Task, ListTasksPage, ListTasksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTasksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListTasksPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListTasksPagedResponse(ListTasksPage page) { + super(page, ListTasksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTasksPage + extends AbstractPage { + + private ListTasksPage( + PageContext context, + ListTasksResponse response) { + super(context, response); + } + + private static ListTasksPage createEmptyPage() { + return new ListTasksPage(null, null); + } + + @Override + protected ListTasksPage createPage( + PageContext context, + ListTasksResponse response) { + return new ListTasksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTasksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTasksRequest, ListTasksResponse, Task, ListTasksPage, ListTasksFixedSizeCollection> { + + private ListTasksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTasksFixedSizeCollection createEmptyCollection() { + return new ListTasksFixedSizeCollection(null, 0); + } + + @Override + protected ListTasksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTasksFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java new file mode 100644 index 0000000..349888a --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceSettings.java @@ -0,0 +1,256 @@ +/* + * 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 static com.google.cloud.batch.v1alpha.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.batch.v1alpha.stub.BatchServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link BatchServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (batch.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createJob to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * BatchServiceSettings.Builder batchServiceSettingsBuilder = BatchServiceSettings.newBuilder();
+ * batchServiceSettingsBuilder
+ *     .createJobSettings()
+ *     .setRetrySettings(
+ *         batchServiceSettingsBuilder
+ *             .createJobSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * BatchServiceSettings batchServiceSettings = batchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class BatchServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createJob. */ + public UnaryCallSettings createJobSettings() { + return ((BatchServiceStubSettings) getStubSettings()).createJobSettings(); + } + + /** Returns the object with the settings used for calls to getJob. */ + public UnaryCallSettings getJobSettings() { + return ((BatchServiceStubSettings) getStubSettings()).getJobSettings(); + } + + /** Returns the object with the settings used for calls to deleteJob. */ + public UnaryCallSettings deleteJobSettings() { + return ((BatchServiceStubSettings) getStubSettings()).deleteJobSettings(); + } + + /** Returns the object with the settings used for calls to deleteJob. */ + public OperationCallSettings + deleteJobOperationSettings() { + return ((BatchServiceStubSettings) getStubSettings()).deleteJobOperationSettings(); + } + + /** Returns the object with the settings used for calls to listJobs. */ + public PagedCallSettings + listJobsSettings() { + return ((BatchServiceStubSettings) getStubSettings()).listJobsSettings(); + } + + /** Returns the object with the settings used for calls to getTask. */ + public UnaryCallSettings getTaskSettings() { + return ((BatchServiceStubSettings) getStubSettings()).getTaskSettings(); + } + + /** Returns the object with the settings used for calls to listTasks. */ + public PagedCallSettings + listTasksSettings() { + return ((BatchServiceStubSettings) getStubSettings()).listTasksSettings(); + } + + public static final BatchServiceSettings create(BatchServiceStubSettings stub) + throws IOException { + return new BatchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return BatchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return BatchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return BatchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BatchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return BatchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return BatchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BatchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BatchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for BatchServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(BatchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(BatchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(BatchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(BatchServiceStubSettings.newBuilder()); + } + + public BatchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((BatchServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createJob. */ + public UnaryCallSettings.Builder createJobSettings() { + return getStubSettingsBuilder().createJobSettings(); + } + + /** Returns the builder for the settings used for calls to getJob. */ + public UnaryCallSettings.Builder getJobSettings() { + return getStubSettingsBuilder().getJobSettings(); + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + public UnaryCallSettings.Builder deleteJobSettings() { + return getStubSettingsBuilder().deleteJobSettings(); + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + public OperationCallSettings.Builder + deleteJobOperationSettings() { + return getStubSettingsBuilder().deleteJobOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listJobs. */ + public PagedCallSettings.Builder + listJobsSettings() { + return getStubSettingsBuilder().listJobsSettings(); + } + + /** Returns the builder for the settings used for calls to getTask. */ + public UnaryCallSettings.Builder getTaskSettings() { + return getStubSettingsBuilder().getTaskSettings(); + } + + /** Returns the builder for the settings used for calls to listTasks. */ + public PagedCallSettings.Builder + listTasksSettings() { + return getStubSettingsBuilder().listTasksSettings(); + } + + @Override + public BatchServiceSettings build() throws IOException { + return new BatchServiceSettings(this); + } + } +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json new file mode 100644 index 0000000..154c03f --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.batch.v1alpha", + "libraryPackage": "com.google.cloud.batch.v1alpha", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": ["createJob", "createJob", "createJob", "createJobCallable"] + }, + "DeleteJob": { + "methods": ["deleteJobAsync", "deleteJobAsync", "deleteJobOperationCallable", "deleteJobCallable"] + }, + "GetJob": { + "methods": ["getJob", "getJob", "getJob", "getJobCallable"] + }, + "GetTask": { + "methods": ["getTask", "getTask", "getTask", "getTaskCallable"] + }, + "ListJobs": { + "methods": ["listJobs", "listJobs", "listJobsPagedCallable", "listJobsCallable"] + }, + "ListTasks": { + "methods": ["listTasks", "listTasks", "listTasks", "listTasksPagedCallable", "listTasksCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/package-info.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/package-info.java new file mode 100644 index 0000000..afb0037 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/package-info.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= BatchServiceClient ======================= + * + *

Service Description: Google Batch Service. The service manages user submitted batch jobs and + * allocates Google Compute Engine VM instances to run the jobs. + * + *

Sample for BatchServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (BatchServiceClient batchServiceClient = BatchServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Job job = Job.newBuilder().build();
+ *   String jobId = "jobId101296568";
+ *   Job response = batchServiceClient.createJob(parent, job, jobId);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.batch.v1alpha; + +import javax.annotation.Generated; diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java new file mode 100644 index 0000000..44de4c2 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStub.java @@ -0,0 +1,95 @@ +/* + * 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.stub; + +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.batch.v1alpha.CreateJobRequest; +import com.google.cloud.batch.v1alpha.DeleteJobRequest; +import com.google.cloud.batch.v1alpha.GetJobRequest; +import com.google.cloud.batch.v1alpha.GetTaskRequest; +import com.google.cloud.batch.v1alpha.Job; +import com.google.cloud.batch.v1alpha.ListJobsRequest; +import com.google.cloud.batch.v1alpha.ListJobsResponse; +import com.google.cloud.batch.v1alpha.ListTasksRequest; +import com.google.cloud.batch.v1alpha.ListTasksResponse; +import com.google.cloud.batch.v1alpha.OperationMetadata; +import com.google.cloud.batch.v1alpha.Task; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the BatchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class BatchServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createJobCallable() { + throw new UnsupportedOperationException("Not implemented: createJobCallable()"); + } + + public UnaryCallable getJobCallable() { + throw new UnsupportedOperationException("Not implemented: getJobCallable()"); + } + + public OperationCallable + deleteJobOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteJobOperationCallable()"); + } + + public UnaryCallable deleteJobCallable() { + throw new UnsupportedOperationException("Not implemented: deleteJobCallable()"); + } + + public UnaryCallable listJobsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listJobsPagedCallable()"); + } + + public UnaryCallable listJobsCallable() { + throw new UnsupportedOperationException("Not implemented: listJobsCallable()"); + } + + public UnaryCallable getTaskCallable() { + throw new UnsupportedOperationException("Not implemented: getTaskCallable()"); + } + + public UnaryCallable listTasksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTasksPagedCallable()"); + } + + public UnaryCallable listTasksCallable() { + throw new UnsupportedOperationException("Not implemented: listTasksCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java new file mode 100644 index 0000000..e21896b --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/BatchServiceStubSettings.java @@ -0,0 +1,582 @@ +/* + * 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.stub; + +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.batch.v1alpha.CreateJobRequest; +import com.google.cloud.batch.v1alpha.DeleteJobRequest; +import com.google.cloud.batch.v1alpha.GetJobRequest; +import com.google.cloud.batch.v1alpha.GetTaskRequest; +import com.google.cloud.batch.v1alpha.Job; +import com.google.cloud.batch.v1alpha.ListJobsRequest; +import com.google.cloud.batch.v1alpha.ListJobsResponse; +import com.google.cloud.batch.v1alpha.ListTasksRequest; +import com.google.cloud.batch.v1alpha.ListTasksResponse; +import com.google.cloud.batch.v1alpha.OperationMetadata; +import com.google.cloud.batch.v1alpha.Task; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link BatchServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (batch.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createJob to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * BatchServiceStubSettings.Builder batchServiceSettingsBuilder =
+ *     BatchServiceStubSettings.newBuilder();
+ * batchServiceSettingsBuilder
+ *     .createJobSettings()
+ *     .setRetrySettings(
+ *         batchServiceSettingsBuilder
+ *             .createJobSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * BatchServiceStubSettings batchServiceSettings = batchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class BatchServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createJobSettings; + private final UnaryCallSettings getJobSettings; + private final UnaryCallSettings deleteJobSettings; + private final OperationCallSettings + deleteJobOperationSettings; + private final PagedCallSettings + listJobsSettings; + private final UnaryCallSettings getTaskSettings; + private final PagedCallSettings + listTasksSettings; + + private static final PagedListDescriptor + LIST_JOBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListJobsRequest injectToken(ListJobsRequest payload, String token) { + return ListJobsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListJobsRequest injectPageSize(ListJobsRequest payload, int pageSize) { + return ListJobsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListJobsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListJobsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListJobsResponse payload) { + return payload.getJobsList() == null + ? ImmutableList.of() + : payload.getJobsList(); + } + }; + + private static final PagedListDescriptor + LIST_TASKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTasksRequest injectToken(ListTasksRequest payload, String token) { + return ListTasksRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTasksRequest injectPageSize(ListTasksRequest payload, int pageSize) { + return ListTasksRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTasksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTasksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTasksResponse payload) { + return payload.getTasksList() == null + ? ImmutableList.of() + : payload.getTasksList(); + } + }; + + private static final PagedListResponseFactory< + ListJobsRequest, ListJobsResponse, ListJobsPagedResponse> + LIST_JOBS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListJobsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_JOBS_PAGE_STR_DESC, request, context); + return ListJobsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTasksRequest, ListTasksResponse, ListTasksPagedResponse> + LIST_TASKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTasksRequest, ListTasksResponse, ListTasksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTasksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TASKS_PAGE_STR_DESC, request, context); + return ListTasksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createJob. */ + public UnaryCallSettings createJobSettings() { + return createJobSettings; + } + + /** Returns the object with the settings used for calls to getJob. */ + public UnaryCallSettings getJobSettings() { + return getJobSettings; + } + + /** Returns the object with the settings used for calls to deleteJob. */ + public UnaryCallSettings deleteJobSettings() { + return deleteJobSettings; + } + + /** Returns the object with the settings used for calls to deleteJob. */ + public OperationCallSettings + deleteJobOperationSettings() { + return deleteJobOperationSettings; + } + + /** Returns the object with the settings used for calls to listJobs. */ + public PagedCallSettings + listJobsSettings() { + return listJobsSettings; + } + + /** Returns the object with the settings used for calls to getTask. */ + public UnaryCallSettings getTaskSettings() { + return getTaskSettings; + } + + /** Returns the object with the settings used for calls to listTasks. */ + public PagedCallSettings + listTasksSettings() { + return listTasksSettings; + } + + public BatchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcBatchServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "batch.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "batch.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(BatchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BatchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createJobSettings = settingsBuilder.createJobSettings().build(); + getJobSettings = settingsBuilder.getJobSettings().build(); + deleteJobSettings = settingsBuilder.deleteJobSettings().build(); + deleteJobOperationSettings = settingsBuilder.deleteJobOperationSettings().build(); + listJobsSettings = settingsBuilder.listJobsSettings().build(); + getTaskSettings = settingsBuilder.getTaskSettings().build(); + listTasksSettings = settingsBuilder.listTasksSettings().build(); + } + + /** Builder for BatchServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createJobSettings; + private final UnaryCallSettings.Builder getJobSettings; + private final UnaryCallSettings.Builder deleteJobSettings; + private final OperationCallSettings.Builder + deleteJobOperationSettings; + private final PagedCallSettings.Builder< + ListJobsRequest, ListJobsResponse, ListJobsPagedResponse> + listJobsSettings; + private final UnaryCallSettings.Builder getTaskSettings; + private final PagedCallSettings.Builder< + ListTasksRequest, ListTasksResponse, ListTasksPagedResponse> + listTasksSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteJobOperationSettings = OperationCallSettings.newBuilder(); + listJobsSettings = PagedCallSettings.newBuilder(LIST_JOBS_PAGE_STR_FACT); + getTaskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listTasksSettings = PagedCallSettings.newBuilder(LIST_TASKS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createJobSettings, + getJobSettings, + deleteJobSettings, + listJobsSettings, + getTaskSettings, + listTasksSettings); + initDefaults(this); + } + + protected Builder(BatchServiceStubSettings settings) { + super(settings); + + createJobSettings = settings.createJobSettings.toBuilder(); + getJobSettings = settings.getJobSettings.toBuilder(); + deleteJobSettings = settings.deleteJobSettings.toBuilder(); + deleteJobOperationSettings = settings.deleteJobOperationSettings.toBuilder(); + listJobsSettings = settings.listJobsSettings.toBuilder(); + getTaskSettings = settings.getTaskSettings.toBuilder(); + listTasksSettings = settings.listTasksSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createJobSettings, + getJobSettings, + deleteJobSettings, + listJobsSettings, + getTaskSettings, + listTasksSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listJobsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getTaskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listTasksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteJobOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createJob. */ + public UnaryCallSettings.Builder createJobSettings() { + return createJobSettings; + } + + /** Returns the builder for the settings used for calls to getJob. */ + public UnaryCallSettings.Builder getJobSettings() { + return getJobSettings; + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + public UnaryCallSettings.Builder deleteJobSettings() { + return deleteJobSettings; + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteJobOperationSettings() { + return deleteJobOperationSettings; + } + + /** Returns the builder for the settings used for calls to listJobs. */ + public PagedCallSettings.Builder + listJobsSettings() { + return listJobsSettings; + } + + /** Returns the builder for the settings used for calls to getTask. */ + public UnaryCallSettings.Builder getTaskSettings() { + return getTaskSettings; + } + + /** Returns the builder for the settings used for calls to listTasks. */ + public PagedCallSettings.Builder + listTasksSettings() { + return listTasksSettings; + } + + @Override + public BatchServiceStubSettings build() throws IOException { + return new BatchServiceStubSettings(this); + } + } +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceCallableFactory.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceCallableFactory.java new file mode 100644 index 0000000..df78b47 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the BatchService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcBatchServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java new file mode 100644 index 0000000..17dcc58 --- /dev/null +++ b/google-cloud-batch/src/main/java/com/google/cloud/batch/v1alpha/stub/GrpcBatchServiceStub.java @@ -0,0 +1,344 @@ +/* + * 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.stub; + +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.batch.v1alpha.CreateJobRequest; +import com.google.cloud.batch.v1alpha.DeleteJobRequest; +import com.google.cloud.batch.v1alpha.GetJobRequest; +import com.google.cloud.batch.v1alpha.GetTaskRequest; +import com.google.cloud.batch.v1alpha.Job; +import com.google.cloud.batch.v1alpha.ListJobsRequest; +import com.google.cloud.batch.v1alpha.ListJobsResponse; +import com.google.cloud.batch.v1alpha.ListTasksRequest; +import com.google.cloud.batch.v1alpha.ListTasksResponse; +import com.google.cloud.batch.v1alpha.OperationMetadata; +import com.google.cloud.batch.v1alpha.Task; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the BatchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcBatchServiceStub extends BatchServiceStub { + private static final MethodDescriptor createJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.batch.v1alpha.BatchService/CreateJob") + .setRequestMarshaller(ProtoUtils.marshaller(CreateJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.batch.v1alpha.BatchService/GetJob") + .setRequestMarshaller(ProtoUtils.marshaller(GetJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.batch.v1alpha.BatchService/DeleteJob") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listJobsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.batch.v1alpha.BatchService/ListJobs") + .setRequestMarshaller(ProtoUtils.marshaller(ListJobsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListJobsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getTaskMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.batch.v1alpha.BatchService/GetTask") + .setRequestMarshaller(ProtoUtils.marshaller(GetTaskRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Task.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listTasksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.batch.v1alpha.BatchService/ListTasks") + .setRequestMarshaller(ProtoUtils.marshaller(ListTasksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListTasksResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createJobCallable; + private final UnaryCallable getJobCallable; + private final UnaryCallable deleteJobCallable; + private final OperationCallable + deleteJobOperationCallable; + private final UnaryCallable listJobsCallable; + private final UnaryCallable listJobsPagedCallable; + private final UnaryCallable getTaskCallable; + private final UnaryCallable listTasksCallable; + private final UnaryCallable listTasksPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcBatchServiceStub create(BatchServiceStubSettings settings) + throws IOException { + return new GrpcBatchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcBatchServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcBatchServiceStub(BatchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcBatchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcBatchServiceStub( + BatchServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcBatchServiceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcBatchServiceStub(BatchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcBatchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcBatchServiceStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcBatchServiceStub( + BatchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createJobMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getJobMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteJobMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listJobsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listJobsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getTaskTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTaskMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listTasksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTasksMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.createJobCallable = + callableFactory.createUnaryCallable( + createJobTransportSettings, settings.createJobSettings(), clientContext); + this.getJobCallable = + callableFactory.createUnaryCallable( + getJobTransportSettings, settings.getJobSettings(), clientContext); + this.deleteJobCallable = + callableFactory.createUnaryCallable( + deleteJobTransportSettings, settings.deleteJobSettings(), clientContext); + this.deleteJobOperationCallable = + callableFactory.createOperationCallable( + deleteJobTransportSettings, + settings.deleteJobOperationSettings(), + clientContext, + operationsStub); + this.listJobsCallable = + callableFactory.createUnaryCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.listJobsPagedCallable = + callableFactory.createPagedCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.getTaskCallable = + callableFactory.createUnaryCallable( + getTaskTransportSettings, settings.getTaskSettings(), clientContext); + this.listTasksCallable = + callableFactory.createUnaryCallable( + listTasksTransportSettings, settings.listTasksSettings(), clientContext); + this.listTasksPagedCallable = + callableFactory.createPagedCallable( + listTasksTransportSettings, settings.listTasksSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createJobCallable() { + return createJobCallable; + } + + @Override + public UnaryCallable getJobCallable() { + return getJobCallable; + } + + @Override + public UnaryCallable deleteJobCallable() { + return deleteJobCallable; + } + + @Override + public OperationCallable + deleteJobOperationCallable() { + return deleteJobOperationCallable; + } + + @Override + public UnaryCallable listJobsCallable() { + return listJobsCallable; + } + + @Override + public UnaryCallable listJobsPagedCallable() { + return listJobsPagedCallable; + } + + @Override + public UnaryCallable getTaskCallable() { + return getTaskCallable; + } + + @Override + public UnaryCallable listTasksCallable() { + return listTasksCallable; + } + + @Override + public UnaryCallable listTasksPagedCallable() { + return listTasksPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java new file mode 100644 index 0000000..df13797 --- /dev/null +++ b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1/BatchServiceClientHttpJsonTest.java @@ -0,0 +1,602 @@ +/* + * 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 static com.google.cloud.batch.v1.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.batch.v1.stub.HttpJsonBatchServiceStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class BatchServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static BatchServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonBatchServiceStub.getMethodDescriptors(), + BatchServiceSettings.getDefaultEndpoint()); + BatchServiceSettings settings = + BatchServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + BatchServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BatchServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createJobTest() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + + Job actualResponse = client.createJob(parent, job, jobId); + 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 createJobExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + client.createJob(parent, job, jobId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createJobTest2() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + + Job actualResponse = client.createJob(parent, job, jobId); + 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 createJobExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + client.createJob(parent, job, jobId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getJobTest() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]"); + + Job actualResponse = client.getJob(name); + 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 getJobExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]"); + client.getJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getJobTest2() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-3306/locations/location-3306/jobs/job-3306"; + + Job actualResponse = client.getJob(name); + 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 getJobExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3306/locations/location-3306/jobs/job-3306"; + client.getJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteJobTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteJobTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-3306/locations/location-3306/jobs/job-3306"; + + client.deleteJobAsync(name).get(); + + 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 deleteJobExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3306/locations/location-3306/jobs/job-3306"; + client.deleteJobAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listJobsTest() throws Exception { + Job responsesElement = Job.newBuilder().build(); + ListJobsResponse expectedResponse = + ListJobsResponse.newBuilder() + .setNextPageToken("") + .addAllJobs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListJobsPagedResponse pagedListResponse = client.listJobs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0)); + + 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 listJobsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listJobs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTaskTest() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName( + TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]") + .toString()) + .setStatus(TaskStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"); + + Task actualResponse = client.getTask(name); + 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 getTaskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"); + client.getTask(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTaskTest2() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName( + TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]") + .toString()) + .setStatus(TaskStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-5433/locations/location-5433/jobs/job-5433/taskGroups/taskGroup-5433/tasks/task-5433"; + + Task actualResponse = client.getTask(name); + 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 getTaskExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-5433/locations/location-5433/jobs/job-5433/taskGroups/taskGroup-5433/tasks/task-5433"; + client.getTask(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTasksTest() throws Exception { + Task responsesElement = Task.newBuilder().build(); + ListTasksResponse expectedResponse = + ListTasksResponse.newBuilder() + .setNextPageToken("") + .addAllTasks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + TaskGroupName parent = TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"); + + ListTasksPagedResponse pagedListResponse = client.listTasks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTasksList().get(0), resources.get(0)); + + 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 listTasksExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TaskGroupName parent = TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"); + client.listTasks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTasksTest2() throws Exception { + Task responsesElement = Task.newBuilder().build(); + ListTasksResponse expectedResponse = + ListTasksResponse.newBuilder() + .setNextPageToken("") + .addAllTasks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-6196/locations/location-6196/jobs/job-6196/taskGroups/taskGroup-6196"; + + ListTasksPagedResponse pagedListResponse = client.listTasks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTasksList().get(0), resources.get(0)); + + 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 listTasksExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-6196/locations/location-6196/jobs/job-6196/taskGroups/taskGroup-6196"; + client.listTasks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java new file mode 100644 index 0000000..e83ee93 --- /dev/null +++ b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/BatchServiceClientTest.java @@ -0,0 +1,557 @@ +/* + * 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 static com.google.cloud.batch.v1alpha.BatchServiceClient.ListJobsPagedResponse; +import static com.google.cloud.batch.v1alpha.BatchServiceClient.ListTasksPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class BatchServiceClientTest { + private static MockBatchService mockBatchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private BatchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockBatchService = new MockBatchService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockBatchService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + BatchServiceSettings settings = + BatchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BatchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createJobTest() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .addAllDependencies(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setNotification(JobNotification.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockBatchService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + + Job actualResponse = client.createJob(parent, job, jobId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateJobRequest actualRequest = ((CreateJobRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(job, actualRequest.getJob()); + Assert.assertEquals(jobId, actualRequest.getJobId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + client.createJob(parent, job, jobId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createJobTest2() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .addAllDependencies(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setNotification(JobNotification.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockBatchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + + Job actualResponse = client.createJob(parent, job, jobId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateJobRequest actualRequest = ((CreateJobRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(job, actualRequest.getJob()); + Assert.assertEquals(jobId, actualRequest.getJobId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createJobExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + String parent = "parent-995424086"; + Job job = Job.newBuilder().build(); + String jobId = "jobId101296568"; + client.createJob(parent, job, jobId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getJobTest() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .addAllDependencies(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setNotification(JobNotification.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockBatchService.addResponse(expectedResponse); + + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]"); + + Job actualResponse = client.getJob(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetJobRequest actualRequest = ((GetJobRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]"); + client.getJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getJobTest2() throws Exception { + Job expectedResponse = + Job.newBuilder() + .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) + .setUid("uid115792") + .setPriority(-1165461084) + .addAllTaskGroups(new ArrayList()) + .addAllDependencies(new ArrayList()) + .setAllocationPolicy(AllocationPolicy.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStatus(JobStatus.newBuilder().build()) + .setNotification(JobNotification.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLogsPolicy(LogsPolicy.newBuilder().build()) + .addAllNotifications(new ArrayList()) + .build(); + mockBatchService.addResponse(expectedResponse); + + String name = "name3373707"; + + Job actualResponse = client.getJob(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetJobRequest actualRequest = ((GetJobRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getJobExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + String name = "name3373707"; + client.getJob(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteJobTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteJobTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBatchService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteJobAsync(name).get(); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteJobRequest actualRequest = ((DeleteJobRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + String name = "name3373707"; + client.deleteJobAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listJobsTest() throws Exception { + Job responsesElement = Job.newBuilder().build(); + ListJobsResponse expectedResponse = + ListJobsResponse.newBuilder() + .setNextPageToken("") + .addAllJobs(Arrays.asList(responsesElement)) + .build(); + mockBatchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListJobsPagedResponse pagedListResponse = client.listJobs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0)); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListJobsRequest actualRequest = ((ListJobsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listJobsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listJobs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTaskTest() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName( + TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]") + .toString()) + .setStatus(TaskStatus.newBuilder().build()) + .build(); + mockBatchService.addResponse(expectedResponse); + + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"); + + Task actualResponse = client.getTask(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTaskRequest actualRequest = ((GetTaskRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTaskExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"); + client.getTask(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTaskTest2() throws Exception { + Task expectedResponse = + Task.newBuilder() + .setName( + TaskName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]") + .toString()) + .setStatus(TaskStatus.newBuilder().build()) + .build(); + mockBatchService.addResponse(expectedResponse); + + String name = "name3373707"; + + Task actualResponse = client.getTask(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTaskRequest actualRequest = ((GetTaskRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTaskExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + String name = "name3373707"; + client.getTask(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTasksTest() throws Exception { + Task responsesElement = Task.newBuilder().build(); + ListTasksResponse expectedResponse = + ListTasksResponse.newBuilder() + .setNextPageToken("") + .addAllTasks(Arrays.asList(responsesElement)) + .build(); + mockBatchService.addResponse(expectedResponse); + + TaskGroupName parent = TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"); + + ListTasksPagedResponse pagedListResponse = client.listTasks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTasksList().get(0), resources.get(0)); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTasksRequest actualRequest = ((ListTasksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTasksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + TaskGroupName parent = TaskGroupName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"); + client.listTasks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTasksTest2() throws Exception { + Task responsesElement = Task.newBuilder().build(); + ListTasksResponse expectedResponse = + ListTasksResponse.newBuilder() + .setNextPageToken("") + .addAllTasks(Arrays.asList(responsesElement)) + .build(); + mockBatchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTasksPagedResponse pagedListResponse = client.listTasks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTasksList().get(0), resources.get(0)); + + List actualRequests = mockBatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTasksRequest actualRequest = ((ListTasksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTasksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBatchService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTasks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchService.java b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchService.java new file mode 100644 index 0000000..82d4337 --- /dev/null +++ b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchService.java @@ -0,0 +1,59 @@ +/* + * 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 MockBatchService implements MockGrpcService { + private final MockBatchServiceImpl serviceImpl; + + public MockBatchService() { + serviceImpl = new MockBatchServiceImpl(); + } + + @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/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchServiceImpl.java b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchServiceImpl.java new file mode 100644 index 0000000..e212c5b --- /dev/null +++ b/google-cloud-batch/src/test/java/com/google/cloud/batch/v1alpha/MockBatchServiceImpl.java @@ -0,0 +1,182 @@ +/* + * 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.cloud.batch.v1alpha.BatchServiceGrpc.BatchServiceImplBase; +import com.google.longrunning.Operation; +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 MockBatchServiceImpl extends BatchServiceImplBase { + private List requests; + private Queue responses; + + public MockBatchServiceImpl() { + 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 createJob(CreateJobRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext(((Job) 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 CreateJob, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Job.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getJob(GetJobRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext(((Job) 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 GetJob, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Job.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteJob(DeleteJobRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 DeleteJob, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listJobs(ListJobsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListJobsResponse) { + requests.add(request); + responseObserver.onNext(((ListJobsResponse) 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 ListJobs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListJobsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getTask(GetTaskRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Task) { + requests.add(request); + responseObserver.onNext(((Task) 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 GetTask, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Task.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTasks( + ListTasksRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTasksResponse) { + requests.add(request); + responseObserver.onNext(((ListTasksResponse) 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 ListTasks, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTasksResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchServiceGrpc.java b/grpc-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchServiceGrpc.java index 0f328f0..f5183c6 100644 --- a/grpc-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchServiceGrpc.java +++ b/grpc-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchServiceGrpc.java @@ -21,7 +21,7 @@ * * *
- * Google Cloud Batch Service.
+ * Google Batch Service.
  * The service manages user submitted batch jobs and allocates Google Compute
  * Engine VM instances to run the jobs.
  * 
@@ -324,7 +324,7 @@ public BatchServiceFutureStub newStub( * * *
-   * Google Cloud Batch Service.
+   * Google Batch Service.
    * The service manages user submitted batch jobs and allocates Google Compute
    * Engine VM instances to run the jobs.
    * 
@@ -374,7 +374,7 @@ public void deleteJob( * * *
-     * List all Jobs for a project.
+     * List all Jobs for a project within a region.
      * 
*/ public void listJobs( @@ -456,7 +456,7 @@ public final io.grpc.ServerServiceDefinition bindService() { * * *
-   * Google Cloud Batch Service.
+   * Google Batch Service.
    * The service manages user submitted batch jobs and allocates Google Compute
    * Engine VM instances to run the jobs.
    * 
@@ -518,7 +518,7 @@ public void deleteJob( * * *
-     * List all Jobs for a project.
+     * List all Jobs for a project within a region.
      * 
*/ public void listJobs( @@ -561,7 +561,7 @@ public void listTasks( * * *
-   * Google Cloud Batch Service.
+   * Google Batch Service.
    * The service manages user submitted batch jobs and allocates Google Compute
    * Engine VM instances to run the jobs.
    * 
@@ -620,7 +620,7 @@ public com.google.longrunning.Operation deleteJob( * * *
-     * List all Jobs for a project.
+     * List all Jobs for a project within a region.
      * 
*/ public com.google.cloud.batch.v1.ListJobsResponse listJobs( @@ -660,7 +660,7 @@ public com.google.cloud.batch.v1.ListTasksResponse listTasks( * * *
-   * Google Cloud Batch Service.
+   * Google Batch Service.
    * The service manages user submitted batch jobs and allocates Google Compute
    * Engine VM instances to run the jobs.
    * 
@@ -720,7 +720,7 @@ public com.google.common.util.concurrent.ListenableFuture - * List all Jobs for a project. + * List all Jobs for a project within a region. * */ public com.google.common.util.concurrent.ListenableFuture< diff --git a/grpc-google-cloud-batch-v1alpha/pom.xml b/grpc-google-cloud-batch-v1alpha/pom.xml new file mode 100644 index 0000000..f349766 --- /dev/null +++ b/grpc-google-cloud-batch-v1alpha/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-batch-v1alpha + 0.1.2-SNAPSHOT + grpc-google-cloud-batch-v1alpha + GRPC library for google-cloud-batch + + com.google.cloud + google-cloud-batch-parent + 0.1.2-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-batch-v1alpha + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceGrpc.java b/grpc-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceGrpc.java new file mode 100644 index 0000000..ff9959b --- /dev/null +++ b/grpc-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchServiceGrpc.java @@ -0,0 +1,909 @@ +/* + * 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. + */ +package com.google.cloud.batch.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Google Batch Service.
+ * The service manages user submitted batch jobs and allocates Google Compute
+ * Engine VM instances to run the jobs.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/batch/v1alpha/batch.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class BatchServiceGrpc { + + private BatchServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.batch.v1alpha.BatchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.CreateJobRequest, com.google.cloud.batch.v1alpha.Job> + getCreateJobMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateJob", + requestType = com.google.cloud.batch.v1alpha.CreateJobRequest.class, + responseType = com.google.cloud.batch.v1alpha.Job.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.CreateJobRequest, com.google.cloud.batch.v1alpha.Job> + getCreateJobMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.CreateJobRequest, com.google.cloud.batch.v1alpha.Job> + getCreateJobMethod; + if ((getCreateJobMethod = BatchServiceGrpc.getCreateJobMethod) == null) { + synchronized (BatchServiceGrpc.class) { + if ((getCreateJobMethod = BatchServiceGrpc.getCreateJobMethod) == null) { + BatchServiceGrpc.getCreateJobMethod = + getCreateJobMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.CreateJobRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.Job.getDefaultInstance())) + .setSchemaDescriptor(new BatchServiceMethodDescriptorSupplier("CreateJob")) + .build(); + } + } + } + return getCreateJobMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.GetJobRequest, com.google.cloud.batch.v1alpha.Job> + getGetJobMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetJob", + requestType = com.google.cloud.batch.v1alpha.GetJobRequest.class, + responseType = com.google.cloud.batch.v1alpha.Job.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.GetJobRequest, com.google.cloud.batch.v1alpha.Job> + getGetJobMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.GetJobRequest, com.google.cloud.batch.v1alpha.Job> + getGetJobMethod; + if ((getGetJobMethod = BatchServiceGrpc.getGetJobMethod) == null) { + synchronized (BatchServiceGrpc.class) { + if ((getGetJobMethod = BatchServiceGrpc.getGetJobMethod) == null) { + BatchServiceGrpc.getGetJobMethod = + getGetJobMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.GetJobRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.Job.getDefaultInstance())) + .setSchemaDescriptor(new BatchServiceMethodDescriptorSupplier("GetJob")) + .build(); + } + } + } + return getGetJobMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.DeleteJobRequest, com.google.longrunning.Operation> + getDeleteJobMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteJob", + requestType = com.google.cloud.batch.v1alpha.DeleteJobRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.DeleteJobRequest, com.google.longrunning.Operation> + getDeleteJobMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.DeleteJobRequest, com.google.longrunning.Operation> + getDeleteJobMethod; + if ((getDeleteJobMethod = BatchServiceGrpc.getDeleteJobMethod) == null) { + synchronized (BatchServiceGrpc.class) { + if ((getDeleteJobMethod = BatchServiceGrpc.getDeleteJobMethod) == null) { + BatchServiceGrpc.getDeleteJobMethod = + getDeleteJobMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.DeleteJobRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new BatchServiceMethodDescriptorSupplier("DeleteJob")) + .build(); + } + } + } + return getDeleteJobMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.ListJobsRequest, + com.google.cloud.batch.v1alpha.ListJobsResponse> + getListJobsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListJobs", + requestType = com.google.cloud.batch.v1alpha.ListJobsRequest.class, + responseType = com.google.cloud.batch.v1alpha.ListJobsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.ListJobsRequest, + com.google.cloud.batch.v1alpha.ListJobsResponse> + getListJobsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.ListJobsRequest, + com.google.cloud.batch.v1alpha.ListJobsResponse> + getListJobsMethod; + if ((getListJobsMethod = BatchServiceGrpc.getListJobsMethod) == null) { + synchronized (BatchServiceGrpc.class) { + if ((getListJobsMethod = BatchServiceGrpc.getListJobsMethod) == null) { + BatchServiceGrpc.getListJobsMethod = + getListJobsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListJobs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.ListJobsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.ListJobsResponse.getDefaultInstance())) + .setSchemaDescriptor(new BatchServiceMethodDescriptorSupplier("ListJobs")) + .build(); + } + } + } + return getListJobsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.GetTaskRequest, com.google.cloud.batch.v1alpha.Task> + getGetTaskMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTask", + requestType = com.google.cloud.batch.v1alpha.GetTaskRequest.class, + responseType = com.google.cloud.batch.v1alpha.Task.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.GetTaskRequest, com.google.cloud.batch.v1alpha.Task> + getGetTaskMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.GetTaskRequest, com.google.cloud.batch.v1alpha.Task> + getGetTaskMethod; + if ((getGetTaskMethod = BatchServiceGrpc.getGetTaskMethod) == null) { + synchronized (BatchServiceGrpc.class) { + if ((getGetTaskMethod = BatchServiceGrpc.getGetTaskMethod) == null) { + BatchServiceGrpc.getGetTaskMethod = + getGetTaskMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTask")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.GetTaskRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.Task.getDefaultInstance())) + .setSchemaDescriptor(new BatchServiceMethodDescriptorSupplier("GetTask")) + .build(); + } + } + } + return getGetTaskMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.ListTasksRequest, + com.google.cloud.batch.v1alpha.ListTasksResponse> + getListTasksMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTasks", + requestType = com.google.cloud.batch.v1alpha.ListTasksRequest.class, + responseType = com.google.cloud.batch.v1alpha.ListTasksResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.ListTasksRequest, + com.google.cloud.batch.v1alpha.ListTasksResponse> + getListTasksMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.batch.v1alpha.ListTasksRequest, + com.google.cloud.batch.v1alpha.ListTasksResponse> + getListTasksMethod; + if ((getListTasksMethod = BatchServiceGrpc.getListTasksMethod) == null) { + synchronized (BatchServiceGrpc.class) { + if ((getListTasksMethod = BatchServiceGrpc.getListTasksMethod) == null) { + BatchServiceGrpc.getListTasksMethod = + getListTasksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTasks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.ListTasksRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.batch.v1alpha.ListTasksResponse + .getDefaultInstance())) + .setSchemaDescriptor(new BatchServiceMethodDescriptorSupplier("ListTasks")) + .build(); + } + } + } + return getListTasksMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static BatchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BatchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BatchServiceStub(channel, callOptions); + } + }; + return BatchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static BatchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BatchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BatchServiceBlockingStub(channel, callOptions); + } + }; + return BatchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static BatchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BatchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BatchServiceFutureStub(channel, callOptions); + } + }; + return BatchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Google Batch Service.
+   * The service manages user submitted batch jobs and allocates Google Compute
+   * Engine VM instances to run the jobs.
+   * 
+ */ + public abstract static class BatchServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Create a Job.
+     * 
+ */ + public void createJob( + com.google.cloud.batch.v1alpha.CreateJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateJobMethod(), responseObserver); + } + + /** + * + * + *
+     * Get a Job specified by its resource name.
+     * 
+ */ + public void getJob( + com.google.cloud.batch.v1alpha.GetJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetJobMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a Job.
+     * 
+ */ + public void deleteJob( + com.google.cloud.batch.v1alpha.DeleteJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteJobMethod(), responseObserver); + } + + /** + * + * + *
+     * List all Jobs for a project within a region.
+     * 
+ */ + public void listJobs( + com.google.cloud.batch.v1alpha.ListJobsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListJobsMethod(), responseObserver); + } + + /** + * + * + *
+     * Return a single Task.
+     * 
+ */ + public void getTask( + com.google.cloud.batch.v1alpha.GetTaskRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTaskMethod(), responseObserver); + } + + /** + * + * + *
+     * List Tasks associated with a job.
+     * 
+ */ + public void listTasks( + com.google.cloud.batch.v1alpha.ListTasksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTasksMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateJobMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.batch.v1alpha.CreateJobRequest, + com.google.cloud.batch.v1alpha.Job>(this, METHODID_CREATE_JOB))) + .addMethod( + getGetJobMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.batch.v1alpha.GetJobRequest, + com.google.cloud.batch.v1alpha.Job>(this, METHODID_GET_JOB))) + .addMethod( + getDeleteJobMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.batch.v1alpha.DeleteJobRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_JOB))) + .addMethod( + getListJobsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.batch.v1alpha.ListJobsRequest, + com.google.cloud.batch.v1alpha.ListJobsResponse>(this, METHODID_LIST_JOBS))) + .addMethod( + getGetTaskMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.batch.v1alpha.GetTaskRequest, + com.google.cloud.batch.v1alpha.Task>(this, METHODID_GET_TASK))) + .addMethod( + getListTasksMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.batch.v1alpha.ListTasksRequest, + com.google.cloud.batch.v1alpha.ListTasksResponse>(this, METHODID_LIST_TASKS))) + .build(); + } + } + + /** + * + * + *
+   * Google Batch Service.
+   * The service manages user submitted batch jobs and allocates Google Compute
+   * Engine VM instances to run the jobs.
+   * 
+ */ + public static final class BatchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private BatchServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BatchServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BatchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a Job.
+     * 
+ */ + public void createJob( + com.google.cloud.batch.v1alpha.CreateJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateJobMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Get a Job specified by its resource name.
+     * 
+ */ + public void getJob( + com.google.cloud.batch.v1alpha.GetJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetJobMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Delete a Job.
+     * 
+ */ + public void deleteJob( + com.google.cloud.batch.v1alpha.DeleteJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteJobMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List all Jobs for a project within a region.
+     * 
+ */ + public void listJobs( + com.google.cloud.batch.v1alpha.ListJobsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListJobsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Return a single Task.
+     * 
+ */ + public void getTask( + com.google.cloud.batch.v1alpha.GetTaskRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTaskMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List Tasks associated with a job.
+     * 
+ */ + public void listTasks( + com.google.cloud.batch.v1alpha.ListTasksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTasksMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Google Batch Service.
+   * The service manages user submitted batch jobs and allocates Google Compute
+   * Engine VM instances to run the jobs.
+   * 
+ */ + public static final class BatchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private BatchServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BatchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BatchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a Job.
+     * 
+ */ + public com.google.cloud.batch.v1alpha.Job createJob( + com.google.cloud.batch.v1alpha.CreateJobRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateJobMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get a Job specified by its resource name.
+     * 
+ */ + public com.google.cloud.batch.v1alpha.Job getJob( + com.google.cloud.batch.v1alpha.GetJobRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetJobMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a Job.
+     * 
+ */ + public com.google.longrunning.Operation deleteJob( + com.google.cloud.batch.v1alpha.DeleteJobRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteJobMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List all Jobs for a project within a region.
+     * 
+ */ + public com.google.cloud.batch.v1alpha.ListJobsResponse listJobs( + com.google.cloud.batch.v1alpha.ListJobsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListJobsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Return a single Task.
+     * 
+ */ + public com.google.cloud.batch.v1alpha.Task getTask( + com.google.cloud.batch.v1alpha.GetTaskRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTaskMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List Tasks associated with a job.
+     * 
+ */ + public com.google.cloud.batch.v1alpha.ListTasksResponse listTasks( + com.google.cloud.batch.v1alpha.ListTasksRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTasksMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Google Batch Service.
+   * The service manages user submitted batch jobs and allocates Google Compute
+   * Engine VM instances to run the jobs.
+   * 
+ */ + public static final class BatchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private BatchServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BatchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BatchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a Job.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createJob(com.google.cloud.batch.v1alpha.CreateJobRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateJobMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get a Job specified by its resource name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getJob(com.google.cloud.batch.v1alpha.GetJobRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetJobMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a Job.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteJob(com.google.cloud.batch.v1alpha.DeleteJobRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteJobMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List all Jobs for a project within a region.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.batch.v1alpha.ListJobsResponse> + listJobs(com.google.cloud.batch.v1alpha.ListJobsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListJobsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Return a single Task.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getTask(com.google.cloud.batch.v1alpha.GetTaskRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTaskMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List Tasks associated with a job.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.batch.v1alpha.ListTasksResponse> + listTasks(com.google.cloud.batch.v1alpha.ListTasksRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTasksMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_JOB = 0; + private static final int METHODID_GET_JOB = 1; + private static final int METHODID_DELETE_JOB = 2; + private static final int METHODID_LIST_JOBS = 3; + private static final int METHODID_GET_TASK = 4; + private static final int METHODID_LIST_TASKS = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final BatchServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(BatchServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_JOB: + serviceImpl.createJob( + (com.google.cloud.batch.v1alpha.CreateJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_JOB: + serviceImpl.getJob( + (com.google.cloud.batch.v1alpha.GetJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_JOB: + serviceImpl.deleteJob( + (com.google.cloud.batch.v1alpha.DeleteJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_JOBS: + serviceImpl.listJobs( + (com.google.cloud.batch.v1alpha.ListJobsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_TASK: + serviceImpl.getTask( + (com.google.cloud.batch.v1alpha.GetTaskRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_TASKS: + serviceImpl.listTasks( + (com.google.cloud.batch.v1alpha.ListTasksRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class BatchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + BatchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("BatchService"); + } + } + + private static final class BatchServiceFileDescriptorSupplier + extends BatchServiceBaseDescriptorSupplier { + BatchServiceFileDescriptorSupplier() {} + } + + private static final class BatchServiceMethodDescriptorSupplier + extends BatchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + BatchServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (BatchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new BatchServiceFileDescriptorSupplier()) + .addMethod(getCreateJobMethod()) + .addMethod(getGetJobMethod()) + .addMethod(getDeleteJobMethod()) + .addMethod(getListJobsMethod()) + .addMethod(getGetTaskMethod()) + .addMethod(getListTasksMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index efdfeeb..b83594d 100644 --- a/pom.xml +++ b/pom.xml @@ -71,6 +71,16 @@ google-cloud-batch 0.1.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-batch-v1alpha + 0.1.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-batch-v1alpha + 0.1.2-SNAPSHOT + com.google.api.grpc grpc-google-cloud-batch-v1 @@ -112,7 +122,9 @@ google-cloud-batch grpc-google-cloud-batch-v1 + grpc-google-cloud-batch-v1alpha proto-google-cloud-batch-v1 + proto-google-cloud-batch-v1alpha google-cloud-batch-bom diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java index 0928bfd..31c0d7a 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/AllocationPolicy.java @@ -383,8 +383,11 @@ public interface LocationPolicyOrBuilder * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -397,8 +400,11 @@ public interface LocationPolicyOrBuilder * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -411,8 +417,11 @@ public interface LocationPolicyOrBuilder * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -426,8 +435,11 @@ public interface LocationPolicyOrBuilder * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -437,16 +449,7 @@ public interface LocationPolicyOrBuilder */ com.google.protobuf.ByteString getAllowedLocationsBytes(int index); } - /** - * - * - *
-   * Be consistent with LocationPolicy in
-   * //cloud/cluster/api/mixer_instances.proto.
-   * 
- * - * Protobuf type {@code google.cloud.batch.v1.AllocationPolicy.LocationPolicy} - */ + /** Protobuf type {@code google.cloud.batch.v1.AllocationPolicy.LocationPolicy} */ public static final class LocationPolicy extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.batch.v1.AllocationPolicy.LocationPolicy) @@ -547,8 +550,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -563,8 +569,11 @@ public com.google.protobuf.ProtocolStringList getAllowedLocationsList() { * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -579,8 +588,11 @@ public int getAllowedLocationsCount() { * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -596,8 +608,11 @@ public java.lang.String getAllowedLocations(int index) { * *
      * A list of allowed location names represented by internal URLs,
-     * for example, zones/us-central1-a, regions/us-west1.
-     * First location in the list should be a region.
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
      * 
* * repeated string allowed_locations = 1; @@ -777,16 +792,7 @@ protected Builder newBuilderForType( Builder builder = new Builder(parent); return builder; } - /** - * - * - *
-     * Be consistent with LocationPolicy in
-     * //cloud/cluster/api/mixer_instances.proto.
-     * 
- * - * Protobuf type {@code google.cloud.batch.v1.AllocationPolicy.LocationPolicy} - */ + /** Protobuf type {@code google.cloud.batch.v1.AllocationPolicy.LocationPolicy} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements @@ -967,8 +973,11 @@ private void ensureAllowedLocationsIsMutable() { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -983,8 +992,11 @@ public com.google.protobuf.ProtocolStringList getAllowedLocationsList() { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -999,8 +1011,11 @@ public int getAllowedLocationsCount() { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -1016,8 +1031,11 @@ public java.lang.String getAllowedLocations(int index) { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -1033,8 +1051,11 @@ public com.google.protobuf.ByteString getAllowedLocationsBytes(int index) { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -1057,8 +1078,11 @@ public Builder setAllowedLocations(int index, java.lang.String value) { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -1080,8 +1104,11 @@ public Builder addAllowedLocations(java.lang.String value) { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -1100,8 +1127,11 @@ public Builder addAllAllowedLocations(java.lang.Iterable value * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -1119,8 +1149,11 @@ public Builder clearAllowedLocations() { * *
        * A list of allowed location names represented by internal URLs,
-       * for example, zones/us-central1-a, regions/us-west1.
-       * First location in the list should be a region.
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
        * 
* * repeated string allowed_locations = 1; @@ -4639,6 +4672,7 @@ public interface InstancePolicyOrBuilder * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -4653,6 +4687,7 @@ public interface InstancePolicyOrBuilder * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -4693,6 +4728,7 @@ public interface InstancePolicyOrBuilder * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -4703,6 +4739,7 @@ public interface InstancePolicyOrBuilder * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -4713,6 +4750,7 @@ public interface InstancePolicyOrBuilder * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -4723,6 +4761,7 @@ public interface InstancePolicyOrBuilder * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -4734,6 +4773,7 @@ public interface InstancePolicyOrBuilder * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -5005,6 +5045,7 @@ public com.google.protobuf.ByteString getMachineTypeBytes() { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -5030,6 +5071,7 @@ public java.lang.String getMinCpuPlatform() { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -5096,6 +5138,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel getProvision * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -5110,6 +5153,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel getProvision * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -5124,6 +5168,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel getProvision * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -5137,6 +5182,7 @@ public int getAcceleratorsCount() { * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -5150,6 +5196,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator getAccelerators(in * *
      * The accelerators attached to each VM instance.
+     * Not yet implemented.
      * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -5823,6 +5870,7 @@ public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -5847,6 +5895,7 @@ public java.lang.String getMinCpuPlatform() { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -5871,6 +5920,7 @@ public com.google.protobuf.ByteString getMinCpuPlatformBytes() { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -5894,6 +5944,7 @@ public Builder setMinCpuPlatform(java.lang.String value) { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -5913,6 +5964,7 @@ public Builder clearMinCpuPlatform() { * The minimum CPU platform. * See * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. * * * string min_cpu_platform = 3; @@ -6054,6 +6106,7 @@ private void ensureAcceleratorsIsMutable() { * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6071,6 +6124,7 @@ private void ensureAcceleratorsIsMutable() { * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6087,6 +6141,7 @@ public int getAcceleratorsCount() { * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6103,6 +6158,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator getAccelerators(in * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6126,6 +6182,7 @@ public Builder setAccelerators( * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6147,6 +6204,7 @@ public Builder setAccelerators( * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6169,6 +6227,7 @@ public Builder addAccelerators(com.google.cloud.batch.v1.AllocationPolicy.Accele * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6192,6 +6251,7 @@ public Builder addAccelerators( * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6212,6 +6272,7 @@ public Builder addAccelerators( * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6233,6 +6294,7 @@ public Builder addAccelerators( * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6254,6 +6316,7 @@ public Builder addAllAccelerators( * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6273,6 +6336,7 @@ public Builder clearAccelerators() { * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6292,6 +6356,7 @@ public Builder removeAccelerators(int index) { * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6305,6 +6370,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator.Builder getAcceler * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6322,6 +6388,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator.Builder getAcceler * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6340,6 +6407,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator.Builder getAcceler * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6355,6 +6423,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator.Builder getAcceler * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; @@ -6370,6 +6439,7 @@ public com.google.cloud.batch.v1.AllocationPolicy.Accelerator.Builder addAcceler * *
        * The accelerators attached to each VM instance.
+       * Not yet implemented.
        * 
* * repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java index 7c67f30..88415b6 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/BatchProto.java @@ -133,10 +133,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "/{parent=projects/*/locations/*/jobs/*/t" + "askGroups/*}/tasks\332A\006parent\032H\312A\024batch.go" + "ogleapis.com\322A.https://www.googleapis.co" - + "m/auth/cloud-platformBk\n\031com.google.clou" - + "d.batch.v1B\nBatchProtoP\001Z:google.golang." - + "org/genproto/googleapis/cloud/batch/v1;b" - + "atch\242\002\003GCBb\006proto3" + + "m/auth/cloud-platformB\266\001\n\031com.google.clo" + + "ud.batch.v1B\nBatchProtoP\001Z:google.golang" + + ".org/genproto/googleapis/cloud/batch/v1;" + + "batch\242\002\003GCB\252\002\025Google.Cloud.Batch.V1\312\002\025Go" + + "ogle\\Cloud\\Batch\\V1\352\002\030Google::Cloud::Bat" + + "ch::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java index 41baffc..9c0e0a2 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequest.java @@ -150,7 +150,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The parent resource name where the Job will be created.
-   * Format: projects/{project}/locations/{location}
+   * Pattern: "projects/{project}/locations/{location}"
    * 
* * @@ -176,7 +176,7 @@ public java.lang.String getParent() { * *
    * Required. The parent resource name where the Job will be created.
-   * Format: projects/{project}/locations/{location}
+   * Pattern: "projects/{project}/locations/{location}"
    * 
* * @@ -756,7 +756,7 @@ public Builder mergeFrom( * *
      * Required. The parent resource name where the Job will be created.
-     * Format: projects/{project}/locations/{location}
+     * Pattern: "projects/{project}/locations/{location}"
      * 
* * @@ -781,7 +781,7 @@ public java.lang.String getParent() { * *
      * Required. The parent resource name where the Job will be created.
-     * Format: projects/{project}/locations/{location}
+     * Pattern: "projects/{project}/locations/{location}"
      * 
* * @@ -806,7 +806,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The parent resource name where the Job will be created.
-     * Format: projects/{project}/locations/{location}
+     * Pattern: "projects/{project}/locations/{location}"
      * 
* * @@ -830,7 +830,7 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The parent resource name where the Job will be created.
-     * Format: projects/{project}/locations/{location}
+     * Pattern: "projects/{project}/locations/{location}"
      * 
* * @@ -850,7 +850,7 @@ public Builder clearParent() { * *
      * Required. The parent resource name where the Job will be created.
-     * Format: projects/{project}/locations/{location}
+     * Pattern: "projects/{project}/locations/{location}"
      * 
* * diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java index a50e9db..4a68932 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/CreateJobRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface CreateJobRequestOrBuilder * *
    * Required. The parent resource name where the Job will be created.
-   * Format: projects/{project}/locations/{location}
+   * Pattern: "projects/{project}/locations/{location}"
    * 
* * @@ -43,7 +43,7 @@ public interface CreateJobRequestOrBuilder * *
    * Required. The parent resource name where the Job will be created.
-   * Format: projects/{project}/locations/{location}
+   * Pattern: "projects/{project}/locations/{location}"
    * 
* * diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java index facf6a2..ca2d0f0 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Job.java @@ -264,12 +264,11 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * * *
-   * Job name.
-   * It must have the format of "projects/*/locations/*/jobs/*".
-   * For example: "projects/123456/locations/us-west1/jobs/job01".
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The name. */ @@ -289,12 +288,11 @@ public java.lang.String getName() { * * *
-   * Job name.
-   * It must have the format of "projects/*/locations/*/jobs/*".
-   * For example: "projects/123456/locations/us-west1/jobs/job01".
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for name. */ @@ -368,7 +366,8 @@ public com.google.protobuf.ByteString getUidBytes() { *
    * Priority of the Job.
    * The valid value range is [0, 100).
-   * A job with higher priority value will be scheduled to run earlier.
+   * A job with higher priority value is more likely to run earlier if all other
+   * requirements are satisfied.
    * 
* * int64 priority = 3; @@ -696,10 +695,11 @@ public com.google.cloud.batch.v1.JobStatusOrBuilder getStatusOrBuilder() { * * *
-   * When the Job was created.
+   * Output only. When the Job was created.
    * 
* - * .google.protobuf.Timestamp create_time = 11; + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -711,10 +711,11 @@ public boolean hasCreateTime() { * * *
-   * When the Job was created.
+   * Output only. When the Job was created.
    * 
* - * .google.protobuf.Timestamp create_time = 11; + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -726,10 +727,11 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
-   * When the Job was created.
+   * Output only. When the Job was created.
    * 
* - * .google.protobuf.Timestamp create_time = 11; + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { @@ -742,10 +744,11 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-   * The last time the Job was updated.
+   * Output only. The last time the Job was updated.
    * 
* - * .google.protobuf.Timestamp update_time = 12; + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -757,10 +760,11 @@ public boolean hasUpdateTime() { * * *
-   * The last time the Job was updated.
+   * Output only. The last time the Job was updated.
    * 
* - * .google.protobuf.Timestamp update_time = 12; + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -772,10 +776,11 @@ public com.google.protobuf.Timestamp getUpdateTime() { * * *
-   * The last time the Job was updated.
+   * Output only. The last time the Job was updated.
    * 
* - * .google.protobuf.Timestamp update_time = 12; + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { @@ -1540,12 +1545,11 @@ public Builder mergeFrom( * * *
-     * Job name.
-     * It must have the format of "projects/*/locations/*/jobs/*".
-     * For example: "projects/123456/locations/us-west1/jobs/job01".
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The name. */ @@ -1564,12 +1568,11 @@ public java.lang.String getName() { * * *
-     * Job name.
-     * It must have the format of "projects/*/locations/*/jobs/*".
-     * For example: "projects/123456/locations/us-west1/jobs/job01".
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for name. */ @@ -1588,12 +1591,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Job name.
-     * It must have the format of "projects/*/locations/*/jobs/*".
-     * For example: "projects/123456/locations/us-west1/jobs/job01".
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The name to set. * @return This builder for chaining. @@ -1611,12 +1613,11 @@ public Builder setName(java.lang.String value) { * * *
-     * Job name.
-     * It must have the format of "projects/*/locations/*/jobs/*".
-     * For example: "projects/123456/locations/us-west1/jobs/job01".
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return This builder for chaining. */ @@ -1630,12 +1631,11 @@ public Builder clearName() { * * *
-     * Job name.
-     * It must have the format of "projects/*/locations/*/jobs/*".
-     * For example: "projects/123456/locations/us-west1/jobs/job01".
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1764,7 +1764,8 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { *
      * Priority of the Job.
      * The valid value range is [0, 100).
-     * A job with higher priority value will be scheduled to run earlier.
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
      * 
* * int64 priority = 3; @@ -1781,7 +1782,8 @@ public long getPriority() { *
      * Priority of the Job.
      * The valid value range is [0, 100).
-     * A job with higher priority value will be scheduled to run earlier.
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
      * 
* * int64 priority = 3; @@ -1801,7 +1803,8 @@ public Builder setPriority(long value) { *
      * Priority of the Job.
      * The valid value range is [0, 100).
-     * A job with higher priority value will be scheduled to run earlier.
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
      * 
* * int64 priority = 3; @@ -2815,10 +2818,12 @@ public com.google.cloud.batch.v1.JobStatusOrBuilder getStatusOrBuilder() { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -2829,10 +2834,12 @@ public boolean hasCreateTime() { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -2849,10 +2856,12 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -2871,10 +2880,12 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { @@ -2890,10 +2901,12 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -2914,10 +2927,12 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearCreateTime() { if (createTimeBuilder_ == null) { @@ -2934,10 +2949,12 @@ public Builder clearCreateTime() { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { @@ -2948,10 +2965,12 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { if (createTimeBuilder_ != null) { @@ -2966,10 +2985,12 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-     * When the Job was created.
+     * Output only. When the Job was created.
      * 
* - * .google.protobuf.Timestamp create_time = 11; + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -2998,10 +3019,12 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -3012,10 +3035,12 @@ public boolean hasUpdateTime() { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -3032,10 +3057,12 @@ public com.google.protobuf.Timestamp getUpdateTime() { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { @@ -3054,10 +3081,12 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (updateTimeBuilder_ == null) { @@ -3073,10 +3102,12 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { @@ -3097,10 +3128,12 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearUpdateTime() { if (updateTimeBuilder_ == null) { @@ -3117,10 +3150,12 @@ public Builder clearUpdateTime() { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { @@ -3131,10 +3166,12 @@ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { if (updateTimeBuilder_ != null) { @@ -3149,10 +3186,12 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-     * The last time the Job was updated.
+     * Output only. The last time the Job was updated.
      * 
* - * .google.protobuf.Timestamp update_time = 12; + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotification.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotification.java index fe1c6b9..3a575ab 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotification.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotification.java @@ -372,7 +372,7 @@ public interface MessageOrBuilder * *
    * Message details.
-   * Describe a list of attributes this message should have.
+   * Describe the attribute that a message should have.
    * Without specified message attributes, no message will be sent by default.
    * 
* @@ -773,7 +773,7 @@ protected Builder newBuilderForType( * *
      * Message details.
-     * Describe a list of attributes this message should have.
+     * Describe the attribute that a message should have.
      * Without specified message attributes, no message will be sent by default.
      * 
* @@ -1277,10 +1277,10 @@ public com.google.cloud.batch.v1.JobNotification.Message getDefaultInstanceForTy * *
    * The Pub/Sub topic where notifications like the job state changes
-   * will be published. This topic should be an existing topic in the same
-   * project with the job and billings will be charged to this project. If no
-   * topic is specified, there will be no Pub/Sub messages sent. Topic
-   * format is `projects/{project}/topics/{topic}`.
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
    * 
* * string pubsub_topic = 1; @@ -1304,10 +1304,10 @@ public java.lang.String getPubsubTopic() { * *
    * The Pub/Sub topic where notifications like the job state changes
-   * will be published. This topic should be an existing topic in the same
-   * project with the job and billings will be charged to this project. If no
-   * topic is specified, there will be no Pub/Sub messages sent. Topic
-   * format is `projects/{project}/topics/{topic}`.
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
    * 
* * string pubsub_topic = 1; @@ -1333,9 +1333,8 @@ public com.google.protobuf.ByteString getPubsubTopicBytes() { * * *
-   * The message caters the message attributes configuration will to be sent
-   * to this Pub/Sub topic. Without this field, there is no message being sent
-   * by default.
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
    * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1350,9 +1349,8 @@ public boolean hasMessage() { * * *
-   * The message caters the message attributes configuration will to be sent
-   * to this Pub/Sub topic. Without this field, there is no message being sent
-   * by default.
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
    * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1369,9 +1367,8 @@ public com.google.cloud.batch.v1.JobNotification.Message getMessage() { * * *
-   * The message caters the message attributes configuration will to be sent
-   * to this Pub/Sub topic. Without this field, there is no message being sent
-   * by default.
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
    * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1731,10 +1728,10 @@ public Builder mergeFrom( * *
      * The Pub/Sub topic where notifications like the job state changes
-     * will be published. This topic should be an existing topic in the same
-     * project with the job and billings will be charged to this project. If no
-     * topic is specified, there will be no Pub/Sub messages sent. Topic
-     * format is `projects/{project}/topics/{topic}`.
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
      * 
* * string pubsub_topic = 1; @@ -1757,10 +1754,10 @@ public java.lang.String getPubsubTopic() { * *
      * The Pub/Sub topic where notifications like the job state changes
-     * will be published. This topic should be an existing topic in the same
-     * project with the job and billings will be charged to this project. If no
-     * topic is specified, there will be no Pub/Sub messages sent. Topic
-     * format is `projects/{project}/topics/{topic}`.
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
      * 
* * string pubsub_topic = 1; @@ -1783,10 +1780,10 @@ public com.google.protobuf.ByteString getPubsubTopicBytes() { * *
      * The Pub/Sub topic where notifications like the job state changes
-     * will be published. This topic should be an existing topic in the same
-     * project with the job and billings will be charged to this project. If no
-     * topic is specified, there will be no Pub/Sub messages sent. Topic
-     * format is `projects/{project}/topics/{topic}`.
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
      * 
* * string pubsub_topic = 1; @@ -1808,10 +1805,10 @@ public Builder setPubsubTopic(java.lang.String value) { * *
      * The Pub/Sub topic where notifications like the job state changes
-     * will be published. This topic should be an existing topic in the same
-     * project with the job and billings will be charged to this project. If no
-     * topic is specified, there will be no Pub/Sub messages sent. Topic
-     * format is `projects/{project}/topics/{topic}`.
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
      * 
* * string pubsub_topic = 1; @@ -1829,10 +1826,10 @@ public Builder clearPubsubTopic() { * *
      * The Pub/Sub topic where notifications like the job state changes
-     * will be published. This topic should be an existing topic in the same
-     * project with the job and billings will be charged to this project. If no
-     * topic is specified, there will be no Pub/Sub messages sent. Topic
-     * format is `projects/{project}/topics/{topic}`.
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
      * 
* * string pubsub_topic = 1; @@ -1861,9 +1858,8 @@ public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1877,9 +1873,8 @@ public boolean hasMessage() { * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1899,9 +1894,8 @@ public com.google.cloud.batch.v1.JobNotification.Message getMessage() { * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1923,9 +1917,8 @@ public Builder setMessage(com.google.cloud.batch.v1.JobNotification.Message valu * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1945,9 +1938,8 @@ public Builder setMessage( * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1973,9 +1965,8 @@ public Builder mergeMessage(com.google.cloud.batch.v1.JobNotification.Message va * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -1995,9 +1986,8 @@ public Builder clearMessage() { * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -2011,9 +2001,8 @@ public com.google.cloud.batch.v1.JobNotification.Message.Builder getMessageBuild * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -2031,9 +2020,8 @@ public com.google.cloud.batch.v1.JobNotification.MessageOrBuilder getMessageOrBu * * *
-     * The message caters the message attributes configuration will to be sent
-     * to this Pub/Sub topic. Without this field, there is no message being sent
-     * by default.
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
      * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotificationOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotificationOrBuilder.java index 81b7a3d..e3e8b48 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotificationOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobNotificationOrBuilder.java @@ -28,10 +28,10 @@ public interface JobNotificationOrBuilder * *
    * The Pub/Sub topic where notifications like the job state changes
-   * will be published. This topic should be an existing topic in the same
-   * project with the job and billings will be charged to this project. If no
-   * topic is specified, there will be no Pub/Sub messages sent. Topic
-   * format is `projects/{project}/topics/{topic}`.
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
    * 
* * string pubsub_topic = 1; @@ -44,10 +44,10 @@ public interface JobNotificationOrBuilder * *
    * The Pub/Sub topic where notifications like the job state changes
-   * will be published. This topic should be an existing topic in the same
-   * project with the job and billings will be charged to this project. If no
-   * topic is specified, there will be no Pub/Sub messages sent. Topic
-   * format is `projects/{project}/topics/{topic}`.
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
    * 
* * string pubsub_topic = 1; @@ -60,9 +60,8 @@ public interface JobNotificationOrBuilder * * *
-   * The message caters the message attributes configuration will to be sent
-   * to this Pub/Sub topic. Without this field, there is no message being sent
-   * by default.
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
    * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -74,9 +73,8 @@ public interface JobNotificationOrBuilder * * *
-   * The message caters the message attributes configuration will to be sent
-   * to this Pub/Sub topic. Without this field, there is no message being sent
-   * by default.
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
    * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; @@ -88,9 +86,8 @@ public interface JobNotificationOrBuilder * * *
-   * The message caters the message attributes configuration will to be sent
-   * to this Pub/Sub topic. Without this field, there is no message being sent
-   * by default.
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
    * 
* * .google.cloud.batch.v1.JobNotification.Message message = 2; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java index 63201e4..0f2caa6 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobOrBuilder.java @@ -27,12 +27,11 @@ public interface JobOrBuilder * * *
-   * Job name.
-   * It must have the format of "projects/*/locations/*/jobs/*".
-   * For example: "projects/123456/locations/us-west1/jobs/job01".
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The name. */ @@ -41,12 +40,11 @@ public interface JobOrBuilder * * *
-   * Job name.
-   * It must have the format of "projects/*/locations/*/jobs/*".
-   * For example: "projects/123456/locations/us-west1/jobs/job01".
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for name. */ @@ -83,7 +81,8 @@ public interface JobOrBuilder *
    * Priority of the Job.
    * The valid value range is [0, 100).
-   * A job with higher priority value will be scheduled to run earlier.
+   * A job with higher priority value is more likely to run earlier if all other
+   * requirements are satisfied.
    * 
* * int64 priority = 3; @@ -335,10 +334,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * When the Job was created.
+   * Output only. When the Job was created.
    * 
* - * .google.protobuf.Timestamp create_time = 11; + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -347,10 +347,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * When the Job was created.
+   * Output only. When the Job was created.
    * 
* - * .google.protobuf.Timestamp create_time = 11; + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -359,10 +360,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * When the Job was created.
+   * Output only. When the Job was created.
    * 
* - * .google.protobuf.Timestamp create_time = 11; + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); @@ -370,10 +372,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * The last time the Job was updated.
+   * Output only. The last time the Job was updated.
    * 
* - * .google.protobuf.Timestamp update_time = 12; + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -382,10 +385,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * The last time the Job was updated.
+   * Output only. The last time the Job was updated.
    * 
* - * .google.protobuf.Timestamp update_time = 12; + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -394,10 +398,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * The last time the Job was updated.
+   * Output only. The last time the Job was updated.
    * 
* - * .google.protobuf.Timestamp update_time = 12; + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobProto.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobProto.java index cfd1a50..ae4cc63 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobProto.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobProto.java @@ -125,106 +125,108 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ior.proto\032\031google/api/resource.proto\032 go" + "ogle/cloud/batch/v1/task.proto\032\036google/p" + "rotobuf/duration.proto\032\037google/protobuf/" - + "timestamp.proto\"\201\005\n\003Job\022\014\n\004name\030\001 \001(\t\022\020\n" - + "\003uid\030\002 \001(\tB\003\340A\003\022\020\n\010priority\030\003 \001(\003\022:\n\013tas" - + "k_groups\030\004 \003(\0132 .google.cloud.batch.v1.T" - + "askGroupB\003\340A\002\022B\n\021allocation_policy\030\007 \001(\013" - + "2\'.google.cloud.batch.v1.AllocationPolic" - + "y\0226\n\006labels\030\010 \003(\0132&.google.cloud.batch.v" - + "1.Job.LabelsEntry\0225\n\006status\030\t \001(\0132 .goog" - + "le.cloud.batch.v1.JobStatusB\003\340A\003\022/\n\013crea" - + "te_time\030\013 \001(\0132\032.google.protobuf.Timestam" - + "p\022/\n\013update_time\030\014 \001(\0132\032.google.protobuf" - + ".Timestamp\0226\n\013logs_policy\030\r \001(\0132!.google" - + ".cloud.batch.v1.LogsPolicy\022=\n\rnotificati" - + "ons\030\016 \003(\0132&.google.cloud.batch.v1.JobNot" - + "ification\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\001:Q\352AN\n\030batch.googleapis." - + "com/Job\0222projects/{project}/locations/{l" - + "ocation}/jobs/{job}\"\254\001\n\nLogsPolicy\022B\n\013de" - + "stination\030\001 \001(\0162-.google.cloud.batch.v1." - + "LogsPolicy.Destination\022\021\n\tlogs_path\030\002 \001(" - + "\t\"G\n\013Destination\022\033\n\027DESTINATION_UNSPECIF" - + "IED\020\000\022\021\n\rCLOUD_LOGGING\020\001\022\010\n\004PATH\020\002\"\277\006\n\tJ" - + "obStatus\0225\n\005state\030\001 \001(\0162&.google.cloud.b" - + "atch.v1.JobStatus.State\0229\n\rstatus_events" - + "\030\002 \003(\0132\".google.cloud.batch.v1.StatusEve" - + "nt\022E\n\013task_groups\030\004 \003(\01320.google.cloud.b" - + "atch.v1.JobStatus.TaskGroupsEntry\022/\n\014run" - + "_duration\030\005 \001(\0132\031.google.protobuf.Durati" - + "on\032\220\001\n\016InstanceStatus\022\024\n\014machine_type\030\001 " - + "\001(\t\022U\n\022provisioning_model\030\002 \001(\01629.google" - + ".cloud.batch.v1.AllocationPolicy.Provisi" - + "oningModel\022\021\n\ttask_pack\030\003 \001(\003\032\322\001\n\017TaskGr" - + "oupStatus\022L\n\006counts\030\001 \003(\0132<.google.cloud" - + ".batch.v1.JobStatus.TaskGroupStatus.Coun" - + "tsEntry\022B\n\tinstances\030\002 \003(\0132/.google.clou" - + "d.batch.v1.JobStatus.InstanceStatus\032-\n\013C" - + "ountsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\002" - + "8\001\032c\n\017TaskGroupsEntry\022\013\n\003key\030\001 \001(\t\022?\n\005va" - + "lue\030\002 \001(\01320.google.cloud.batch.v1.JobSta" - + "tus.TaskGroupStatus:\0028\001\"{\n\005State\022\025\n\021STAT" - + "E_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\"\374\002\n\017JobNoti" - + "fication\022\024\n\014pubsub_topic\030\001 \001(\t\022?\n\007messag" - + "e\030\002 \001(\0132..google.cloud.batch.v1.JobNotif" - + "ication.Message\032\304\001\n\007Message\0229\n\004type\030\001 \001(" - + "\0162+.google.cloud.batch.v1.JobNotificatio" - + "n.Type\022=\n\rnew_job_state\030\002 \001(\0162&.google.c" - + "loud.batch.v1.JobStatus.State\022?\n\016new_tas" - + "k_state\030\003 \001(\0162\'.google.cloud.batch.v1.Ta" - + "skStatus.State\"K\n\004Type\022\024\n\020TYPE_UNSPECIFI" - + "ED\020\000\022\025\n\021JOB_STATE_CHANGED\020\001\022\026\n\022TASK_STAT" - + "E_CHANGED\020\002\"\221\013\n\020AllocationPolicy\022H\n\010loca" - + "tion\030\001 \001(\01326.google.cloud.batch.v1.Alloc" - + "ationPolicy.LocationPolicy\022S\n\tinstances\030" - + "\010 \003(\0132@.google.cloud.batch.v1.Allocation" - + "Policy.InstancePolicyOrTemplate\022C\n\006label" - + "s\030\006 \003(\01323.google.cloud.batch.v1.Allocati" - + "onPolicy.LabelsEntry\022F\n\007network\030\007 \001(\01325." - + "google.cloud.batch.v1.AllocationPolicy.N" - + "etworkPolicy\032+\n\016LocationPolicy\022\031\n\021allowe" - + "d_locations\030\001 \003(\t\032Y\n\004Disk\022\017\n\005image\030\004 \001(\t" - + "H\000\022\022\n\010snapshot\030\005 \001(\tH\000\022\014\n\004type\030\001 \001(\t\022\017\n\007" - + "size_gb\030\002 \001(\003B\r\n\013data_source\032\212\001\n\014Attache" - + "dDisk\022@\n\010new_disk\030\001 \001(\0132,.google.cloud.b" - + "atch.v1.AllocationPolicy.DiskH\000\022\027\n\rexist" - + "ing_disk\030\002 \001(\tH\000\022\023\n\013device_name\030\003 \001(\tB\n\n" - + "\010attached\032*\n\013Accelerator\022\014\n\004type\030\001 \001(\t\022\r" - + "\n\005count\030\002 \001(\003\032\247\002\n\016InstancePolicy\022\024\n\014mach" - + "ine_type\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 \001(\t" - + "\022U\n\022provisioning_model\030\004 \001(\01629.google.cl" - + "oud.batch.v1.AllocationPolicy.Provisioni" - + "ngModel\022I\n\014accelerators\030\005 \003(\01323.google.c" - + "loud.batch.v1.AllocationPolicy.Accelerat" - + "or\022C\n\005disks\030\006 \003(\01324.google.cloud.batch.v" - + "1.AllocationPolicy.AttachedDisk\032\224\001\n\030Inst" - + "ancePolicyOrTemplate\022H\n\006policy\030\001 \001(\01326.g" - + "oogle.cloud.batch.v1.AllocationPolicy.In" - + "stancePolicyH\000\022\033\n\021instance_template\030\002 \001(" - + "\tH\000B\021\n\017policy_template\032W\n\020NetworkInterfa" - + "ce\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\032e\n\rNetwo" - + "rkPolicy\022T\n\022network_interfaces\030\001 \003(\01328.g" - + "oogle.cloud.batch.v1.AllocationPolicy.Ne" - + "tworkInterface\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" - + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\021ProvisioningMod" - + "el\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\"" - + "\201\003\n\tTaskGroup\022\021\n\004name\030\001 \001(\tB\003\340A\003\0227\n\ttask" - + "_spec\030\003 \001(\0132\037.google.cloud.batch.v1.Task" - + "SpecB\003\340A\002\022\022\n\ntask_count\030\004 \001(\003\022\023\n\013paralle" - + "lism\030\005 \001(\003\022=\n\021task_environments\030\t \003(\0132\"." - + "google.cloud.batch.v1.Environment\022\033\n\023tas" - + "k_count_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:o\352Al\n" - + "\036batch.googleapis.com/TaskGroup\022Jproject" - + "s/{project}/locations/{location}/jobs/{j" - + "ob}/taskGroups/{task_group}Bi\n\031com.googl" - + "e.cloud.batch.v1B\010JobProtoP\001Z:google.gol" - + "ang.org/genproto/googleapis/cloud/batch/" - + "v1;batch\242\002\003GCBb\006proto3" + + "timestamp.proto\"\220\005\n\003Job\022\021\n\004name\030\001 \001(\tB\003\340" + + "A\003\022\020\n\003uid\030\002 \001(\tB\003\340A\003\022\020\n\010priority\030\003 \001(\003\022:" + + "\n\013task_groups\030\004 \003(\0132 .google.cloud.batch" + + ".v1.TaskGroupB\003\340A\002\022B\n\021allocation_policy\030" + + "\007 \001(\0132\'.google.cloud.batch.v1.Allocation" + + "Policy\0226\n\006labels\030\010 \003(\0132&.google.cloud.ba" + + "tch.v1.Job.LabelsEntry\0225\n\006status\030\t \001(\0132 " + + ".google.cloud.batch.v1.JobStatusB\003\340A\003\0224\n" + + "\013create_time\030\013 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\0224\n\013update_time\030\014 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\0226\n\013logs_policy" + + "\030\r \001(\0132!.google.cloud.batch.v1.LogsPolic" + + "y\022=\n\rnotifications\030\016 \003(\0132&.google.cloud." + + "batch.v1.JobNotification\032-\n\013LabelsEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:Q\352AN\n\030ba" + + "tch.googleapis.com/Job\0222projects/{projec" + + "t}/locations/{location}/jobs/{job}\"\254\001\n\nL" + + "ogsPolicy\022B\n\013destination\030\001 \001(\0162-.google." + + "cloud.batch.v1.LogsPolicy.Destination\022\021\n" + + "\tlogs_path\030\002 \001(\t\"G\n\013Destination\022\033\n\027DESTI" + + "NATION_UNSPECIFIED\020\000\022\021\n\rCLOUD_LOGGING\020\001\022" + + "\010\n\004PATH\020\002\"\277\006\n\tJobStatus\0225\n\005state\030\001 \001(\0162&" + + ".google.cloud.batch.v1.JobStatus.State\0229" + + "\n\rstatus_events\030\002 \003(\0132\".google.cloud.bat" + + "ch.v1.StatusEvent\022E\n\013task_groups\030\004 \003(\01320" + + ".google.cloud.batch.v1.JobStatus.TaskGro" + + "upsEntry\022/\n\014run_duration\030\005 \001(\0132\031.google." + + "protobuf.Duration\032\220\001\n\016InstanceStatus\022\024\n\014" + + "machine_type\030\001 \001(\t\022U\n\022provisioning_model" + + "\030\002 \001(\01629.google.cloud.batch.v1.Allocatio" + + "nPolicy.ProvisioningModel\022\021\n\ttask_pack\030\003" + + " \001(\003\032\322\001\n\017TaskGroupStatus\022L\n\006counts\030\001 \003(\013" + + "2<.google.cloud.batch.v1.JobStatus.TaskG" + + "roupStatus.CountsEntry\022B\n\tinstances\030\002 \003(" + + "\0132/.google.cloud.batch.v1.JobStatus.Inst" + + "anceStatus\032-\n\013CountsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\003:\0028\001\032c\n\017TaskGroupsEntry\022\013\n\003" + + "key\030\001 \001(\t\022?\n\005value\030\002 \001(\01320.google.cloud." + + "batch.v1.JobStatus.TaskGroupStatus:\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\tSUCCEE" + + "DED\020\004\022\n\n\006FAILED\020\005\022\030\n\024DELETION_IN_PROGRES" + + "S\020\006\"\374\002\n\017JobNotification\022\024\n\014pubsub_topic\030" + + "\001 \001(\t\022?\n\007message\030\002 \001(\0132..google.cloud.ba" + + "tch.v1.JobNotification.Message\032\304\001\n\007Messa" + + "ge\0229\n\004type\030\001 \001(\0162+.google.cloud.batch.v1" + + ".JobNotification.Type\022=\n\rnew_job_state\030\002" + + " \001(\0162&.google.cloud.batch.v1.JobStatus.S" + + "tate\022?\n\016new_task_state\030\003 \001(\0162\'.google.cl" + + "oud.batch.v1.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\"\221\013\n\020Allocatio" + + "nPolicy\022H\n\010location\030\001 \001(\01326.google.cloud" + + ".batch.v1.AllocationPolicy.LocationPolic" + + "y\022S\n\tinstances\030\010 \003(\0132@.google.cloud.batc" + + "h.v1.AllocationPolicy.InstancePolicyOrTe" + + "mplate\022C\n\006labels\030\006 \003(\01323.google.cloud.ba" + + "tch.v1.AllocationPolicy.LabelsEntry\022F\n\007n" + + "etwork\030\007 \001(\01325.google.cloud.batch.v1.All" + + "ocationPolicy.NetworkPolicy\032+\n\016LocationP" + + "olicy\022\031\n\021allowed_locations\030\001 \003(\t\032Y\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(\003B\r\n\013data_sou" + + "rce\032\212\001\n\014AttachedDisk\022@\n\010new_disk\030\001 \001(\0132," + + ".google.cloud.batch.v1.AllocationPolicy." + + "DiskH\000\022\027\n\rexisting_disk\030\002 \001(\tH\000\022\023\n\013devic" + + "e_name\030\003 \001(\tB\n\n\010attached\032*\n\013Accelerator\022" + + "\014\n\004type\030\001 \001(\t\022\r\n\005count\030\002 \001(\003\032\247\002\n\016Instanc" + + "ePolicy\022\024\n\014machine_type\030\002 \001(\t\022\030\n\020min_cpu" + + "_platform\030\003 \001(\t\022U\n\022provisioning_model\030\004 " + + "\001(\01629.google.cloud.batch.v1.AllocationPo" + + "licy.ProvisioningModel\022I\n\014accelerators\030\005" + + " \003(\01323.google.cloud.batch.v1.AllocationP" + + "olicy.Accelerator\022C\n\005disks\030\006 \003(\01324.googl" + + "e.cloud.batch.v1.AllocationPolicy.Attach" + + "edDisk\032\224\001\n\030InstancePolicyOrTemplate\022H\n\006p" + + "olicy\030\001 \001(\01326.google.cloud.batch.v1.Allo" + + "cationPolicy.InstancePolicyH\000\022\033\n\021instanc" + + "e_template\030\002 \001(\tH\000B\021\n\017policy_template\032W\n" + + "\020NetworkInterface\022\017\n\007network\030\001 \001(\t\022\022\n\nsu" + + "bnetwork\030\002 \001(\t\022\036\n\026no_external_ip_address" + + "\030\003 \001(\010\032e\n\rNetworkPolicy\022T\n\022network_inter" + + "faces\030\001 \003(\01328.google.cloud.batch.v1.Allo" + + "cationPolicy.NetworkInterface\032-\n\013LabelsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\021" + + "ProvisioningModel\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\"\201\003\n\tTaskGroup\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\003\0227\n\ttask_spec\030\003 \001(\0132\037.google.clou" + + "d.batch.v1.TaskSpecB\003\340A\002\022\022\n\ntask_count\030\004" + + " \001(\003\022\023\n\013parallelism\030\005 \001(\003\022=\n\021task_enviro" + + "nments\030\t \003(\0132\".google.cloud.batch.v1.Env" + + "ironment\022\033\n\023task_count_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:o\352Al\n\036batch.googleapis.com/Tas" + + "kGroup\022Jprojects/{project}/locations/{lo" + + "cation}/jobs/{job}/taskGroups/{task_grou" + + "p}B\264\001\n\031com.google.cloud.batch.v1B\010JobPro" + + "toP\001Z:google.golang.org/genproto/googlea" + + "pis/cloud/batch/v1;batch\242\002\003GCB\252\002\025Google." + + "Cloud.Batch.V1\312\002\025Google\\Cloud\\Batch\\V1\352\002" + + "\030Google::Cloud::Batch::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatus.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatus.java index 653a0fa..870d396 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatus.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatus.java @@ -188,8 +188,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Job is submitted into a ResourcePool and waiting
-     * for resource allocation.
+     * Job is admitted (validated and persisted) and waiting for resources.
      * 
* * QUEUED = 1; @@ -258,8 +257,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Job is submitted into a ResourcePool and waiting
-     * for resource allocation.
+     * Job is admitted (validated and persisted) and waiting for resources.
      * 
* * QUEUED = 1; @@ -2991,10 +2989,7 @@ public com.google.cloud.batch.v1.JobStatus.TaskGroupStatus getTaskGroupsOrThrow( * * *
-   * The duration of time the Job is in status
-   * RUNNING. Once the Job completes (i.e. the Job status is either
-   * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-   * to complete.
+   * The duration of time that the Job spent in status RUNNING.
    * 
* * .google.protobuf.Duration run_duration = 5; @@ -3009,10 +3004,7 @@ public boolean hasRunDuration() { * * *
-   * The duration of time the Job is in status
-   * RUNNING. Once the Job completes (i.e. the Job status is either
-   * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-   * to complete.
+   * The duration of time that the Job spent in status RUNNING.
    * 
* * .google.protobuf.Duration run_duration = 5; @@ -3027,10 +3019,7 @@ public com.google.protobuf.Duration getRunDuration() { * * *
-   * The duration of time the Job is in status
-   * RUNNING. Once the Job completes (i.e. the Job status is either
-   * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-   * to complete.
+   * The duration of time that the Job spent in status RUNNING.
    * 
* * .google.protobuf.Duration run_duration = 5; @@ -4120,10 +4109,7 @@ public Builder putAllTaskGroups( * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4137,10 +4123,7 @@ public boolean hasRunDuration() { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4160,10 +4143,7 @@ public com.google.protobuf.Duration getRunDuration() { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4185,10 +4165,7 @@ public Builder setRunDuration(com.google.protobuf.Duration value) { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4207,10 +4184,7 @@ public Builder setRunDuration(com.google.protobuf.Duration.Builder builderForVal * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4234,10 +4208,7 @@ public Builder mergeRunDuration(com.google.protobuf.Duration value) { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4257,10 +4228,7 @@ public Builder clearRunDuration() { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4274,10 +4242,7 @@ public com.google.protobuf.Duration.Builder getRunDurationBuilder() { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; @@ -4295,10 +4260,7 @@ public com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder() { * * *
-     * The duration of time the Job is in status
-     * RUNNING. Once the Job completes (i.e. the Job status is either
-     * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-     * to complete.
+     * The duration of time that the Job spent in status RUNNING.
      * 
* * .google.protobuf.Duration run_duration = 5; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatusOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatusOrBuilder.java index 300d92a..aea76e3 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatusOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/JobStatusOrBuilder.java @@ -175,10 +175,7 @@ com.google.cloud.batch.v1.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( * * *
-   * The duration of time the Job is in status
-   * RUNNING. Once the Job completes (i.e. the Job status is either
-   * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-   * to complete.
+   * The duration of time that the Job spent in status RUNNING.
    * 
* * .google.protobuf.Duration run_duration = 5; @@ -190,10 +187,7 @@ com.google.cloud.batch.v1.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( * * *
-   * The duration of time the Job is in status
-   * RUNNING. Once the Job completes (i.e. the Job status is either
-   * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-   * to complete.
+   * The duration of time that the Job spent in status RUNNING.
    * 
* * .google.protobuf.Duration run_duration = 5; @@ -205,10 +199,7 @@ com.google.cloud.batch.v1.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( * * *
-   * The duration of time the Job is in status
-   * RUNNING. Once the Job completes (i.e. the Job status is either
-   * SUCCEEDED/FAILED) the run duration represents the time it took the Job
-   * to complete.
+   * The duration of time that the Job spent in status RUNNING.
    * 
* * .google.protobuf.Duration run_duration = 5; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequest.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequest.java index d539673..feac90b 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequest.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequest.java @@ -140,7 +140,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. Path of the TaskGroup from which Tasks are being requested.
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
    * 
* * @@ -165,7 +167,9 @@ public java.lang.String getParent() { * * *
-   * Required. Path of the TaskGroup from which Tasks are being requested.
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
    * 
* * @@ -675,7 +679,9 @@ public Builder mergeFrom( * * *
-     * Required. Path of the TaskGroup from which Tasks are being requested.
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
      * 
* * @@ -699,7 +705,9 @@ public java.lang.String getParent() { * * *
-     * Required. Path of the TaskGroup from which Tasks are being requested.
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
      * 
* * @@ -723,7 +731,9 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. Path of the TaskGroup from which Tasks are being requested.
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
      * 
* * @@ -746,7 +756,9 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. Path of the TaskGroup from which Tasks are being requested.
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
      * 
* * @@ -765,7 +777,9 @@ public Builder clearParent() { * * *
-     * Required. Path of the TaskGroup from which Tasks are being requested.
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
      * 
* * diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequestOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequestOrBuilder.java index a48636a..5991a55 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequestOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksRequestOrBuilder.java @@ -27,7 +27,9 @@ public interface ListTasksRequestOrBuilder * * *
-   * Required. Path of the TaskGroup from which Tasks are being requested.
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
    * 
* * @@ -41,7 +43,9 @@ public interface ListTasksRequestOrBuilder * * *
-   * Required. Path of the TaskGroup from which Tasks are being requested.
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
    * 
* * diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksResponse.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksResponse.java index 3ca3a99..6e37706 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksResponse.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/ListTasksResponse.java @@ -22,7 +22,7 @@ * * *
- * ListAssignedTasks Response.
+ * ListTasks Response.
  * 
* * Protobuf type {@code google.cloud.batch.v1.ListTasksResponse} @@ -510,7 +510,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * ListAssignedTasks Response.
+   * ListTasks Response.
    * 
* * Protobuf type {@code google.cloud.batch.v1.ListTasksResponse} diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicy.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicy.java index 0bdb361..5003eff 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicy.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicy.java @@ -156,7 +156,7 @@ public enum Destination implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Logs are saved to a path.
+     * Logs are saved to a file path.
      * 
* * PATH = 2; @@ -189,7 +189,7 @@ public enum Destination implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Logs are saved to a path.
+     * Logs are saved to a file path.
      * 
* * PATH = 2; @@ -322,7 +322,7 @@ public com.google.cloud.batch.v1.LogsPolicy.Destination getDestination() { * *
    * The path to which logs are saved when the destination = PATH. This can be a
-   * local filepath on the VM, or under the mount point of a Persistent Disk or
+   * local file path on the VM, or under the mount point of a Persistent Disk or
    * Filestore, or a Cloud Storage path.
    * 
* @@ -347,7 +347,7 @@ public java.lang.String getLogsPath() { * *
    * The path to which logs are saved when the destination = PATH. This can be a
-   * local filepath on the VM, or under the mount point of a Persistent Disk or
+   * local file path on the VM, or under the mount point of a Persistent Disk or
    * Filestore, or a Cloud Storage path.
    * 
* @@ -798,7 +798,7 @@ public Builder clearDestination() { * *
      * The path to which logs are saved when the destination = PATH. This can be a
-     * local filepath on the VM, or under the mount point of a Persistent Disk or
+     * local file path on the VM, or under the mount point of a Persistent Disk or
      * Filestore, or a Cloud Storage path.
      * 
* @@ -822,7 +822,7 @@ public java.lang.String getLogsPath() { * *
      * The path to which logs are saved when the destination = PATH. This can be a
-     * local filepath on the VM, or under the mount point of a Persistent Disk or
+     * local file path on the VM, or under the mount point of a Persistent Disk or
      * Filestore, or a Cloud Storage path.
      * 
* @@ -846,7 +846,7 @@ public com.google.protobuf.ByteString getLogsPathBytes() { * *
      * The path to which logs are saved when the destination = PATH. This can be a
-     * local filepath on the VM, or under the mount point of a Persistent Disk or
+     * local file path on the VM, or under the mount point of a Persistent Disk or
      * Filestore, or a Cloud Storage path.
      * 
* @@ -869,7 +869,7 @@ public Builder setLogsPath(java.lang.String value) { * *
      * The path to which logs are saved when the destination = PATH. This can be a
-     * local filepath on the VM, or under the mount point of a Persistent Disk or
+     * local file path on the VM, or under the mount point of a Persistent Disk or
      * Filestore, or a Cloud Storage path.
      * 
* @@ -888,7 +888,7 @@ public Builder clearLogsPath() { * *
      * The path to which logs are saved when the destination = PATH. This can be a
-     * local filepath on the VM, or under the mount point of a Persistent Disk or
+     * local file path on the VM, or under the mount point of a Persistent Disk or
      * Filestore, or a Cloud Storage path.
      * 
* diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicyOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicyOrBuilder.java index 19ba4c7..dbda502 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicyOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/LogsPolicyOrBuilder.java @@ -53,7 +53,7 @@ public interface LogsPolicyOrBuilder * *
    * The path to which logs are saved when the destination = PATH. This can be a
-   * local filepath on the VM, or under the mount point of a Persistent Disk or
+   * local file path on the VM, or under the mount point of a Persistent Disk or
    * Filestore, or a Cloud Storage path.
    * 
* @@ -67,7 +67,7 @@ public interface LogsPolicyOrBuilder * *
    * The path to which logs are saved when the destination = PATH. This can be a
-   * local filepath on the VM, or under the mount point of a Persistent Disk or
+   * local file path on the VM, or under the mount point of a Persistent Disk or
    * Filestore, or a Cloud Storage path.
    * 
* diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java index 13e7f26..c42b894 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/Runnable.java @@ -2530,7 +2530,7 @@ public interface ScriptOrBuilder * * *
-     * Script file path.
+     * Script file path on the host VM.
      * 
* * string path = 1; @@ -2542,7 +2542,7 @@ public interface ScriptOrBuilder * * *
-     * Script file path.
+     * Script file path on the host VM.
      * 
* * string path = 1; @@ -2554,7 +2554,7 @@ public interface ScriptOrBuilder * * *
-     * Script file path.
+     * Script file path on the host VM.
      * 
* * string path = 1; @@ -2754,7 +2754,7 @@ public CommandCase getCommandCase() { * * *
-     * Script file path.
+     * Script file path on the host VM.
      * 
* * string path = 1; @@ -2768,7 +2768,7 @@ public boolean hasPath() { * * *
-     * Script file path.
+     * Script file path on the host VM.
      * 
* * string path = 1; @@ -2795,7 +2795,7 @@ public java.lang.String getPath() { * * *
-     * Script file path.
+     * Script file path on the host VM.
      * 
* * string path = 1; @@ -3275,7 +3275,7 @@ public Builder clearCommand() { * * *
-       * Script file path.
+       * Script file path on the host VM.
        * 
* * string path = 1; @@ -3290,7 +3290,7 @@ public boolean hasPath() { * * *
-       * Script file path.
+       * Script file path on the host VM.
        * 
* * string path = 1; @@ -3318,7 +3318,7 @@ public java.lang.String getPath() { * * *
-       * Script file path.
+       * Script file path on the host VM.
        * 
* * string path = 1; @@ -3346,7 +3346,7 @@ public com.google.protobuf.ByteString getPathBytes() { * * *
-       * Script file path.
+       * Script file path on the host VM.
        * 
* * string path = 1; @@ -3367,7 +3367,7 @@ public Builder setPath(java.lang.String value) { * * *
-       * Script file path.
+       * Script file path on the host VM.
        * 
* * string path = 1; @@ -3386,7 +3386,7 @@ public Builder clearPath() { * * *
-       * Script file path.
+       * Script file path on the host VM.
        * 
* * string path = 1; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroup.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroup.java index d3391e3..cb92291 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroup.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroup.java @@ -180,7 +180,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -206,7 +206,7 @@ public java.lang.String getName() { * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -428,7 +428,7 @@ public com.google.cloud.batch.v1.EnvironmentOrBuilder getTaskEnvironmentsOrBuild * * *
-   * Max number of tasks that can be run on a node at the same time.
+   * Max number of tasks that can be run on a VM at the same time.
    * If not specified, the system will decide a value based on available
    * compute resources on a VM and task requirements.
    * 
@@ -469,7 +469,7 @@ public boolean getRequireHostsFile() { * *
    * When true, Batch will configure SSH to allow passwordless login between
-   * VMs for the user running the Batch tasks.
+   * VMs running the Batch tasks in the same TaskGroup.
    * 
* * bool permissive_ssh = 12; @@ -964,7 +964,7 @@ public Builder mergeFrom( * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -989,7 +989,7 @@ public java.lang.String getName() { * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1014,7 +1014,7 @@ public com.google.protobuf.ByteString getNameBytes() { * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1038,7 +1038,7 @@ public Builder setName(java.lang.String value) { * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1058,7 +1058,7 @@ public Builder clearName() { * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1893,7 +1893,7 @@ public com.google.cloud.batch.v1.Environment.Builder addTaskEnvironmentsBuilder( * * *
-     * Max number of tasks that can be run on a node at the same time.
+     * Max number of tasks that can be run on a VM at the same time.
      * If not specified, the system will decide a value based on available
      * compute resources on a VM and task requirements.
      * 
@@ -1910,7 +1910,7 @@ public long getTaskCountPerNode() { * * *
-     * Max number of tasks that can be run on a node at the same time.
+     * Max number of tasks that can be run on a VM at the same time.
      * If not specified, the system will decide a value based on available
      * compute resources on a VM and task requirements.
      * 
@@ -1930,7 +1930,7 @@ public Builder setTaskCountPerNode(long value) { * * *
-     * Max number of tasks that can be run on a node at the same time.
+     * Max number of tasks that can be run on a VM at the same time.
      * If not specified, the system will decide a value based on available
      * compute resources on a VM and task requirements.
      * 
@@ -2010,7 +2010,7 @@ public Builder clearRequireHostsFile() { * *
      * When true, Batch will configure SSH to allow passwordless login between
-     * VMs for the user running the Batch tasks.
+     * VMs running the Batch tasks in the same TaskGroup.
      * 
* * bool permissive_ssh = 12; @@ -2026,7 +2026,7 @@ public boolean getPermissiveSsh() { * *
      * When true, Batch will configure SSH to allow passwordless login between
-     * VMs for the user running the Batch tasks.
+     * VMs running the Batch tasks in the same TaskGroup.
      * 
* * bool permissive_ssh = 12; @@ -2045,7 +2045,7 @@ public Builder setPermissiveSsh(boolean value) { * *
      * When true, Batch will configure SSH to allow passwordless login between
-     * VMs for the user running the Batch tasks.
+     * VMs running the Batch tasks in the same TaskGroup.
      * 
* * bool permissive_ssh = 12; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroupOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroupOrBuilder.java index d0dcf2e..83196a4 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroupOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskGroupOrBuilder.java @@ -30,7 +30,7 @@ public interface TaskGroupOrBuilder * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -45,7 +45,7 @@ public interface TaskGroupOrBuilder * Output only. TaskGroup name. * The system generates this field based on parent Job name. * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". * * * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -216,7 +216,7 @@ public interface TaskGroupOrBuilder * * *
-   * Max number of tasks that can be run on a node at the same time.
+   * Max number of tasks that can be run on a VM at the same time.
    * If not specified, the system will decide a value based on available
    * compute resources on a VM and task requirements.
    * 
@@ -247,7 +247,7 @@ public interface TaskGroupOrBuilder * *
    * When true, Batch will configure SSH to allow passwordless login between
-   * VMs for the user running the Batch tasks.
+   * VMs running the Batch tasks in the same TaskGroup.
    * 
* * bool permissive_ssh = 12; diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java index 3e657c8..226ef1e 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskProto.java @@ -152,10 +152,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "p}/tasks/{task}\"\205\001\n\013Environment\022D\n\tvaria" + "bles\030\001 \003(\01321.google.cloud.batch.v1.Envir" + "onment.VariablesEntry\0320\n\016VariablesEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001Bj\n\031com.g" - + "oogle.cloud.batch.v1B\tTaskProtoP\001Z:googl" - + "e.golang.org/genproto/googleapis/cloud/b" - + "atch/v1;batch\242\002\003GCBb\006proto3" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\265\001\n\031com." + + "google.cloud.batch.v1B\tTaskProtoP\001Z:goog" + + "le.golang.org/genproto/googleapis/cloud/" + + "batch/v1;batch\242\002\003GCB\252\002\025Google.Cloud.Batc" + + "h.V1\312\002\025Google\\Cloud\\Batch\\V1\352\002\030Google::C" + + "loud::Batch::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java index cae8d0a..7d43cf4 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpec.java @@ -450,7 +450,7 @@ 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 be executed. + * 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 @@ -471,7 +471,7 @@ 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 be executed. + * 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 @@ -493,7 +493,7 @@ 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 be executed. + * 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 @@ -514,7 +514,7 @@ 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 be executed. + * 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 @@ -535,7 +535,7 @@ 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 be executed. + * 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 @@ -2255,7 +2255,7 @@ 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 be executed. + * 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 @@ -2279,7 +2279,7 @@ 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 be executed. + * 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 @@ -2303,7 +2303,7 @@ 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 be executed. + * 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 @@ -2327,7 +2327,7 @@ 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 be executed. + * 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 @@ -2358,7 +2358,7 @@ 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 be executed. + * 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 @@ -2386,7 +2386,7 @@ 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 be executed. + * 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 @@ -2416,7 +2416,7 @@ 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 be executed. + * 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 @@ -2447,7 +2447,7 @@ 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 be executed. + * 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 @@ -2475,7 +2475,7 @@ 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 be executed. + * 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 @@ -2503,7 +2503,7 @@ 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 be executed. + * 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 @@ -2531,7 +2531,7 @@ 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 be executed. + * 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 @@ -2558,7 +2558,7 @@ 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 be executed. + * 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 @@ -2585,7 +2585,7 @@ 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 be executed. + * 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 @@ -2606,7 +2606,7 @@ 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 be executed. + * 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 @@ -2631,7 +2631,7 @@ 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 be executed. + * 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 @@ -2656,7 +2656,7 @@ 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 be executed. + * 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 @@ -2677,7 +2677,7 @@ 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 be executed. + * 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 @@ -2699,7 +2699,7 @@ 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 be executed. + * 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 diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java index 152ab0b..bd20399 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/TaskSpecOrBuilder.java @@ -209,7 +209,7 @@ 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 be executed. + * 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 @@ -227,7 +227,7 @@ 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 be executed. + * 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 @@ -245,7 +245,7 @@ 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 be executed. + * 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 @@ -263,7 +263,7 @@ 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 be executed. + * 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 @@ -282,7 +282,7 @@ 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 be executed. + * 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 diff --git a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/VolumeProto.java b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/VolumeProto.java index 1fe3bf5..fff8999 100644 --- a/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/VolumeProto.java +++ b/proto-google-cloud-batch-v1/src/main/java/com/google/cloud/batch/v1/VolumeProto.java @@ -55,10 +55,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "device_name\030\006 \001(\tH\000\022\022\n\nmount_path\030\004 \001(\t\022" + "\025\n\rmount_options\030\005 \003(\tB\010\n\006source\"*\n\003NFS\022" + "\016\n\006server\030\001 \001(\t\022\023\n\013remote_path\030\002 \001(\t\"\032\n\003" - + "GCS\022\023\n\013remote_path\030\001 \001(\tBl\n\031com.google.c" - + "loud.batch.v1B\013VolumeProtoP\001Z:google.gol" - + "ang.org/genproto/googleapis/cloud/batch/" - + "v1;batch\242\002\003GCBb\006proto3" + + "GCS\022\023\n\013remote_path\030\001 \001(\tB\267\001\n\031com.google." + + "cloud.batch.v1B\013VolumeProtoP\001Z:google.go" + + "lang.org/genproto/googleapis/cloud/batch" + + "/v1;batch\242\002\003GCB\252\002\025Google.Cloud.Batch.V1\312" + + "\002\025Google\\Cloud\\Batch\\V1\352\002\030Google::Cloud:" + + ":Batch::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto index 90da1d2..5dfe9ca 100644 --- a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto +++ b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/batch.proto @@ -25,13 +25,16 @@ import "google/cloud/batch/v1/task.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; +option csharp_namespace = "Google.Cloud.Batch.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/batch/v1;batch"; option java_multiple_files = true; option java_outer_classname = "BatchProto"; option java_package = "com.google.cloud.batch.v1"; option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; -// Google Cloud Batch Service. +// Google Batch Service. // The service manages user submitted batch jobs and allocates Google Compute // Engine VM instances to run the jobs. service BatchService { @@ -67,7 +70,7 @@ service BatchService { }; } - // List all Jobs for a project. + // List all Jobs for a project within a region. rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/jobs" @@ -95,7 +98,7 @@ service BatchService { // CreateJob Request. message CreateJobRequest { // Required. The parent resource name where the Job will be created. - // Format: projects/{project}/locations/{location} + // Pattern: "projects/{project}/locations/{location}" string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -196,7 +199,9 @@ message ListJobsResponse { // ListTasks Request. message ListTasksRequest { - // Required. Path of the TaskGroup from which Tasks are being requested. + // Required. Name of a TaskGroup from which Tasks are being requested. + // Pattern: + // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -216,7 +221,7 @@ message ListTasksRequest { string page_token = 4; } -// ListAssignedTasks Response. +// ListTasks Response. message ListTasksResponse { // Tasks. repeated Task tasks = 1; diff --git a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto index 34ce5c4..a24c017 100644 --- a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto +++ b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/job.proto @@ -22,11 +22,14 @@ import "google/cloud/batch/v1/task.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +option csharp_namespace = "Google.Cloud.Batch.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/batch/v1;batch"; option java_multiple_files = true; option java_outer_classname = "JobProto"; option java_package = "com.google.cloud.batch.v1"; option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; // The Cloud Batch Job description. message Job { @@ -35,17 +38,17 @@ message Job { pattern: "projects/{project}/locations/{location}/jobs/{job}" }; - // Job name. - // It must have the format of "projects/*/locations/*/jobs/*". - // For example: "projects/123456/locations/us-west1/jobs/job01". - string name = 1; + // Output only. Job name. + // For example: "projects/123456/locations/us-central1/jobs/job01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. A system generated unique ID (in UUID4 format) for the Job. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Priority of the Job. // The valid value range is [0, 100). - // A job with higher priority value will be scheduled to run earlier. + // A job with higher priority value is more likely to run earlier if all other + // requirements are satisfied. int64 priority = 3; // Required. TaskGroups in the Job. Only one TaskGroup is supported now. @@ -69,11 +72,11 @@ message Job { // Output only. Job status. It is read only for users. JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // When the Job was created. - google.protobuf.Timestamp create_time = 11; + // Output only. When the Job was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The last time the Job was updated. - google.protobuf.Timestamp update_time = 12; + // Output only. The last time the Job was updated. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; // Log preservation policy for the Job. LogsPolicy logs_policy = 13; @@ -93,7 +96,7 @@ message LogsPolicy { // Logs are streamed to Cloud Logging. CLOUD_LOGGING = 1; - // Logs are saved to a path. + // Logs are saved to a file path. PATH = 2; } @@ -101,7 +104,7 @@ message LogsPolicy { Destination destination = 1; // The path to which logs are saved when the destination = PATH. This can be a - // local filepath on the VM, or under the mount point of a Persistent Disk or + // local file path on the VM, or under the mount point of a Persistent Disk or // Filestore, or a Cloud Storage path. string logs_path = 2; } @@ -134,8 +137,7 @@ message JobStatus { enum State { STATE_UNSPECIFIED = 0; - // Job is submitted into a ResourcePool and waiting - // for resource allocation. + // Job is admitted (validated and persisted) and waiting for resources. QUEUED = 1; // Job is scheduled to run as soon as resource allocation is ready. @@ -168,17 +170,14 @@ message JobStatus { // The map key is TaskGroup ID. map task_groups = 4; - // The duration of time the Job is in status - // RUNNING. Once the Job completes (i.e. the Job status is either - // SUCCEEDED/FAILED) the run duration represents the time it took the Job - // to complete. + // The duration of time that the Job spent in status RUNNING. google.protobuf.Duration run_duration = 5; } // Notification configurations. message JobNotification { // Message details. - // Describe a list of attributes this message should have. + // Describe the attribute that a message should have. // Without specified message attributes, no message will be sent by default. message Message { // The message type. @@ -204,27 +203,27 @@ message JobNotification { } // The Pub/Sub topic where notifications like the job state changes - // will be published. This topic should be an existing topic in the same - // project with the job and billings will be charged to this project. If no - // topic is specified, there will be no Pub/Sub messages sent. Topic - // format is `projects/{project}/topics/{topic}`. + // will be published. This topic exist in the same project as the job + // and billings will be charged to this project. + // If not specified, no Pub/Sub messages will be sent. + // Topic format: `projects/{project}/topics/{topic}`. string pubsub_topic = 1; - // The message caters the message attributes configuration will to be sent - // to this Pub/Sub topic. Without this field, there is no message being sent - // by default. + // The attribute requirements of messages to be sent to this Pub/Sub topic. + // Without this field, no message will be sent. Message message = 2; } // A Job's resource allocation policy describes when, where, and how compute // resources should be allocated for the Job. message AllocationPolicy { - // Be consistent with LocationPolicy in - // //cloud/cluster/api/mixer_instances.proto. message LocationPolicy { // A list of allowed location names represented by internal URLs, - // for example, zones/us-central1-a, regions/us-west1. - // First location in the list should be a region. + // First location in the list must be a region. + // for example, + // ["regions/us-central1"] allow VMs in region us-central1, + // ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone + // us-central1-a. repeated string allowed_locations = 1; } @@ -281,12 +280,14 @@ message AllocationPolicy { // The minimum CPU platform. // See // `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + // Not yet implemented. string min_cpu_platform = 3; // The provisioning model. ProvisioningModel provisioning_model = 4; // The accelerators attached to each VM instance. + // Not yet implemented. repeated Accelerator accelerators = 5; // Non-boot disks to be attached for each VM created by this InstancePolicy. @@ -382,7 +383,7 @@ message TaskGroup { // Output only. TaskGroup name. // The system generates this field based on parent Job name. // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/default-group". + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. Tasks in the group share the same task spec. @@ -409,7 +410,7 @@ message TaskGroup { // task_environments supports up to 200 entries. repeated Environment task_environments = 9; - // Max number of tasks that can be run on a node at the same time. + // Max number of tasks that can be run on a VM at the same time. // If not specified, the system will decide a value based on available // compute resources on a VM and task requirements. int64 task_count_per_node = 10; @@ -420,6 +421,6 @@ message TaskGroup { bool require_hosts_file = 11; // When true, Batch will configure SSH to allow passwordless login between - // VMs for the user running the Batch tasks. + // VMs running the Batch tasks in the same TaskGroup. bool permissive_ssh = 12; } diff --git a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto index 1c9429d..5462ee7 100644 --- a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto +++ b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/task.proto @@ -21,11 +21,14 @@ import "google/cloud/batch/v1/volume.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +option csharp_namespace = "Google.Cloud.Batch.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/batch/v1;batch"; option java_multiple_files = true; option java_outer_classname = "TaskProto"; option java_package = "com.google.cloud.batch.v1"; option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; // Compute resource requirements message ComputeResource { @@ -136,7 +139,7 @@ message Runnable { // Script runnable. message Script { oneof command { - // Script file path. + // Script file path on the host VM. string path = 1; // Shell script text. @@ -212,7 +215,7 @@ message TaskSpec { // 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 be executed. + // 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 diff --git a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/volume.proto b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/volume.proto index 9b5bae7..45399cc 100644 --- a/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/volume.proto +++ b/proto-google-cloud-batch-v1/src/main/proto/google/cloud/batch/v1/volume.proto @@ -16,11 +16,14 @@ syntax = "proto3"; package google.cloud.batch.v1; +option csharp_namespace = "Google.Cloud.Batch.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/batch/v1;batch"; option java_multiple_files = true; option java_outer_classname = "VolumeProto"; option java_package = "com.google.cloud.batch.v1"; option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; // Volume and mount parameters to be associated with a TaskSpec. A TaskSpec // might describe zero, one, or multiple volumes to be mounted as part of the diff --git a/proto-google-cloud-batch-v1alpha/clirr-ignored-differences.xml b/proto-google-cloud-batch-v1alpha/clirr-ignored-differences.xml new file mode 100644 index 0000000..066ed88 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/batch/v1alpha/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/batch/v1alpha/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/batch/v1alpha/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-batch-v1alpha/pom.xml b/proto-google-cloud-batch-v1alpha/pom.xml new file mode 100644 index 0000000..cf468bb --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-batch-v1alpha + 0.1.2-SNAPSHOT + proto-google-cloud-batch-v1alpha + Proto library for google-cloud-batch + + com.google.cloud + google-cloud-batch-parent + 0.1.2-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java new file mode 100644 index 0000000..5a82f66 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicy.java @@ -0,0 +1,14418 @@ +/* + * 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; + +/** + * + * + *
+ * A Job's resource allocation policy describes when, where, and how compute
+ * resources should be allocated for the Job.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy} + */ +public final class AllocationPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy) + AllocationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AllocationPolicy.newBuilder() to construct. + private AllocationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AllocationPolicy() { + instances_ = java.util.Collections.emptyList(); + instanceTemplates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + provisioningModels_ = java.util.Collections.emptyList(); + serviceAccountEmail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AllocationPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AllocationPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder subBuilder = + null; + if (location_ != null) { + subBuilder = location_.toBuilder(); + } + location_ = + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(location_); + location_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder subBuilder = + null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + instanceTemplates_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + instanceTemplates_.add(s); + break; + } + case 32: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + provisioningModels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + provisioningModels_.add(rawValue); + break; + } + case 34: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + provisioningModels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + provisioningModels_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 58: + { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder subBuilder = + null; + if (network_ != null) { + subBuilder = network_.toBuilder(); + } + network_ = + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(network_); + network_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate>(); + mutable_bitField0_ |= 0x00000001; + } + instances_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + .parser(), + extensionRegistry)); + break; + } + case 74: + { + com.google.cloud.batch.v1alpha.ServiceAccount.Builder subBuilder = null; + if (serviceAccount_ != null) { + subBuilder = serviceAccount_.toBuilder(); + } + serviceAccount_ = + input.readMessage( + com.google.cloud.batch.v1alpha.ServiceAccount.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceAccount_); + serviceAccount_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + instanceTemplates_ = instanceTemplates_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + provisioningModels_ = java.util.Collections.unmodifiableList(provisioningModels_); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder.class); + } + + /** + * + * + *
+   * Compute Engine VM instance provisioning model.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} + */ + public enum ProvisioningModel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * PROVISIONING_MODEL_UNSPECIFIED = 0; + */ + PROVISIONING_MODEL_UNSPECIFIED(0), + /** + * + * + *
+     * Standard VM.
+     * 
+ * + * STANDARD = 1; + */ + STANDARD(1), + /** + * + * + *
+     * SPOT VM.
+     * 
+ * + * SPOT = 2; + */ + SPOT(2), + /** + * + * + *
+     * Preemptible VM (PVM).
+     * Above SPOT VM is the preferable model for preemptible VM instances: the
+     * old preemptible VM model (indicated by this field) is the older model,
+     * and has been migrated to use the SPOT model as the underlying technology.
+     * This old model will still be supported.
+     * 
+ * + * PREEMPTIBLE = 3; + */ + PREEMPTIBLE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * PROVISIONING_MODEL_UNSPECIFIED = 0; + */ + public static final int PROVISIONING_MODEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Standard VM.
+     * 
+ * + * STANDARD = 1; + */ + public static final int STANDARD_VALUE = 1; + /** + * + * + *
+     * SPOT VM.
+     * 
+ * + * SPOT = 2; + */ + public static final int SPOT_VALUE = 2; + /** + * + * + *
+     * Preemptible VM (PVM).
+     * Above SPOT VM is the preferable model for preemptible VM instances: the
+     * old preemptible VM model (indicated by this field) is the older model,
+     * and has been migrated to use the SPOT model as the underlying technology.
+     * This old model will still be supported.
+     * 
+ * + * PREEMPTIBLE = 3; + */ + public static final int PREEMPTIBLE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProvisioningModel valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ProvisioningModel forNumber(int value) { + switch (value) { + case 0: + return PROVISIONING_MODEL_UNSPECIFIED; + case 1: + return STANDARD; + case 2: + return SPOT; + case 3: + return PREEMPTIBLE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ProvisioningModel findValueByNumber(int number) { + return ProvisioningModel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.getDescriptor().getEnumTypes().get(0); + } + + private static final ProvisioningModel[] VALUES = values(); + + public static ProvisioningModel valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ProvisioningModel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel) + } + + public interface LocationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @return A list containing the allowedLocations. + */ + java.util.List getAllowedLocationsList(); + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @return The count of allowedLocations. + */ + int getAllowedLocationsCount(); + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index of the element to return. + * @return The allowedLocations at the given index. + */ + java.lang.String getAllowedLocations(int index); + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedLocations at the given index. + */ + com.google.protobuf.ByteString getAllowedLocationsBytes(int index); + + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @return A list containing the deniedLocations. + */ + java.util.List getDeniedLocationsList(); + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @return The count of deniedLocations. + */ + int getDeniedLocationsCount(); + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index of the element to return. + * @return The deniedLocations at the given index. + */ + java.lang.String getDeniedLocations(int index); + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the deniedLocations at the given index. + */ + com.google.protobuf.ByteString getDeniedLocationsBytes(int index); + } + /** Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} */ + public static final class LocationPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + LocationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocationPolicy.newBuilder() to construct. + private LocationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocationPolicy() { + allowedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deniedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocationPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LocationPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedLocations_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedLocations_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + deniedLocations_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + deniedLocations_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + allowedLocations_ = allowedLocations_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + deniedLocations_ = deniedLocations_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder.class); + } + + public static final int ALLOWED_LOCATIONS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList allowedLocations_; + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @return A list containing the allowedLocations. + */ + public com.google.protobuf.ProtocolStringList getAllowedLocationsList() { + return allowedLocations_; + } + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @return The count of allowedLocations. + */ + public int getAllowedLocationsCount() { + return allowedLocations_.size(); + } + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index of the element to return. + * @return The allowedLocations at the given index. + */ + public java.lang.String getAllowedLocations(int index) { + return allowedLocations_.get(index); + } + /** + * + * + *
+     * A list of allowed location names represented by internal URLs,
+     * First location in the list must be a region.
+     * for example,
+     * ["regions/us-central1"] allow VMs in region us-central1,
+     * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+     * us-central1-a.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedLocations at the given index. + */ + public com.google.protobuf.ByteString getAllowedLocationsBytes(int index) { + return allowedLocations_.getByteString(index); + } + + public static final int DENIED_LOCATIONS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList deniedLocations_; + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @return A list containing the deniedLocations. + */ + public com.google.protobuf.ProtocolStringList getDeniedLocationsList() { + return deniedLocations_; + } + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @return The count of deniedLocations. + */ + public int getDeniedLocationsCount() { + return deniedLocations_.size(); + } + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index of the element to return. + * @return The deniedLocations at the given index. + */ + public java.lang.String getDeniedLocations(int index) { + return deniedLocations_.get(index); + } + /** + * + * + *
+     * A list of denied location names.
+     * Not yet implemented.
+     * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the deniedLocations at the given index. + */ + public com.google.protobuf.ByteString getDeniedLocationsBytes(int index) { + return deniedLocations_.getByteString(index); + } + + 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 { + for (int i = 0; i < allowedLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedLocations_.getRaw(i)); + } + for (int i = 0; i < deniedLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deniedLocations_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < allowedLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedLocationsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < deniedLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(deniedLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeniedLocationsList().size(); + } + size += unknownFields.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.AllocationPolicy.LocationPolicy)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) obj; + + if (!getAllowedLocationsList().equals(other.getAllowedLocationsList())) return false; + if (!getDeniedLocationsList().equals(other.getDeniedLocationsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAllowedLocationsCount() > 0) { + hash = (37 * hash) + ALLOWED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedLocationsList().hashCode(); + } + if (getDeniedLocationsCount() > 0) { + hash = (37 * hash) + DENIED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeniedLocationsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy 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.AllocationPolicy.LocationPolicy 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; + } + /** Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + allowedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + deniedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + 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_AllocationPolicy_LocationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + allowedLocations_ = allowedLocations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedLocations_ = allowedLocations_; + if (((bitField0_ & 0x00000002) != 0)) { + deniedLocations_ = deniedLocations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.deniedLocations_ = deniedLocations_; + onBuilt(); + return result; + } + + @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.AllocationPolicy.LocationPolicy) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.getDefaultInstance()) + return this; + if (!other.allowedLocations_.isEmpty()) { + if (allowedLocations_.isEmpty()) { + allowedLocations_ = other.allowedLocations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedLocationsIsMutable(); + allowedLocations_.addAll(other.allowedLocations_); + } + onChanged(); + } + if (!other.deniedLocations_.isEmpty()) { + if (deniedLocations_.isEmpty()) { + deniedLocations_ = other.deniedLocations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDeniedLocationsIsMutable(); + deniedLocations_.addAll(other.deniedLocations_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList allowedLocations_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedLocationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedLocations_ = new com.google.protobuf.LazyStringArrayList(allowedLocations_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @return A list containing the allowedLocations. + */ + public com.google.protobuf.ProtocolStringList getAllowedLocationsList() { + return allowedLocations_.getUnmodifiableView(); + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @return The count of allowedLocations. + */ + public int getAllowedLocationsCount() { + return allowedLocations_.size(); + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index of the element to return. + * @return The allowedLocations at the given index. + */ + public java.lang.String getAllowedLocations(int index) { + return allowedLocations_.get(index); + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedLocations at the given index. + */ + public com.google.protobuf.ByteString getAllowedLocationsBytes(int index) { + return allowedLocations_.getByteString(index); + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @param index The index to set the value at. + * @param value The allowedLocations to set. + * @return This builder for chaining. + */ + public Builder setAllowedLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedLocationsIsMutable(); + allowedLocations_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @param value The allowedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllowedLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedLocationsIsMutable(); + allowedLocations_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @param values The allowedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedLocations(java.lang.Iterable values) { + ensureAllowedLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedLocations_); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedLocations() { + allowedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of allowed location names represented by internal URLs,
+       * First location in the list must be a region.
+       * for example,
+       * ["regions/us-central1"] allow VMs in region us-central1,
+       * ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
+       * us-central1-a.
+       * 
+ * + * repeated string allowed_locations = 1; + * + * @param value The bytes of the allowedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllowedLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedLocationsIsMutable(); + allowedLocations_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList deniedLocations_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDeniedLocationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + deniedLocations_ = new com.google.protobuf.LazyStringArrayList(deniedLocations_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @return A list containing the deniedLocations. + */ + public com.google.protobuf.ProtocolStringList getDeniedLocationsList() { + return deniedLocations_.getUnmodifiableView(); + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @return The count of deniedLocations. + */ + public int getDeniedLocationsCount() { + return deniedLocations_.size(); + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index of the element to return. + * @return The deniedLocations at the given index. + */ + public java.lang.String getDeniedLocations(int index) { + return deniedLocations_.get(index); + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the deniedLocations at the given index. + */ + public com.google.protobuf.ByteString getDeniedLocationsBytes(int index) { + return deniedLocations_.getByteString(index); + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @param index The index to set the value at. + * @param value The deniedLocations to set. + * @return This builder for chaining. + */ + public Builder setDeniedLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedLocationsIsMutable(); + deniedLocations_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @param value The deniedLocations to add. + * @return This builder for chaining. + */ + public Builder addDeniedLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedLocationsIsMutable(); + deniedLocations_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @param values The deniedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllDeniedLocations(java.lang.Iterable values) { + ensureDeniedLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedLocations_); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @return This builder for chaining. + */ + public Builder clearDeniedLocations() { + deniedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * A list of denied location names.
+       * Not yet implemented.
+       * 
+ * + * repeated string denied_locations = 2; + * + * @param value The bytes of the deniedLocations to add. + * @return This builder for chaining. + */ + public Builder addDeniedLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDeniedLocationsIsMutable(); + deniedLocations_.add(value); + 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.AllocationPolicy.LocationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocationPolicy(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.LocationPolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.Disk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * 
+ * + * string image = 4; + * + * @return Whether the image field is set. + */ + boolean hasImage(); + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * 
+ * + * string image = 4; + * + * @return The image. + */ + java.lang.String getImage(); + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * 
+ * + * string image = 4; + * + * @return The bytes for image. + */ + com.google.protobuf.ByteString getImageBytes(); + + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * 
+ * + * string snapshot = 5; + * + * @return Whether the snapshot field is set. + */ + boolean hasSnapshot(); + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * 
+ * + * string snapshot = 5; + * + * @return The snapshot. + */ + java.lang.String getSnapshot(); + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * 
+ * + * string snapshot = 5; + * + * @return The bytes for snapshot. + */ + com.google.protobuf.ByteString getSnapshotBytes(); + + /** + * + * + *
+     * Disk type as shown in `gcloud compute disk-types list`
+     * For example, "pd-ssd", "pd-standard", "pd-balanced".
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+     * Disk type as shown in `gcloud compute disk-types list`
+     * For example, "pd-ssd", "pd-standard", "pd-balanced".
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+     * Disk size in GB.
+     * This field is ignored if `data_source` is `disk` or `image`.
+     * 
+ * + * int64 size_gb = 2; + * + * @return The sizeGb. + */ + long getSizeGb(); + + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.DataSourceCase getDataSourceCase(); + } + /** + * + * + *
+   * A new persistent disk.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.Disk} + */ + public static final class Disk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.Disk) + DiskOrBuilder { + private static final long serialVersionUID = 0L; + // Use Disk.newBuilder() to construct. + private Disk(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Disk() { + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Disk(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Disk( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 16: + { + sizeGb_ = input.readInt64(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + dataSourceCase_ = 4; + dataSource_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + dataSourceCase_ = 5; + dataSource_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder.class); + } + + private int dataSourceCase_ = 0; + private java.lang.Object dataSource_; + + public enum DataSourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + IMAGE(4), + SNAPSHOT(5), + DATASOURCE_NOT_SET(0); + private final int value; + + private DataSourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataSourceCase valueOf(int value) { + return forNumber(value); + } + + public static DataSourceCase forNumber(int value) { + switch (value) { + case 4: + return IMAGE; + case 5: + return SNAPSHOT; + case 0: + return DATASOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataSourceCase getDataSourceCase() { + return DataSourceCase.forNumber(dataSourceCase_); + } + + public static final int IMAGE_FIELD_NUMBER = 4; + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * 
+ * + * string image = 4; + * + * @return Whether the image field is set. + */ + public boolean hasImage() { + return dataSourceCase_ == 4; + } + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * 
+ * + * string image = 4; + * + * @return The image. + */ + public java.lang.String getImage() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 4) { + ref = dataSource_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataSourceCase_ == 4) { + dataSource_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * 
+ * + * string image = 4; + * + * @return The bytes for image. + */ + public com.google.protobuf.ByteString getImageBytes() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 4) { + ref = dataSource_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceCase_ == 4) { + dataSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_FIELD_NUMBER = 5; + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * 
+ * + * string snapshot = 5; + * + * @return Whether the snapshot field is set. + */ + public boolean hasSnapshot() { + return dataSourceCase_ == 5; + } + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * 
+ * + * string snapshot = 5; + * + * @return The snapshot. + */ + public java.lang.String getSnapshot() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 5) { + ref = dataSource_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataSourceCase_ == 5) { + dataSource_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * 
+ * + * string snapshot = 5; + * + * @return The bytes for snapshot. + */ + public com.google.protobuf.ByteString getSnapshotBytes() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 5) { + ref = dataSource_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceCase_ == 5) { + dataSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+     * Disk type as shown in `gcloud compute disk-types list`
+     * For example, "pd-ssd", "pd-standard", "pd-balanced".
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+     * Disk type as shown in `gcloud compute disk-types list`
+     * For example, "pd-ssd", "pd-standard", "pd-balanced".
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIZE_GB_FIELD_NUMBER = 2; + private long sizeGb_; + /** + * + * + *
+     * Disk size in GB.
+     * This field is ignored if `data_source` is `disk` or `image`.
+     * 
+ * + * int64 size_gb = 2; + * + * @return The sizeGb. + */ + @java.lang.Override + public long getSizeGb() { + return sizeGb_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (sizeGb_ != 0L) { + output.writeInt64(2, sizeGb_); + } + if (dataSourceCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dataSource_); + } + if (dataSourceCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, dataSource_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (sizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, sizeGb_); + } + if (dataSourceCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dataSource_); + } + if (dataSourceCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, dataSource_); + } + size += unknownFields.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.AllocationPolicy.Disk)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) obj; + + if (!getType().equals(other.getType())) return false; + if (getSizeGb() != other.getSizeGb()) return false; + if (!getDataSourceCase().equals(other.getDataSourceCase())) return false; + switch (dataSourceCase_) { + case 4: + if (!getImage().equals(other.getImage())) return false; + break; + case 5: + if (!getSnapshot().equals(other.getSnapshot())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeGb()); + switch (dataSourceCase_) { + case 4: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; + case 5: + hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapshot().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk 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.AllocationPolicy.Disk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk 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.AllocationPolicy.Disk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk 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.AllocationPolicy.Disk parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk 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.AllocationPolicy.Disk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk 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.AllocationPolicy.Disk 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.AllocationPolicy.Disk 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.AllocationPolicy.Disk 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; + } + /** + * + * + *
+     * A new persistent disk.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.Disk} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.Disk) + com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + sizeGb_ = 0L; + + dataSourceCase_ = 0; + dataSource_ = null; + 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_AllocationPolicy_Disk_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.Disk(this); + if (dataSourceCase_ == 4) { + result.dataSource_ = dataSource_; + } + if (dataSourceCase_ == 5) { + result.dataSource_ = dataSource_; + } + result.type_ = type_; + result.sizeGb_ = sizeGb_; + result.dataSourceCase_ = dataSourceCase_; + onBuilt(); + return result; + } + + @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.AllocationPolicy.Disk) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.AllocationPolicy.Disk other) { + if (other == com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.getSizeGb() != 0L) { + setSizeGb(other.getSizeGb()); + } + switch (other.getDataSourceCase()) { + case IMAGE: + { + dataSourceCase_ = 4; + dataSource_ = other.dataSource_; + onChanged(); + break; + } + case SNAPSHOT: + { + dataSourceCase_ = 5; + dataSource_ = other.dataSource_; + onChanged(); + break; + } + case DATASOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dataSourceCase_ = 0; + private java.lang.Object dataSource_; + + public DataSourceCase getDataSourceCase() { + return DataSourceCase.forNumber(dataSourceCase_); + } + + public Builder clearDataSource() { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * 
+ * + * string image = 4; + * + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return dataSourceCase_ == 4; + } + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * 
+ * + * string image = 4; + * + * @return The image. + */ + @java.lang.Override + public java.lang.String getImage() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 4) { + ref = dataSource_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataSourceCase_ == 4) { + dataSource_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * 
+ * + * string image = 4; + * + * @return The bytes for image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImageBytes() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 4) { + ref = dataSource_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceCase_ == 4) { + dataSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * 
+ * + * string image = 4; + * + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataSourceCase_ = 4; + dataSource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * 
+ * + * string image = 4; + * + * @return This builder for chaining. + */ + public Builder clearImage() { + if (dataSourceCase_ == 4) { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * 
+ * + * string image = 4; + * + * @param value The bytes for image to set. + * @return This builder for chaining. + */ + public Builder setImageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataSourceCase_ = 4; + dataSource_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Name of a snapshot used as the data source.
+       * 
+ * + * string snapshot = 5; + * + * @return Whether the snapshot field is set. + */ + @java.lang.Override + public boolean hasSnapshot() { + return dataSourceCase_ == 5; + } + /** + * + * + *
+       * Name of a snapshot used as the data source.
+       * 
+ * + * string snapshot = 5; + * + * @return The snapshot. + */ + @java.lang.Override + public java.lang.String getSnapshot() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 5) { + ref = dataSource_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataSourceCase_ == 5) { + dataSource_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of a snapshot used as the data source.
+       * 
+ * + * string snapshot = 5; + * + * @return The bytes for snapshot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSnapshotBytes() { + java.lang.Object ref = ""; + if (dataSourceCase_ == 5) { + ref = dataSource_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceCase_ == 5) { + dataSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of a snapshot used as the data source.
+       * 
+ * + * string snapshot = 5; + * + * @param value The snapshot to set. + * @return This builder for chaining. + */ + public Builder setSnapshot(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataSourceCase_ = 5; + dataSource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of a snapshot used as the data source.
+       * 
+ * + * string snapshot = 5; + * + * @return This builder for chaining. + */ + public Builder clearSnapshot() { + if (dataSourceCase_ == 5) { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Name of a snapshot used as the data source.
+       * 
+ * + * string snapshot = 5; + * + * @param value The bytes for snapshot to set. + * @return This builder for chaining. + */ + public Builder setSnapshotBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataSourceCase_ = 5; + dataSource_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`
+       * For example, "pd-ssd", "pd-standard", "pd-balanced".
+       * 
+ * + * string type = 1; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`
+       * For example, "pd-ssd", "pd-standard", "pd-balanced".
+       * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`
+       * For example, "pd-ssd", "pd-standard", "pd-balanced".
+       * 
+ * + * string type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`
+       * For example, "pd-ssd", "pd-standard", "pd-balanced".
+       * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`
+       * For example, "pd-ssd", "pd-standard", "pd-balanced".
+       * 
+ * + * string type = 1; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private long sizeGb_; + /** + * + * + *
+       * Disk size in GB.
+       * This field is ignored if `data_source` is `disk` or `image`.
+       * 
+ * + * int64 size_gb = 2; + * + * @return The sizeGb. + */ + @java.lang.Override + public long getSizeGb() { + return sizeGb_; + } + /** + * + * + *
+       * Disk size in GB.
+       * This field is ignored if `data_source` is `disk` or `image`.
+       * 
+ * + * int64 size_gb = 2; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(long value) { + + sizeGb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Disk size in GB.
+       * This field is ignored if `data_source` is `disk` or `image`.
+       * 
+ * + * int64 size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + + sizeGb_ = 0L; + 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.AllocationPolicy.Disk) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.Disk) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.Disk DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Disk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Disk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Disk(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.Disk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AttachedDiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; + * + * @return Whether the newDisk field is set. + */ + boolean hasNewDisk(); + /** + * .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; + * + * @return The newDisk. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk getNewDisk(); + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder getNewDiskOrBuilder(); + + /** + * + * + *
+     * Name of an existing PD.
+     * 
+ * + * string existing_disk = 2; + * + * @return Whether the existingDisk field is set. + */ + boolean hasExistingDisk(); + /** + * + * + *
+     * Name of an existing PD.
+     * 
+ * + * string existing_disk = 2; + * + * @return The existingDisk. + */ + java.lang.String getExistingDisk(); + /** + * + * + *
+     * Name of an existing PD.
+     * 
+ * + * string existing_disk = 2; + * + * @return The bytes for existingDisk. + */ + com.google.protobuf.ByteString getExistingDiskBytes(); + + /** + * + * + *
+     * Device name that the guest operating system will see.
+     * If not specified, this is default to the disk name.
+     * 
+ * + * string device_name = 3; + * + * @return The deviceName. + */ + java.lang.String getDeviceName(); + /** + * + * + *
+     * Device name that the guest operating system will see.
+     * If not specified, this is default to the disk name.
+     * 
+ * + * string device_name = 3; + * + * @return The bytes for deviceName. + */ + com.google.protobuf.ByteString getDeviceNameBytes(); + + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.AttachedCase + getAttachedCase(); + } + /** + * + * + *
+   * A new or an existing persistent disk attached to a VM instance.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} + */ + public static final class AttachedDisk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + AttachedDiskOrBuilder { + private static final long serialVersionUID = 0L; + // Use AttachedDisk.newBuilder() to construct. + private AttachedDisk(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttachedDisk() { + deviceName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttachedDisk(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttachedDisk( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder subBuilder = null; + if (attachedCase_ == 1) { + subBuilder = + ((com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_) + .toBuilder(); + } + attached_ = + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_); + attached_ = subBuilder.buildPartial(); + } + attachedCase_ = 1; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + attachedCase_ = 2; + attached_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + deviceName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder.class); + } + + private int attachedCase_ = 0; + private java.lang.Object attached_; + + public enum AttachedCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NEW_DISK(1), + EXISTING_DISK(2), + ATTACHED_NOT_SET(0); + private final int value; + + private AttachedCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AttachedCase valueOf(int value) { + return forNumber(value); + } + + public static AttachedCase forNumber(int value) { + switch (value) { + case 1: + return NEW_DISK; + case 2: + return EXISTING_DISK; + case 0: + return ATTACHED_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AttachedCase getAttachedCase() { + return AttachedCase.forNumber(attachedCase_); + } + + public static final int NEW_DISK_FIELD_NUMBER = 1; + /** + * .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; + * + * @return Whether the newDisk field is set. + */ + @java.lang.Override + public boolean hasNewDisk() { + return attachedCase_ == 1; + } + /** + * .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; + * + * @return The newDisk. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk getNewDisk() { + if (attachedCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder getNewDiskOrBuilder() { + if (attachedCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } + + public static final int EXISTING_DISK_FIELD_NUMBER = 2; + /** + * + * + *
+     * Name of an existing PD.
+     * 
+ * + * string existing_disk = 2; + * + * @return Whether the existingDisk field is set. + */ + public boolean hasExistingDisk() { + return attachedCase_ == 2; + } + /** + * + * + *
+     * Name of an existing PD.
+     * 
+ * + * string existing_disk = 2; + * + * @return The existingDisk. + */ + public java.lang.String getExistingDisk() { + java.lang.Object ref = ""; + if (attachedCase_ == 2) { + ref = attached_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (attachedCase_ == 2) { + attached_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name of an existing PD.
+     * 
+ * + * string existing_disk = 2; + * + * @return The bytes for existingDisk. + */ + public com.google.protobuf.ByteString getExistingDiskBytes() { + java.lang.Object ref = ""; + if (attachedCase_ == 2) { + ref = attached_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (attachedCase_ == 2) { + attached_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object deviceName_; + /** + * + * + *
+     * Device name that the guest operating system will see.
+     * If not specified, this is default to the disk name.
+     * 
+ * + * string device_name = 3; + * + * @return The deviceName. + */ + @java.lang.Override + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceName_ = s; + return s; + } + } + /** + * + * + *
+     * Device name that the guest operating system will see.
+     * If not specified, this is default to the disk name.
+     * 
+ * + * string device_name = 3; + * + * @return The bytes for deviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (attachedCase_ == 1) { + output.writeMessage(1, (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_); + } + if (attachedCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attached_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deviceName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attachedCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_); + } + if (attachedCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attached_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deviceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deviceName_); + } + size += unknownFields.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.AllocationPolicy.AttachedDisk)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) obj; + + if (!getDeviceName().equals(other.getDeviceName())) return false; + if (!getAttachedCase().equals(other.getAttachedCase())) return false; + switch (attachedCase_) { + case 1: + if (!getNewDisk().equals(other.getNewDisk())) return false; + break; + case 2: + if (!getExistingDisk().equals(other.getExistingDisk())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + DEVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDeviceName().hashCode(); + switch (attachedCase_) { + case 1: + hash = (37 * hash) + NEW_DISK_FIELD_NUMBER; + hash = (53 * hash) + getNewDisk().hashCode(); + break; + case 2: + hash = (37 * hash) + EXISTING_DISK_FIELD_NUMBER; + hash = (53 * hash) + getExistingDisk().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk 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.AllocationPolicy.AttachedDisk 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; + } + /** + * + * + *
+     * A new or an existing persistent disk attached to a VM instance.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + deviceName_ = ""; + + attachedCase_ = 0; + attached_ = null; + 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_AllocationPolicy_AttachedDisk_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(this); + if (attachedCase_ == 1) { + if (newDiskBuilder_ == null) { + result.attached_ = attached_; + } else { + result.attached_ = newDiskBuilder_.build(); + } + } + if (attachedCase_ == 2) { + result.attached_ = attached_; + } + result.deviceName_ = deviceName_; + result.attachedCase_ = attachedCase_; + onBuilt(); + return result; + } + + @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.AllocationPolicy.AttachedDisk) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.getDefaultInstance()) + return this; + if (!other.getDeviceName().isEmpty()) { + deviceName_ = other.deviceName_; + onChanged(); + } + switch (other.getAttachedCase()) { + case NEW_DISK: + { + mergeNewDisk(other.getNewDisk()); + break; + } + case EXISTING_DISK: + { + attachedCase_ = 2; + attached_ = other.attached_; + onChanged(); + break; + } + case ATTACHED_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int attachedCase_ = 0; + private java.lang.Object attached_; + + public AttachedCase getAttachedCase() { + return AttachedCase.forNumber(attachedCase_); + } + + public Builder clearAttached() { + attachedCase_ = 0; + attached_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk, + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder> + newDiskBuilder_; + /** + * .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; + * + * @return Whether the newDisk field is set. + */ + @java.lang.Override + public boolean hasNewDisk() { + return attachedCase_ == 1; + } + /** + * .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; + * + * @return The newDisk. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk getNewDisk() { + if (newDiskBuilder_ == null) { + if (attachedCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } else { + if (attachedCase_ == 1) { + return newDiskBuilder_.getMessage(); + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + public Builder setNewDisk(com.google.cloud.batch.v1alpha.AllocationPolicy.Disk value) { + if (newDiskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attached_ = value; + onChanged(); + } else { + newDiskBuilder_.setMessage(value); + } + attachedCase_ = 1; + return this; + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + public Builder setNewDisk( + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder builderForValue) { + if (newDiskBuilder_ == null) { + attached_ = builderForValue.build(); + onChanged(); + } else { + newDiskBuilder_.setMessage(builderForValue.build()); + } + attachedCase_ = 1; + return this; + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + public Builder mergeNewDisk(com.google.cloud.batch.v1alpha.AllocationPolicy.Disk value) { + if (newDiskBuilder_ == null) { + if (attachedCase_ == 1 + && attached_ + != com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance()) { + attached_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.newBuilder( + (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_) + .mergeFrom(value) + .buildPartial(); + } else { + attached_ = value; + } + onChanged(); + } else { + if (attachedCase_ == 1) { + newDiskBuilder_.mergeFrom(value); + } else { + newDiskBuilder_.setMessage(value); + } + } + attachedCase_ = 1; + return this; + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + public Builder clearNewDisk() { + if (newDiskBuilder_ == null) { + if (attachedCase_ == 1) { + attachedCase_ = 0; + attached_ = null; + onChanged(); + } + } else { + if (attachedCase_ == 1) { + attachedCase_ = 0; + attached_ = null; + } + newDiskBuilder_.clear(); + } + return this; + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder getNewDiskBuilder() { + return getNewDiskFieldBuilder().getBuilder(); + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder getNewDiskOrBuilder() { + if ((attachedCase_ == 1) && (newDiskBuilder_ != null)) { + return newDiskBuilder_.getMessageOrBuilder(); + } else { + if (attachedCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } + } + /** .google.cloud.batch.v1alpha.AllocationPolicy.Disk new_disk = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk, + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder> + getNewDiskFieldBuilder() { + if (newDiskBuilder_ == null) { + if (!(attachedCase_ == 1)) { + attached_ = com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.getDefaultInstance(); + } + newDiskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk, + com.google.cloud.batch.v1alpha.AllocationPolicy.Disk.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.DiskOrBuilder>( + (com.google.cloud.batch.v1alpha.AllocationPolicy.Disk) attached_, + getParentForChildren(), + isClean()); + attached_ = null; + } + attachedCase_ = 1; + onChanged(); + ; + return newDiskBuilder_; + } + + /** + * + * + *
+       * Name of an existing PD.
+       * 
+ * + * string existing_disk = 2; + * + * @return Whether the existingDisk field is set. + */ + @java.lang.Override + public boolean hasExistingDisk() { + return attachedCase_ == 2; + } + /** + * + * + *
+       * Name of an existing PD.
+       * 
+ * + * string existing_disk = 2; + * + * @return The existingDisk. + */ + @java.lang.Override + public java.lang.String getExistingDisk() { + java.lang.Object ref = ""; + if (attachedCase_ == 2) { + ref = attached_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (attachedCase_ == 2) { + attached_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of an existing PD.
+       * 
+ * + * string existing_disk = 2; + * + * @return The bytes for existingDisk. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExistingDiskBytes() { + java.lang.Object ref = ""; + if (attachedCase_ == 2) { + ref = attached_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (attachedCase_ == 2) { + attached_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of an existing PD.
+       * 
+ * + * string existing_disk = 2; + * + * @param value The existingDisk to set. + * @return This builder for chaining. + */ + public Builder setExistingDisk(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attachedCase_ = 2; + attached_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of an existing PD.
+       * 
+ * + * string existing_disk = 2; + * + * @return This builder for chaining. + */ + public Builder clearExistingDisk() { + if (attachedCase_ == 2) { + attachedCase_ = 0; + attached_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Name of an existing PD.
+       * 
+ * + * string existing_disk = 2; + * + * @param value The bytes for existingDisk to set. + * @return This builder for chaining. + */ + public Builder setExistingDiskBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attachedCase_ = 2; + attached_ = value; + onChanged(); + return this; + } + + private java.lang.Object deviceName_ = ""; + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * If not specified, this is default to the disk name.
+       * 
+ * + * string device_name = 3; + * + * @return The deviceName. + */ + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * If not specified, this is default to the disk name.
+       * 
+ * + * string device_name = 3; + * + * @return The bytes for deviceName. + */ + public com.google.protobuf.ByteString getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * If not specified, this is default to the disk name.
+       * 
+ * + * string device_name = 3; + * + * @param value The deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * If not specified, this is default to the disk name.
+       * 
+ * + * string device_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDeviceName() { + + deviceName_ = getDefaultInstance().getDeviceName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * If not specified, this is default to the disk name.
+       * 
+ * + * string device_name = 3; + * + * @param value The bytes for deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deviceName_ = value; + 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.AllocationPolicy.AttachedDisk) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttachedDisk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttachedDisk(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.AttachedDisk + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AcceleratorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The accelerator type. For example, "nvidia-tesla-t4".
+     * See `gcloud compute accelerator-types list`.
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+     * The accelerator type. For example, "nvidia-tesla-t4".
+     * See `gcloud compute accelerator-types list`.
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+     * The number of accelerators of this type.
+     * 
+ * + * int64 count = 2; + * + * @return The count. + */ + long getCount(); + } + /** + * + * + *
+   * Accelerator describes Compute Engine accelerators to be attached to VMs.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} + */ + public static final class Accelerator extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + AcceleratorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Accelerator.newBuilder() to construct. + private Accelerator(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Accelerator() { + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Accelerator(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Accelerator( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 16: + { + count_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+     * The accelerator type. For example, "nvidia-tesla-t4".
+     * See `gcloud compute accelerator-types list`.
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+     * The accelerator type. For example, "nvidia-tesla-t4".
+     * See `gcloud compute accelerator-types list`.
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COUNT_FIELD_NUMBER = 2; + private long count_; + /** + * + * + *
+     * The number of accelerators of this type.
+     * 
+ * + * int64 count = 2; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (count_ != 0L) { + output.writeInt64(2, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, count_); + } + size += unknownFields.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.AllocationPolicy.Accelerator)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) obj; + + if (!getType().equals(other.getType())) return false; + if (getCount() != other.getCount()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator 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.AllocationPolicy.Accelerator 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; + } + /** + * + * + *
+     * Accelerator describes Compute Engine accelerators to be attached to VMs.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + count_ = 0L; + + 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_AllocationPolicy_Accelerator_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(this); + result.type_ = type_; + result.count_ = count_; + onBuilt(); + return result; + } + + @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.AllocationPolicy.Accelerator) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+       * The accelerator type. For example, "nvidia-tesla-t4".
+       * See `gcloud compute accelerator-types list`.
+       * 
+ * + * string type = 1; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The accelerator type. For example, "nvidia-tesla-t4".
+       * See `gcloud compute accelerator-types list`.
+       * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The accelerator type. For example, "nvidia-tesla-t4".
+       * See `gcloud compute accelerator-types list`.
+       * 
+ * + * string type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The accelerator type. For example, "nvidia-tesla-t4".
+       * See `gcloud compute accelerator-types list`.
+       * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+       * The accelerator type. For example, "nvidia-tesla-t4".
+       * See `gcloud compute accelerator-types list`.
+       * 
+ * + * string type = 1; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private long count_; + /** + * + * + *
+       * The number of accelerators of this type.
+       * 
+ * + * int64 count = 2; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * + * + *
+       * The number of accelerators of this type.
+       * 
+ * + * int64 count = 2; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of accelerators of this type.
+       * 
+ * + * int64 count = 2; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + + count_ = 0L; + 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.AllocationPolicy.Accelerator) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Accelerator parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Accelerator(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.Accelerator getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InstancePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * 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=331 + * @return A list containing the allowedMachineTypes. + */ + @java.lang.Deprecated + java.util.List 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=331 + * @return The count of allowedMachineTypes. + */ + @java.lang.Deprecated + 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=331 + * @param index The index of the element to return. + * @return The allowedMachineTypes at the given index. + */ + @java.lang.Deprecated + 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=331 + * @param index The index of the value to return. + * @return The bytes of the allowedMachineTypes at the given index. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getAllowedMachineTypesBytes(int index); + + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 2; + * + * @return The machineType. + */ + java.lang.String getMachineType(); + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 2; + * + * @return The bytes for machineType. + */ + com.google.protobuf.ByteString getMachineTypeBytes(); + + /** + * + * + *
+     * The minimum CPU platform.
+     * See
+     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+     * Not yet implemented.
+     * 
+ * + * string min_cpu_platform = 3; + * + * @return The minCpuPlatform. + */ + java.lang.String getMinCpuPlatform(); + /** + * + * + *
+     * The minimum CPU platform.
+     * See
+     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+     * Not yet implemented.
+     * 
+ * + * string min_cpu_platform = 3; + * + * @return The bytes for minCpuPlatform. + */ + com.google.protobuf.ByteString getMinCpuPlatformBytes(); + + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + int getProvisioningModelValue(); + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The provisioningModel. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisioningModel(); + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + java.util.List + getAcceleratorsList(); + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator getAccelerators(int index); + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + int getAcceleratorsCount(); + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + java.util.List + getAcceleratorsOrBuilderList(); + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder getAcceleratorsOrBuilder( + int index); + + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + java.util.List getDisksList(); + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk getDisks(int index); + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + int getDisksCount(); + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + java.util.List + getDisksOrBuilderList(); + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder getDisksOrBuilder( + int index); + } + /** + * + * + *
+   * InstancePolicy describes an instance type and resources attached to each VM
+   * created by this InstancePolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} + */ + public static final class InstancePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + InstancePolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstancePolicy.newBuilder() to construct. + private InstancePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InstancePolicy() { + allowedMachineTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + machineType_ = ""; + minCpuPlatform_ = ""; + provisioningModel_ = 0; + accelerators_ = java.util.Collections.emptyList(); + disks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InstancePolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InstancePolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedMachineTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedMachineTypes_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + machineType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + minCpuPlatform_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + provisioningModel_ = rawValue; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + accelerators_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator>(); + mutable_bitField0_ |= 0x00000002; + } + accelerators_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.parser(), + extensionRegistry)); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + disks_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk>(); + mutable_bitField0_ |= 0x00000004; + } + disks_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + allowedMachineTypes_ = allowedMachineTypes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + accelerators_ = java.util.Collections.unmodifiableList(accelerators_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + disks_ = java.util.Collections.unmodifiableList(disks_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder.class); + } + + public static final int ALLOWED_MACHINE_TYPES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList allowedMachineTypes_; + /** + * 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=331 + * @return A list containing the allowedMachineTypes. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getAllowedMachineTypesList() { + return allowedMachineTypes_; + } + /** + * 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=331 + * @return The count of allowedMachineTypes. + */ + @java.lang.Deprecated + public int getAllowedMachineTypesCount() { + return allowedMachineTypes_.size(); + } + /** + * 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=331 + * @param index The index of the element to return. + * @return The allowedMachineTypes at the given index. + */ + @java.lang.Deprecated + public java.lang.String getAllowedMachineTypes(int index) { + return allowedMachineTypes_.get(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=331 + * @param index The index of the value to return. + * @return The bytes of the allowedMachineTypes at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getAllowedMachineTypesBytes(int index) { + return allowedMachineTypes_.getByteString(index); + } + + public static final int MACHINE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object machineType_; + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 2; + * + * @return The machineType. + */ + @java.lang.Override + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } + } + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 2; + * + * @return The bytes for machineType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MIN_CPU_PLATFORM_FIELD_NUMBER = 3; + private volatile java.lang.Object minCpuPlatform_; + /** + * + * + *
+     * The minimum CPU platform.
+     * See
+     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+     * Not yet implemented.
+     * 
+ * + * string min_cpu_platform = 3; + * + * @return The minCpuPlatform. + */ + @java.lang.Override + public java.lang.String getMinCpuPlatform() { + java.lang.Object ref = minCpuPlatform_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + minCpuPlatform_ = s; + return s; + } + } + /** + * + * + *
+     * The minimum CPU platform.
+     * See
+     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+     * Not yet implemented.
+     * 
+ * + * string min_cpu_platform = 3; + * + * @return The bytes for minCpuPlatform. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMinCpuPlatformBytes() { + java.lang.Object ref = minCpuPlatform_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + minCpuPlatform_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROVISIONING_MODEL_FIELD_NUMBER = 4; + private int provisioningModel_; + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + @java.lang.Override + public int getProvisioningModelValue() { + return provisioningModel_; + } + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel result = + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.valueOf( + provisioningModel_); + return result == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + + public static final int ACCELERATORS_FIELD_NUMBER = 5; + private java.util.List + accelerators_; + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public java.util.List + getAcceleratorsList() { + return accelerators_; + } + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder> + getAcceleratorsOrBuilderList() { + return accelerators_; + } + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public int getAcceleratorsCount() { + return accelerators_.size(); + } + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator getAccelerators(int index) { + return accelerators_.get(index); + } + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder + getAcceleratorsOrBuilder(int index) { + return accelerators_.get(index); + } + + public static final int DISKS_FIELD_NUMBER = 6; + private java.util.List disks_; + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public java.util.List + getDisksList() { + return disks_; + } + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder> + getDisksOrBuilderList() { + return disks_; + } + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public int getDisksCount() { + return disks_.size(); + } + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk getDisks(int index) { + return disks_.get(index); + } + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the attached VM is deleted.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder getDisksOrBuilder( + int index) { + return disks_.get(index); + } + + 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 { + for (int i = 0; i < allowedMachineTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, allowedMachineTypes_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, machineType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minCpuPlatform_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, minCpuPlatform_); + } + if (provisioningModel_ + != com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + .PROVISIONING_MODEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, provisioningModel_); + } + for (int i = 0; i < accelerators_.size(); i++) { + output.writeMessage(5, accelerators_.get(i)); + } + for (int i = 0; i < disks_.size(); i++) { + output.writeMessage(6, disks_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < allowedMachineTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedMachineTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedMachineTypesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, machineType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minCpuPlatform_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, minCpuPlatform_); + } + if (provisioningModel_ + != com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + .PROVISIONING_MODEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, provisioningModel_); + } + for (int i = 0; i < accelerators_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, accelerators_.get(i)); + } + for (int i = 0; i < disks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, disks_.get(i)); + } + size += unknownFields.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.AllocationPolicy.InstancePolicy)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) obj; + + if (!getAllowedMachineTypesList().equals(other.getAllowedMachineTypesList())) return false; + if (!getMachineType().equals(other.getMachineType())) return false; + if (!getMinCpuPlatform().equals(other.getMinCpuPlatform())) return false; + if (provisioningModel_ != other.provisioningModel_) return false; + if (!getAcceleratorsList().equals(other.getAcceleratorsList())) return false; + if (!getDisksList().equals(other.getDisksList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAllowedMachineTypesCount() > 0) { + hash = (37 * hash) + ALLOWED_MACHINE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedMachineTypesList().hashCode(); + } + hash = (37 * hash) + MACHINE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMachineType().hashCode(); + hash = (37 * hash) + MIN_CPU_PLATFORM_FIELD_NUMBER; + hash = (53 * hash) + getMinCpuPlatform().hashCode(); + hash = (37 * hash) + PROVISIONING_MODEL_FIELD_NUMBER; + hash = (53 * hash) + provisioningModel_; + if (getAcceleratorsCount() > 0) { + hash = (37 * hash) + ACCELERATORS_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratorsList().hashCode(); + } + if (getDisksCount() > 0) { + hash = (37 * hash) + DISKS_FIELD_NUMBER; + hash = (53 * hash) + getDisksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy 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.AllocationPolicy.InstancePolicy 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; + } + /** + * + * + *
+     * InstancePolicy describes an instance type and resources attached to each VM
+     * created by this InstancePolicy.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAcceleratorsFieldBuilder(); + getDisksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + allowedMachineTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + machineType_ = ""; + + minCpuPlatform_ = ""; + + provisioningModel_ = 0; + + if (acceleratorsBuilder_ == null) { + accelerators_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + acceleratorsBuilder_.clear(); + } + if (disksBuilder_ == null) { + disks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + disksBuilder_.clear(); + } + 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_AllocationPolicy_InstancePolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + allowedMachineTypes_ = allowedMachineTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedMachineTypes_ = allowedMachineTypes_; + result.machineType_ = machineType_; + result.minCpuPlatform_ = minCpuPlatform_; + result.provisioningModel_ = provisioningModel_; + if (acceleratorsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + accelerators_ = java.util.Collections.unmodifiableList(accelerators_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.accelerators_ = accelerators_; + } else { + result.accelerators_ = acceleratorsBuilder_.build(); + } + if (disksBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + disks_ = java.util.Collections.unmodifiableList(disks_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.disks_ = disks_; + } else { + result.disks_ = disksBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.AllocationPolicy.InstancePolicy) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance()) + return this; + if (!other.allowedMachineTypes_.isEmpty()) { + if (allowedMachineTypes_.isEmpty()) { + allowedMachineTypes_ = other.allowedMachineTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedMachineTypesIsMutable(); + allowedMachineTypes_.addAll(other.allowedMachineTypes_); + } + onChanged(); + } + if (!other.getMachineType().isEmpty()) { + machineType_ = other.machineType_; + onChanged(); + } + if (!other.getMinCpuPlatform().isEmpty()) { + minCpuPlatform_ = other.minCpuPlatform_; + onChanged(); + } + if (other.provisioningModel_ != 0) { + setProvisioningModelValue(other.getProvisioningModelValue()); + } + if (acceleratorsBuilder_ == null) { + if (!other.accelerators_.isEmpty()) { + if (accelerators_.isEmpty()) { + accelerators_ = other.accelerators_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAcceleratorsIsMutable(); + accelerators_.addAll(other.accelerators_); + } + onChanged(); + } + } else { + if (!other.accelerators_.isEmpty()) { + if (acceleratorsBuilder_.isEmpty()) { + acceleratorsBuilder_.dispose(); + acceleratorsBuilder_ = null; + accelerators_ = other.accelerators_; + bitField0_ = (bitField0_ & ~0x00000002); + acceleratorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAcceleratorsFieldBuilder() + : null; + } else { + acceleratorsBuilder_.addAllMessages(other.accelerators_); + } + } + } + if (disksBuilder_ == null) { + if (!other.disks_.isEmpty()) { + if (disks_.isEmpty()) { + disks_ = other.disks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureDisksIsMutable(); + disks_.addAll(other.disks_); + } + onChanged(); + } + } else { + if (!other.disks_.isEmpty()) { + if (disksBuilder_.isEmpty()) { + disksBuilder_.dispose(); + disksBuilder_ = null; + disks_ = other.disks_; + bitField0_ = (bitField0_ & ~0x00000004); + disksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDisksFieldBuilder() + : null; + } else { + disksBuilder_.addAllMessages(other.disks_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList allowedMachineTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedMachineTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedMachineTypes_ = new com.google.protobuf.LazyStringArrayList(allowedMachineTypes_); + bitField0_ |= 0x00000001; + } + } + /** + * 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=331 + * @return A list containing the allowedMachineTypes. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getAllowedMachineTypesList() { + return allowedMachineTypes_.getUnmodifiableView(); + } + /** + * 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=331 + * @return The count of allowedMachineTypes. + */ + @java.lang.Deprecated + public int getAllowedMachineTypesCount() { + return allowedMachineTypes_.size(); + } + /** + * 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=331 + * @param index The index of the element to return. + * @return The allowedMachineTypes at the given index. + */ + @java.lang.Deprecated + public java.lang.String getAllowedMachineTypes(int index) { + return allowedMachineTypes_.get(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=331 + * @param index The index of the value to return. + * @return The bytes of the allowedMachineTypes at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getAllowedMachineTypesBytes(int index) { + return allowedMachineTypes_.getByteString(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=331 + * @param index The index to set the value at. + * @param value The allowedMachineTypes to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setAllowedMachineTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedMachineTypesIsMutable(); + allowedMachineTypes_.set(index, value); + onChanged(); + return this; + } + /** + * 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=331 + * @param value The allowedMachineTypes to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllowedMachineTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedMachineTypesIsMutable(); + allowedMachineTypes_.add(value); + onChanged(); + return this; + } + /** + * 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=331 + * @param values The allowedMachineTypes to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllAllowedMachineTypes(java.lang.Iterable values) { + ensureAllowedMachineTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedMachineTypes_); + onChanged(); + return this; + } + /** + * 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=331 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearAllowedMachineTypes() { + allowedMachineTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * 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=331 + * @param value The bytes of the allowedMachineTypes to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllowedMachineTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedMachineTypesIsMutable(); + allowedMachineTypes_.add(value); + onChanged(); + return this; + } + + private java.lang.Object machineType_ = ""; + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 2; + * + * @return The machineType. + */ + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 2; + * + * @return The bytes for machineType. + */ + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 2; + * + * @param value The machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + machineType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearMachineType() { + + machineType_ = getDefaultInstance().getMachineType(); + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 2; + * + * @param value The bytes for machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + machineType_ = value; + onChanged(); + return this; + } + + private java.lang.Object minCpuPlatform_ = ""; + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+       * Not yet implemented.
+       * 
+ * + * string min_cpu_platform = 3; + * + * @return The minCpuPlatform. + */ + public java.lang.String getMinCpuPlatform() { + java.lang.Object ref = minCpuPlatform_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + minCpuPlatform_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+       * Not yet implemented.
+       * 
+ * + * string min_cpu_platform = 3; + * + * @return The bytes for minCpuPlatform. + */ + public com.google.protobuf.ByteString getMinCpuPlatformBytes() { + java.lang.Object ref = minCpuPlatform_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + minCpuPlatform_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+       * Not yet implemented.
+       * 
+ * + * string min_cpu_platform = 3; + * + * @param value The minCpuPlatform to set. + * @return This builder for chaining. + */ + public Builder setMinCpuPlatform(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + minCpuPlatform_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+       * Not yet implemented.
+       * 
+ * + * string min_cpu_platform = 3; + * + * @return This builder for chaining. + */ + public Builder clearMinCpuPlatform() { + + minCpuPlatform_ = getDefaultInstance().getMinCpuPlatform(); + onChanged(); + return this; + } + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
+       * Not yet implemented.
+       * 
+ * + * string min_cpu_platform = 3; + * + * @param value The bytes for minCpuPlatform to set. + * @return This builder for chaining. + */ + public Builder setMinCpuPlatformBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + minCpuPlatform_ = value; + onChanged(); + return this; + } + + private int provisioningModel_ = 0; + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + @java.lang.Override + public int getProvisioningModelValue() { + return provisioningModel_; + } + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @param value The enum numeric value on the wire for provisioningModel to set. + * @return This builder for chaining. + */ + public Builder setProvisioningModelValue(int value) { + + provisioningModel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel result = + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.valueOf( + provisioningModel_); + return result == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @param value The provisioningModel to set. + * @return This builder for chaining. + */ + public Builder setProvisioningModel( + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel value) { + if (value == null) { + throw new NullPointerException(); + } + + provisioningModel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearProvisioningModel() { + + provisioningModel_ = 0; + onChanged(); + return this; + } + + private java.util.List + accelerators_ = java.util.Collections.emptyList(); + + private void ensureAcceleratorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + accelerators_ = + new java.util.ArrayList( + accelerators_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder> + acceleratorsBuilder_; + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public java.util.List + getAcceleratorsList() { + if (acceleratorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(accelerators_); + } else { + return acceleratorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public int getAcceleratorsCount() { + if (acceleratorsBuilder_ == null) { + return accelerators_.size(); + } else { + return acceleratorsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator getAccelerators( + int index) { + if (acceleratorsBuilder_ == null) { + return accelerators_.get(index); + } else { + return acceleratorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder setAccelerators( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator value) { + if (acceleratorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorsIsMutable(); + accelerators_.set(index, value); + onChanged(); + } else { + acceleratorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder setAccelerators( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder builderForValue) { + if (acceleratorsBuilder_ == null) { + ensureAcceleratorsIsMutable(); + accelerators_.set(index, builderForValue.build()); + onChanged(); + } else { + acceleratorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator value) { + if (acceleratorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorsIsMutable(); + accelerators_.add(value); + onChanged(); + } else { + acceleratorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator value) { + if (acceleratorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceleratorsIsMutable(); + accelerators_.add(index, value); + onChanged(); + } else { + acceleratorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder builderForValue) { + if (acceleratorsBuilder_ == null) { + ensureAcceleratorsIsMutable(); + accelerators_.add(builderForValue.build()); + onChanged(); + } else { + acceleratorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder builderForValue) { + if (acceleratorsBuilder_ == null) { + ensureAcceleratorsIsMutable(); + accelerators_.add(index, builderForValue.build()); + onChanged(); + } else { + acceleratorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAllAccelerators( + java.lang.Iterable + values) { + if (acceleratorsBuilder_ == null) { + ensureAcceleratorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accelerators_); + onChanged(); + } else { + acceleratorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder clearAccelerators() { + if (acceleratorsBuilder_ == null) { + accelerators_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + acceleratorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder removeAccelerators(int index) { + if (acceleratorsBuilder_ == null) { + ensureAcceleratorsIsMutable(); + accelerators_.remove(index); + onChanged(); + } else { + acceleratorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder + getAcceleratorsBuilder(int index) { + return getAcceleratorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder + getAcceleratorsOrBuilder(int index) { + if (acceleratorsBuilder_ == null) { + return accelerators_.get(index); + } else { + return acceleratorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder> + getAcceleratorsOrBuilderList() { + if (acceleratorsBuilder_ != null) { + return acceleratorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(accelerators_); + } + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder + addAcceleratorsBuilder() { + return getAcceleratorsFieldBuilder() + .addBuilder( + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.getDefaultInstance()); + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder + addAcceleratorsBuilder(int index) { + return getAcceleratorsFieldBuilder() + .addBuilder( + index, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.getDefaultInstance()); + } + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * Not yet implemented.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public java.util.List + getAcceleratorsBuilderList() { + return getAcceleratorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder> + getAcceleratorsFieldBuilder() { + if (acceleratorsBuilder_ == null) { + acceleratorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, + com.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.AcceleratorOrBuilder>( + accelerators_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + accelerators_ = null; + } + return acceleratorsBuilder_; + } + + private java.util.List disks_ = + java.util.Collections.emptyList(); + + private void ensureDisksIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + disks_ = + new java.util.ArrayList( + disks_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder> + disksBuilder_; + + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public java.util.List + getDisksList() { + if (disksBuilder_ == null) { + return java.util.Collections.unmodifiableList(disks_); + } else { + return disksBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public int getDisksCount() { + if (disksBuilder_ == null) { + return disks_.size(); + } else { + return disksBuilder_.getCount(); + } + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk getDisks(int index) { + if (disksBuilder_ == null) { + return disks_.get(index); + } else { + return disksBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder setDisks( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk value) { + if (disksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisksIsMutable(); + disks_.set(index, value); + onChanged(); + } else { + disksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder setDisks( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder builderForValue) { + if (disksBuilder_ == null) { + ensureDisksIsMutable(); + disks_.set(index, builderForValue.build()); + onChanged(); + } else { + disksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder addDisks(com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk value) { + if (disksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisksIsMutable(); + disks_.add(value); + onChanged(); + } else { + disksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder addDisks( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk value) { + if (disksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisksIsMutable(); + disks_.add(index, value); + onChanged(); + } else { + disksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder addDisks( + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder builderForValue) { + if (disksBuilder_ == null) { + ensureDisksIsMutable(); + disks_.add(builderForValue.build()); + onChanged(); + } else { + disksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder addDisks( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder builderForValue) { + if (disksBuilder_ == null) { + ensureDisksIsMutable(); + disks_.add(index, builderForValue.build()); + onChanged(); + } else { + disksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder addAllDisks( + java.lang.Iterable + values) { + if (disksBuilder_ == null) { + ensureDisksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, disks_); + onChanged(); + } else { + disksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder clearDisks() { + if (disksBuilder_ == null) { + disks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + disksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public Builder removeDisks(int index) { + if (disksBuilder_ == null) { + ensureDisksIsMutable(); + disks_.remove(index); + onChanged(); + } else { + disksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder getDisksBuilder( + int index) { + return getDisksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder + getDisksOrBuilder(int index) { + if (disksBuilder_ == null) { + return disks_.get(index); + } else { + return disksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder> + getDisksOrBuilderList() { + if (disksBuilder_ != null) { + return disksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(disks_); + } + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder + addDisksBuilder() { + return getDisksFieldBuilder() + .addBuilder( + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.getDefaultInstance()); + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder addDisksBuilder( + int index) { + return getDisksFieldBuilder() + .addBuilder( + index, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.getDefaultInstance()); + } + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the attached VM is deleted.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk disks = 6; + */ + public java.util.List + getDisksBuilderList() { + return getDisksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder> + getDisksFieldBuilder() { + if (disksBuilder_ == null) { + disksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDiskOrBuilder>( + disks_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + disks_ = null; + } + return disksBuilder_; + } + + @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.AllocationPolicy.InstancePolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancePolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InstancePolicy(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.InstancePolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InstancePolicyOrTemplateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + * + * @return The policy. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy getPolicy(); + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+     * Name of an instance template used to create VMs.
+     * Named the field as 'instance_template' instead of 'template' to avoid
+     * c++ keyword conflict.
+     * 
+ * + * string instance_template = 2; + * + * @return Whether the instanceTemplate field is set. + */ + boolean hasInstanceTemplate(); + /** + * + * + *
+     * Name of an instance template used to create VMs.
+     * Named the field as 'instance_template' instead of 'template' to avoid
+     * c++ keyword conflict.
+     * 
+ * + * string instance_template = 2; + * + * @return The instanceTemplate. + */ + java.lang.String getInstanceTemplate(); + /** + * + * + *
+     * Name of an instance template used to create VMs.
+     * Named the field as 'instance_template' instead of 'template' to avoid
+     * c++ keyword conflict.
+     * 
+ * + * string instance_template = 2; + * + * @return The bytes for instanceTemplate. + */ + com.google.protobuf.ByteString getInstanceTemplateBytes(); + + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + .PolicyTemplateCase + getPolicyTemplateCase(); + } + /** + * + * + *
+   * Either an InstancePolicy or an instance template.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} + */ + public static final class InstancePolicyOrTemplate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + InstancePolicyOrTemplateOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstancePolicyOrTemplate.newBuilder() to construct. + private InstancePolicyOrTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InstancePolicyOrTemplate() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InstancePolicyOrTemplate(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InstancePolicyOrTemplate( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder subBuilder = + null; + if (policyTemplateCase_ == 1) { + subBuilder = + ((com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + policyTemplate_) + .toBuilder(); + } + policyTemplate_ = + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + policyTemplate_); + policyTemplate_ = subBuilder.buildPartial(); + } + policyTemplateCase_ = 1; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + policyTemplateCase_ = 2; + policyTemplate_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + .class); + } + + private int policyTemplateCase_ = 0; + private java.lang.Object policyTemplate_; + + public enum PolicyTemplateCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + POLICY(1), + INSTANCE_TEMPLATE(2), + POLICYTEMPLATE_NOT_SET(0); + private final int value; + + private PolicyTemplateCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PolicyTemplateCase valueOf(int value) { + return forNumber(value); + } + + public static PolicyTemplateCase forNumber(int value) { + switch (value) { + case 1: + return POLICY; + case 2: + return INSTANCE_TEMPLATE; + case 0: + return POLICYTEMPLATE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PolicyTemplateCase getPolicyTemplateCase() { + return PolicyTemplateCase.forNumber(policyTemplateCase_); + } + + public static final int POLICY_FIELD_NUMBER = 1; + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policyTemplateCase_ == 1; + } + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + * + * @return The policy. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy getPolicy() { + if (policyTemplateCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance(); + } + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder + getPolicyOrBuilder() { + if (policyTemplateCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance(); + } + + public static final int INSTANCE_TEMPLATE_FIELD_NUMBER = 2; + /** + * + * + *
+     * Name of an instance template used to create VMs.
+     * Named the field as 'instance_template' instead of 'template' to avoid
+     * c++ keyword conflict.
+     * 
+ * + * string instance_template = 2; + * + * @return Whether the instanceTemplate field is set. + */ + public boolean hasInstanceTemplate() { + return policyTemplateCase_ == 2; + } + /** + * + * + *
+     * Name of an instance template used to create VMs.
+     * Named the field as 'instance_template' instead of 'template' to avoid
+     * c++ keyword conflict.
+     * 
+ * + * string instance_template = 2; + * + * @return The instanceTemplate. + */ + public java.lang.String getInstanceTemplate() { + java.lang.Object ref = ""; + if (policyTemplateCase_ == 2) { + ref = policyTemplate_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (policyTemplateCase_ == 2) { + policyTemplate_ = s; + } + return s; + } + } + /** + * + * + *
+     * Name of an instance template used to create VMs.
+     * Named the field as 'instance_template' instead of 'template' to avoid
+     * c++ keyword conflict.
+     * 
+ * + * string instance_template = 2; + * + * @return The bytes for instanceTemplate. + */ + public com.google.protobuf.ByteString getInstanceTemplateBytes() { + java.lang.Object ref = ""; + if (policyTemplateCase_ == 2) { + ref = policyTemplate_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (policyTemplateCase_ == 2) { + policyTemplate_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (policyTemplateCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_); + } + if (policyTemplateCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, policyTemplate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (policyTemplateCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_); + } + if (policyTemplateCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, policyTemplate_); + } + size += unknownFields.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.AllocationPolicy.InstancePolicyOrTemplate)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) obj; + + if (!getPolicyTemplateCase().equals(other.getPolicyTemplateCase())) return false; + switch (policyTemplateCase_) { + case 1: + if (!getPolicy().equals(other.getPolicy())) return false; + break; + case 2: + if (!getInstanceTemplate().equals(other.getInstanceTemplate())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (policyTemplateCase_) { + case 1: + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + break; + case 2: + hash = (37 * hash) + INSTANCE_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getInstanceTemplate().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate + 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.AllocationPolicy.InstancePolicyOrTemplate 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; + } + /** + * + * + *
+     * Either an InstancePolicy or an instance template.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + .class); + } + + // Construct using + // com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + policyTemplateCase_ = 0; + policyTemplate_ = null; + 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_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(this); + if (policyTemplateCase_ == 1) { + if (policyBuilder_ == null) { + result.policyTemplate_ = policyTemplate_; + } else { + result.policyTemplate_ = policyBuilder_.build(); + } + } + if (policyTemplateCase_ == 2) { + result.policyTemplate_ = policyTemplate_; + } + result.policyTemplateCase_ = policyTemplateCase_; + onBuilt(); + return result; + } + + @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.AllocationPolicy.InstancePolicyOrTemplate) { + return mergeFrom( + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance()) return this; + switch (other.getPolicyTemplateCase()) { + case POLICY: + { + mergePolicy(other.getPolicy()); + break; + } + case INSTANCE_TEMPLATE: + { + policyTemplateCase_ = 2; + policyTemplate_ = other.policyTemplate_; + onChanged(); + break; + } + case POLICYTEMPLATE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int policyTemplateCase_ = 0; + private java.lang.Object policyTemplate_; + + public PolicyTemplateCase getPolicyTemplateCase() { + return PolicyTemplateCase.forNumber(policyTemplateCase_); + } + + public Builder clearPolicyTemplate() { + policyTemplateCase_ = 0; + policyTemplate_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policyTemplateCase_ == 1; + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + * + * @return The policy. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy getPolicy() { + if (policyBuilder_ == null) { + if (policyTemplateCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } else { + if (policyTemplateCase_ == 1) { + return policyBuilder_.getMessage(); + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder setPolicy( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyTemplate_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + policyTemplateCase_ = 1; + return this; + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder setPolicy( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder builderForValue) { + if (policyBuilder_ == null) { + policyTemplate_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + policyTemplateCase_ = 1; + return this; + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder mergePolicy( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy value) { + if (policyBuilder_ == null) { + if (policyTemplateCase_ == 1 + && policyTemplate_ + != com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + .getDefaultInstance()) { + policyTemplate_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.newBuilder( + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + policyTemplate_) + .mergeFrom(value) + .buildPartial(); + } else { + policyTemplate_ = value; + } + onChanged(); + } else { + if (policyTemplateCase_ == 1) { + policyBuilder_.mergeFrom(value); + } else { + policyBuilder_.setMessage(value); + } + } + policyTemplateCase_ = 1; + return this; + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + if (policyTemplateCase_ == 1) { + policyTemplateCase_ = 0; + policyTemplate_ = null; + onChanged(); + } + } else { + if (policyTemplateCase_ == 1) { + policyTemplateCase_ = 0; + policyTemplate_ = null; + } + policyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder + getPolicyBuilder() { + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder + getPolicyOrBuilder() { + if ((policyTemplateCase_ == 1) && (policyBuilder_ != null)) { + return policyBuilder_.getMessageOrBuilder(); + } else { + if (policyTemplateCase_ == 1) { + return (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_; + } + return com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } + } + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + if (!(policyTemplateCase_ == 1)) { + policyTemplate_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance(); + } + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder>( + (com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) policyTemplate_, + getParentForChildren(), + isClean()); + policyTemplate_ = null; + } + policyTemplateCase_ = 1; + onChanged(); + ; + return policyBuilder_; + } + + /** + * + * + *
+       * Name of an instance template used to create VMs.
+       * Named the field as 'instance_template' instead of 'template' to avoid
+       * c++ keyword conflict.
+       * 
+ * + * string instance_template = 2; + * + * @return Whether the instanceTemplate field is set. + */ + @java.lang.Override + public boolean hasInstanceTemplate() { + return policyTemplateCase_ == 2; + } + /** + * + * + *
+       * Name of an instance template used to create VMs.
+       * Named the field as 'instance_template' instead of 'template' to avoid
+       * c++ keyword conflict.
+       * 
+ * + * string instance_template = 2; + * + * @return The instanceTemplate. + */ + @java.lang.Override + public java.lang.String getInstanceTemplate() { + java.lang.Object ref = ""; + if (policyTemplateCase_ == 2) { + ref = policyTemplate_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (policyTemplateCase_ == 2) { + policyTemplate_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of an instance template used to create VMs.
+       * Named the field as 'instance_template' instead of 'template' to avoid
+       * c++ keyword conflict.
+       * 
+ * + * string instance_template = 2; + * + * @return The bytes for instanceTemplate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceTemplateBytes() { + java.lang.Object ref = ""; + if (policyTemplateCase_ == 2) { + ref = policyTemplate_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (policyTemplateCase_ == 2) { + policyTemplate_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of an instance template used to create VMs.
+       * Named the field as 'instance_template' instead of 'template' to avoid
+       * c++ keyword conflict.
+       * 
+ * + * string instance_template = 2; + * + * @param value The instanceTemplate to set. + * @return This builder for chaining. + */ + public Builder setInstanceTemplate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policyTemplateCase_ = 2; + policyTemplate_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of an instance template used to create VMs.
+       * Named the field as 'instance_template' instead of 'template' to avoid
+       * c++ keyword conflict.
+       * 
+ * + * string instance_template = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstanceTemplate() { + if (policyTemplateCase_ == 2) { + policyTemplateCase_ = 0; + policyTemplate_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Name of an instance template used to create VMs.
+       * Named the field as 'instance_template' instead of 'template' to avoid
+       * c++ keyword conflict.
+       * 
+ * + * string instance_template = 2; + * + * @param value The bytes for instanceTemplate to set. + * @return This builder for chaining. + */ + public Builder setInstanceTemplateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policyTemplateCase_ = 2; + policyTemplate_ = value; + 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.AllocationPolicy.InstancePolicyOrTemplate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstancePolicyOrTemplate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InstancePolicyOrTemplate(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.InstancePolicyOrTemplate + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NetworkInterfaceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The URL of the network resource.
+     * 
+ * + * string network = 1; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+     * The URL of the network resource.
+     * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+     * The URL of the Subnetwork resource.
+     * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + java.lang.String getSubnetwork(); + /** + * + * + *
+     * The URL of the Subnetwork resource.
+     * 
+ * + * string subnetwork = 2; + * + * @return The bytes for subnetwork. + */ + com.google.protobuf.ByteString getSubnetworkBytes(); + + /** + * + * + *
+     * Default is false (with an external IP address). Required if
+     * no external public IP address is attached to the VM. If no external
+     * public IP address, additional configuration is required to allow the VM
+     * to access Google Services. See
+     * https://cloud.google.com/vpc/docs/configure-private-google-access and
+     * https://cloud.google.com/nat/docs/gce-example#create-nat for more
+     * information.
+     * 
+ * + * bool no_external_ip_address = 3; + * + * @return The noExternalIpAddress. + */ + boolean getNoExternalIpAddress(); + } + /** + * + * + *
+   * A network interface.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} + */ + public static final class NetworkInterface extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + NetworkInterfaceOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkInterface.newBuilder() to construct. + private NetworkInterface(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkInterface() { + network_ = ""; + subnetwork_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkInterface(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NetworkInterface( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + network_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + subnetwork_ = s; + break; + } + case 24: + { + noExternalIpAddress_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 1; + private volatile java.lang.Object network_; + /** + * + * + *
+     * The URL of the network resource.
+     * 
+ * + * string network = 1; + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+     * The URL of the network resource.
+     * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBNETWORK_FIELD_NUMBER = 2; + private volatile java.lang.Object subnetwork_; + /** + * + * + *
+     * The URL of the Subnetwork resource.
+     * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + @java.lang.Override + public java.lang.String getSubnetwork() { + java.lang.Object ref = subnetwork_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subnetwork_ = s; + return s; + } + } + /** + * + * + *
+     * The URL of the Subnetwork resource.
+     * 
+ * + * string subnetwork = 2; + * + * @return The bytes for subnetwork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubnetworkBytes() { + java.lang.Object ref = subnetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subnetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NO_EXTERNAL_IP_ADDRESS_FIELD_NUMBER = 3; + private boolean noExternalIpAddress_; + /** + * + * + *
+     * Default is false (with an external IP address). Required if
+     * no external public IP address is attached to the VM. If no external
+     * public IP address, additional configuration is required to allow the VM
+     * to access Google Services. See
+     * https://cloud.google.com/vpc/docs/configure-private-google-access and
+     * https://cloud.google.com/nat/docs/gce-example#create-nat for more
+     * information.
+     * 
+ * + * bool no_external_ip_address = 3; + * + * @return The noExternalIpAddress. + */ + @java.lang.Override + public boolean getNoExternalIpAddress() { + return noExternalIpAddress_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subnetwork_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subnetwork_); + } + if (noExternalIpAddress_ != false) { + output.writeBool(3, noExternalIpAddress_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subnetwork_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subnetwork_); + } + if (noExternalIpAddress_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, noExternalIpAddress_); + } + size += unknownFields.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.AllocationPolicy.NetworkInterface)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getSubnetwork().equals(other.getSubnetwork())) return false; + if (getNoExternalIpAddress() != other.getNoExternalIpAddress()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + SUBNETWORK_FIELD_NUMBER; + hash = (53 * hash) + getSubnetwork().hashCode(); + hash = (37 * hash) + NO_EXTERNAL_IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNoExternalIpAddress()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface 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.AllocationPolicy.NetworkInterface parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface 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.AllocationPolicy.NetworkInterface parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface 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.AllocationPolicy.NetworkInterface parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface 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.AllocationPolicy.NetworkInterface + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + 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.AllocationPolicy.NetworkInterface 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.AllocationPolicy.NetworkInterface 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.AllocationPolicy.NetworkInterface 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; + } + /** + * + * + *
+     * A network interface.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder.class); + } + + // Construct using + // com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + network_ = ""; + + subnetwork_ = ""; + + noExternalIpAddress_ = false; + + 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_AllocationPolicy_NetworkInterface_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(this); + result.network_ = network_; + result.subnetwork_ = subnetwork_; + result.noExternalIpAddress_ = noExternalIpAddress_; + onBuilt(); + return result; + } + + @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.AllocationPolicy.NetworkInterface) { + return mergeFrom( + (com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + .getDefaultInstance()) return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (!other.getSubnetwork().isEmpty()) { + subnetwork_ = other.subnetwork_; + onChanged(); + } + if (other.getNoExternalIpAddress() != false) { + setNoExternalIpAddress(other.getNoExternalIpAddress()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+       * The URL of the network resource.
+       * 
+ * + * string network = 1; + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The URL of the network resource.
+       * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The URL of the network resource.
+       * 
+ * + * string network = 1; + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + network_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The URL of the network resource.
+       * 
+ * + * string network = 1; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + * + * + *
+       * The URL of the network resource.
+       * 
+ * + * string network = 1; + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + network_ = value; + onChanged(); + return this; + } + + private java.lang.Object subnetwork_ = ""; + /** + * + * + *
+       * The URL of the Subnetwork resource.
+       * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + public java.lang.String getSubnetwork() { + java.lang.Object ref = subnetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subnetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The URL of the Subnetwork resource.
+       * 
+ * + * string subnetwork = 2; + * + * @return The bytes for subnetwork. + */ + public com.google.protobuf.ByteString getSubnetworkBytes() { + java.lang.Object ref = subnetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subnetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The URL of the Subnetwork resource.
+       * 
+ * + * string subnetwork = 2; + * + * @param value The subnetwork to set. + * @return This builder for chaining. + */ + public Builder setSubnetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subnetwork_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The URL of the Subnetwork resource.
+       * 
+ * + * string subnetwork = 2; + * + * @return This builder for chaining. + */ + public Builder clearSubnetwork() { + + subnetwork_ = getDefaultInstance().getSubnetwork(); + onChanged(); + return this; + } + /** + * + * + *
+       * The URL of the Subnetwork resource.
+       * 
+ * + * string subnetwork = 2; + * + * @param value The bytes for subnetwork to set. + * @return This builder for chaining. + */ + public Builder setSubnetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subnetwork_ = value; + onChanged(); + return this; + } + + private boolean noExternalIpAddress_; + /** + * + * + *
+       * Default is false (with an external IP address). Required if
+       * no external public IP address is attached to the VM. If no external
+       * public IP address, additional configuration is required to allow the VM
+       * to access Google Services. See
+       * https://cloud.google.com/vpc/docs/configure-private-google-access and
+       * https://cloud.google.com/nat/docs/gce-example#create-nat for more
+       * information.
+       * 
+ * + * bool no_external_ip_address = 3; + * + * @return The noExternalIpAddress. + */ + @java.lang.Override + public boolean getNoExternalIpAddress() { + return noExternalIpAddress_; + } + /** + * + * + *
+       * Default is false (with an external IP address). Required if
+       * no external public IP address is attached to the VM. If no external
+       * public IP address, additional configuration is required to allow the VM
+       * to access Google Services. See
+       * https://cloud.google.com/vpc/docs/configure-private-google-access and
+       * https://cloud.google.com/nat/docs/gce-example#create-nat for more
+       * information.
+       * 
+ * + * bool no_external_ip_address = 3; + * + * @param value The noExternalIpAddress to set. + * @return This builder for chaining. + */ + public Builder setNoExternalIpAddress(boolean value) { + + noExternalIpAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Default is false (with an external IP address). Required if
+       * no external public IP address is attached to the VM. If no external
+       * public IP address, additional configuration is required to allow the VM
+       * to access Google Services. See
+       * https://cloud.google.com/vpc/docs/configure-private-google-access and
+       * https://cloud.google.com/nat/docs/gce-example#create-nat for more
+       * information.
+       * 
+ * + * bool no_external_ip_address = 3; + * + * @return This builder for chaining. + */ + public Builder clearNoExternalIpAddress() { + + noExternalIpAddress_ = false; + 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.AllocationPolicy.NetworkInterface) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkInterface parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkInterface(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.NetworkInterface + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NetworkPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + java.util.List + getNetworkInterfacesList(); + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface getNetworkInterfaces( + int index); + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + int getNetworkInterfacesCount(); + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesOrBuilderList(); + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder + getNetworkInterfacesOrBuilder(int index); + } + /** + * + * + *
+   * NetworkPolicy describes VM instance network configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} + */ + public static final class NetworkPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + NetworkPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use NetworkPolicy.newBuilder() to construct. + private NetworkPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NetworkPolicy() { + networkInterfaces_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NetworkPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NetworkPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + networkInterfaces_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface>(); + mutable_bitField0_ |= 0x00000001; + } + networkInterfaces_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + networkInterfaces_ = java.util.Collections.unmodifiableList(networkInterfaces_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder.class); + } + + public static final int NETWORK_INTERFACES_FIELD_NUMBER = 1; + private java.util.List + networkInterfaces_; + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public java.util.List + getNetworkInterfacesList() { + return networkInterfaces_; + } + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesOrBuilderList() { + return networkInterfaces_; + } + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public int getNetworkInterfacesCount() { + return networkInterfaces_.size(); + } + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface getNetworkInterfaces( + int index) { + return networkInterfaces_.get(index); + } + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder + getNetworkInterfacesOrBuilder(int index) { + return networkInterfaces_.get(index); + } + + 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 { + for (int i = 0; i < networkInterfaces_.size(); i++) { + output.writeMessage(1, networkInterfaces_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < networkInterfaces_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, networkInterfaces_.get(i)); + } + size += unknownFields.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.AllocationPolicy.NetworkPolicy)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy other = + (com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) obj; + + if (!getNetworkInterfacesList().equals(other.getNetworkInterfacesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNetworkInterfacesCount() > 0) { + hash = (37 * hash) + NETWORK_INTERFACES_FIELD_NUMBER; + hash = (53 * hash) + getNetworkInterfacesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy 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.AllocationPolicy.NetworkPolicy 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; + } + /** + * + * + *
+     * NetworkPolicy describes VM instance network configurations.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNetworkInterfacesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (networkInterfacesBuilder_ == null) { + networkInterfaces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + networkInterfacesBuilder_.clear(); + } + 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_AllocationPolicy_NetworkPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy build() { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy result = + new com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(this); + int from_bitField0_ = bitField0_; + if (networkInterfacesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + networkInterfaces_ = java.util.Collections.unmodifiableList(networkInterfaces_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.networkInterfaces_ = networkInterfaces_; + } else { + result.networkInterfaces_ = networkInterfacesBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.AllocationPolicy.NetworkPolicy) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy other) { + if (other + == com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.getDefaultInstance()) + return this; + if (networkInterfacesBuilder_ == null) { + if (!other.networkInterfaces_.isEmpty()) { + if (networkInterfaces_.isEmpty()) { + networkInterfaces_ = other.networkInterfaces_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.addAll(other.networkInterfaces_); + } + onChanged(); + } + } else { + if (!other.networkInterfaces_.isEmpty()) { + if (networkInterfacesBuilder_.isEmpty()) { + networkInterfacesBuilder_.dispose(); + networkInterfacesBuilder_ = null; + networkInterfaces_ = other.networkInterfaces_; + bitField0_ = (bitField0_ & ~0x00000001); + networkInterfacesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNetworkInterfacesFieldBuilder() + : null; + } else { + networkInterfacesBuilder_.addAllMessages(other.networkInterfaces_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + networkInterfaces_ = java.util.Collections.emptyList(); + + private void ensureNetworkInterfacesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + networkInterfaces_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface>( + networkInterfaces_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder> + networkInterfacesBuilder_; + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public java.util.List + getNetworkInterfacesList() { + if (networkInterfacesBuilder_ == null) { + return java.util.Collections.unmodifiableList(networkInterfaces_); + } else { + return networkInterfacesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public int getNetworkInterfacesCount() { + if (networkInterfacesBuilder_ == null) { + return networkInterfaces_.size(); + } else { + return networkInterfacesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface getNetworkInterfaces( + int index) { + if (networkInterfacesBuilder_ == null) { + return networkInterfaces_.get(index); + } else { + return networkInterfacesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder setNetworkInterfaces( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface value) { + if (networkInterfacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.set(index, value); + onChanged(); + } else { + networkInterfacesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder setNetworkInterfaces( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder + builderForValue) { + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.set(index, builderForValue.build()); + onChanged(); + } else { + networkInterfacesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface value) { + if (networkInterfacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.add(value); + onChanged(); + } else { + networkInterfacesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface value) { + if (networkInterfacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.add(index, value); + onChanged(); + } else { + networkInterfacesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder + builderForValue) { + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.add(builderForValue.build()); + onChanged(); + } else { + networkInterfacesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder + builderForValue) { + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.add(index, builderForValue.build()); + onChanged(); + } else { + networkInterfacesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addAllNetworkInterfaces( + java.lang.Iterable< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface> + values) { + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, networkInterfaces_); + onChanged(); + } else { + networkInterfacesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder clearNetworkInterfaces() { + if (networkInterfacesBuilder_ == null) { + networkInterfaces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + networkInterfacesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder removeNetworkInterfaces(int index) { + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.remove(index); + onChanged(); + } else { + networkInterfacesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder + getNetworkInterfacesBuilder(int index) { + return getNetworkInterfacesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder + getNetworkInterfacesOrBuilder(int index) { + if (networkInterfacesBuilder_ == null) { + return networkInterfaces_.get(index); + } else { + return networkInterfacesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesOrBuilderList() { + if (networkInterfacesBuilder_ != null) { + return networkInterfacesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(networkInterfaces_); + } + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder + addNetworkInterfacesBuilder() { + return getNetworkInterfacesFieldBuilder() + .addBuilder( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + .getDefaultInstance()); + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder + addNetworkInterfacesBuilder(int index) { + return getNetworkInterfacesFieldBuilder() + .addBuilder( + index, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + .getDefaultInstance()); + } + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public java.util.List< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder> + getNetworkInterfacesBuilderList() { + return getNetworkInterfacesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesFieldBuilder() { + if (networkInterfacesBuilder_ == null) { + networkInterfacesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterfaceOrBuilder>( + networkInterfaces_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + networkInterfaces_ = null; + } + return networkInterfacesBuilder_; + } + + @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.AllocationPolicy.NetworkPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NetworkPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NetworkPolicy(input, extensionRegistry); + } + }; + + 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.AllocationPolicy.NetworkPolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int LOCATION_FIELD_NUMBER = 1; + private com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location_; + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + * + * @return Whether the location field is set. + */ + @java.lang.Override + public boolean hasLocation() { + return location_ != null; + } + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + * + * @return The location. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy getLocation() { + return location_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder + getLocationOrBuilder() { + return getLocation(); + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance_; + /** + * + * + *
+   * Create only instances allowed by this policy.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=415 + * @return Whether the instance field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasInstance() { + return instance_ != null; + } + /** + * + * + *
+   * Create only instances allowed by this policy.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=415 + * @return The instance. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy getInstance() { + return instance_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Create only instances allowed by this policy.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder + getInstanceOrBuilder() { + return getInstance(); + } + + public static final int INSTANCES_FIELD_NUMBER = 8; + private java.util.List + instances_; + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public java.util.List + getInstancesList() { + return instances_; + } + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate getInstances( + int index) { + return instances_.get(index); + } + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder + getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int INSTANCE_TEMPLATES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList instanceTemplates_; + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @return A list containing the instanceTemplates. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getInstanceTemplatesList() { + return instanceTemplates_; + } + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @return The count of instanceTemplates. + */ + @java.lang.Deprecated + public int getInstanceTemplatesCount() { + return instanceTemplates_.size(); + } + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @param index The index of the element to return. + * @return The instanceTemplates at the given index. + */ + @java.lang.Deprecated + public java.lang.String getInstanceTemplates(int index) { + return instanceTemplates_.get(index); + } + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @param index The index of the value to return. + * @return The bytes of the instanceTemplates at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getInstanceTemplatesBytes(int index) { + return instanceTemplates_.getByteString(index); + } + + public static final int PROVISIONING_MODELS_FIELD_NUMBER = 4; + private java.util.List provisioningModels_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel> + provisioningModels_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel>() { + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel result = + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.valueOf(from); + return result == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @return A list containing the provisioningModels. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.List + getProvisioningModelsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel>( + provisioningModels_, provisioningModels_converter_); + } + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @return The count of provisioningModels. + */ + @java.lang.Override + @java.lang.Deprecated + public int getProvisioningModelsCount() { + return provisioningModels_.size(); + } + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the element to return. + * @return The provisioningModels at the given index. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisioningModels( + int index) { + return provisioningModels_converter_.convert(provisioningModels_.get(index)); + } + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @return A list containing the enum numeric values on the wire for provisioningModels. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.List getProvisioningModelsValueList() { + return provisioningModels_; + } + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the value to return. + * @return The enum numeric value on the wire of provisioningModels at the given index. + */ + @java.lang.Override + @java.lang.Deprecated + public int getProvisioningModelsValue(int index) { + return provisioningModels_.get(index); + } + + private int provisioningModelsMemoizedSerializedSize; + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * Email of the service account that VMs will run as.
+   * 
+ * + * string service_account_email = 5; + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * Email of the service account that VMs will run as.
+   * 
+ * + * string service_account_email = 5; + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 9; + private com.google.cloud.batch.v1alpha.ServiceAccount serviceAccount_; + /** + * + * + *
+   * Service account that VMs will run as.
+   * Not yet implemented.
+   * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + * + * @return Whether the serviceAccount field is set. + */ + @java.lang.Override + public boolean hasServiceAccount() { + return serviceAccount_ != null; + } + /** + * + * + *
+   * Service account that VMs will run as.
+   * Not yet implemented.
+   * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + * + * @return The serviceAccount. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.ServiceAccount getServiceAccount() { + return serviceAccount_ == null + ? com.google.cloud.batch.v1alpha.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + /** + * + * + *
+   * Service account that VMs will run as.
+   * Not yet implemented.
+   * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + return getServiceAccount(); + } + + public static final int LABELS_FIELD_NUMBER = 6; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NETWORK_FIELD_NUMBER = 7; + private com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network_; + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + * + * @return Whether the network field is set. + */ + @java.lang.Override + public boolean hasNetwork() { + return network_ != null; + } + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + * + * @return The network. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy getNetwork() { + return network_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder + getNetworkOrBuilder() { + return getNetwork(); + } + + 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 { + getSerializedSize(); + if (location_ != null) { + output.writeMessage(1, getLocation()); + } + if (instance_ != null) { + output.writeMessage(2, getInstance()); + } + for (int i = 0; i < instanceTemplates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, instanceTemplates_.getRaw(i)); + } + if (getProvisioningModelsList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(provisioningModelsMemoizedSerializedSize); + } + for (int i = 0; i < provisioningModels_.size(); i++) { + output.writeEnumNoTag(provisioningModels_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceAccountEmail_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 6); + if (network_ != null) { + output.writeMessage(7, getNetwork()); + } + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(8, instances_.get(i)); + } + if (serviceAccount_ != null) { + output.writeMessage(9, getServiceAccount()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (location_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLocation()); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + { + int dataSize = 0; + for (int i = 0; i < instanceTemplates_.size(); i++) { + dataSize += computeStringSizeNoTag(instanceTemplates_.getRaw(i)); + } + size += dataSize; + size += 1 * getInstanceTemplatesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < provisioningModels_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(provisioningModels_.get(i)); + } + size += dataSize; + if (!getProvisioningModelsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + provisioningModelsMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serviceAccountEmail_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, labels__); + } + if (network_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getNetwork()); + } + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, instances_.get(i)); + } + if (serviceAccount_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getServiceAccount()); + } + size += unknownFields.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.AllocationPolicy)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.AllocationPolicy other = + (com.google.cloud.batch.v1alpha.AllocationPolicy) obj; + + if (hasLocation() != other.hasLocation()) return false; + if (hasLocation()) { + if (!getLocation().equals(other.getLocation())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getInstanceTemplatesList().equals(other.getInstanceTemplatesList())) return false; + if (!provisioningModels_.equals(other.provisioningModels_)) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (hasServiceAccount() != other.hasServiceAccount()) return false; + if (hasServiceAccount()) { + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasNetwork() != other.hasNetwork()) return false; + if (hasNetwork()) { + if (!getNetwork().equals(other.getNetwork())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLocation()) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + if (getInstanceTemplatesCount() > 0) { + hash = (37 * hash) + INSTANCE_TEMPLATES_FIELD_NUMBER; + hash = (53 * hash) + getInstanceTemplatesList().hashCode(); + } + if (getProvisioningModelsCount() > 0) { + hash = (37 * hash) + PROVISIONING_MODELS_FIELD_NUMBER; + hash = (53 * hash) + provisioningModels_.hashCode(); + } + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + if (hasServiceAccount()) { + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasNetwork()) { + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy 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.AllocationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy 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.AllocationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy 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.AllocationPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy 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.AllocationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy 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.AllocationPolicy 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.AllocationPolicy 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.AllocationPolicy 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; + } + /** + * + * + *
+   * A Job's resource allocation policy describes when, where, and how compute
+   * resources should be allocated for the Job.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.AllocationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.AllocationPolicy) + com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_AllocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.AllocationPolicy.class, + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.AllocationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (locationBuilder_ == null) { + location_ = null; + } else { + location_ = null; + locationBuilder_ = null; + } + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = null; + } + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + instancesBuilder_.clear(); + } + instanceTemplates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + provisioningModels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + serviceAccountEmail_ = ""; + + if (serviceAccountBuilder_ == null) { + serviceAccount_ = null; + } else { + serviceAccount_ = null; + serviceAccountBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (networkBuilder_ == null) { + network_ = null; + } else { + network_ = null; + networkBuilder_ = null; + } + 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_AllocationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.AllocationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy build() { + com.google.cloud.batch.v1alpha.AllocationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy buildPartial() { + com.google.cloud.batch.v1alpha.AllocationPolicy result = + new com.google.cloud.batch.v1alpha.AllocationPolicy(this); + int from_bitField0_ = bitField0_; + if (locationBuilder_ == null) { + result.location_ = location_; + } else { + result.location_ = locationBuilder_.build(); + } + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.build(); + } + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + instanceTemplates_ = instanceTemplates_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.instanceTemplates_ = instanceTemplates_; + if (((bitField0_ & 0x00000004) != 0)) { + provisioningModels_ = java.util.Collections.unmodifiableList(provisioningModels_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.provisioningModels_ = provisioningModels_; + result.serviceAccountEmail_ = serviceAccountEmail_; + if (serviceAccountBuilder_ == null) { + result.serviceAccount_ = serviceAccount_; + } else { + result.serviceAccount_ = serviceAccountBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (networkBuilder_ == null) { + result.network_ = network_; + } else { + result.network_ = networkBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.AllocationPolicy) { + return mergeFrom((com.google.cloud.batch.v1alpha.AllocationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.AllocationPolicy other) { + if (other == com.google.cloud.batch.v1alpha.AllocationPolicy.getDefaultInstance()) + return this; + if (other.hasLocation()) { + mergeLocation(other.getLocation()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.instanceTemplates_.isEmpty()) { + if (instanceTemplates_.isEmpty()) { + instanceTemplates_ = other.instanceTemplates_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInstanceTemplatesIsMutable(); + instanceTemplates_.addAll(other.instanceTemplates_); + } + onChanged(); + } + if (!other.provisioningModels_.isEmpty()) { + if (provisioningModels_.isEmpty()) { + provisioningModels_ = other.provisioningModels_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureProvisioningModelsIsMutable(); + provisioningModels_.addAll(other.provisioningModels_); + } + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.hasServiceAccount()) { + mergeServiceAccount(other.getServiceAccount()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasNetwork()) { + mergeNetwork(other.getNetwork()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.AllocationPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.AllocationPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder> + locationBuilder_; + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + * + * @return Whether the location field is set. + */ + public boolean hasLocation() { + return locationBuilder_ != null || location_ != null; + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + * + * @return The location. + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy getLocation() { + if (locationBuilder_ == null) { + return location_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } else { + return locationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder setLocation( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + onChanged(); + } else { + locationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder setLocation( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder builderForValue) { + if (locationBuilder_ == null) { + location_ = builderForValue.build(); + onChanged(); + } else { + locationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder mergeLocation( + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy value) { + if (locationBuilder_ == null) { + if (location_ != null) { + location_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.newBuilder(location_) + .mergeFrom(value) + .buildPartial(); + } else { + location_ = value; + } + onChanged(); + } else { + locationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder clearLocation() { + if (locationBuilder_ == null) { + location_ = null; + onChanged(); + } else { + location_ = null; + locationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder + getLocationBuilder() { + + onChanged(); + return getLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder + getLocationOrBuilder() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilder(); + } else { + return location_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } + } + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder>( + getLocation(), getParentForChildren(), isClean()); + location_ = null; + } + return locationBuilder_; + } + + private com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=415 + * @return Whether the instance field is set. + */ + @java.lang.Deprecated + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=415 + * @return The instance. + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setInstance( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setInstance( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeInstance( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.newBuilder(instance_) + .mergeFrom(value) + .buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder + getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder + getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Create only instances allowed by this policy.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.util.List + instances_ = java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate>( + instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public java.util.List + getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate getInstances( + int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder setInstances( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder setInstances( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + int index, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addAllInstances( + java.lang.Iterable< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate> + values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder + getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public java.util.List< + ? extends + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder( + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance()); + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder + addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder( + index, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance()); + } + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public java.util.List< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder> + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private com.google.protobuf.LazyStringList instanceTemplates_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInstanceTemplatesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + instanceTemplates_ = new com.google.protobuf.LazyStringArrayList(instanceTemplates_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @return A list containing the instanceTemplates. + */ + @java.lang.Deprecated + public com.google.protobuf.ProtocolStringList getInstanceTemplatesList() { + return instanceTemplates_.getUnmodifiableView(); + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @return The count of instanceTemplates. + */ + @java.lang.Deprecated + public int getInstanceTemplatesCount() { + return instanceTemplates_.size(); + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @param index The index of the element to return. + * @return The instanceTemplates at the given index. + */ + @java.lang.Deprecated + public java.lang.String getInstanceTemplates(int index) { + return instanceTemplates_.get(index); + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @param index The index of the value to return. + * @return The bytes of the instanceTemplates at the given index. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getInstanceTemplatesBytes(int index) { + return instanceTemplates_.getByteString(index); + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @param index The index to set the value at. + * @param value The instanceTemplates to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setInstanceTemplates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTemplatesIsMutable(); + instanceTemplates_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @param value The instanceTemplates to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addInstanceTemplates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstanceTemplatesIsMutable(); + instanceTemplates_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @param values The instanceTemplates to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllInstanceTemplates(java.lang.Iterable values) { + ensureInstanceTemplatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instanceTemplates_); + onChanged(); + return this; + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearInstanceTemplates() { + instanceTemplates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Instance templates that are used to VMs.
+     * If specified, only instance_templates[0] is used.
+     * 
+ * + * 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=423 + * @param value The bytes of the instanceTemplates to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addInstanceTemplatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInstanceTemplatesIsMutable(); + instanceTemplates_.add(value); + onChanged(); + return this; + } + + private java.util.List provisioningModels_ = + java.util.Collections.emptyList(); + + private void ensureProvisioningModelsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + provisioningModels_ = new java.util.ArrayList(provisioningModels_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @return A list containing the provisioningModels. + */ + @java.lang.Deprecated + public java.util.List + getProvisioningModelsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel>( + provisioningModels_, provisioningModels_converter_); + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @return The count of provisioningModels. + */ + @java.lang.Deprecated + public int getProvisioningModelsCount() { + return provisioningModels_.size(); + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the element to return. + * @return The provisioningModels at the given index. + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisioningModels( + int index) { + return provisioningModels_converter_.convert(provisioningModels_.get(index)); + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index to set the value at. + * @param value The provisioningModels to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setProvisioningModels( + int index, com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProvisioningModelsIsMutable(); + provisioningModels_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param value The provisioningModels to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addProvisioningModels( + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProvisioningModelsIsMutable(); + provisioningModels_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param values The provisioningModels to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllProvisioningModels( + java.lang.Iterable< + ? extends com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel> + values) { + ensureProvisioningModelsIsMutable(); + for (com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel value : values) { + provisioningModels_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearProvisioningModels() { + provisioningModels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @return A list containing the enum numeric values on the wire for provisioningModels. + */ + @java.lang.Deprecated + public java.util.List getProvisioningModelsValueList() { + return java.util.Collections.unmodifiableList(provisioningModels_); + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the value to return. + * @return The enum numeric value on the wire of provisioningModels at the given index. + */ + @java.lang.Deprecated + public int getProvisioningModelsValue(int index) { + return provisioningModels_.get(index); + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the value to return. + * @return The enum numeric value on the wire of provisioningModels at the given index. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setProvisioningModelsValue(int index, int value) { + ensureProvisioningModelsIsMutable(); + provisioningModels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param value The enum numeric value on the wire for provisioningModels to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addProvisioningModelsValue(int value) { + ensureProvisioningModelsIsMutable(); + provisioningModels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Create only instances in the listed provisiong models.
+     * Default to allow all.
+     * Currently only the first model of the provisioning_models list will be
+     * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. + * See google/cloud/batch/v1alpha/job.proto;l=430 + * @param values The enum numeric values on the wire for provisioningModels to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder addAllProvisioningModelsValue(java.lang.Iterable values) { + ensureProvisioningModelsIsMutable(); + for (int value : values) { + provisioningModels_.add(value); + } + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * Email of the service account that VMs will run as.
+     * 
+ * + * string service_account_email = 5; + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Email of the service account that VMs will run as.
+     * 
+ * + * string service_account_email = 5; + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Email of the service account that VMs will run as.
+     * 
+ * + * string service_account_email = 5; + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Email of the service account that VMs will run as.
+     * 
+ * + * string service_account_email = 5; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Email of the service account that VMs will run as.
+     * 
+ * + * string service_account_email = 5; + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private com.google.cloud.batch.v1alpha.ServiceAccount serviceAccount_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.ServiceAccount, + com.google.cloud.batch.v1alpha.ServiceAccount.Builder, + com.google.cloud.batch.v1alpha.ServiceAccountOrBuilder> + serviceAccountBuilder_; + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + * + * @return Whether the serviceAccount field is set. + */ + public boolean hasServiceAccount() { + return serviceAccountBuilder_ != null || serviceAccount_ != null; + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + * + * @return The serviceAccount. + */ + public com.google.cloud.batch.v1alpha.ServiceAccount getServiceAccount() { + if (serviceAccountBuilder_ == null) { + return serviceAccount_ == null + ? com.google.cloud.batch.v1alpha.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } else { + return serviceAccountBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + public Builder setServiceAccount(com.google.cloud.batch.v1alpha.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccount_ = value; + onChanged(); + } else { + serviceAccountBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + public Builder setServiceAccount( + com.google.cloud.batch.v1alpha.ServiceAccount.Builder builderForValue) { + if (serviceAccountBuilder_ == null) { + serviceAccount_ = builderForValue.build(); + onChanged(); + } else { + serviceAccountBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + public Builder mergeServiceAccount(com.google.cloud.batch.v1alpha.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (serviceAccount_ != null) { + serviceAccount_ = + com.google.cloud.batch.v1alpha.ServiceAccount.newBuilder(serviceAccount_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceAccount_ = value; + } + onChanged(); + } else { + serviceAccountBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + public Builder clearServiceAccount() { + if (serviceAccountBuilder_ == null) { + serviceAccount_ = null; + onChanged(); + } else { + serviceAccount_ = null; + serviceAccountBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + public com.google.cloud.batch.v1alpha.ServiceAccount.Builder getServiceAccountBuilder() { + + onChanged(); + return getServiceAccountFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + public com.google.cloud.batch.v1alpha.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + if (serviceAccountBuilder_ != null) { + return serviceAccountBuilder_.getMessageOrBuilder(); + } else { + return serviceAccount_ == null + ? com.google.cloud.batch.v1alpha.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + } + /** + * + * + *
+     * Service account that VMs will run as.
+     * Not yet implemented.
+     * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.ServiceAccount, + com.google.cloud.batch.v1alpha.ServiceAccount.Builder, + com.google.cloud.batch.v1alpha.ServiceAccountOrBuilder> + getServiceAccountFieldBuilder() { + if (serviceAccountBuilder_ == null) { + serviceAccountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.ServiceAccount, + com.google.cloud.batch.v1alpha.ServiceAccount.Builder, + com.google.cloud.batch.v1alpha.ServiceAccountOrBuilder>( + getServiceAccount(), getParentForChildren(), isClean()); + serviceAccount_ = null; + } + return serviceAccountBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels applied to all VM instances and other resources
+     * created by AllocationPolicy.
+     * Labels could be user provided or system generated.
+     * You can assign up to 64 labels. [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 6; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder> + networkBuilder_; + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + * + * @return Whether the network field is set. + */ + public boolean hasNetwork() { + return networkBuilder_ != null || network_ != null; + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + * + * @return The network. + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy getNetwork() { + if (networkBuilder_ == null) { + return network_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } else { + return networkBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder setNetwork(com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy value) { + if (networkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + onChanged(); + } else { + networkBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder setNetwork( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder builderForValue) { + if (networkBuilder_ == null) { + network_ = builderForValue.build(); + onChanged(); + } else { + networkBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder mergeNetwork( + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy value) { + if (networkBuilder_ == null) { + if (network_ != null) { + network_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.newBuilder(network_) + .mergeFrom(value) + .buildPartial(); + } else { + network_ = value; + } + onChanged(); + } else { + networkBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder clearNetwork() { + if (networkBuilder_ == null) { + network_ = null; + onChanged(); + } else { + network_ = null; + networkBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder + getNetworkBuilder() { + + onChanged(); + return getNetworkFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder + getNetworkOrBuilder() { + if (networkBuilder_ != null) { + return networkBuilder_.getMessageOrBuilder(); + } else { + return network_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } + } + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder> + getNetworkFieldBuilder() { + if (networkBuilder_ == null) { + networkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder>( + getNetwork(), getParentForChildren(), isClean()); + network_ = null; + } + return networkBuilder_; + } + + @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.AllocationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.AllocationPolicy) + private static final com.google.cloud.batch.v1alpha.AllocationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.AllocationPolicy(); + } + + public static com.google.cloud.batch.v1alpha.AllocationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllocationPolicy(input, extensionRegistry); + } + }; + + 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.AllocationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java new file mode 100644 index 0000000..22071de --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/AllocationPolicyOrBuilder.java @@ -0,0 +1,538 @@ +/* + * 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 AllocationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.AllocationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + * + * @return Whether the location field is set. + */ + boolean hasLocation(); + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + * + * @return The location. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy getLocation(); + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1; + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicyOrBuilder getLocationOrBuilder(); + + /** + * + * + *
+   * Create only instances allowed by this policy.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=415 + * @return Whether the instance field is set. + */ + @java.lang.Deprecated + boolean hasInstance(); + /** + * + * + *
+   * Create only instances allowed by this policy.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=415 + * @return The instance. + */ + @java.lang.Deprecated + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy getInstance(); + /** + * + * + *
+   * Create only instances allowed by this policy.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + java.util.List + getInstancesList(); + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate getInstances(int index); + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + int getInstancesCount(); + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + java.util.List< + ? extends + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesOrBuilderList(); + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplateOrBuilder + getInstancesOrBuilder(int index); + + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @return A list containing the instanceTemplates. + */ + @java.lang.Deprecated + java.util.List getInstanceTemplatesList(); + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @return The count of instanceTemplates. + */ + @java.lang.Deprecated + int getInstanceTemplatesCount(); + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @param index The index of the element to return. + * @return The instanceTemplates at the given index. + */ + @java.lang.Deprecated + java.lang.String getInstanceTemplates(int index); + /** + * + * + *
+   * Instance templates that are used to VMs.
+   * If specified, only instance_templates[0] is used.
+   * 
+ * + * 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=423 + * @param index The index of the value to return. + * @return The bytes of the instanceTemplates at the given index. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getInstanceTemplatesBytes(int index); + + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @return A list containing the provisioningModels. + */ + @java.lang.Deprecated + java.util.List + getProvisioningModelsList(); + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @return The count of provisioningModels. + */ + @java.lang.Deprecated + int getProvisioningModelsCount(); + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the element to return. + * @return The provisioningModels at the given index. + */ + @java.lang.Deprecated + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisioningModels( + int index); + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @return A list containing the enum numeric values on the wire for provisioningModels. + */ + @java.lang.Deprecated + java.util.List getProvisioningModelsValueList(); + /** + * + * + *
+   * Create only instances in the listed provisiong models.
+   * Default to allow all.
+   * Currently only the first model of the provisioning_models list will be
+   * considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true]; + * + * + * @deprecated google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See + * google/cloud/batch/v1alpha/job.proto;l=430 + * @param index The index of the value to return. + * @return The enum numeric value on the wire of provisioningModels at the given index. + */ + @java.lang.Deprecated + int getProvisioningModelsValue(int index); + + /** + * + * + *
+   * Email of the service account that VMs will run as.
+   * 
+ * + * string service_account_email = 5; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * Email of the service account that VMs will run as.
+   * 
+ * + * string service_account_email = 5; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Service account that VMs will run as.
+   * Not yet implemented.
+   * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + * + * @return Whether the serviceAccount field is set. + */ + boolean hasServiceAccount(); + /** + * + * + *
+   * Service account that VMs will run as.
+   * Not yet implemented.
+   * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + * + * @return The serviceAccount. + */ + com.google.cloud.batch.v1alpha.ServiceAccount getServiceAccount(); + /** + * + * + *
+   * Service account that VMs will run as.
+   * Not yet implemented.
+   * 
+ * + * .google.cloud.batch.v1alpha.ServiceAccount service_account = 9; + */ + com.google.cloud.batch.v1alpha.ServiceAccountOrBuilder getServiceAccountOrBuilder(); + + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels applied to all VM instances and other resources
+   * created by AllocationPolicy.
+   * Labels could be user provided or system generated.
+   * You can assign up to 64 labels. [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 6; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + * + * @return Whether the network field is set. + */ + boolean hasNetwork(); + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + * + * @return The network. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy getNetwork(); + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7; + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicyOrBuilder getNetworkOrBuilder(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java new file mode 100644 index 0000000..0f64557 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/BatchProto.java @@ -0,0 +1,260 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public final class BatchProto { + private BatchProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_CreateJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_GetJobRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_GetJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_ListJobsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_ListJobsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_ListJobsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_ListJobsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_ListTasksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_ListTasksRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_ListTasksResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_ListTasksResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_GetTaskRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_GetTaskRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/cloud/batch/v1alpha/batch.proto" + + "\022\032google.cloud.batch.v1alpha\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\031go" + + "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\317\001\n\036com.goog" + + "le.cloud.batch.v1alphaB\nBatchProtoP\001Z?go" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/batch/v1alpha;batch\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( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.batch.v1alpha.JobProto.getDescriptor(), + com.google.cloud.batch.v1alpha.TaskProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_batch_v1alpha_CreateJobRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor, + new java.lang.String[] { + "Parent", "JobId", "Job", "RequestId", + }); + internal_static_google_cloud_batch_v1alpha_GetJobRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_batch_v1alpha_GetJobRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_GetJobRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_descriptor, + new java.lang.String[] { + "Name", "Reason", "RequestId", + }); + internal_static_google_cloud_batch_v1alpha_ListJobsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_batch_v1alpha_ListJobsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_ListJobsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_batch_v1alpha_ListJobsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_batch_v1alpha_ListJobsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_ListJobsResponse_descriptor, + new java.lang.String[] { + "Jobs", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_batch_v1alpha_ListTasksRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_batch_v1alpha_ListTasksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_ListTasksRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_cloud_batch_v1alpha_ListTasksResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_batch_v1alpha_ListTasksResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_ListTasksResponse_descriptor, + new java.lang.String[] { + "Tasks", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_batch_v1alpha_GetTaskRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_batch_v1alpha_GetTaskRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_GetTaskRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_batch_v1alpha_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_batch_v1alpha_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.batch.v1alpha.JobProto.getDescriptor(); + com.google.cloud.batch.v1alpha.TaskProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResource.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResource.java new file mode 100644 index 0000000..6cf13a2 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResource.java @@ -0,0 +1,820 @@ +/* + * 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; + +/** + * + * + *
+ * Compute resource requirements
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ComputeResource} + */ +public final class ComputeResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.ComputeResource) + ComputeResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComputeResource.newBuilder() to construct. + private ComputeResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComputeResource() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComputeResource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComputeResource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + cpuMilli_ = input.readInt64(); + break; + } + case 16: + { + memoryMib_ = input.readInt64(); + break; + } + case 24: + { + gpuCount_ = input.readInt64(); + break; + } + case 32: + { + bootDiskMib_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_ComputeResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_ComputeResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ComputeResource.class, + com.google.cloud.batch.v1alpha.ComputeResource.Builder.class); + } + + public static final int CPU_MILLI_FIELD_NUMBER = 1; + private long cpuMilli_; + /** + * + * + *
+   * The milliCPU count.
+   * 
+ * + * int64 cpu_milli = 1; + * + * @return The cpuMilli. + */ + @java.lang.Override + public long getCpuMilli() { + return cpuMilli_; + } + + public static final int MEMORY_MIB_FIELD_NUMBER = 2; + private long memoryMib_; + /** + * + * + *
+   * Memory in MiB.
+   * 
+ * + * int64 memory_mib = 2; + * + * @return The memoryMib. + */ + @java.lang.Override + public long getMemoryMib() { + return memoryMib_; + } + + public static final int GPU_COUNT_FIELD_NUMBER = 3; + private long gpuCount_; + /** + * + * + *
+   * The GPU count.
+   * Not yet implemented.
+   * 
+ * + * int64 gpu_count = 3; + * + * @return The gpuCount. + */ + @java.lang.Override + public long getGpuCount() { + return gpuCount_; + } + + public static final int BOOT_DISK_MIB_FIELD_NUMBER = 4; + private long bootDiskMib_; + /** + * + * + *
+   * Extra boot disk size in MiB for each task.
+   * 
+ * + * int64 boot_disk_mib = 4; + * + * @return The bootDiskMib. + */ + @java.lang.Override + public long getBootDiskMib() { + return bootDiskMib_; + } + + 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 (cpuMilli_ != 0L) { + output.writeInt64(1, cpuMilli_); + } + if (memoryMib_ != 0L) { + output.writeInt64(2, memoryMib_); + } + if (gpuCount_ != 0L) { + output.writeInt64(3, gpuCount_); + } + if (bootDiskMib_ != 0L) { + output.writeInt64(4, bootDiskMib_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cpuMilli_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, cpuMilli_); + } + if (memoryMib_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, memoryMib_); + } + if (gpuCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, gpuCount_); + } + if (bootDiskMib_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, bootDiskMib_); + } + size += unknownFields.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.ComputeResource)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.ComputeResource other = + (com.google.cloud.batch.v1alpha.ComputeResource) obj; + + if (getCpuMilli() != other.getCpuMilli()) return false; + if (getMemoryMib() != other.getMemoryMib()) return false; + if (getGpuCount() != other.getGpuCount()) return false; + if (getBootDiskMib() != other.getBootDiskMib()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + CPU_MILLI_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCpuMilli()); + hash = (37 * hash) + MEMORY_MIB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMemoryMib()); + hash = (37 * hash) + GPU_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGpuCount()); + hash = (37 * hash) + BOOT_DISK_MIB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBootDiskMib()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.ComputeResource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ComputeResource 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.ComputeResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ComputeResource 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.ComputeResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ComputeResource 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.ComputeResource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ComputeResource 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.ComputeResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ComputeResource 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.ComputeResource 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.ComputeResource 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.ComputeResource 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; + } + /** + * + * + *
+   * Compute resource requirements
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ComputeResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.ComputeResource) + com.google.cloud.batch.v1alpha.ComputeResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_ComputeResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_ComputeResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ComputeResource.class, + com.google.cloud.batch.v1alpha.ComputeResource.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.ComputeResource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + cpuMilli_ = 0L; + + memoryMib_ = 0L; + + gpuCount_ = 0L; + + bootDiskMib_ = 0L; + + 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_ComputeResource_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ComputeResource getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.ComputeResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ComputeResource build() { + com.google.cloud.batch.v1alpha.ComputeResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ComputeResource buildPartial() { + com.google.cloud.batch.v1alpha.ComputeResource result = + new com.google.cloud.batch.v1alpha.ComputeResource(this); + result.cpuMilli_ = cpuMilli_; + result.memoryMib_ = memoryMib_; + result.gpuCount_ = gpuCount_; + result.bootDiskMib_ = bootDiskMib_; + onBuilt(); + return result; + } + + @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.ComputeResource) { + return mergeFrom((com.google.cloud.batch.v1alpha.ComputeResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.ComputeResource other) { + if (other == com.google.cloud.batch.v1alpha.ComputeResource.getDefaultInstance()) return this; + if (other.getCpuMilli() != 0L) { + setCpuMilli(other.getCpuMilli()); + } + if (other.getMemoryMib() != 0L) { + setMemoryMib(other.getMemoryMib()); + } + if (other.getGpuCount() != 0L) { + setGpuCount(other.getGpuCount()); + } + if (other.getBootDiskMib() != 0L) { + setBootDiskMib(other.getBootDiskMib()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.ComputeResource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.ComputeResource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long cpuMilli_; + /** + * + * + *
+     * The milliCPU count.
+     * 
+ * + * int64 cpu_milli = 1; + * + * @return The cpuMilli. + */ + @java.lang.Override + public long getCpuMilli() { + return cpuMilli_; + } + /** + * + * + *
+     * The milliCPU count.
+     * 
+ * + * int64 cpu_milli = 1; + * + * @param value The cpuMilli to set. + * @return This builder for chaining. + */ + public Builder setCpuMilli(long value) { + + cpuMilli_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The milliCPU count.
+     * 
+ * + * int64 cpu_milli = 1; + * + * @return This builder for chaining. + */ + public Builder clearCpuMilli() { + + cpuMilli_ = 0L; + onChanged(); + return this; + } + + private long memoryMib_; + /** + * + * + *
+     * Memory in MiB.
+     * 
+ * + * int64 memory_mib = 2; + * + * @return The memoryMib. + */ + @java.lang.Override + public long getMemoryMib() { + return memoryMib_; + } + /** + * + * + *
+     * Memory in MiB.
+     * 
+ * + * int64 memory_mib = 2; + * + * @param value The memoryMib to set. + * @return This builder for chaining. + */ + public Builder setMemoryMib(long value) { + + memoryMib_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Memory in MiB.
+     * 
+ * + * int64 memory_mib = 2; + * + * @return This builder for chaining. + */ + public Builder clearMemoryMib() { + + memoryMib_ = 0L; + onChanged(); + return this; + } + + private long gpuCount_; + /** + * + * + *
+     * The GPU count.
+     * Not yet implemented.
+     * 
+ * + * int64 gpu_count = 3; + * + * @return The gpuCount. + */ + @java.lang.Override + public long getGpuCount() { + return gpuCount_; + } + /** + * + * + *
+     * The GPU count.
+     * Not yet implemented.
+     * 
+ * + * int64 gpu_count = 3; + * + * @param value The gpuCount to set. + * @return This builder for chaining. + */ + public Builder setGpuCount(long value) { + + gpuCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The GPU count.
+     * Not yet implemented.
+     * 
+ * + * int64 gpu_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearGpuCount() { + + gpuCount_ = 0L; + onChanged(); + return this; + } + + private long bootDiskMib_; + /** + * + * + *
+     * Extra boot disk size in MiB for each task.
+     * 
+ * + * int64 boot_disk_mib = 4; + * + * @return The bootDiskMib. + */ + @java.lang.Override + public long getBootDiskMib() { + return bootDiskMib_; + } + /** + * + * + *
+     * Extra boot disk size in MiB for each task.
+     * 
+ * + * int64 boot_disk_mib = 4; + * + * @param value The bootDiskMib to set. + * @return This builder for chaining. + */ + public Builder setBootDiskMib(long value) { + + bootDiskMib_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Extra boot disk size in MiB for each task.
+     * 
+ * + * int64 boot_disk_mib = 4; + * + * @return This builder for chaining. + */ + public Builder clearBootDiskMib() { + + bootDiskMib_ = 0L; + 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.ComputeResource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.ComputeResource) + private static final com.google.cloud.batch.v1alpha.ComputeResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.ComputeResource(); + } + + public static com.google.cloud.batch.v1alpha.ComputeResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComputeResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComputeResource(input, extensionRegistry); + } + }; + + 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.ComputeResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResourceOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResourceOrBuilder.java new file mode 100644 index 0000000..f2ba78b --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ComputeResourceOrBuilder.java @@ -0,0 +1,78 @@ +/* + * 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 ComputeResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.ComputeResource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The milliCPU count.
+   * 
+ * + * int64 cpu_milli = 1; + * + * @return The cpuMilli. + */ + long getCpuMilli(); + + /** + * + * + *
+   * Memory in MiB.
+   * 
+ * + * int64 memory_mib = 2; + * + * @return The memoryMib. + */ + long getMemoryMib(); + + /** + * + * + *
+   * The GPU count.
+   * Not yet implemented.
+   * 
+ * + * int64 gpu_count = 3; + * + * @return The gpuCount. + */ + long getGpuCount(); + + /** + * + * + *
+   * Extra boot disk size in MiB for each task.
+   * 
+ * + * int64 boot_disk_mib = 4; + * + * @return The bootDiskMib. + */ + long getBootDiskMib(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java new file mode 100644 index 0000000..3668fec --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequest.java @@ -0,0 +1,1405 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * CreateJob Request.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.CreateJobRequest} + */ +public final class CreateJobRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.CreateJobRequest) + CreateJobRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateJobRequest.newBuilder() to construct. + private CreateJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateJobRequest() { + parent_ = ""; + jobId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateJobRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateJobRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + jobId_ = s; + break; + } + case 26: + { + com.google.cloud.batch.v1alpha.Job.Builder subBuilder = null; + if (job_ != null) { + subBuilder = job_.toBuilder(); + } + job_ = + input.readMessage(com.google.cloud.batch.v1alpha.Job.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(job_); + job_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_CreateJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.CreateJobRequest.class, + com.google.cloud.batch.v1alpha.CreateJobRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name where the Job will be created.
+   * Pattern: "projects/{project}/locations/{location}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name where the Job will be created.
+   * Pattern: "projects/{project}/locations/{location}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int JOB_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object jobId_; + /** + * + * + *
+   * ID used to uniquely identify the Job within its parent scope.
+   * This field should contain at most 63 characters.
+   * Only alphanumeric characters or '-' are accepted.
+   * The '-' character cannot be the first or the last one.
+   * A system generated ID will be used if the field is not set.
+   * The job.name field in the request will be ignored and the created resource
+   * name of the Job will be "{parent}/jobs/{job_id}".
+   * 
+ * + * string job_id = 2; + * + * @return The jobId. + */ + @java.lang.Override + public java.lang.String getJobId() { + java.lang.Object ref = jobId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jobId_ = s; + return s; + } + } + /** + * + * + *
+   * ID used to uniquely identify the Job within its parent scope.
+   * This field should contain at most 63 characters.
+   * Only alphanumeric characters or '-' are accepted.
+   * The '-' character cannot be the first or the last one.
+   * A system generated ID will be used if the field is not set.
+   * The job.name field in the request will be ignored and the created resource
+   * name of the Job will be "{parent}/jobs/{job_id}".
+   * 
+ * + * string job_id = 2; + * + * @return The bytes for jobId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJobIdBytes() { + java.lang.Object ref = jobId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + jobId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int JOB_FIELD_NUMBER = 3; + private com.google.cloud.batch.v1alpha.Job job_; + /** + * + * + *
+   * Required. The Job to create.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the job field is set. + */ + @java.lang.Override + public boolean hasJob() { + return job_ != null; + } + /** + * + * + *
+   * Required. The Job to create.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The job. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job getJob() { + return job_ == null ? com.google.cloud.batch.v1alpha.Job.getDefaultInstance() : job_; + } + /** + * + * + *
+   * Required. The Job to create.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobOrBuilder getJobOrBuilder() { + return getJob(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(jobId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, jobId_); + } + if (job_ != null) { + output.writeMessage(3, getJob()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(jobId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, jobId_); + } + if (job_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getJob()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + size += unknownFields.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.CreateJobRequest)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.CreateJobRequest other = + (com.google.cloud.batch.v1alpha.CreateJobRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getJobId().equals(other.getJobId())) return false; + if (hasJob() != other.hasJob()) return false; + if (hasJob()) { + if (!getJob().equals(other.getJob())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + JOB_ID_FIELD_NUMBER; + hash = (53 * hash) + getJobId().hashCode(); + if (hasJob()) { + hash = (37 * hash) + JOB_FIELD_NUMBER; + hash = (53 * hash) + getJob().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest 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.CreateJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest 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.CreateJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest 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.CreateJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest 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.CreateJobRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest 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.CreateJobRequest 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.CreateJobRequest 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.CreateJobRequest 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; + } + /** + * + * + *
+   * CreateJob Request.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.CreateJobRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.CreateJobRequest) + com.google.cloud.batch.v1alpha.CreateJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_CreateJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.CreateJobRequest.class, + com.google.cloud.batch.v1alpha.CreateJobRequest.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.CreateJobRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + jobId_ = ""; + + if (jobBuilder_ == null) { + job_ = null; + } else { + job_ = null; + jobBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_CreateJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.CreateJobRequest getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.CreateJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.CreateJobRequest build() { + com.google.cloud.batch.v1alpha.CreateJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.CreateJobRequest buildPartial() { + com.google.cloud.batch.v1alpha.CreateJobRequest result = + new com.google.cloud.batch.v1alpha.CreateJobRequest(this); + result.parent_ = parent_; + result.jobId_ = jobId_; + if (jobBuilder_ == null) { + result.job_ = job_; + } else { + result.job_ = jobBuilder_.build(); + } + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.CreateJobRequest) { + return mergeFrom((com.google.cloud.batch.v1alpha.CreateJobRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.CreateJobRequest other) { + if (other == com.google.cloud.batch.v1alpha.CreateJobRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getJobId().isEmpty()) { + jobId_ = other.jobId_; + onChanged(); + } + if (other.hasJob()) { + mergeJob(other.getJob()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.CreateJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.CreateJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name where the Job will be created.
+     * Pattern: "projects/{project}/locations/{location}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name where the Job will be created.
+     * Pattern: "projects/{project}/locations/{location}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name where the Job will be created.
+     * Pattern: "projects/{project}/locations/{location}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name where the Job will be created.
+     * Pattern: "projects/{project}/locations/{location}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name where the Job will be created.
+     * Pattern: "projects/{project}/locations/{location}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object jobId_ = ""; + /** + * + * + *
+     * ID used to uniquely identify the Job within its parent scope.
+     * This field should contain at most 63 characters.
+     * Only alphanumeric characters or '-' are accepted.
+     * The '-' character cannot be the first or the last one.
+     * A system generated ID will be used if the field is not set.
+     * The job.name field in the request will be ignored and the created resource
+     * name of the Job will be "{parent}/jobs/{job_id}".
+     * 
+ * + * string job_id = 2; + * + * @return The jobId. + */ + public java.lang.String getJobId() { + java.lang.Object ref = jobId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jobId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID used to uniquely identify the Job within its parent scope.
+     * This field should contain at most 63 characters.
+     * Only alphanumeric characters or '-' are accepted.
+     * The '-' character cannot be the first or the last one.
+     * A system generated ID will be used if the field is not set.
+     * The job.name field in the request will be ignored and the created resource
+     * name of the Job will be "{parent}/jobs/{job_id}".
+     * 
+ * + * string job_id = 2; + * + * @return The bytes for jobId. + */ + public com.google.protobuf.ByteString getJobIdBytes() { + java.lang.Object ref = jobId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + jobId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID used to uniquely identify the Job within its parent scope.
+     * This field should contain at most 63 characters.
+     * Only alphanumeric characters or '-' are accepted.
+     * The '-' character cannot be the first or the last one.
+     * A system generated ID will be used if the field is not set.
+     * The job.name field in the request will be ignored and the created resource
+     * name of the Job will be "{parent}/jobs/{job_id}".
+     * 
+ * + * string job_id = 2; + * + * @param value The jobId to set. + * @return This builder for chaining. + */ + public Builder setJobId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + jobId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID used to uniquely identify the Job within its parent scope.
+     * This field should contain at most 63 characters.
+     * Only alphanumeric characters or '-' are accepted.
+     * The '-' character cannot be the first or the last one.
+     * A system generated ID will be used if the field is not set.
+     * The job.name field in the request will be ignored and the created resource
+     * name of the Job will be "{parent}/jobs/{job_id}".
+     * 
+ * + * string job_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearJobId() { + + jobId_ = getDefaultInstance().getJobId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID used to uniquely identify the Job within its parent scope.
+     * This field should contain at most 63 characters.
+     * Only alphanumeric characters or '-' are accepted.
+     * The '-' character cannot be the first or the last one.
+     * A system generated ID will be used if the field is not set.
+     * The job.name field in the request will be ignored and the created resource
+     * name of the Job will be "{parent}/jobs/{job_id}".
+     * 
+ * + * string job_id = 2; + * + * @param value The bytes for jobId to set. + * @return This builder for chaining. + */ + public Builder setJobIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + jobId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.batch.v1alpha.Job job_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.Job, + com.google.cloud.batch.v1alpha.Job.Builder, + com.google.cloud.batch.v1alpha.JobOrBuilder> + jobBuilder_; + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the job field is set. + */ + public boolean hasJob() { + return jobBuilder_ != null || job_ != null; + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The job. + */ + public com.google.cloud.batch.v1alpha.Job getJob() { + if (jobBuilder_ == null) { + return job_ == null ? com.google.cloud.batch.v1alpha.Job.getDefaultInstance() : job_; + } else { + return jobBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setJob(com.google.cloud.batch.v1alpha.Job value) { + if (jobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + job_ = value; + onChanged(); + } else { + jobBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setJob(com.google.cloud.batch.v1alpha.Job.Builder builderForValue) { + if (jobBuilder_ == null) { + job_ = builderForValue.build(); + onChanged(); + } else { + jobBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeJob(com.google.cloud.batch.v1alpha.Job value) { + if (jobBuilder_ == null) { + if (job_ != null) { + job_ = + com.google.cloud.batch.v1alpha.Job.newBuilder(job_).mergeFrom(value).buildPartial(); + } else { + job_ = value; + } + onChanged(); + } else { + jobBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearJob() { + if (jobBuilder_ == null) { + job_ = null; + onChanged(); + } else { + job_ = null; + jobBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.Job.Builder getJobBuilder() { + + onChanged(); + return getJobFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.JobOrBuilder getJobOrBuilder() { + if (jobBuilder_ != null) { + return jobBuilder_.getMessageOrBuilder(); + } else { + return job_ == null ? com.google.cloud.batch.v1alpha.Job.getDefaultInstance() : job_; + } + } + /** + * + * + *
+     * Required. The Job to create.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.Job, + com.google.cloud.batch.v1alpha.Job.Builder, + com.google.cloud.batch.v1alpha.JobOrBuilder> + getJobFieldBuilder() { + if (jobBuilder_ == null) { + jobBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.Job, + com.google.cloud.batch.v1alpha.Job.Builder, + com.google.cloud.batch.v1alpha.JobOrBuilder>( + getJob(), getParentForChildren(), isClean()); + job_ = null; + } + return jobBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + 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.CreateJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.CreateJobRequest) + private static final com.google.cloud.batch.v1alpha.CreateJobRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.CreateJobRequest(); + } + + public static com.google.cloud.batch.v1alpha.CreateJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateJobRequest(input, extensionRegistry); + } + }; + + 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.CreateJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java new file mode 100644 index 0000000..8a31549 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/CreateJobRequestOrBuilder.java @@ -0,0 +1,173 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface CreateJobRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.CreateJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name where the Job will be created.
+   * Pattern: "projects/{project}/locations/{location}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name where the Job will be created.
+   * Pattern: "projects/{project}/locations/{location}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * ID used to uniquely identify the Job within its parent scope.
+   * This field should contain at most 63 characters.
+   * Only alphanumeric characters or '-' are accepted.
+   * The '-' character cannot be the first or the last one.
+   * A system generated ID will be used if the field is not set.
+   * The job.name field in the request will be ignored and the created resource
+   * name of the Job will be "{parent}/jobs/{job_id}".
+   * 
+ * + * string job_id = 2; + * + * @return The jobId. + */ + java.lang.String getJobId(); + /** + * + * + *
+   * ID used to uniquely identify the Job within its parent scope.
+   * This field should contain at most 63 characters.
+   * Only alphanumeric characters or '-' are accepted.
+   * The '-' character cannot be the first or the last one.
+   * A system generated ID will be used if the field is not set.
+   * The job.name field in the request will be ignored and the created resource
+   * name of the Job will be "{parent}/jobs/{job_id}".
+   * 
+ * + * string job_id = 2; + * + * @return The bytes for jobId. + */ + com.google.protobuf.ByteString getJobIdBytes(); + + /** + * + * + *
+   * Required. The Job to create.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the job field is set. + */ + boolean hasJob(); + /** + * + * + *
+   * Required. The Job to create.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The job. + */ + com.google.cloud.batch.v1alpha.Job getJob(); + /** + * + * + *
+   * Required. The Job to create.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.batch.v1alpha.JobOrBuilder getJobOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java new file mode 100644 index 0000000..2b5010b --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequest.java @@ -0,0 +1,1065 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * DeleteJob Request.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.DeleteJobRequest} + */ +public final class DeleteJobRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.DeleteJobRequest) + DeleteJobRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteJobRequest.newBuilder() to construct. + private DeleteJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteJobRequest() { + name_ = ""; + reason_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteJobRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteJobRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + reason_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.DeleteJobRequest.class, + com.google.cloud.batch.v1alpha.DeleteJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Job name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Job name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REASON_FIELD_NUMBER = 2; + private volatile java.lang.Object reason_; + /** + * + * + *
+   * Optional. Reason for this deletion.
+   * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The reason. + */ + @java.lang.Override + public java.lang.String getReason() { + java.lang.Object ref = reason_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reason_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Reason for this deletion.
+   * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for reason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, reason_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, reason_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + size += unknownFields.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.DeleteJobRequest)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.DeleteJobRequest other = + (com.google.cloud.batch.v1alpha.DeleteJobRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getReason().equals(other.getReason())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REASON_FIELD_NUMBER; + hash = (53 * hash) + getReason().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest 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.DeleteJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest 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.DeleteJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest 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.DeleteJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest 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.DeleteJobRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest 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.DeleteJobRequest 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.DeleteJobRequest 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.DeleteJobRequest 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; + } + /** + * + * + *
+   * DeleteJob Request.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.DeleteJobRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.DeleteJobRequest) + com.google.cloud.batch.v1alpha.DeleteJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.DeleteJobRequest.class, + com.google.cloud.batch.v1alpha.DeleteJobRequest.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.DeleteJobRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + reason_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_DeleteJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.DeleteJobRequest getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.DeleteJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.DeleteJobRequest build() { + com.google.cloud.batch.v1alpha.DeleteJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.DeleteJobRequest buildPartial() { + com.google.cloud.batch.v1alpha.DeleteJobRequest result = + new com.google.cloud.batch.v1alpha.DeleteJobRequest(this); + result.name_ = name_; + result.reason_ = reason_; + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.DeleteJobRequest) { + return mergeFrom((com.google.cloud.batch.v1alpha.DeleteJobRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.DeleteJobRequest other) { + if (other == com.google.cloud.batch.v1alpha.DeleteJobRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getReason().isEmpty()) { + reason_ = other.reason_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.DeleteJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.DeleteJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Job name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Job name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Job name.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Job name.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Job name.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object reason_ = ""; + /** + * + * + *
+     * Optional. Reason for this deletion.
+     * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The reason. + */ + public java.lang.String getReason() { + java.lang.Object ref = reason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Reason for this deletion.
+     * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for reason. + */ + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Reason for this deletion.
+     * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Reason for this deletion.
+     * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + + reason_ = getDefaultInstance().getReason(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Reason for this deletion.
+     * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reason_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique 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
+     * 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.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + 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.DeleteJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.DeleteJobRequest) + private static final com.google.cloud.batch.v1alpha.DeleteJobRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.DeleteJobRequest(); + } + + public static com.google.cloud.batch.v1alpha.DeleteJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteJobRequest(input, extensionRegistry); + } + }; + + 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.DeleteJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java new file mode 100644 index 0000000..ee503e6 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/DeleteJobRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface DeleteJobRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.DeleteJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Job name.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Job name.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Reason for this deletion.
+   * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The reason. + */ + java.lang.String getReason(); + /** + * + * + *
+   * Optional. Reason for this deletion.
+   * 
+ * + * string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for reason. + */ + com.google.protobuf.ByteString getReasonBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique 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
+   * 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.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Environment.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Environment.java new file mode 100644 index 0000000..05e12e8 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Environment.java @@ -0,0 +1,2256 @@ +/* + * 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; + +/** + * + * + *
+ * An Environment describes a collection of environment variables to set when
+ * executing Tasks.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Environment} + */ +public final class Environment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.Environment) + EnvironmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Environment.newBuilder() to construct. + private Environment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Environment() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Environment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Environment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + variables_ = + com.google.protobuf.MapField.newMapField( + VariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry variables__ = + input.readMessage( + VariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + variables_.getMutableMap().put(variables__.getKey(), variables__.getValue()); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + secretVariables_ = + com.google.protobuf.MapField.newMapField( + SecretVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry secretVariables__ = + input.readMessage( + SecretVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + secretVariables_ + .getMutableMap() + .put(secretVariables__.getKey(), secretVariables__.getValue()); + break; + } + case 26: + { + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder subBuilder = null; + if (encryptedVariables_ != null) { + subBuilder = encryptedVariables_.toBuilder(); + } + encryptedVariables_ = + input.readMessage( + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptedVariables_); + encryptedVariables_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetVariables(); + case 2: + return internalGetSecretVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Environment.class, + com.google.cloud.batch.v1alpha.Environment.Builder.class); + } + + public interface KMSEnvMapOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.Environment.KMSEnvMap) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the KMS key that will be used to decrypt the cipher text.
+     * 
+ * + * string key_name = 1; + * + * @return The keyName. + */ + java.lang.String getKeyName(); + /** + * + * + *
+     * The name of the KMS key that will be used to decrypt the cipher text.
+     * 
+ * + * string key_name = 1; + * + * @return The bytes for keyName. + */ + com.google.protobuf.ByteString getKeyNameBytes(); + + /** + * + * + *
+     * The value of the cipherText response from the `encrypt` method.
+     * 
+ * + * string cipher_text = 2; + * + * @return The cipherText. + */ + java.lang.String getCipherText(); + /** + * + * + *
+     * The value of the cipherText response from the `encrypt` method.
+     * 
+ * + * string cipher_text = 2; + * + * @return The bytes for cipherText. + */ + com.google.protobuf.ByteString getCipherTextBytes(); + } + /** Protobuf type {@code google.cloud.batch.v1alpha.Environment.KMSEnvMap} */ + public static final class KMSEnvMap extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.Environment.KMSEnvMap) + KMSEnvMapOrBuilder { + private static final long serialVersionUID = 0L; + // Use KMSEnvMap.newBuilder() to construct. + private KMSEnvMap(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private KMSEnvMap() { + keyName_ = ""; + cipherText_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new KMSEnvMap(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private KMSEnvMap( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + keyName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + cipherText_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_KMSEnvMap_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_KMSEnvMap_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.class, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder.class); + } + + public static final int KEY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object keyName_; + /** + * + * + *
+     * The name of the KMS key that will be used to decrypt the cipher text.
+     * 
+ * + * string key_name = 1; + * + * @return The keyName. + */ + @java.lang.Override + public java.lang.String getKeyName() { + java.lang.Object ref = keyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyName_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the KMS key that will be used to decrypt the cipher text.
+     * 
+ * + * string key_name = 1; + * + * @return The bytes for keyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyNameBytes() { + java.lang.Object ref = keyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CIPHER_TEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object cipherText_; + /** + * + * + *
+     * The value of the cipherText response from the `encrypt` method.
+     * 
+ * + * string cipher_text = 2; + * + * @return The cipherText. + */ + @java.lang.Override + public java.lang.String getCipherText() { + java.lang.Object ref = cipherText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cipherText_ = s; + return s; + } + } + /** + * + * + *
+     * The value of the cipherText response from the `encrypt` method.
+     * 
+ * + * string cipher_text = 2; + * + * @return The bytes for cipherText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCipherTextBytes() { + java.lang.Object ref = cipherText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cipherText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, keyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cipherText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cipherText_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, keyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cipherText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cipherText_); + } + size += unknownFields.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.Environment.KMSEnvMap)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap other = + (com.google.cloud.batch.v1alpha.Environment.KMSEnvMap) obj; + + if (!getKeyName().equals(other.getKeyName())) return false; + if (!getCipherText().equals(other.getCipherText())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKeyName().hashCode(); + hash = (37 * hash) + CIPHER_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getCipherText().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap 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.Environment.KMSEnvMap parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap 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.Environment.KMSEnvMap parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap 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.Environment.KMSEnvMap parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap 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.Environment.KMSEnvMap parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap 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.Environment.KMSEnvMap 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.Environment.KMSEnvMap 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.Environment.KMSEnvMap 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; + } + /** Protobuf type {@code google.cloud.batch.v1alpha.Environment.KMSEnvMap} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.Environment.KMSEnvMap) + com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_KMSEnvMap_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_KMSEnvMap_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.class, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + keyName_ = ""; + + cipherText_ = ""; + + 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_Environment_KMSEnvMap_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMap getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMap build() { + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMap buildPartial() { + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap result = + new com.google.cloud.batch.v1alpha.Environment.KMSEnvMap(this); + result.keyName_ = keyName_; + result.cipherText_ = cipherText_; + onBuilt(); + return result; + } + + @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.Environment.KMSEnvMap) { + return mergeFrom((com.google.cloud.batch.v1alpha.Environment.KMSEnvMap) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.Environment.KMSEnvMap other) { + if (other == com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.getDefaultInstance()) + return this; + if (!other.getKeyName().isEmpty()) { + keyName_ = other.keyName_; + onChanged(); + } + if (!other.getCipherText().isEmpty()) { + cipherText_ = other.cipherText_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.Environment.KMSEnvMap) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object keyName_ = ""; + /** + * + * + *
+       * The name of the KMS key that will be used to decrypt the cipher text.
+       * 
+ * + * string key_name = 1; + * + * @return The keyName. + */ + public java.lang.String getKeyName() { + java.lang.Object ref = keyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the KMS key that will be used to decrypt the cipher text.
+       * 
+ * + * string key_name = 1; + * + * @return The bytes for keyName. + */ + public com.google.protobuf.ByteString getKeyNameBytes() { + java.lang.Object ref = keyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the KMS key that will be used to decrypt the cipher text.
+       * 
+ * + * string key_name = 1; + * + * @param value The keyName to set. + * @return This builder for chaining. + */ + public Builder setKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + keyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the KMS key that will be used to decrypt the cipher text.
+       * 
+ * + * string key_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearKeyName() { + + keyName_ = getDefaultInstance().getKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the KMS key that will be used to decrypt the cipher text.
+       * 
+ * + * string key_name = 1; + * + * @param value The bytes for keyName to set. + * @return This builder for chaining. + */ + public Builder setKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + keyName_ = value; + onChanged(); + return this; + } + + private java.lang.Object cipherText_ = ""; + /** + * + * + *
+       * The value of the cipherText response from the `encrypt` method.
+       * 
+ * + * string cipher_text = 2; + * + * @return The cipherText. + */ + public java.lang.String getCipherText() { + java.lang.Object ref = cipherText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cipherText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The value of the cipherText response from the `encrypt` method.
+       * 
+ * + * string cipher_text = 2; + * + * @return The bytes for cipherText. + */ + public com.google.protobuf.ByteString getCipherTextBytes() { + java.lang.Object ref = cipherText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cipherText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The value of the cipherText response from the `encrypt` method.
+       * 
+ * + * string cipher_text = 2; + * + * @param value The cipherText to set. + * @return This builder for chaining. + */ + public Builder setCipherText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cipherText_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the cipherText response from the `encrypt` method.
+       * 
+ * + * string cipher_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearCipherText() { + + cipherText_ = getDefaultInstance().getCipherText(); + onChanged(); + return this; + } + /** + * + * + *
+       * The value of the cipherText response from the `encrypt` method.
+       * 
+ * + * string cipher_text = 2; + * + * @param value The bytes for cipherText to set. + * @return This builder for chaining. + */ + public Builder setCipherTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cipherText_ = value; + 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.Environment.KMSEnvMap) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.Environment.KMSEnvMap) + private static final com.google.cloud.batch.v1alpha.Environment.KMSEnvMap DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); + } + + public static com.google.cloud.batch.v1alpha.Environment.KMSEnvMap getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KMSEnvMap parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KMSEnvMap(input, extensionRegistry); + } + }; + + 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.Environment.KMSEnvMap getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int VARIABLES_FIELD_NUMBER = 1; + + private static final class VariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_VariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField variables_; + + private com.google.protobuf.MapField internalGetVariables() { + if (variables_ == null) { + return com.google.protobuf.MapField.emptyMapField(VariablesDefaultEntryHolder.defaultEntry); + } + return variables_; + } + + public int getVariablesCount() { + return internalGetVariables().getMap().size(); + } + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public boolean containsVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVariables().getMap().containsKey(key); + } + /** Use {@link #getVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariables() { + return getVariablesMap(); + } + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public java.util.Map getVariablesMap() { + return internalGetVariables().getMap(); + } + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public java.lang.String getVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public java.lang.String getVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECRET_VARIABLES_FIELD_NUMBER = 2; + + private static final class SecretVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_SecretVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField secretVariables_; + + private com.google.protobuf.MapField + internalGetSecretVariables() { + if (secretVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SecretVariablesDefaultEntryHolder.defaultEntry); + } + return secretVariables_; + } + + public int getSecretVariablesCount() { + return internalGetSecretVariables().getMap().size(); + } + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public boolean containsSecretVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetSecretVariables().getMap().containsKey(key); + } + /** Use {@link #getSecretVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSecretVariables() { + return getSecretVariablesMap(); + } + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public java.util.Map getSecretVariablesMap() { + return internalGetSecretVariables().getMap(); + } + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public java.lang.String getSecretVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetSecretVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public java.lang.String getSecretVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetSecretVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ENCRYPTED_VARIABLES_FIELD_NUMBER = 3; + private com.google.cloud.batch.v1alpha.Environment.KMSEnvMap encryptedVariables_; + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return Whether the encryptedVariables field is set. + */ + @java.lang.Override + public boolean hasEncryptedVariables() { + return encryptedVariables_ != null; + } + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return The encryptedVariables. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMap getEncryptedVariables() { + return encryptedVariables_ == null + ? com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.getDefaultInstance() + : encryptedVariables_; + } + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder + getEncryptedVariablesOrBuilder() { + return getEncryptedVariables(); + } + + 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetVariables(), VariablesDefaultEntryHolder.defaultEntry, 1); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetSecretVariables(), SecretVariablesDefaultEntryHolder.defaultEntry, 2); + if (encryptedVariables_ != null) { + output.writeMessage(3, getEncryptedVariables()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry variables__ = + VariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, variables__); + } + for (java.util.Map.Entry entry : + internalGetSecretVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry secretVariables__ = + SecretVariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, secretVariables__); + } + if (encryptedVariables_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEncryptedVariables()); + } + size += unknownFields.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.Environment)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.Environment other = + (com.google.cloud.batch.v1alpha.Environment) obj; + + if (!internalGetVariables().equals(other.internalGetVariables())) return false; + if (!internalGetSecretVariables().equals(other.internalGetSecretVariables())) return false; + if (hasEncryptedVariables() != other.hasEncryptedVariables()) return false; + if (hasEncryptedVariables()) { + if (!getEncryptedVariables().equals(other.getEncryptedVariables())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVariables().getMap().isEmpty()) { + hash = (37 * hash) + VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetVariables().hashCode(); + } + if (!internalGetSecretVariables().getMap().isEmpty()) { + hash = (37 * hash) + SECRET_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetSecretVariables().hashCode(); + } + if (hasEncryptedVariables()) { + hash = (37 * hash) + ENCRYPTED_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + getEncryptedVariables().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.Environment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Environment 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.Environment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Environment 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.Environment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Environment 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.Environment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Environment 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.Environment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Environment 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.Environment 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.Environment 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.Environment 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; + } + /** + * + * + *
+   * An Environment describes a collection of environment variables to set when
+   * executing Tasks.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Environment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.Environment) + com.google.cloud.batch.v1alpha.EnvironmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetVariables(); + case 2: + return internalGetSecretVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableVariables(); + case 2: + return internalGetMutableSecretVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Environment.class, + com.google.cloud.batch.v1alpha.Environment.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.Environment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableVariables().clear(); + internalGetMutableSecretVariables().clear(); + if (encryptedVariablesBuilder_ == null) { + encryptedVariables_ = null; + } else { + encryptedVariables_ = null; + encryptedVariablesBuilder_ = null; + } + 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_Environment_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.Environment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment build() { + com.google.cloud.batch.v1alpha.Environment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Environment buildPartial() { + com.google.cloud.batch.v1alpha.Environment result = + new com.google.cloud.batch.v1alpha.Environment(this); + int from_bitField0_ = bitField0_; + result.variables_ = internalGetVariables(); + result.variables_.makeImmutable(); + result.secretVariables_ = internalGetSecretVariables(); + result.secretVariables_.makeImmutable(); + if (encryptedVariablesBuilder_ == null) { + result.encryptedVariables_ = encryptedVariables_; + } else { + result.encryptedVariables_ = encryptedVariablesBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.Environment) { + return mergeFrom((com.google.cloud.batch.v1alpha.Environment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.Environment other) { + if (other == com.google.cloud.batch.v1alpha.Environment.getDefaultInstance()) return this; + internalGetMutableVariables().mergeFrom(other.internalGetVariables()); + internalGetMutableSecretVariables().mergeFrom(other.internalGetSecretVariables()); + if (other.hasEncryptedVariables()) { + mergeEncryptedVariables(other.getEncryptedVariables()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.Environment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.Environment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField variables_; + + private com.google.protobuf.MapField + internalGetVariables() { + if (variables_ == null) { + return com.google.protobuf.MapField.emptyMapField(VariablesDefaultEntryHolder.defaultEntry); + } + return variables_; + } + + private com.google.protobuf.MapField + internalGetMutableVariables() { + onChanged(); + ; + if (variables_ == null) { + variables_ = + com.google.protobuf.MapField.newMapField(VariablesDefaultEntryHolder.defaultEntry); + } + if (!variables_.isMutable()) { + variables_ = variables_.copy(); + } + return variables_; + } + + public int getVariablesCount() { + return internalGetVariables().getMap().size(); + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public boolean containsVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetVariables().getMap().containsKey(key); + } + /** Use {@link #getVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVariables() { + return getVariablesMap(); + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public java.util.Map getVariablesMap() { + return internalGetVariables().getMap(); + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public java.lang.String getVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + @java.lang.Override + public java.lang.String getVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearVariables() { + internalGetMutableVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + public Builder removeVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableVariables() { + return internalGetMutableVariables().getMutableMap(); + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + public Builder putVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A map of environment variable names to values.
+     * 
+ * + * map<string, string> variables = 1; + */ + public Builder putAllVariables(java.util.Map values) { + internalGetMutableVariables().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField secretVariables_; + + private com.google.protobuf.MapField + internalGetSecretVariables() { + if (secretVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SecretVariablesDefaultEntryHolder.defaultEntry); + } + return secretVariables_; + } + + private com.google.protobuf.MapField + internalGetMutableSecretVariables() { + onChanged(); + ; + if (secretVariables_ == null) { + secretVariables_ = + com.google.protobuf.MapField.newMapField( + SecretVariablesDefaultEntryHolder.defaultEntry); + } + if (!secretVariables_.isMutable()) { + secretVariables_ = secretVariables_.copy(); + } + return secretVariables_; + } + + public int getSecretVariablesCount() { + return internalGetSecretVariables().getMap().size(); + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public boolean containsSecretVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetSecretVariables().getMap().containsKey(key); + } + /** Use {@link #getSecretVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSecretVariables() { + return getSecretVariablesMap(); + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public java.util.Map getSecretVariablesMap() { + return internalGetSecretVariables().getMap(); + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public java.lang.String getSecretVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetSecretVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + @java.lang.Override + public java.lang.String getSecretVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetSecretVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearSecretVariables() { + internalGetMutableSecretVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + public Builder removeSecretVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableSecretVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableSecretVariables() { + return internalGetMutableSecretVariables().getMutableMap(); + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + public Builder putSecretVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableSecretVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A map of environment variable names to Secret Manager secret names.
+     * The VM will access the named secrets to set the value of each environment
+     * variable.
+     * 
+ * + * map<string, string> secret_variables = 2; + */ + public Builder putAllSecretVariables(java.util.Map values) { + internalGetMutableSecretVariables().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.batch.v1alpha.Environment.KMSEnvMap encryptedVariables_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder> + encryptedVariablesBuilder_; + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return Whether the encryptedVariables field is set. + */ + public boolean hasEncryptedVariables() { + return encryptedVariablesBuilder_ != null || encryptedVariables_ != null; + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return The encryptedVariables. + */ + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMap getEncryptedVariables() { + if (encryptedVariablesBuilder_ == null) { + return encryptedVariables_ == null + ? com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.getDefaultInstance() + : encryptedVariables_; + } else { + return encryptedVariablesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder setEncryptedVariables( + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap value) { + if (encryptedVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptedVariables_ = value; + onChanged(); + } else { + encryptedVariablesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder setEncryptedVariables( + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder builderForValue) { + if (encryptedVariablesBuilder_ == null) { + encryptedVariables_ = builderForValue.build(); + onChanged(); + } else { + encryptedVariablesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder mergeEncryptedVariables( + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap value) { + if (encryptedVariablesBuilder_ == null) { + if (encryptedVariables_ != null) { + encryptedVariables_ = + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.newBuilder(encryptedVariables_) + .mergeFrom(value) + .buildPartial(); + } else { + encryptedVariables_ = value; + } + onChanged(); + } else { + encryptedVariablesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder clearEncryptedVariables() { + if (encryptedVariablesBuilder_ == null) { + encryptedVariables_ = null; + onChanged(); + } else { + encryptedVariables_ = null; + encryptedVariablesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder + getEncryptedVariablesBuilder() { + + onChanged(); + return getEncryptedVariablesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + public com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder + getEncryptedVariablesOrBuilder() { + if (encryptedVariablesBuilder_ != null) { + return encryptedVariablesBuilder_.getMessageOrBuilder(); + } else { + return encryptedVariables_ == null + ? com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.getDefaultInstance() + : encryptedVariables_; + } + } + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder> + getEncryptedVariablesFieldBuilder() { + if (encryptedVariablesBuilder_ == null) { + encryptedVariablesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap.Builder, + com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder>( + getEncryptedVariables(), getParentForChildren(), isClean()); + encryptedVariables_ = null; + } + return encryptedVariablesBuilder_; + } + + @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.Environment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.Environment) + private static final com.google.cloud.batch.v1alpha.Environment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.Environment(); + } + + public static com.google.cloud.batch.v1alpha.Environment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Environment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Environment(input, extensionRegistry); + } + }; + + 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.Environment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/EnvironmentOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/EnvironmentOrBuilder.java new file mode 100644 index 0000000..e68c495 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/EnvironmentOrBuilder.java @@ -0,0 +1,191 @@ +/* + * 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 EnvironmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.Environment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + int getVariablesCount(); + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + boolean containsVariables(java.lang.String key); + /** Use {@link #getVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getVariables(); + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + java.util.Map getVariablesMap(); + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + + /* nullable */ + java.lang.String getVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * A map of environment variable names to values.
+   * 
+ * + * map<string, string> variables = 1; + */ + java.lang.String getVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + int getSecretVariablesCount(); + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + boolean containsSecretVariables(java.lang.String key); + /** Use {@link #getSecretVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getSecretVariables(); + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + java.util.Map getSecretVariablesMap(); + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + + /* nullable */ + java.lang.String getSecretVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * A map of environment variable names to Secret Manager secret names.
+   * The VM will access the named secrets to set the value of each environment
+   * variable.
+   * 
+ * + * map<string, string> secret_variables = 2; + */ + java.lang.String getSecretVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return Whether the encryptedVariables field is set. + */ + boolean hasEncryptedVariables(); + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return The encryptedVariables. + */ + com.google.cloud.batch.v1alpha.Environment.KMSEnvMap getEncryptedVariables(); + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.cloud.batch.v1alpha.Environment.KMSEnvMap encrypted_variables = 3; + */ + com.google.cloud.batch.v1alpha.Environment.KMSEnvMapOrBuilder getEncryptedVariablesOrBuilder(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCS.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCS.java new file mode 100644 index 0000000..51f1b5f --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCS.java @@ -0,0 +1,640 @@ +/* + * 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/volume.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * Represents a Google Cloud Storage volume source config.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.GCS} + */ +public final class GCS extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.GCS) + GCSOrBuilder { + private static final long serialVersionUID = 0L; + // Use GCS.newBuilder() to construct. + private GCS(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GCS() { + remotePath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GCS(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GCS( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + remotePath_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_GCS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_GCS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.GCS.class, + com.google.cloud.batch.v1alpha.GCS.Builder.class); + } + + public static final int REMOTE_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object remotePath_; + /** + * + * + *
+   * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+   * bucket_name, bucket_name/subdirectory/
+   * 
+ * + * string remote_path = 1; + * + * @return The remotePath. + */ + @java.lang.Override + public java.lang.String getRemotePath() { + java.lang.Object ref = remotePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remotePath_ = s; + return s; + } + } + /** + * + * + *
+   * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+   * bucket_name, bucket_name/subdirectory/
+   * 
+ * + * string remote_path = 1; + * + * @return The bytes for remotePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRemotePathBytes() { + java.lang.Object ref = remotePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remotePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remotePath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, remotePath_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remotePath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, remotePath_); + } + size += unknownFields.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.GCS)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.GCS other = (com.google.cloud.batch.v1alpha.GCS) obj; + + if (!getRemotePath().equals(other.getRemotePath())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + REMOTE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRemotePath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.GCS parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GCS 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.GCS parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GCS 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.GCS parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GCS 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.GCS parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.GCS 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.GCS parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.GCS 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.GCS 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.GCS 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.GCS 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; + } + /** + * + * + *
+   * Represents a Google Cloud Storage volume source config.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.GCS} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.GCS) + com.google.cloud.batch.v1alpha.GCSOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_GCS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_GCS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.GCS.class, + com.google.cloud.batch.v1alpha.GCS.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.GCS.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + remotePath_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_GCS_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GCS getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.GCS.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GCS build() { + com.google.cloud.batch.v1alpha.GCS result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GCS buildPartial() { + com.google.cloud.batch.v1alpha.GCS result = new com.google.cloud.batch.v1alpha.GCS(this); + result.remotePath_ = remotePath_; + onBuilt(); + return result; + } + + @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.GCS) { + return mergeFrom((com.google.cloud.batch.v1alpha.GCS) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.GCS other) { + if (other == com.google.cloud.batch.v1alpha.GCS.getDefaultInstance()) return this; + if (!other.getRemotePath().isEmpty()) { + remotePath_ = other.remotePath_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.GCS parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.GCS) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object remotePath_ = ""; + /** + * + * + *
+     * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+     * bucket_name, bucket_name/subdirectory/
+     * 
+ * + * string remote_path = 1; + * + * @return The remotePath. + */ + public java.lang.String getRemotePath() { + java.lang.Object ref = remotePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remotePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+     * bucket_name, bucket_name/subdirectory/
+     * 
+ * + * string remote_path = 1; + * + * @return The bytes for remotePath. + */ + public com.google.protobuf.ByteString getRemotePathBytes() { + java.lang.Object ref = remotePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remotePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+     * bucket_name, bucket_name/subdirectory/
+     * 
+ * + * string remote_path = 1; + * + * @param value The remotePath to set. + * @return This builder for chaining. + */ + public Builder setRemotePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remotePath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+     * bucket_name, bucket_name/subdirectory/
+     * 
+ * + * string remote_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearRemotePath() { + + remotePath_ = getDefaultInstance().getRemotePath(); + onChanged(); + return this; + } + /** + * + * + *
+     * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+     * bucket_name, bucket_name/subdirectory/
+     * 
+ * + * string remote_path = 1; + * + * @param value The bytes for remotePath to set. + * @return This builder for chaining. + */ + public Builder setRemotePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remotePath_ = value; + 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.GCS) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.GCS) + private static final com.google.cloud.batch.v1alpha.GCS DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.GCS(); + } + + public static com.google.cloud.batch.v1alpha.GCS getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GCS parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GCS(input, extensionRegistry); + } + }; + + 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.GCS getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCSOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCSOrBuilder.java new file mode 100644 index 0000000..b96b47f --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GCSOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/volume.proto + +package com.google.cloud.batch.v1alpha; + +public interface GCSOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.GCS) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+   * bucket_name, bucket_name/subdirectory/
+   * 
+ * + * string remote_path = 1; + * + * @return The remotePath. + */ + java.lang.String getRemotePath(); + /** + * + * + *
+   * Remote path, either a bucket name or a subdirectory of a bucket, e.g.:
+   * bucket_name, bucket_name/subdirectory/
+   * 
+ * + * string remote_path = 1; + * + * @return The bytes for remotePath. + */ + com.google.protobuf.ByteString getRemotePathBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequest.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequest.java new file mode 100644 index 0000000..2f856dd --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequest.java @@ -0,0 +1,650 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * GetJob Request.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.GetJobRequest} + */ +public final class GetJobRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.GetJobRequest) + GetJobRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetJobRequest.newBuilder() to construct. + private GetJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetJobRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetJobRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetJobRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.GetJobRequest.class, + com.google.cloud.batch.v1alpha.GetJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Job name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Job name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetJobRequest)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.GetJobRequest other = + (com.google.cloud.batch.v1alpha.GetJobRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest 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.GetJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest 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.GetJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest 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.GetJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest 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.GetJobRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest 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.GetJobRequest 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.GetJobRequest 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.GetJobRequest 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; + } + /** + * + * + *
+   * GetJob Request.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.GetJobRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.GetJobRequest) + com.google.cloud.batch.v1alpha.GetJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.GetJobRequest.class, + com.google.cloud.batch.v1alpha.GetJobRequest.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.GetJobRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GetJobRequest getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.GetJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GetJobRequest build() { + com.google.cloud.batch.v1alpha.GetJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GetJobRequest buildPartial() { + com.google.cloud.batch.v1alpha.GetJobRequest result = + new com.google.cloud.batch.v1alpha.GetJobRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.GetJobRequest) { + return mergeFrom((com.google.cloud.batch.v1alpha.GetJobRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.GetJobRequest other) { + if (other == com.google.cloud.batch.v1alpha.GetJobRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.GetJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.GetJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Job name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Job name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Job name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Job name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Job name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.GetJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.GetJobRequest) + private static final com.google.cloud.batch.v1alpha.GetJobRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.GetJobRequest(); + } + + public static com.google.cloud.batch.v1alpha.GetJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetJobRequest(input, extensionRegistry); + } + }; + + 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.GetJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequestOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequestOrBuilder.java new file mode 100644 index 0000000..fee2b38 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetJobRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface GetJobRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.GetJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Job name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Job name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequest.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequest.java new file mode 100644 index 0000000..8bb4c53 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequest.java @@ -0,0 +1,650 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * Request for a single Task by name.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.GetTaskRequest} + */ +public final class GetTaskRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.GetTaskRequest) + GetTaskRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetTaskRequest.newBuilder() to construct. + private GetTaskRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetTaskRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetTaskRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetTaskRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetTaskRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetTaskRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.GetTaskRequest.class, + com.google.cloud.batch.v1alpha.GetTaskRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Task name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Task name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetTaskRequest)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.GetTaskRequest other = + (com.google.cloud.batch.v1alpha.GetTaskRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest 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.GetTaskRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest 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.GetTaskRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest 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.GetTaskRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest 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.GetTaskRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest 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.GetTaskRequest 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.GetTaskRequest 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.GetTaskRequest 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; + } + /** + * + * + *
+   * Request for a single Task by name.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.GetTaskRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.GetTaskRequest) + com.google.cloud.batch.v1alpha.GetTaskRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetTaskRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetTaskRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.GetTaskRequest.class, + com.google.cloud.batch.v1alpha.GetTaskRequest.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.GetTaskRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_GetTaskRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GetTaskRequest getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.GetTaskRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GetTaskRequest build() { + com.google.cloud.batch.v1alpha.GetTaskRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.GetTaskRequest buildPartial() { + com.google.cloud.batch.v1alpha.GetTaskRequest result = + new com.google.cloud.batch.v1alpha.GetTaskRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.GetTaskRequest) { + return mergeFrom((com.google.cloud.batch.v1alpha.GetTaskRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.GetTaskRequest other) { + if (other == com.google.cloud.batch.v1alpha.GetTaskRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.GetTaskRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.GetTaskRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Task name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Task name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Task name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Task name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Task name.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.GetTaskRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.GetTaskRequest) + private static final com.google.cloud.batch.v1alpha.GetTaskRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.GetTaskRequest(); + } + + public static com.google.cloud.batch.v1alpha.GetTaskRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTaskRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTaskRequest(input, extensionRegistry); + } + }; + + 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.GetTaskRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequestOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequestOrBuilder.java new file mode 100644 index 0000000..53bc669 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/GetTaskRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface GetTaskRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.GetTaskRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Task name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Task name.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java new file mode 100644 index 0000000..9a9bf9b --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Job.java @@ -0,0 +1,4984 @@ +/* + * 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; + +/** + * + * + *
+ * The Cloud Batch Job description.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Job} + */ +public final class Job extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.Job) + JobOrBuilder { + private static final long serialVersionUID = 0L; + // Use Job.newBuilder() to construct. + private Job(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Job() { + name_ = ""; + uid_ = ""; + taskGroups_ = java.util.Collections.emptyList(); + schedulingPolicy_ = 0; + dependencies_ = java.util.Collections.emptyList(); + notifications_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Job(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Job( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + uid_ = s; + break; + } + case 24: + { + priority_ = input.readInt64(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + taskGroups_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + taskGroups_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.TaskGroup.parser(), extensionRegistry)); + break; + } + case 40: + { + int rawValue = input.readEnum(); + + schedulingPolicy_ = rawValue; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + dependencies_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + dependencies_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.JobDependency.parser(), extensionRegistry)); + break; + } + case 58: + { + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder subBuilder = null; + if (allocationPolicy_ != null) { + subBuilder = allocationPolicy_.toBuilder(); + } + allocationPolicy_ = + input.readMessage( + com.google.cloud.batch.v1alpha.AllocationPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(allocationPolicy_); + allocationPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 74: + { + com.google.cloud.batch.v1alpha.JobStatus.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = + input.readMessage( + com.google.cloud.batch.v1alpha.JobStatus.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + com.google.cloud.batch.v1alpha.JobNotification.Builder subBuilder = null; + if (notification_ != null) { + subBuilder = notification_.toBuilder(); + } + notification_ = + input.readMessage( + com.google.cloud.batch.v1alpha.JobNotification.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(notification_); + notification_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 98: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + com.google.cloud.batch.v1alpha.LogsPolicy.Builder subBuilder = null; + if (logsPolicy_ != null) { + subBuilder = logsPolicy_.toBuilder(); + } + logsPolicy_ = + input.readMessage( + com.google.cloud.batch.v1alpha.LogsPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(logsPolicy_); + logsPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 114: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + notifications_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + notifications_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.JobNotification.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + taskGroups_ = java.util.Collections.unmodifiableList(taskGroups_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + dependencies_ = java.util.Collections.unmodifiableList(dependencies_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + notifications_ = java.util.Collections.unmodifiableList(notifications_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_Job_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_Job_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Job.class, + com.google.cloud.batch.v1alpha.Job.Builder.class); + } + + /** + * + * + *
+   * The order that TaskGroups are scheduled relative to each other.
+   * Not yet implemented.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.Job.SchedulingPolicy} + */ + public enum SchedulingPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * SCHEDULING_POLICY_UNSPECIFIED = 0; + */ + SCHEDULING_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * Run all TaskGroups as soon as possible.
+     * 
+ * + * AS_SOON_AS_POSSIBLE = 1; + */ + AS_SOON_AS_POSSIBLE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * SCHEDULING_POLICY_UNSPECIFIED = 0; + */ + public static final int SCHEDULING_POLICY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Run all TaskGroups as soon as possible.
+     * 
+ * + * AS_SOON_AS_POSSIBLE = 1; + */ + public static final int AS_SOON_AS_POSSIBLE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SchedulingPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SchedulingPolicy forNumber(int value) { + switch (value) { + case 0: + return SCHEDULING_POLICY_UNSPECIFIED; + case 1: + return AS_SOON_AS_POSSIBLE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SchedulingPolicy findValueByNumber(int number) { + return SchedulingPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.Job.getDescriptor().getEnumTypes().get(0); + } + + private static final SchedulingPolicy[] VALUES = values(); + + public static SchedulingPolicy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SchedulingPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.Job.SchedulingPolicy) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 2; + private volatile java.lang.Object uid_; + /** + * + * + *
+   * Output only. A system generated unique ID (in UUID4 format) for the Job.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A system generated unique ID (in UUID4 format) for the Job.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIORITY_FIELD_NUMBER = 3; + private long priority_; + /** + * + * + *
+   * Priority of the Job.
+   * The valid value range is [0, 100).
+   * A job with higher priority value is more likely to run earlier if all other
+   * requirements are satisfied.
+   * 
+ * + * int64 priority = 3; + * + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + + public static final int TASK_GROUPS_FIELD_NUMBER = 4; + private java.util.List taskGroups_; + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getTaskGroupsList() { + return taskGroups_; + } + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getTaskGroupsOrBuilderList() { + return taskGroups_; + } + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getTaskGroupsCount() { + return taskGroups_.size(); + } + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskGroup getTaskGroups(int index) { + return taskGroups_.get(index); + } + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskGroupOrBuilder getTaskGroupsOrBuilder(int index) { + return taskGroups_.get(index); + } + + public static final int SCHEDULING_POLICY_FIELD_NUMBER = 5; + private int schedulingPolicy_; + /** + * + * + *
+   * Scheduling policy for TaskGroups in the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return The enum numeric value on the wire for schedulingPolicy. + */ + @java.lang.Override + public int getSchedulingPolicyValue() { + return schedulingPolicy_; + } + /** + * + * + *
+   * Scheduling policy for TaskGroups in the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return The schedulingPolicy. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job.SchedulingPolicy getSchedulingPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.Job.SchedulingPolicy result = + com.google.cloud.batch.v1alpha.Job.SchedulingPolicy.valueOf(schedulingPolicy_); + return result == null + ? com.google.cloud.batch.v1alpha.Job.SchedulingPolicy.UNRECOGNIZED + : result; + } + + public static final int DEPENDENCIES_FIELD_NUMBER = 6; + private java.util.List dependencies_; + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + @java.lang.Override + public java.util.List getDependenciesList() { + return dependencies_; + } + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + @java.lang.Override + public java.util.List + getDependenciesOrBuilderList() { + return dependencies_; + } + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + @java.lang.Override + public int getDependenciesCount() { + return dependencies_.size(); + } + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependency getDependencies(int index) { + return dependencies_.get(index); + } + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependencyOrBuilder getDependenciesOrBuilder(int index) { + return dependencies_.get(index); + } + + public static final int ALLOCATION_POLICY_FIELD_NUMBER = 7; + private com.google.cloud.batch.v1alpha.AllocationPolicy allocationPolicy_; + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + * + * @return Whether the allocationPolicy field is set. + */ + @java.lang.Override + public boolean hasAllocationPolicy() { + return allocationPolicy_ != null; + } + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + * + * @return The allocationPolicy. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy getAllocationPolicy() { + return allocationPolicy_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder() { + return getAllocationPolicy(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_Job_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATUS_FIELD_NUMBER = 9; + private com.google.cloud.batch.v1alpha.JobStatus status_; + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus getStatus() { + return status_ == null + ? com.google.cloud.batch.v1alpha.JobStatus.getDefaultInstance() + : status_; + } + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int NOTIFICATION_FIELD_NUMBER = 10; + private com.google.cloud.batch.v1alpha.JobNotification notification_; + /** + * + * + *
+   * Job notification.
+   * 
+ * + * .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 + * @return Whether the notification field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasNotification() { + return notification_ != null; + } + /** + * + * + *
+   * Job notification.
+   * 
+ * + * .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 + * @return The notification. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.JobNotification getNotification() { + return notification_ == null + ? com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance() + : notification_; + } + /** + * + * + *
+   * Job notification.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.JobNotificationOrBuilder getNotificationOrBuilder() { + return getNotification(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LOGS_POLICY_FIELD_NUMBER = 13; + private com.google.cloud.batch.v1alpha.LogsPolicy logsPolicy_; + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + * + * @return Whether the logsPolicy field is set. + */ + @java.lang.Override + public boolean hasLogsPolicy() { + return logsPolicy_ != null; + } + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + * + * @return The logsPolicy. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicy getLogsPolicy() { + return logsPolicy_ == null + ? com.google.cloud.batch.v1alpha.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder getLogsPolicyOrBuilder() { + return getLogsPolicy(); + } + + public static final int NOTIFICATIONS_FIELD_NUMBER = 14; + private java.util.List notifications_; + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + @java.lang.Override + public java.util.List getNotificationsList() { + return notifications_; + } + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + @java.lang.Override + public java.util.List + getNotificationsOrBuilderList() { + return notifications_; + } + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + @java.lang.Override + public int getNotificationsCount() { + return notifications_.size(); + } + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification getNotifications(int index) { + return notifications_.get(index); + } + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotificationOrBuilder getNotificationsOrBuilder( + int index) { + return notifications_.get(index); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uid_); + } + if (priority_ != 0L) { + output.writeInt64(3, priority_); + } + for (int i = 0; i < taskGroups_.size(); i++) { + output.writeMessage(4, taskGroups_.get(i)); + } + if (schedulingPolicy_ + != com.google.cloud.batch.v1alpha.Job.SchedulingPolicy.SCHEDULING_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, schedulingPolicy_); + } + for (int i = 0; i < dependencies_.size(); i++) { + output.writeMessage(6, dependencies_.get(i)); + } + if (allocationPolicy_ != null) { + output.writeMessage(7, getAllocationPolicy()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + if (status_ != null) { + output.writeMessage(9, getStatus()); + } + if (notification_ != null) { + output.writeMessage(10, getNotification()); + } + if (createTime_ != null) { + output.writeMessage(11, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(12, getUpdateTime()); + } + if (logsPolicy_ != null) { + output.writeMessage(13, getLogsPolicy()); + } + for (int i = 0; i < notifications_.size(); i++) { + output.writeMessage(14, notifications_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uid_); + } + if (priority_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, priority_); + } + for (int i = 0; i < taskGroups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, taskGroups_.get(i)); + } + if (schedulingPolicy_ + != com.google.cloud.batch.v1alpha.Job.SchedulingPolicy.SCHEDULING_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, schedulingPolicy_); + } + for (int i = 0; i < dependencies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, dependencies_.get(i)); + } + if (allocationPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAllocationPolicy()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getStatus()); + } + if (notification_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getNotification()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUpdateTime()); + } + if (logsPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getLogsPolicy()); + } + for (int i = 0; i < notifications_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, notifications_.get(i)); + } + size += unknownFields.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.Job)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.Job other = (com.google.cloud.batch.v1alpha.Job) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (getPriority() != other.getPriority()) return false; + if (!getTaskGroupsList().equals(other.getTaskGroupsList())) return false; + if (schedulingPolicy_ != other.schedulingPolicy_) return false; + if (!getDependenciesList().equals(other.getDependenciesList())) return false; + if (hasAllocationPolicy() != other.hasAllocationPolicy()) return false; + if (hasAllocationPolicy()) { + if (!getAllocationPolicy().equals(other.getAllocationPolicy())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasNotification() != other.hasNotification()) return false; + if (hasNotification()) { + if (!getNotification().equals(other.getNotification())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasLogsPolicy() != other.hasLogsPolicy()) return false; + if (hasLogsPolicy()) { + if (!getLogsPolicy().equals(other.getLogsPolicy())) return false; + } + if (!getNotificationsList().equals(other.getNotificationsList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPriority()); + if (getTaskGroupsCount() > 0) { + hash = (37 * hash) + TASK_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getTaskGroupsList().hashCode(); + } + hash = (37 * hash) + SCHEDULING_POLICY_FIELD_NUMBER; + hash = (53 * hash) + schedulingPolicy_; + if (getDependenciesCount() > 0) { + hash = (37 * hash) + DEPENDENCIES_FIELD_NUMBER; + hash = (53 * hash) + getDependenciesList().hashCode(); + } + if (hasAllocationPolicy()) { + hash = (37 * hash) + ALLOCATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAllocationPolicy().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasNotification()) { + hash = (37 * hash) + NOTIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getNotification().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasLogsPolicy()) { + hash = (37 * hash) + LOGS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getLogsPolicy().hashCode(); + } + if (getNotificationsCount() > 0) { + hash = (37 * hash) + NOTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + getNotificationsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.Job parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Job 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.Job parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Job 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.Job parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Job 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.Job parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Job 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.Job parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Job 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.Job 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.Job 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.Job 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; + } + /** + * + * + *
+   * The Cloud Batch Job description.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Job} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.Job) + com.google.cloud.batch.v1alpha.JobOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_Job_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_Job_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Job.class, + com.google.cloud.batch.v1alpha.Job.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.Job.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTaskGroupsFieldBuilder(); + getDependenciesFieldBuilder(); + getNotificationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + uid_ = ""; + + priority_ = 0L; + + if (taskGroupsBuilder_ == null) { + taskGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + taskGroupsBuilder_.clear(); + } + schedulingPolicy_ = 0; + + if (dependenciesBuilder_ == null) { + dependencies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + dependenciesBuilder_.clear(); + } + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = null; + } else { + allocationPolicy_ = null; + allocationPolicyBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + if (notificationBuilder_ == null) { + notification_ = null; + } else { + notification_ = null; + notificationBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (logsPolicyBuilder_ == null) { + logsPolicy_ = null; + } else { + logsPolicy_ = null; + logsPolicyBuilder_ = null; + } + if (notificationsBuilder_ == null) { + notifications_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + notificationsBuilder_.clear(); + } + 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_Job_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.Job.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job build() { + com.google.cloud.batch.v1alpha.Job result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job buildPartial() { + com.google.cloud.batch.v1alpha.Job result = new com.google.cloud.batch.v1alpha.Job(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.uid_ = uid_; + result.priority_ = priority_; + if (taskGroupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + taskGroups_ = java.util.Collections.unmodifiableList(taskGroups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.taskGroups_ = taskGroups_; + } else { + result.taskGroups_ = taskGroupsBuilder_.build(); + } + result.schedulingPolicy_ = schedulingPolicy_; + if (dependenciesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + dependencies_ = java.util.Collections.unmodifiableList(dependencies_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.dependencies_ = dependencies_; + } else { + result.dependencies_ = dependenciesBuilder_.build(); + } + if (allocationPolicyBuilder_ == null) { + result.allocationPolicy_ = allocationPolicy_; + } else { + result.allocationPolicy_ = allocationPolicyBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (notificationBuilder_ == null) { + result.notification_ = notification_; + } else { + result.notification_ = notificationBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (logsPolicyBuilder_ == null) { + result.logsPolicy_ = logsPolicy_; + } else { + result.logsPolicy_ = logsPolicyBuilder_.build(); + } + if (notificationsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + notifications_ = java.util.Collections.unmodifiableList(notifications_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.notifications_ = notifications_; + } else { + result.notifications_ = notificationsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.Job) { + return mergeFrom((com.google.cloud.batch.v1alpha.Job) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.Job other) { + if (other == com.google.cloud.batch.v1alpha.Job.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + onChanged(); + } + if (other.getPriority() != 0L) { + setPriority(other.getPriority()); + } + if (taskGroupsBuilder_ == null) { + if (!other.taskGroups_.isEmpty()) { + if (taskGroups_.isEmpty()) { + taskGroups_ = other.taskGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTaskGroupsIsMutable(); + taskGroups_.addAll(other.taskGroups_); + } + onChanged(); + } + } else { + if (!other.taskGroups_.isEmpty()) { + if (taskGroupsBuilder_.isEmpty()) { + taskGroupsBuilder_.dispose(); + taskGroupsBuilder_ = null; + taskGroups_ = other.taskGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + taskGroupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTaskGroupsFieldBuilder() + : null; + } else { + taskGroupsBuilder_.addAllMessages(other.taskGroups_); + } + } + } + if (other.schedulingPolicy_ != 0) { + setSchedulingPolicyValue(other.getSchedulingPolicyValue()); + } + if (dependenciesBuilder_ == null) { + if (!other.dependencies_.isEmpty()) { + if (dependencies_.isEmpty()) { + dependencies_ = other.dependencies_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDependenciesIsMutable(); + dependencies_.addAll(other.dependencies_); + } + onChanged(); + } + } else { + if (!other.dependencies_.isEmpty()) { + if (dependenciesBuilder_.isEmpty()) { + dependenciesBuilder_.dispose(); + dependenciesBuilder_ = null; + dependencies_ = other.dependencies_; + bitField0_ = (bitField0_ & ~0x00000002); + dependenciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDependenciesFieldBuilder() + : null; + } else { + dependenciesBuilder_.addAllMessages(other.dependencies_); + } + } + } + if (other.hasAllocationPolicy()) { + mergeAllocationPolicy(other.getAllocationPolicy()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasNotification()) { + mergeNotification(other.getNotification()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasLogsPolicy()) { + mergeLogsPolicy(other.getLogsPolicy()); + } + if (notificationsBuilder_ == null) { + if (!other.notifications_.isEmpty()) { + if (notifications_.isEmpty()) { + notifications_ = other.notifications_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureNotificationsIsMutable(); + notifications_.addAll(other.notifications_); + } + onChanged(); + } + } else { + if (!other.notifications_.isEmpty()) { + if (notificationsBuilder_.isEmpty()) { + notificationsBuilder_.dispose(); + notificationsBuilder_ = null; + notifications_ = other.notifications_; + bitField0_ = (bitField0_ & ~0x00000008); + notificationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNotificationsFieldBuilder() + : null; + } else { + notificationsBuilder_.addAllMessages(other.notifications_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.Job parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.Job) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + + uid_ = getDefaultInstance().getUid(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uid_ = value; + onChanged(); + return this; + } + + private long priority_; + /** + * + * + *
+     * Priority of the Job.
+     * The valid value range is [0, 100).
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
+     * 
+ * + * int64 priority = 3; + * + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + /** + * + * + *
+     * Priority of the Job.
+     * The valid value range is [0, 100).
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
+     * 
+ * + * int64 priority = 3; + * + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(long value) { + + priority_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Priority of the Job.
+     * The valid value range is [0, 100).
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
+     * 
+ * + * int64 priority = 3; + * + * @return This builder for chaining. + */ + public Builder clearPriority() { + + priority_ = 0L; + onChanged(); + return this; + } + + private java.util.List taskGroups_ = + java.util.Collections.emptyList(); + + private void ensureTaskGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + taskGroups_ = + new java.util.ArrayList(taskGroups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.TaskGroup, + com.google.cloud.batch.v1alpha.TaskGroup.Builder, + com.google.cloud.batch.v1alpha.TaskGroupOrBuilder> + taskGroupsBuilder_; + + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getTaskGroupsList() { + if (taskGroupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(taskGroups_); + } else { + return taskGroupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getTaskGroupsCount() { + if (taskGroupsBuilder_ == null) { + return taskGroups_.size(); + } else { + return taskGroupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.TaskGroup getTaskGroups(int index) { + if (taskGroupsBuilder_ == null) { + return taskGroups_.get(index); + } else { + return taskGroupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTaskGroups(int index, com.google.cloud.batch.v1alpha.TaskGroup value) { + if (taskGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTaskGroupsIsMutable(); + taskGroups_.set(index, value); + onChanged(); + } else { + taskGroupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTaskGroups( + int index, com.google.cloud.batch.v1alpha.TaskGroup.Builder builderForValue) { + if (taskGroupsBuilder_ == null) { + ensureTaskGroupsIsMutable(); + taskGroups_.set(index, builderForValue.build()); + onChanged(); + } else { + taskGroupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTaskGroups(com.google.cloud.batch.v1alpha.TaskGroup value) { + if (taskGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTaskGroupsIsMutable(); + taskGroups_.add(value); + onChanged(); + } else { + taskGroupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTaskGroups(int index, com.google.cloud.batch.v1alpha.TaskGroup value) { + if (taskGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTaskGroupsIsMutable(); + taskGroups_.add(index, value); + onChanged(); + } else { + taskGroupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTaskGroups(com.google.cloud.batch.v1alpha.TaskGroup.Builder builderForValue) { + if (taskGroupsBuilder_ == null) { + ensureTaskGroupsIsMutable(); + taskGroups_.add(builderForValue.build()); + onChanged(); + } else { + taskGroupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTaskGroups( + int index, com.google.cloud.batch.v1alpha.TaskGroup.Builder builderForValue) { + if (taskGroupsBuilder_ == null) { + ensureTaskGroupsIsMutable(); + taskGroups_.add(index, builderForValue.build()); + onChanged(); + } else { + taskGroupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllTaskGroups( + java.lang.Iterable values) { + if (taskGroupsBuilder_ == null) { + ensureTaskGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, taskGroups_); + onChanged(); + } else { + taskGroupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTaskGroups() { + if (taskGroupsBuilder_ == null) { + taskGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + taskGroupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeTaskGroups(int index) { + if (taskGroupsBuilder_ == null) { + ensureTaskGroupsIsMutable(); + taskGroups_.remove(index); + onChanged(); + } else { + taskGroupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.TaskGroup.Builder getTaskGroupsBuilder(int index) { + return getTaskGroupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.TaskGroupOrBuilder getTaskGroupsOrBuilder(int index) { + if (taskGroupsBuilder_ == null) { + return taskGroups_.get(index); + } else { + return taskGroupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getTaskGroupsOrBuilderList() { + if (taskGroupsBuilder_ != null) { + return taskGroupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(taskGroups_); + } + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.TaskGroup.Builder addTaskGroupsBuilder() { + return getTaskGroupsFieldBuilder() + .addBuilder(com.google.cloud.batch.v1alpha.TaskGroup.getDefaultInstance()); + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.batch.v1alpha.TaskGroup.Builder addTaskGroupsBuilder(int index) { + return getTaskGroupsFieldBuilder() + .addBuilder(index, com.google.cloud.batch.v1alpha.TaskGroup.getDefaultInstance()); + } + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getTaskGroupsBuilderList() { + return getTaskGroupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.TaskGroup, + com.google.cloud.batch.v1alpha.TaskGroup.Builder, + com.google.cloud.batch.v1alpha.TaskGroupOrBuilder> + getTaskGroupsFieldBuilder() { + if (taskGroupsBuilder_ == null) { + taskGroupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.TaskGroup, + com.google.cloud.batch.v1alpha.TaskGroup.Builder, + com.google.cloud.batch.v1alpha.TaskGroupOrBuilder>( + taskGroups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + taskGroups_ = null; + } + return taskGroupsBuilder_; + } + + private int schedulingPolicy_ = 0; + /** + * + * + *
+     * Scheduling policy for TaskGroups in the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return The enum numeric value on the wire for schedulingPolicy. + */ + @java.lang.Override + public int getSchedulingPolicyValue() { + return schedulingPolicy_; + } + /** + * + * + *
+     * Scheduling policy for TaskGroups in the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @param value The enum numeric value on the wire for schedulingPolicy to set. + * @return This builder for chaining. + */ + public Builder setSchedulingPolicyValue(int value) { + + schedulingPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Scheduling policy for TaskGroups in the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return The schedulingPolicy. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job.SchedulingPolicy getSchedulingPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.Job.SchedulingPolicy result = + com.google.cloud.batch.v1alpha.Job.SchedulingPolicy.valueOf(schedulingPolicy_); + return result == null + ? com.google.cloud.batch.v1alpha.Job.SchedulingPolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Scheduling policy for TaskGroups in the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @param value The schedulingPolicy to set. + * @return This builder for chaining. + */ + public Builder setSchedulingPolicy(com.google.cloud.batch.v1alpha.Job.SchedulingPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + schedulingPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Scheduling policy for TaskGroups in the job.
+     * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return This builder for chaining. + */ + public Builder clearSchedulingPolicy() { + + schedulingPolicy_ = 0; + onChanged(); + return this; + } + + private java.util.List dependencies_ = + java.util.Collections.emptyList(); + + private void ensureDependenciesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + dependencies_ = + new java.util.ArrayList(dependencies_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobDependency, + com.google.cloud.batch.v1alpha.JobDependency.Builder, + com.google.cloud.batch.v1alpha.JobDependencyOrBuilder> + dependenciesBuilder_; + + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public java.util.List getDependenciesList() { + if (dependenciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dependencies_); + } else { + return dependenciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public int getDependenciesCount() { + if (dependenciesBuilder_ == null) { + return dependencies_.size(); + } else { + return dependenciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public com.google.cloud.batch.v1alpha.JobDependency getDependencies(int index) { + if (dependenciesBuilder_ == null) { + return dependencies_.get(index); + } else { + return dependenciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder setDependencies(int index, com.google.cloud.batch.v1alpha.JobDependency value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.set(index, value); + onChanged(); + } else { + dependenciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder setDependencies( + int index, com.google.cloud.batch.v1alpha.JobDependency.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.set(index, builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder addDependencies(com.google.cloud.batch.v1alpha.JobDependency value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.add(value); + onChanged(); + } else { + dependenciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder addDependencies(int index, com.google.cloud.batch.v1alpha.JobDependency value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.add(index, value); + onChanged(); + } else { + dependenciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder addDependencies( + com.google.cloud.batch.v1alpha.JobDependency.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder addDependencies( + int index, com.google.cloud.batch.v1alpha.JobDependency.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(index, builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder addAllDependencies( + java.lang.Iterable values) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dependencies_); + onChanged(); + } else { + dependenciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder clearDependencies() { + if (dependenciesBuilder_ == null) { + dependencies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + dependenciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public Builder removeDependencies(int index) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.remove(index); + onChanged(); + } else { + dependenciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public com.google.cloud.batch.v1alpha.JobDependency.Builder getDependenciesBuilder(int index) { + return getDependenciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public com.google.cloud.batch.v1alpha.JobDependencyOrBuilder getDependenciesOrBuilder( + int index) { + if (dependenciesBuilder_ == null) { + return dependencies_.get(index); + } else { + return dependenciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public java.util.List + getDependenciesOrBuilderList() { + if (dependenciesBuilder_ != null) { + return dependenciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dependencies_); + } + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public com.google.cloud.batch.v1alpha.JobDependency.Builder addDependenciesBuilder() { + return getDependenciesFieldBuilder() + .addBuilder(com.google.cloud.batch.v1alpha.JobDependency.getDefaultInstance()); + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public com.google.cloud.batch.v1alpha.JobDependency.Builder addDependenciesBuilder(int index) { + return getDependenciesFieldBuilder() + .addBuilder(index, com.google.cloud.batch.v1alpha.JobDependency.getDefaultInstance()); + } + /** + * + * + *
+     * At least one of the dependencies must be satisfied before the Job is
+     * scheduled to run.
+     * Only one JobDependency is supported now.
+     * Not yet implemented.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + public java.util.List + getDependenciesBuilderList() { + return getDependenciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobDependency, + com.google.cloud.batch.v1alpha.JobDependency.Builder, + com.google.cloud.batch.v1alpha.JobDependencyOrBuilder> + getDependenciesFieldBuilder() { + if (dependenciesBuilder_ == null) { + dependenciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobDependency, + com.google.cloud.batch.v1alpha.JobDependency.Builder, + com.google.cloud.batch.v1alpha.JobDependencyOrBuilder>( + dependencies_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + dependencies_ = null; + } + return dependenciesBuilder_; + } + + private com.google.cloud.batch.v1alpha.AllocationPolicy allocationPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder> + allocationPolicyBuilder_; + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + * + * @return Whether the allocationPolicy field is set. + */ + public boolean hasAllocationPolicy() { + return allocationPolicyBuilder_ != null || allocationPolicy_ != null; + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + * + * @return The allocationPolicy. + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy getAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + return allocationPolicy_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } else { + return allocationPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + public Builder setAllocationPolicy(com.google.cloud.batch.v1alpha.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allocationPolicy_ = value; + onChanged(); + } else { + allocationPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + public Builder setAllocationPolicy( + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder builderForValue) { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = builderForValue.build(); + onChanged(); + } else { + allocationPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + public Builder mergeAllocationPolicy(com.google.cloud.batch.v1alpha.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (allocationPolicy_ != null) { + allocationPolicy_ = + com.google.cloud.batch.v1alpha.AllocationPolicy.newBuilder(allocationPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + allocationPolicy_ = value; + } + onChanged(); + } else { + allocationPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + public Builder clearAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = null; + onChanged(); + } else { + allocationPolicy_ = null; + allocationPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicy.Builder getAllocationPolicyBuilder() { + + onChanged(); + return getAllocationPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + public com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder() { + if (allocationPolicyBuilder_ != null) { + return allocationPolicyBuilder_.getMessageOrBuilder(); + } else { + return allocationPolicy_ == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + } + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder> + getAllocationPolicyFieldBuilder() { + if (allocationPolicyBuilder_ == null) { + allocationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.AllocationPolicy, + com.google.cloud.batch.v1alpha.AllocationPolicy.Builder, + com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder>( + getAllocationPolicy(), getParentForChildren(), isClean()); + allocationPolicy_ = null; + } + return allocationPolicyBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels for the Job. Labels could be user provided or system generated.
+     * For example,
+     * "labels": {
+     *    "department": "finance",
+     *    "environment": "test"
+     *  }
+     * You can assign up to 64 labels.  [Google Compute Engine label
+     * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+     * apply.
+     * Label names that start with "goog-" or "google-" are reserved.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.batch.v1alpha.JobStatus status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobStatus, + com.google.cloud.batch.v1alpha.JobStatus.Builder, + com.google.cloud.batch.v1alpha.JobStatusOrBuilder> + statusBuilder_; + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + public com.google.cloud.batch.v1alpha.JobStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? com.google.cloud.batch.v1alpha.JobStatus.getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStatus(com.google.cloud.batch.v1alpha.JobStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStatus(com.google.cloud.batch.v1alpha.JobStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStatus(com.google.cloud.batch.v1alpha.JobStatus value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = + com.google.cloud.batch.v1alpha.JobStatus.newBuilder(status_) + .mergeFrom(value) + .buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.batch.v1alpha.JobStatus.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.batch.v1alpha.JobStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? com.google.cloud.batch.v1alpha.JobStatus.getDefaultInstance() + : status_; + } + } + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobStatus, + com.google.cloud.batch.v1alpha.JobStatus.Builder, + com.google.cloud.batch.v1alpha.JobStatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobStatus, + com.google.cloud.batch.v1alpha.JobStatus.Builder, + com.google.cloud.batch.v1alpha.JobStatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.cloud.batch.v1alpha.JobNotification notification_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification, + com.google.cloud.batch.v1alpha.JobNotification.Builder, + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder> + notificationBuilder_; + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .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 + * @return Whether the notification field is set. + */ + @java.lang.Deprecated + public boolean hasNotification() { + return notificationBuilder_ != null || notification_ != null; + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .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 + * @return The notification. + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.JobNotification getNotification() { + if (notificationBuilder_ == null) { + return notification_ == null + ? com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance() + : notification_; + } else { + return notificationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setNotification(com.google.cloud.batch.v1alpha.JobNotification value) { + if (notificationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notification_ = value; + onChanged(); + } else { + notificationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setNotification( + com.google.cloud.batch.v1alpha.JobNotification.Builder builderForValue) { + if (notificationBuilder_ == null) { + notification_ = builderForValue.build(); + onChanged(); + } else { + notificationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeNotification(com.google.cloud.batch.v1alpha.JobNotification value) { + if (notificationBuilder_ == null) { + if (notification_ != null) { + notification_ = + com.google.cloud.batch.v1alpha.JobNotification.newBuilder(notification_) + .mergeFrom(value) + .buildPartial(); + } else { + notification_ = value; + } + onChanged(); + } else { + notificationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearNotification() { + if (notificationBuilder_ == null) { + notification_ = null; + onChanged(); + } else { + notification_ = null; + notificationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.JobNotification.Builder getNotificationBuilder() { + + onChanged(); + return getNotificationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.batch.v1alpha.JobNotificationOrBuilder getNotificationOrBuilder() { + if (notificationBuilder_ != null) { + return notificationBuilder_.getMessageOrBuilder(); + } else { + return notification_ == null + ? com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance() + : notification_; + } + } + /** + * + * + *
+     * Job notification.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification, + com.google.cloud.batch.v1alpha.JobNotification.Builder, + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder> + getNotificationFieldBuilder() { + if (notificationBuilder_ == null) { + notificationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification, + com.google.cloud.batch.v1alpha.JobNotification.Builder, + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder>( + getNotification(), getParentForChildren(), isClean()); + notification_ = null; + } + return notificationBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.cloud.batch.v1alpha.LogsPolicy logsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.LogsPolicy, + com.google.cloud.batch.v1alpha.LogsPolicy.Builder, + com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder> + logsPolicyBuilder_; + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + * + * @return Whether the logsPolicy field is set. + */ + public boolean hasLogsPolicy() { + return logsPolicyBuilder_ != null || logsPolicy_ != null; + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + * + * @return The logsPolicy. + */ + public com.google.cloud.batch.v1alpha.LogsPolicy getLogsPolicy() { + if (logsPolicyBuilder_ == null) { + return logsPolicy_ == null + ? com.google.cloud.batch.v1alpha.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } else { + return logsPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + public Builder setLogsPolicy(com.google.cloud.batch.v1alpha.LogsPolicy value) { + if (logsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + logsPolicy_ = value; + onChanged(); + } else { + logsPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + public Builder setLogsPolicy( + com.google.cloud.batch.v1alpha.LogsPolicy.Builder builderForValue) { + if (logsPolicyBuilder_ == null) { + logsPolicy_ = builderForValue.build(); + onChanged(); + } else { + logsPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + public Builder mergeLogsPolicy(com.google.cloud.batch.v1alpha.LogsPolicy value) { + if (logsPolicyBuilder_ == null) { + if (logsPolicy_ != null) { + logsPolicy_ = + com.google.cloud.batch.v1alpha.LogsPolicy.newBuilder(logsPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + logsPolicy_ = value; + } + onChanged(); + } else { + logsPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + public Builder clearLogsPolicy() { + if (logsPolicyBuilder_ == null) { + logsPolicy_ = null; + onChanged(); + } else { + logsPolicy_ = null; + logsPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + public com.google.cloud.batch.v1alpha.LogsPolicy.Builder getLogsPolicyBuilder() { + + onChanged(); + return getLogsPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + public com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder getLogsPolicyOrBuilder() { + if (logsPolicyBuilder_ != null) { + return logsPolicyBuilder_.getMessageOrBuilder(); + } else { + return logsPolicy_ == null + ? com.google.cloud.batch.v1alpha.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } + } + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.LogsPolicy, + com.google.cloud.batch.v1alpha.LogsPolicy.Builder, + com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder> + getLogsPolicyFieldBuilder() { + if (logsPolicyBuilder_ == null) { + logsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.LogsPolicy, + com.google.cloud.batch.v1alpha.LogsPolicy.Builder, + com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder>( + getLogsPolicy(), getParentForChildren(), isClean()); + logsPolicy_ = null; + } + return logsPolicyBuilder_; + } + + private java.util.List notifications_ = + java.util.Collections.emptyList(); + + private void ensureNotificationsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + notifications_ = + new java.util.ArrayList(notifications_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification, + com.google.cloud.batch.v1alpha.JobNotification.Builder, + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder> + notificationsBuilder_; + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public java.util.List getNotificationsList() { + if (notificationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(notifications_); + } else { + return notificationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public int getNotificationsCount() { + if (notificationsBuilder_ == null) { + return notifications_.size(); + } else { + return notificationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public com.google.cloud.batch.v1alpha.JobNotification getNotifications(int index) { + if (notificationsBuilder_ == null) { + return notifications_.get(index); + } else { + return notificationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder setNotifications( + int index, com.google.cloud.batch.v1alpha.JobNotification value) { + if (notificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationsIsMutable(); + notifications_.set(index, value); + onChanged(); + } else { + notificationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder setNotifications( + int index, com.google.cloud.batch.v1alpha.JobNotification.Builder builderForValue) { + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + notifications_.set(index, builderForValue.build()); + onChanged(); + } else { + notificationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder addNotifications(com.google.cloud.batch.v1alpha.JobNotification value) { + if (notificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationsIsMutable(); + notifications_.add(value); + onChanged(); + } else { + notificationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder addNotifications( + int index, com.google.cloud.batch.v1alpha.JobNotification value) { + if (notificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotificationsIsMutable(); + notifications_.add(index, value); + onChanged(); + } else { + notificationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder addNotifications( + com.google.cloud.batch.v1alpha.JobNotification.Builder builderForValue) { + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + notifications_.add(builderForValue.build()); + onChanged(); + } else { + notificationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder addNotifications( + int index, com.google.cloud.batch.v1alpha.JobNotification.Builder builderForValue) { + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + notifications_.add(index, builderForValue.build()); + onChanged(); + } else { + notificationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder addAllNotifications( + java.lang.Iterable values) { + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, notifications_); + onChanged(); + } else { + notificationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder clearNotifications() { + if (notificationsBuilder_ == null) { + notifications_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + notificationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public Builder removeNotifications(int index) { + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + notifications_.remove(index); + onChanged(); + } else { + notificationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public com.google.cloud.batch.v1alpha.JobNotification.Builder getNotificationsBuilder( + int index) { + return getNotificationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public com.google.cloud.batch.v1alpha.JobNotificationOrBuilder getNotificationsOrBuilder( + int index) { + if (notificationsBuilder_ == null) { + return notifications_.get(index); + } else { + return notificationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public java.util.List + getNotificationsOrBuilderList() { + if (notificationsBuilder_ != null) { + return notificationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(notifications_); + } + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public com.google.cloud.batch.v1alpha.JobNotification.Builder addNotificationsBuilder() { + return getNotificationsFieldBuilder() + .addBuilder(com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance()); + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public com.google.cloud.batch.v1alpha.JobNotification.Builder addNotificationsBuilder( + int index) { + return getNotificationsFieldBuilder() + .addBuilder(index, com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance()); + } + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + public java.util.List + getNotificationsBuilderList() { + return getNotificationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification, + com.google.cloud.batch.v1alpha.JobNotification.Builder, + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder> + getNotificationsFieldBuilder() { + if (notificationsBuilder_ == null) { + notificationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification, + com.google.cloud.batch.v1alpha.JobNotification.Builder, + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder>( + notifications_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + notifications_ = null; + } + return notificationsBuilder_; + } + + @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.Job) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.Job) + private static final com.google.cloud.batch.v1alpha.Job DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.Job(); + } + + public static com.google.cloud.batch.v1alpha.Job getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Job parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Job(input, extensionRegistry); + } + }; + + 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.Job getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependency.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependency.java new file mode 100644 index 0000000..ad6f2bc --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependency.java @@ -0,0 +1,1211 @@ +/* + * 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; + +/** + * + * + *
+ * JobDependency describes the state of other Jobs that the start of this Job
+ * depends on.
+ * All dependent Jobs must have been submitted in the same region.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobDependency} + */ +public final class JobDependency extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.JobDependency) + JobDependencyOrBuilder { + private static final long serialVersionUID = 0L; + // Use JobDependency.newBuilder() to construct. + private JobDependency(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private JobDependency() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new JobDependency(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private JobDependency( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = + com.google.protobuf.MapField.newMapField(ItemsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry items__ = + input.readMessage( + ItemsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + items_.getMutableMap().put(items__.getKey(), items__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobDependency_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetItems(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobDependency_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobDependency.class, + com.google.cloud.batch.v1alpha.JobDependency.Builder.class); + } + + /** + * + * + *
+   * Dependency type.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.JobDependency.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The dependent Job has succeeded.
+     * 
+ * + * SUCCEEDED = 1; + */ + SUCCEEDED(1), + /** + * + * + *
+     * The dependent Job has failed.
+     * 
+ * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
+     * SUCCEEDED or FAILED.
+     * 
+ * + * FINISHED = 3; + */ + FINISHED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The dependent Job has succeeded.
+     * 
+ * + * SUCCEEDED = 1; + */ + public static final int SUCCEEDED_VALUE = 1; + /** + * + * + *
+     * The dependent Job has failed.
+     * 
+ * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + /** + * + * + *
+     * SUCCEEDED or FAILED.
+     * 
+ * + * FINISHED = 3; + */ + public static final int FINISHED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return SUCCEEDED; + case 2: + return FAILED; + case 3: + return FINISHED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobDependency.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.JobDependency.Type) + } + + public static final int ITEMS_FIELD_NUMBER = 1; + + private static final class ItemsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobDependency_ItemsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.ENUM, + com.google.cloud.batch.v1alpha.JobDependency.Type.TYPE_UNSPECIFIED.getNumber()); + } + + private com.google.protobuf.MapField items_; + + private com.google.protobuf.MapField internalGetItems() { + if (items_ == null) { + return com.google.protobuf.MapField.emptyMapField(ItemsDefaultEntryHolder.defaultEntry); + } + return items_; + } + + private static final com.google.protobuf.Internal.MapAdapter.Converter< + java.lang.Integer, com.google.cloud.batch.v1alpha.JobDependency.Type> + itemsValueConverter = + com.google.protobuf.Internal.MapAdapter.newEnumConverter( + com.google.cloud.batch.v1alpha.JobDependency.Type.internalGetValueMap(), + com.google.cloud.batch.v1alpha.JobDependency.Type.UNRECOGNIZED); + + private static final java.util.Map< + java.lang.String, com.google.cloud.batch.v1alpha.JobDependency.Type> + internalGetAdaptedItemsMap(java.util.Map map) { + return new com.google.protobuf.Internal.MapAdapter< + java.lang.String, com.google.cloud.batch.v1alpha.JobDependency.Type, java.lang.Integer>( + map, itemsValueConverter); + } + + public int getItemsCount() { + return internalGetItems().getMap().size(); + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public boolean containsItems(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetItems().getMap().containsKey(key); + } + /** Use {@link #getItemsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getItems() { + return getItemsMap(); + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public java.util.Map + getItemsMap() { + return internalGetAdaptedItemsMap(internalGetItems().getMap()); + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public /* nullable */ com.google.cloud.batch.v1alpha.JobDependency.Type getItemsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.batch.v1alpha.JobDependency.Type defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + return map.containsKey(key) ? itemsValueConverter.doForward(map.get(key)) : defaultValue; + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependency.Type getItemsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return itemsValueConverter.doForward(map.get(key)); + } + /** Use {@link #getItemsValueMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getItemsValue() { + return getItemsValueMap(); + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public java.util.Map getItemsValueMap() { + return internalGetItems().getMap(); + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public int getItemsValueOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public int getItemsValueOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetItems(), ItemsDefaultEntryHolder.defaultEntry, 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetItems().getMap().entrySet()) { + com.google.protobuf.MapEntry items__ = + ItemsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, items__); + } + size += unknownFields.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.JobDependency)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.JobDependency other = + (com.google.cloud.batch.v1alpha.JobDependency) obj; + + if (!internalGetItems().equals(other.internalGetItems())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetItems().getMap().isEmpty()) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetItems().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.JobDependency parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobDependency 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.JobDependency parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobDependency 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.JobDependency parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobDependency 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.JobDependency parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobDependency 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.JobDependency parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobDependency 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.JobDependency 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.JobDependency 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.JobDependency 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; + } + /** + * + * + *
+   * JobDependency describes the state of other Jobs that the start of this Job
+   * depends on.
+   * All dependent Jobs must have been submitted in the same region.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobDependency} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.JobDependency) + com.google.cloud.batch.v1alpha.JobDependencyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobDependency_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetItems(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableItems(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobDependency_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobDependency.class, + com.google.cloud.batch.v1alpha.JobDependency.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.JobDependency.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableItems().clear(); + 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_JobDependency_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependency getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.JobDependency.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependency build() { + com.google.cloud.batch.v1alpha.JobDependency result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependency buildPartial() { + com.google.cloud.batch.v1alpha.JobDependency result = + new com.google.cloud.batch.v1alpha.JobDependency(this); + int from_bitField0_ = bitField0_; + result.items_ = internalGetItems(); + result.items_.makeImmutable(); + onBuilt(); + return result; + } + + @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.JobDependency) { + return mergeFrom((com.google.cloud.batch.v1alpha.JobDependency) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobDependency other) { + if (other == com.google.cloud.batch.v1alpha.JobDependency.getDefaultInstance()) return this; + internalGetMutableItems().mergeFrom(other.internalGetItems()); + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.JobDependency parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.JobDependency) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField items_; + + private com.google.protobuf.MapField internalGetItems() { + if (items_ == null) { + return com.google.protobuf.MapField.emptyMapField(ItemsDefaultEntryHolder.defaultEntry); + } + return items_; + } + + private com.google.protobuf.MapField + internalGetMutableItems() { + onChanged(); + ; + if (items_ == null) { + items_ = com.google.protobuf.MapField.newMapField(ItemsDefaultEntryHolder.defaultEntry); + } + if (!items_.isMutable()) { + items_ = items_.copy(); + } + return items_; + } + + public int getItemsCount() { + return internalGetItems().getMap().size(); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public boolean containsItems(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetItems().getMap().containsKey(key); + } + /** Use {@link #getItemsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getItems() { + return getItemsMap(); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public java.util.Map + getItemsMap() { + return internalGetAdaptedItemsMap(internalGetItems().getMap()); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public /* nullable */ com.google.cloud.batch.v1alpha.JobDependency.Type getItemsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.batch.v1alpha.JobDependency.Type defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + return map.containsKey(key) ? itemsValueConverter.doForward(map.get(key)) : defaultValue; + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobDependency.Type getItemsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return itemsValueConverter.doForward(map.get(key)); + } + /** Use {@link #getItemsValueMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getItemsValue() { + return getItemsValueMap(); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public java.util.Map getItemsValueMap() { + return internalGetItems().getMap(); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public int getItemsValueOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + @java.lang.Override + public int getItemsValueOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetItems().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearItems() { + internalGetMutableItems().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + public Builder removeItems(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableItems().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableItems() { + return internalGetAdaptedItemsMap(internalGetMutableItems().getMutableMap()); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + public Builder putItems( + java.lang.String key, com.google.cloud.batch.v1alpha.JobDependency.Type value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableItems().getMutableMap().put(key, itemsValueConverter.doBackward(value)); + return this; + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + public Builder putAllItems( + java.util.Map values) { + internalGetAdaptedItemsMap(internalGetMutableItems().getMutableMap()).putAll(values); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableItemsValue() { + return internalGetMutableItems().getMutableMap(); + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + public Builder putItemsValue(java.lang.String key, int value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableItems().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Each item maps a Job name to a Type.
+     * All items must be satisfied for the JobDependency to be satisfied (the AND
+     * operation).
+     * Once a condition for one item becomes true, it won't go back to false
+     * even the dependent Job state changes again.
+     * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + public Builder putAllItemsValue(java.util.Map values) { + internalGetMutableItems().getMutableMap().putAll(values); + 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.JobDependency) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.JobDependency) + private static final com.google.cloud.batch.v1alpha.JobDependency DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.JobDependency(); + } + + public static com.google.cloud.batch.v1alpha.JobDependency getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobDependency parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JobDependency(input, extensionRegistry); + } + }; + + 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.JobDependency getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependencyOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependencyOrBuilder.java new file mode 100644 index 0000000..05acf48 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobDependencyOrBuilder.java @@ -0,0 +1,148 @@ +/* + * 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 JobDependencyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.JobDependency) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + int getItemsCount(); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + boolean containsItems(java.lang.String key); + /** Use {@link #getItemsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getItems(); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + java.util.Map getItemsMap(); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + /* nullable */ + com.google.cloud.batch.v1alpha.JobDependency.Type getItemsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.batch.v1alpha.JobDependency.Type defaultValue); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + com.google.cloud.batch.v1alpha.JobDependency.Type getItemsOrThrow(java.lang.String key); + /** Use {@link #getItemsValueMap()} instead. */ + @java.lang.Deprecated + java.util.Map getItemsValue(); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + java.util.Map getItemsValueMap(); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + int getItemsValueOrDefault(java.lang.String key, int defaultValue); + /** + * + * + *
+   * Each item maps a Job name to a Type.
+   * All items must be satisfied for the JobDependency to be satisfied (the AND
+   * operation).
+   * Once a condition for one item becomes true, it won't go back to false
+   * even the dependent Job state changes again.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobDependency.Type> items = 1; + */ + int getItemsValueOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobName.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobName.java new file mode 100644 index 0000000..3f42920 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobName.java @@ -0,0 +1,216 @@ +/* + * 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class JobName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_JOB = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/jobs/{job}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String job; + + @Deprecated + protected JobName() { + project = null; + location = null; + job = null; + } + + private JobName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + job = Preconditions.checkNotNull(builder.getJob()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getJob() { + return job; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static JobName of(String project, String location, String job) { + return newBuilder().setProject(project).setLocation(location).setJob(job).build(); + } + + public static String format(String project, String location, String job) { + return newBuilder().setProject(project).setLocation(location).setJob(job).build().toString(); + } + + public static JobName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_JOB.validatedMatch( + formattedString, "JobName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("job")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (JobName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_JOB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (job != null) { + fieldMapBuilder.put("job", job); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_JOB.instantiate("project", project, "location", location, "job", job); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + JobName that = ((JobName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.job, that.job); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(job); + return h; + } + + /** Builder for projects/{project}/locations/{location}/jobs/{job}. */ + public static class Builder { + private String project; + private String location; + private String job; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getJob() { + return job; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setJob(String job) { + this.job = job; + return this; + } + + private Builder(JobName jobName) { + this.project = jobName.project; + this.location = jobName.location; + this.job = jobName.job; + } + + public JobName build() { + return new JobName(this); + } + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotification.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotification.java new file mode 100644 index 0000000..5e161ee --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotification.java @@ -0,0 +1,2106 @@ +/* + * 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; + +/** + * + * + *
+ * Notification configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobNotification} + */ +public final class JobNotification extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.JobNotification) + JobNotificationOrBuilder { + private static final long serialVersionUID = 0L; + // Use JobNotification.newBuilder() to construct. + private JobNotification(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private JobNotification() { + pubsubTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new JobNotification(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private JobNotification( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubTopic_ = s; + break; + } + case 18: + { + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder subBuilder = null; + if (message_ != null) { + subBuilder = message_.toBuilder(); + } + message_ = + input.readMessage( + com.google.cloud.batch.v1alpha.JobNotification.Message.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(message_); + message_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobNotification.class, + com.google.cloud.batch.v1alpha.JobNotification.Builder.class); + } + + /** + * + * + *
+   * The message type.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.JobNotification.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Notify users that the job state has changed.
+     * 
+ * + * JOB_STATE_CHANGED = 1; + */ + JOB_STATE_CHANGED(1), + /** + * + * + *
+     * Notify users that the task state has changed.
+     * 
+ * + * TASK_STATE_CHANGED = 2; + */ + TASK_STATE_CHANGED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Notify users that the job state has changed.
+     * 
+ * + * JOB_STATE_CHANGED = 1; + */ + public static final int JOB_STATE_CHANGED_VALUE = 1; + /** + * + * + *
+     * Notify users that the task state has changed.
+     * 
+ * + * TASK_STATE_CHANGED = 2; + */ + public static final int TASK_STATE_CHANGED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return JOB_STATE_CHANGED; + case 2: + return TASK_STATE_CHANGED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobNotification.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.JobNotification.Type) + } + + public interface MessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.JobNotification.Message) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return The type. + */ + com.google.cloud.batch.v1alpha.JobNotification.Type getType(); + + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return The enum numeric value on the wire for newJobState. + */ + int getNewJobStateValue(); + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return The newJobState. + */ + com.google.cloud.batch.v1alpha.JobStatus.State getNewJobState(); + + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return The enum numeric value on the wire for newTaskState. + */ + int getNewTaskStateValue(); + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return The newTaskState. + */ + com.google.cloud.batch.v1alpha.TaskStatus.State getNewTaskState(); + } + /** + * + * + *
+   * Message details.
+   * Describe the attribute that a message should have.
+   * Without specified message attributes, no message will be sent by default.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobNotification.Message} + */ + public static final class Message extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.JobNotification.Message) + MessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Message.newBuilder() to construct. + private Message(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Message() { + type_ = 0; + newJobState_ = 0; + newTaskState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Message(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Message( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + newJobState_ = rawValue; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + newTaskState_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobNotification.Message.class, + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.JobNotification.Type result = + com.google.cloud.batch.v1alpha.JobNotification.Type.valueOf(type_); + return result == null + ? com.google.cloud.batch.v1alpha.JobNotification.Type.UNRECOGNIZED + : result; + } + + public static final int NEW_JOB_STATE_FIELD_NUMBER = 2; + private int newJobState_; + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return The enum numeric value on the wire for newJobState. + */ + @java.lang.Override + public int getNewJobStateValue() { + return newJobState_; + } + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return The newJobState. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.State getNewJobState() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.JobStatus.State result = + com.google.cloud.batch.v1alpha.JobStatus.State.valueOf(newJobState_); + return result == null ? com.google.cloud.batch.v1alpha.JobStatus.State.UNRECOGNIZED : result; + } + + public static final int NEW_TASK_STATE_FIELD_NUMBER = 3; + private int newTaskState_; + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return The enum numeric value on the wire for newTaskState. + */ + @java.lang.Override + public int getNewTaskStateValue() { + return newTaskState_; + } + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return The newTaskState. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskStatus.State getNewTaskState() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.TaskStatus.State result = + com.google.cloud.batch.v1alpha.TaskStatus.State.valueOf(newTaskState_); + return result == null ? com.google.cloud.batch.v1alpha.TaskStatus.State.UNRECOGNIZED : result; + } + + 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 (type_ + != com.google.cloud.batch.v1alpha.JobNotification.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (newJobState_ + != com.google.cloud.batch.v1alpha.JobStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, newJobState_); + } + if (newTaskState_ + != com.google.cloud.batch.v1alpha.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, newTaskState_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.batch.v1alpha.JobNotification.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (newJobState_ + != com.google.cloud.batch.v1alpha.JobStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, newJobState_); + } + if (newTaskState_ + != com.google.cloud.batch.v1alpha.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, newTaskState_); + } + size += unknownFields.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.JobNotification.Message)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.JobNotification.Message other = + (com.google.cloud.batch.v1alpha.JobNotification.Message) obj; + + if (type_ != other.type_) return false; + if (newJobState_ != other.newJobState_) return false; + if (newTaskState_ != other.newTaskState_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + NEW_JOB_STATE_FIELD_NUMBER; + hash = (53 * hash) + newJobState_; + hash = (37 * hash) + NEW_TASK_STATE_FIELD_NUMBER; + hash = (53 * hash) + newTaskState_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message 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.JobNotification.Message parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message 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.JobNotification.Message parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message 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.JobNotification.Message parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message 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.JobNotification.Message parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message 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.JobNotification.Message 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.JobNotification.Message 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.JobNotification.Message 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; + } + /** + * + * + *
+     * Message details.
+     * Describe the attribute that a message should have.
+     * Without specified message attributes, no message will be sent by default.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobNotification.Message} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.JobNotification.Message) + com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobNotification.Message.class, + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.JobNotification.Message.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + newJobState_ = 0; + + newTaskState_ = 0; + + 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_JobNotification_Message_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.Message getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.JobNotification.Message.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.Message build() { + com.google.cloud.batch.v1alpha.JobNotification.Message result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.Message buildPartial() { + com.google.cloud.batch.v1alpha.JobNotification.Message result = + new com.google.cloud.batch.v1alpha.JobNotification.Message(this); + result.type_ = type_; + result.newJobState_ = newJobState_; + result.newTaskState_ = newTaskState_; + onBuilt(); + return result; + } + + @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.JobNotification.Message) { + return mergeFrom((com.google.cloud.batch.v1alpha.JobNotification.Message) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobNotification.Message other) { + if (other == com.google.cloud.batch.v1alpha.JobNotification.Message.getDefaultInstance()) + return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.newJobState_ != 0) { + setNewJobStateValue(other.getNewJobStateValue()); + } + if (other.newTaskState_ != 0) { + setNewTaskStateValue(other.getNewTaskStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.JobNotification.Message parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.JobNotification.Message) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.JobNotification.Type result = + com.google.cloud.batch.v1alpha.JobNotification.Type.valueOf(type_); + return result == null + ? com.google.cloud.batch.v1alpha.JobNotification.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.batch.v1alpha.JobNotification.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int newJobState_ = 0; + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return The enum numeric value on the wire for newJobState. + */ + @java.lang.Override + public int getNewJobStateValue() { + return newJobState_; + } + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @param value The enum numeric value on the wire for newJobState to set. + * @return This builder for chaining. + */ + public Builder setNewJobStateValue(int value) { + + newJobState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return The newJobState. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.State getNewJobState() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.JobStatus.State result = + com.google.cloud.batch.v1alpha.JobStatus.State.valueOf(newJobState_); + return result == null + ? com.google.cloud.batch.v1alpha.JobStatus.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @param value The newJobState to set. + * @return This builder for chaining. + */ + public Builder setNewJobState(com.google.cloud.batch.v1alpha.JobStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + + newJobState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State new_job_state = 2; + * + * @return This builder for chaining. + */ + public Builder clearNewJobState() { + + newJobState_ = 0; + onChanged(); + return this; + } + + private int newTaskState_ = 0; + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return The enum numeric value on the wire for newTaskState. + */ + @java.lang.Override + public int getNewTaskStateValue() { + return newTaskState_; + } + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @param value The enum numeric value on the wire for newTaskState to set. + * @return This builder for chaining. + */ + public Builder setNewTaskStateValue(int value) { + + newTaskState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return The newTaskState. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskStatus.State getNewTaskState() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.TaskStatus.State result = + com.google.cloud.batch.v1alpha.TaskStatus.State.valueOf(newTaskState_); + return result == null + ? com.google.cloud.batch.v1alpha.TaskStatus.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @param value The newTaskState to set. + * @return This builder for chaining. + */ + public Builder setNewTaskState(com.google.cloud.batch.v1alpha.TaskStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + + newTaskState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.cloud.batch.v1alpha.TaskStatus.State new_task_state = 3; + * + * @return This builder for chaining. + */ + public Builder clearNewTaskState() { + + newTaskState_ = 0; + 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.JobNotification.Message) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.JobNotification.Message) + private static final com.google.cloud.batch.v1alpha.JobNotification.Message DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.JobNotification.Message(); + } + + public static com.google.cloud.batch.v1alpha.JobNotification.Message getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Message parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Message(input, extensionRegistry); + } + }; + + 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.JobNotification.Message getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object pubsubTopic_; + /** + * + * + *
+   * The Pub/Sub topic where notifications like the job state changes
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
+   * 
+ * + * string pubsub_topic = 1; + * + * @return The pubsubTopic. + */ + @java.lang.Override + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * The Pub/Sub topic where notifications like the job state changes
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
+   * 
+ * + * string pubsub_topic = 1; + * + * @return The bytes for pubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private com.google.cloud.batch.v1alpha.JobNotification.Message message_; + /** + * + * + *
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return message_ != null; + } + /** + * + * + *
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + * + * @return The message. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.Message getMessage() { + return message_ == null + ? com.google.cloud.batch.v1alpha.JobNotification.Message.getDefaultInstance() + : message_; + } + /** + * + * + *
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder getMessageOrBuilder() { + return getMessage(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pubsubTopic_); + } + if (message_ != null) { + output.writeMessage(2, getMessage()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pubsubTopic_); + } + if (message_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMessage()); + } + size += unknownFields.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.JobNotification)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.JobNotification other = + (com.google.cloud.batch.v1alpha.JobNotification) obj; + + if (!getPubsubTopic().equals(other.getPubsubTopic())) return false; + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage().equals(other.getMessage())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTopic().hashCode(); + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.JobNotification parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobNotification 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.JobNotification parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobNotification 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.JobNotification parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobNotification 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.JobNotification parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobNotification 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.JobNotification parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobNotification 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.JobNotification 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.JobNotification 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.JobNotification 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; + } + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobNotification} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.JobNotification) + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobNotification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobNotification.class, + com.google.cloud.batch.v1alpha.JobNotification.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.JobNotification.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pubsubTopic_ = ""; + + if (messageBuilder_ == null) { + message_ = null; + } else { + message_ = null; + messageBuilder_ = null; + } + 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_JobNotification_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification build() { + com.google.cloud.batch.v1alpha.JobNotification result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobNotification buildPartial() { + com.google.cloud.batch.v1alpha.JobNotification result = + new com.google.cloud.batch.v1alpha.JobNotification(this); + result.pubsubTopic_ = pubsubTopic_; + if (messageBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = messageBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.JobNotification) { + return mergeFrom((com.google.cloud.batch.v1alpha.JobNotification) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobNotification other) { + if (other == com.google.cloud.batch.v1alpha.JobNotification.getDefaultInstance()) return this; + if (!other.getPubsubTopic().isEmpty()) { + pubsubTopic_ = other.pubsubTopic_; + onChanged(); + } + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.JobNotification parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.JobNotification) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object pubsubTopic_ = ""; + /** + * + * + *
+     * The Pub/Sub topic where notifications like the job state changes
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
+     * 
+ * + * string pubsub_topic = 1; + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Pub/Sub topic where notifications like the job state changes
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
+     * 
+ * + * string pubsub_topic = 1; + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Pub/Sub topic where notifications like the job state changes
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
+     * 
+ * + * string pubsub_topic = 1; + * + * @param value The pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Pub/Sub topic where notifications like the job state changes
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
+     * 
+ * + * string pubsub_topic = 1; + * + * @return This builder for chaining. + */ + public Builder clearPubsubTopic() { + + pubsubTopic_ = getDefaultInstance().getPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Pub/Sub topic where notifications like the job state changes
+     * will be published. This topic exist in the same project as the job
+     * and billings will be charged to this project.
+     * If not specified, no Pub/Sub messages will be sent.
+     * Topic format: `projects/{project}/topics/{topic}`.
+     * 
+ * + * string pubsub_topic = 1; + * + * @param value The bytes for pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubTopic_ = value; + onChanged(); + return this; + } + + private com.google.cloud.batch.v1alpha.JobNotification.Message message_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification.Message, + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder, + com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder> + messageBuilder_; + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return messageBuilder_ != null || message_ != null; + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + * + * @return The message. + */ + public com.google.cloud.batch.v1alpha.JobNotification.Message getMessage() { + if (messageBuilder_ == null) { + return message_ == null + ? com.google.cloud.batch.v1alpha.JobNotification.Message.getDefaultInstance() + : message_; + } else { + return messageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + public Builder setMessage(com.google.cloud.batch.v1alpha.JobNotification.Message value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + messageBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + public Builder setMessage( + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder builderForValue) { + if (messageBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + public Builder mergeMessage(com.google.cloud.batch.v1alpha.JobNotification.Message value) { + if (messageBuilder_ == null) { + if (message_ != null) { + message_ = + com.google.cloud.batch.v1alpha.JobNotification.Message.newBuilder(message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + messageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + public Builder clearMessage() { + if (messageBuilder_ == null) { + message_ = null; + onChanged(); + } else { + message_ = null; + messageBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + public com.google.cloud.batch.v1alpha.JobNotification.Message.Builder getMessageBuilder() { + + onChanged(); + return getMessageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + public com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder getMessageOrBuilder() { + if (messageBuilder_ != null) { + return messageBuilder_.getMessageOrBuilder(); + } else { + return message_ == null + ? com.google.cloud.batch.v1alpha.JobNotification.Message.getDefaultInstance() + : message_; + } + } + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification.Message, + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder, + com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + messageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobNotification.Message, + com.google.cloud.batch.v1alpha.JobNotification.Message.Builder, + com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder>( + getMessage(), getParentForChildren(), isClean()); + message_ = null; + } + return messageBuilder_; + } + + @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.JobNotification) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.JobNotification) + private static final com.google.cloud.batch.v1alpha.JobNotification DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.JobNotification(); + } + + public static com.google.cloud.batch.v1alpha.JobNotification getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobNotification parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JobNotification(input, extensionRegistry); + } + }; + + 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.JobNotification getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotificationOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotificationOrBuilder.java new file mode 100644 index 0000000..234395a --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobNotificationOrBuilder.java @@ -0,0 +1,96 @@ +/* + * 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 JobNotificationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.JobNotification) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Pub/Sub topic where notifications like the job state changes
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
+   * 
+ * + * string pubsub_topic = 1; + * + * @return The pubsubTopic. + */ + java.lang.String getPubsubTopic(); + /** + * + * + *
+   * The Pub/Sub topic where notifications like the job state changes
+   * will be published. This topic exist in the same project as the job
+   * and billings will be charged to this project.
+   * If not specified, no Pub/Sub messages will be sent.
+   * Topic format: `projects/{project}/topics/{topic}`.
+   * 
+ * + * string pubsub_topic = 1; + * + * @return The bytes for pubsubTopic. + */ + com.google.protobuf.ByteString getPubsubTopicBytes(); + + /** + * + * + *
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + /** + * + * + *
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + * + * @return The message. + */ + com.google.cloud.batch.v1alpha.JobNotification.Message getMessage(); + /** + * + * + *
+   * The attribute requirements of messages to be sent to this Pub/Sub topic.
+   * Without this field, no message will be sent.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification.Message message = 2; + */ + com.google.cloud.batch.v1alpha.JobNotification.MessageOrBuilder getMessageOrBuilder(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java new file mode 100644 index 0000000..f2bda0a --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobOrBuilder.java @@ -0,0 +1,632 @@ +/* + * 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 JobOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.Job) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. A system generated unique ID (in UUID4 format) for the Job.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. A system generated unique ID (in UUID4 format) for the Job.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Priority of the Job.
+   * The valid value range is [0, 100).
+   * A job with higher priority value is more likely to run earlier if all other
+   * requirements are satisfied.
+   * 
+ * + * int64 priority = 3; + * + * @return The priority. + */ + long getPriority(); + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getTaskGroupsList(); + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.batch.v1alpha.TaskGroup getTaskGroups(int index); + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getTaskGroupsCount(); + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getTaskGroupsOrBuilderList(); + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * + * repeated .google.cloud.batch.v1alpha.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.batch.v1alpha.TaskGroupOrBuilder getTaskGroupsOrBuilder(int index); + + /** + * + * + *
+   * Scheduling policy for TaskGroups in the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return The enum numeric value on the wire for schedulingPolicy. + */ + int getSchedulingPolicyValue(); + /** + * + * + *
+   * Scheduling policy for TaskGroups in the job.
+   * 
+ * + * .google.cloud.batch.v1alpha.Job.SchedulingPolicy scheduling_policy = 5; + * + * @return The schedulingPolicy. + */ + com.google.cloud.batch.v1alpha.Job.SchedulingPolicy getSchedulingPolicy(); + + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + java.util.List getDependenciesList(); + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + com.google.cloud.batch.v1alpha.JobDependency getDependencies(int index); + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + int getDependenciesCount(); + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + java.util.List + getDependenciesOrBuilderList(); + /** + * + * + *
+   * At least one of the dependencies must be satisfied before the Job is
+   * scheduled to run.
+   * Only one JobDependency is supported now.
+   * Not yet implemented.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobDependency dependencies = 6; + */ + com.google.cloud.batch.v1alpha.JobDependencyOrBuilder getDependenciesOrBuilder(int index); + + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + * + * @return Whether the allocationPolicy field is set. + */ + boolean hasAllocationPolicy(); + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + * + * @return The allocationPolicy. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy getAllocationPolicy(); + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7; + */ + com.google.cloud.batch.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder(); + + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels for the Job. Labels could be user provided or system generated.
+   * For example,
+   * "labels": {
+   *    "department": "finance",
+   *    "environment": "test"
+   *  }
+   * You can assign up to 64 labels.  [Google Compute Engine label
+   * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
+   * apply.
+   * Label names that start with "goog-" or "google-" are reserved.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + com.google.cloud.batch.v1alpha.JobStatus getStatus(); + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * + * .google.cloud.batch.v1alpha.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.batch.v1alpha.JobStatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * Job notification.
+   * 
+ * + * .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 + * @return Whether the notification field is set. + */ + @java.lang.Deprecated + boolean hasNotification(); + /** + * + * + *
+   * Job notification.
+   * 
+ * + * .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 + * @return The notification. + */ + @java.lang.Deprecated + com.google.cloud.batch.v1alpha.JobNotification getNotification(); + /** + * + * + *
+   * Job notification.
+   * 
+ * + * .google.cloud.batch.v1alpha.JobNotification notification = 10 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder getNotificationOrBuilder(); + + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + * + * @return Whether the logsPolicy field is set. + */ + boolean hasLogsPolicy(); + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + * + * @return The logsPolicy. + */ + com.google.cloud.batch.v1alpha.LogsPolicy getLogsPolicy(); + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy logs_policy = 13; + */ + com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder getLogsPolicyOrBuilder(); + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + java.util.List getNotificationsList(); + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + com.google.cloud.batch.v1alpha.JobNotification getNotifications(int index); + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + int getNotificationsCount(); + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + java.util.List + getNotificationsOrBuilderList(); + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.JobNotification notifications = 14; + */ + com.google.cloud.batch.v1alpha.JobNotificationOrBuilder getNotificationsOrBuilder(int index); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java new file mode 100644 index 0000000..b95e4d5 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobProto.java @@ -0,0 +1,567 @@ +/* + * 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 final class JobProto { + private JobProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_Job_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_Job_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_Job_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_Job_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_LogsPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_LogsPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobDependency_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobDependency_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobDependency_ItemsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobDependency_ItemsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_CountsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_CountsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + 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_JobNotification_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobNotification_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_JobNotification_Message_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_JobNotification_Message_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_TaskGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_batch_v1alpha_ServiceAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_batch_v1alpha_ServiceAccount_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n$google/cloud/batch/v1alpha/job.proto\022\032" + + "google.cloud.batch.v1alpha\032\037google/api/f" + + "ield_behavior.proto\032\031google/api/resource" + + ".proto\032%google/cloud/batch/v1alpha/task." + + "proto\032\036google/protobuf/duration.proto\032\037g" + + "oogle/protobuf/timestamp.proto\"\323\007\n\003Job\022\021" + + "\n\004name\030\001 \001(\tB\003\340A\003\022\020\n\003uid\030\002 \001(\tB\003\340A\003\022\020\n\010p" + + "riority\030\003 \001(\003\022?\n\013task_groups\030\004 \003(\0132%.goo" + + "gle.cloud.batch.v1alpha.TaskGroupB\003\340A\002\022K" + + "\n\021scheduling_policy\030\005 \001(\01620.google.cloud" + + ".batch.v1alpha.Job.SchedulingPolicy\022?\n\014d" + + "ependencies\030\006 \003(\0132).google.cloud.batch.v" + + "1alpha.JobDependency\022G\n\021allocation_polic" + + "y\030\007 \001(\0132,.google.cloud.batch.v1alpha.All" + + "ocationPolicy\022;\n\006labels\030\010 \003(\0132+.google.c" + + "loud.batch.v1alpha.Job.LabelsEntry\022:\n\006st" + + "atus\030\t \001(\0132%.google.cloud.batch.v1alpha." + + "JobStatusB\003\340A\003\022E\n\014notification\030\n \001(\0132+.g" + + "oogle.cloud.batch.v1alpha.JobNotificatio" + + "nB\002\030\001\0224\n\013create_time\030\013 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\014 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022;\n\013log" + + "s_policy\030\r \001(\0132&.google.cloud.batch.v1al" + + "pha.LogsPolicy\022B\n\rnotifications\030\016 \003(\0132+." + + "google.cloud.batch.v1alpha.JobNotificati" + + "on\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001\"N\n\020SchedulingPolicy\022!\n\035SCHEDUL" + + "ING_POLICY_UNSPECIFIED\020\000\022\027\n\023AS_SOON_AS_P" + + "OSSIBLE\020\001:Q\352AN\n\030batch.googleapis.com/Job" + + "\0222projects/{project}/locations/{location" + + "}/jobs/{job}\"\261\001\n\nLogsPolicy\022G\n\013destinati" + + "on\030\001 \001(\01622.google.cloud.batch.v1alpha.Lo" + + "gsPolicy.Destination\022\021\n\tlogs_path\030\002 \001(\t\"" + + "G\n\013Destination\022\033\n\027DESTINATION_UNSPECIFIE" + + "D\020\000\022\021\n\rCLOUD_LOGGING\020\001\022\010\n\004PATH\020\002\"\371\001\n\rJob" + + "Dependency\022C\n\005items\030\001 \003(\01324.google.cloud" + + ".batch.v1alpha.JobDependency.ItemsEntry\032" + + "\\\n\nItemsEntry\022\013\n\003key\030\001 \001(\t\022=\n\005value\030\002 \001(" + + "\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\"\342\006\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\225\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\032\334\001\n\017TaskGroupStatus\022" + + "Q\n\006counts\030\001 \003(\0132A.google.cloud.batch.v1a" + + "lpha.JobStatus.TaskGroupStatus.CountsEnt" + + "ry\022G\n\tinstances\030\002 \003(\01324.google.cloud.bat" + + "ch.v1alpha.JobStatus.InstanceStatus\032-\n\013C" + + "ountsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\002" + + "8\001\032h\n\017TaskGroupsEntry\022\013\n\003key\030\001 \001(\t\022D\n\005va" + + "lue\030\002 \001(\01325.google.cloud.batch.v1alpha.J" + + "obStatus.TaskGroupStatus:\0028\001\"{\n\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\n\n\006QUEUED\020\001\022\r\n\tSCHE" + + "DULED\020\002\022\013\n\007RUNNING\020\003\022\r\n\tSUCCEEDED\020\004\022\n\n\006F" + + "AILED\020\005\022\030\n\024DELETION_IN_PROGRESS\020\006\"\220\003\n\017Jo" + + "bNotification\022\024\n\014pubsub_topic\030\001 \001(\t\022D\n\007m" + + "essage\030\002 \001(\01323.google.cloud.batch.v1alph" + + "a.JobNotification.Message\032\323\001\n\007Message\022>\n" + + "\004type\030\001 \001(\01620.google.cloud.batch.v1alpha" + + ".JobNotification.Type\022B\n\rnew_job_state\030\002" + + " \001(\0162+.google.cloud.batch.v1alpha.JobSta" + + "tus.State\022D\n\016new_task_state\030\003 \001(\0162,.goog" + + "le.cloud.batch.v1alpha.TaskStatus.State\"" + + "K\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\025\n\021JOB_STA" + + "TE_CHANGED\020\001\022\026\n\022TASK_STATE_CHANGED\020\002\"\270\016\n" + + "\020AllocationPolicy\022M\n\010location\030\001 \001(\0132;.go" + + "ogle.cloud.batch.v1alpha.AllocationPolic" + + "y.LocationPolicy\022Q\n\010instance\030\002 \001(\0132;.goo" + + "gle.cloud.batch.v1alpha.AllocationPolicy" + + ".InstancePolicyB\002\030\001\022X\n\tinstances\030\010 \003(\0132E" + + ".google.cloud.batch.v1alpha.AllocationPo" + + "licy.InstancePolicyOrTemplate\022\036\n\022instanc" + + "e_templates\030\003 \003(\tB\002\030\001\022_\n\023provisioning_mo" + + "dels\030\004 \003(\0162>.google.cloud.batch.v1alpha." + + "AllocationPolicy.ProvisioningModelB\002\030\001\022\035" + + "\n\025service_account_email\030\005 \001(\t\022C\n\017service" + + "_account\030\t \001(\0132*.google.cloud.batch.v1al" + + "pha.ServiceAccount\022H\n\006labels\030\006 \003(\01328.goo" + + "gle.cloud.batch.v1alpha.AllocationPolicy" + + ".LabelsEntry\022K\n\007network\030\007 \001(\0132:.google.c" + + "loud.batch.v1alpha.AllocationPolicy.Netw" + + "orkPolicy\032E\n\016LocationPolicy\022\031\n\021allowed_l" + + "ocations\030\001 \003(\t\022\030\n\020denied_locations\030\002 \003(\t" + + "\032Y\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(\003B\r\n\013" + + "data_source\032\217\001\n\014AttachedDisk\022E\n\010new_disk" + + "\030\001 \001(\01321.google.cloud.batch.v1alpha.Allo" + + "cationPolicy.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*\n" + + "\013Accelerator\022\014\n\004type\030\001 \001(\t\022\r\n\005count\030\002 \001(" + + "\003\032\331\002\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" + + ".AllocationPolicy.ProvisioningModel\022N\n\014a" + + "ccelerators\030\005 \003(\01328.google.cloud.batch.v" + + "1alpha.AllocationPolicy.Accelerator\022H\n\005d" + + "isks\030\006 \003(\01329.google.cloud.batch.v1alpha." + + "AllocationPolicy.AttachedDisk\032\231\001\n\030Instan" + + "cePolicyOrTemplate\022M\n\006policy\030\001 \001(\0132;.goo" + + "gle.cloud.batch.v1alpha.AllocationPolicy" + + ".InstancePolicyH\000\022\033\n\021instance_template\030\002" + + " \001(\tH\000B\021\n\017policy_template\032W\n\020NetworkInte" + + "rface\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\rNe" + + "tworkPolicy\022Y\n\022network_interfaces\030\001 \003(\0132" + + "=.google.cloud.batch.v1alpha.AllocationP" + + "olicy.NetworkInterface\032-\n\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\021Provisi" + + "oningModel\022\"\n\036PROVISIONING_MODEL_UNSPECI" + + "FIED\020\000\022\014\n\010STANDARD\020\001\022\010\n\004SPOT\020\002\022\017\n\013PREEMP" + + "TIBLE\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\ntask_count\030\004 \001" + + "(\003\022\023\n\013parallelism\030\005 \001(\003\022Q\n\021scheduling_po" + + "licy\030\006 \001(\01626.google.cloud.batch.v1alpha." + + "TaskGroup.SchedulingPolicy\022G\n\021allocation" + + "_policy\030\007 \001(\0132,.google.cloud.batch.v1alp" + + "ha.AllocationPolicy\022A\n\006labels\030\010 \003(\01321.go" + + "ogle.cloud.batch.v1alpha.TaskGroup.Label" + + "sEntry\022B\n\021task_environments\030\t \003(\0132\'.goog" + + "le.cloud.batch.v1alpha.Environment\022\033\n\023ta" + + "sk_count_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\013L" + + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" + + "8\001\"N\n\020SchedulingPolicy\022!\n\035SCHEDULING_POL" + + "ICY_UNSPECIFIED\020\000\022\027\n\023AS_SOON_AS_POSSIBLE" + + "\020\001:o\352Al\n\036batch.googleapis.com/TaskGroup\022" + + "Jprojects/{project}/locations/{location}" + + "/jobs/{job}/taskGroups/{task_group}\"/\n\016S" + + "erviceAccount\022\r\n\005email\030\001 \001(\t\022\016\n\006scopes\030\002" + + " \003(\tB\315\001\n\036com.google.cloud.batch.v1alphaB" + + "\010JobProtoP\001Z?google.golang.org/genproto/" + + "googleapis/cloud/batch/v1alpha;batch\242\002\003G" + + "CB\252\002\032Google.Cloud.Batch.V1Alpha\312\002\032Google" + + "\\Cloud\\Batch\\V1alpha\352\002\035Google::Cloud::Ba" + + "tch::V1alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.batch.v1alpha.TaskProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_batch_v1alpha_Job_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_batch_v1alpha_Job_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_Job_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Priority", + "TaskGroups", + "SchedulingPolicy", + "Dependencies", + "AllocationPolicy", + "Labels", + "Status", + "Notification", + "CreateTime", + "UpdateTime", + "LogsPolicy", + "Notifications", + }); + internal_static_google_cloud_batch_v1alpha_Job_LabelsEntry_descriptor = + internal_static_google_cloud_batch_v1alpha_Job_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_batch_v1alpha_Job_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_Job_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_batch_v1alpha_LogsPolicy_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_batch_v1alpha_LogsPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_LogsPolicy_descriptor, + new java.lang.String[] { + "Destination", "LogsPath", + }); + internal_static_google_cloud_batch_v1alpha_JobDependency_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_batch_v1alpha_JobDependency_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobDependency_descriptor, + new java.lang.String[] { + "Items", + }); + internal_static_google_cloud_batch_v1alpha_JobDependency_ItemsEntry_descriptor = + internal_static_google_cloud_batch_v1alpha_JobDependency_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_batch_v1alpha_JobDependency_ItemsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobDependency_ItemsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_batch_v1alpha_JobStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor, + new java.lang.String[] { + "State", "StatusEvents", "TaskGroups", "RunDuration", + }); + internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_descriptor = + internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_descriptor, + new java.lang.String[] { + "MachineType", "ProvisioningModel", "TaskPack", + }); + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_descriptor = + internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_descriptor, + new java.lang.String[] { + "Counts", "Instances", + }); + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_CountsEntry_descriptor = + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_CountsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_CountsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupsEntry_descriptor = + internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_batch_v1alpha_JobNotification_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor, + new java.lang.String[] { + "PubsubTopic", "Message", + }); + internal_static_google_cloud_batch_v1alpha_JobNotification_Message_descriptor = + internal_static_google_cloud_batch_v1alpha_JobNotification_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_batch_v1alpha_JobNotification_Message_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_JobNotification_Message_descriptor, + new java.lang.String[] { + "Type", "NewJobState", "NewTaskState", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor, + new java.lang.String[] { + "Location", + "Instance", + "Instances", + "InstanceTemplates", + "ProvisioningModels", + "ServiceAccountEmail", + "ServiceAccount", + "Labels", + "Network", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LocationPolicy_descriptor, + new java.lang.String[] { + "AllowedLocations", "DeniedLocations", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Disk_descriptor, + new java.lang.String[] { + "Image", "Snapshot", "Type", "SizeGb", "DataSource", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_AttachedDisk_descriptor, + new java.lang.String[] { + "NewDisk", "ExistingDisk", "DeviceName", "Attached", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_Accelerator_descriptor, + new java.lang.String[] { + "Type", "Count", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicy_descriptor, + new java.lang.String[] { + "AllowedMachineTypes", + "MachineType", + "MinCpuPlatform", + "ProvisioningModel", + "Accelerators", + "Disks", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(5); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_InstancePolicyOrTemplate_descriptor, + new java.lang.String[] { + "Policy", "InstanceTemplate", "PolicyTemplate", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(6); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkInterface_descriptor, + new java.lang.String[] { + "Network", "Subnetwork", "NoExternalIpAddress", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(7); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_NetworkPolicy_descriptor, + new java.lang.String[] { + "NetworkInterfaces", + }); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(8); + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_AllocationPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_batch_v1alpha_TaskGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor, + new java.lang.String[] { + "Name", + "TaskSpec", + "TaskCount", + "Parallelism", + "SchedulingPolicy", + "AllocationPolicy", + "Labels", + "TaskEnvironments", + "TaskCountPerNode", + "RequireHostsFile", + "PermissiveSsh", + }); + internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_descriptor = + internal_static_google_cloud_batch_v1alpha_TaskGroup_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_TaskGroup_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_batch_v1alpha_ServiceAccount_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_batch_v1alpha_ServiceAccount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_batch_v1alpha_ServiceAccount_descriptor, + new java.lang.String[] { + "Email", "Scopes", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.batch.v1alpha.TaskProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java new file mode 100644 index 0000000..03267c2 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatus.java @@ -0,0 +1,4368 @@ +/* + * 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; + +/** + * + * + *
+ * Job status.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobStatus} + */ +public final class JobStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.JobStatus) + JobStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use JobStatus.newBuilder() to construct. + private JobStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private JobStatus() { + state_ = 0; + statusEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new JobStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private JobStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + statusEvents_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + statusEvents_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.StatusEvent.parser(), extensionRegistry)); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + taskGroups_ = + com.google.protobuf.MapField.newMapField( + TaskGroupsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + taskGroups__ = + input.readMessage( + TaskGroupsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + taskGroups_.getMutableMap().put(taskGroups__.getKey(), taskGroups__.getValue()); + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (runDuration_ != null) { + subBuilder = runDuration_.toBuilder(); + } + runDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(runDuration_); + runDuration_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + statusEvents_ = java.util.Collections.unmodifiableList(statusEvents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetTaskGroups(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobStatus.class, + com.google.cloud.batch.v1alpha.JobStatus.Builder.class); + } + + /** + * + * + *
+   * Valid Job states.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.JobStatus.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** STATE_UNSPECIFIED = 0; */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Job is admitted (validated and persisted) and waiting for resources.
+     * 
+ * + * QUEUED = 1; + */ + QUEUED(1), + /** + * + * + *
+     * Job is scheduled to run as soon as resource allocation is ready.
+     * The resource allocation may happen at a later time but with a high
+     * chance to succeed.
+     * 
+ * + * SCHEDULED = 2; + */ + SCHEDULED(2), + /** + * + * + *
+     * Resource allocation has been successful. At least one Task in the Job is
+     * RUNNING.
+     * 
+ * + * RUNNING = 3; + */ + RUNNING(3), + /** + * + * + *
+     * All Tasks in the Job have finished successfully.
+     * 
+ * + * SUCCEEDED = 4; + */ + SUCCEEDED(4), + /** + * + * + *
+     * At least one Task in the Job has failed.
+     * 
+ * + * FAILED = 5; + */ + FAILED(5), + /** + * + * + *
+     * The Job will be deleted, but has not been deleted yet. Typically this is
+     * because resources used by the Job are still being cleaned up.
+     * 
+ * + * DELETION_IN_PROGRESS = 6; + */ + DELETION_IN_PROGRESS(6), + UNRECOGNIZED(-1), + ; + + /** STATE_UNSPECIFIED = 0; */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Job is admitted (validated and persisted) and waiting for resources.
+     * 
+ * + * QUEUED = 1; + */ + public static final int QUEUED_VALUE = 1; + /** + * + * + *
+     * Job is scheduled to run as soon as resource allocation is ready.
+     * The resource allocation may happen at a later time but with a high
+     * chance to succeed.
+     * 
+ * + * SCHEDULED = 2; + */ + public static final int SCHEDULED_VALUE = 2; + /** + * + * + *
+     * Resource allocation has been successful. At least one Task in the Job is
+     * RUNNING.
+     * 
+ * + * RUNNING = 3; + */ + public static final int RUNNING_VALUE = 3; + /** + * + * + *
+     * All Tasks in the Job have finished successfully.
+     * 
+ * + * SUCCEEDED = 4; + */ + public static final int SUCCEEDED_VALUE = 4; + /** + * + * + *
+     * At least one Task in the Job has failed.
+     * 
+ * + * FAILED = 5; + */ + public static final int FAILED_VALUE = 5; + /** + * + * + *
+     * The Job will be deleted, but has not been deleted yet. Typically this is
+     * because resources used by the Job are still being cleaned up.
+     * 
+ * + * DELETION_IN_PROGRESS = 6; + */ + public static final int DELETION_IN_PROGRESS_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return QUEUED; + case 2: + return SCHEDULED; + case 3: + return RUNNING; + case 4: + return SUCCEEDED; + case 5: + return FAILED; + case 6: + return DELETION_IN_PROGRESS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobStatus.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.JobStatus.State) + } + + public interface InstanceStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.JobStatus.InstanceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 1; + * + * @return The machineType. + */ + java.lang.String getMachineType(); + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 1; + * + * @return The bytes for machineType. + */ + com.google.protobuf.ByteString getMachineTypeBytes(); + + /** + * + * + *
+     * The VM instance provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + int getProvisioningModelValue(); + /** + * + * + *
+     * The VM instance provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The provisioningModel. + */ + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel getProvisioningModel(); + + /** + * + * + *
+     * The max number of tasks can be assigned to this instance type.
+     * 
+ * + * int64 task_pack = 3; + * + * @return The taskPack. + */ + long getTaskPack(); + } + /** + * + * + *
+   * VM instance status.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobStatus.InstanceStatus} + */ + public static final class InstanceStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.JobStatus.InstanceStatus) + InstanceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstanceStatus.newBuilder() to construct. + private InstanceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InstanceStatus() { + machineType_ = ""; + provisioningModel_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InstanceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InstanceStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + machineType_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + provisioningModel_ = rawValue; + break; + } + case 24: + { + taskPack_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.class, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder.class); + } + + public static final int MACHINE_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object machineType_; + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 1; + * + * @return The machineType. + */ + @java.lang.Override + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } + } + /** + * + * + *
+     * The Compute Engine machine type.
+     * 
+ * + * string machine_type = 1; + * + * @return The bytes for machineType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROVISIONING_MODEL_FIELD_NUMBER = 2; + private int provisioningModel_; + /** + * + * + *
+     * The VM instance provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + @java.lang.Override + public int getProvisioningModelValue() { + return provisioningModel_; + } + /** + * + * + *
+     * The VM instance provisioning model.
+     * 
+ * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel result = + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.valueOf( + provisioningModel_); + return result == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + + public static final int TASK_PACK_FIELD_NUMBER = 3; + private long taskPack_; + /** + * + * + *
+     * The max number of tasks can be assigned to this instance type.
+     * 
+ * + * int64 task_pack = 3; + * + * @return The taskPack. + */ + @java.lang.Override + public long getTaskPack() { + return taskPack_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, machineType_); + } + if (provisioningModel_ + != com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + .PROVISIONING_MODEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, provisioningModel_); + } + if (taskPack_ != 0L) { + output.writeInt64(3, taskPack_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, machineType_); + } + if (provisioningModel_ + != com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + .PROVISIONING_MODEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, provisioningModel_); + } + if (taskPack_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, taskPack_); + } + size += unknownFields.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.JobStatus.InstanceStatus)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus other = + (com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) obj; + + if (!getMachineType().equals(other.getMachineType())) return false; + if (provisioningModel_ != other.provisioningModel_) return false; + if (getTaskPack() != other.getTaskPack()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + MACHINE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMachineType().hashCode(); + hash = (37 * hash) + PROVISIONING_MODEL_FIELD_NUMBER; + hash = (53 * hash) + provisioningModel_; + hash = (37 * hash) + TASK_PACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTaskPack()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus 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.JobStatus.InstanceStatus 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; + } + /** + * + * + *
+     * VM instance status.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobStatus.InstanceStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.JobStatus.InstanceStatus) + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_InstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.class, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + machineType_ = ""; + + provisioningModel_ = 0; + + taskPack_ = 0L; + + 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_JobStatus_InstanceStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus build() { + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus buildPartial() { + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus result = + new com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(this); + result.machineType_ = machineType_; + result.provisioningModel_ = provisioningModel_; + result.taskPack_ = taskPack_; + onBuilt(); + return result; + } + + @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.JobStatus.InstanceStatus) { + return mergeFrom((com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus other) { + if (other == com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.getDefaultInstance()) + return this; + if (!other.getMachineType().isEmpty()) { + machineType_ = other.machineType_; + onChanged(); + } + if (other.provisioningModel_ != 0) { + setProvisioningModelValue(other.getProvisioningModelValue()); + } + if (other.getTaskPack() != 0L) { + setTaskPack(other.getTaskPack()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object machineType_ = ""; + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return The machineType. + */ + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return The bytes for machineType. + */ + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @param value The machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + machineType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearMachineType() { + + machineType_ = getDefaultInstance().getMachineType(); + onChanged(); + return this; + } + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @param value The bytes for machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + machineType_ = value; + onChanged(); + return this; + } + + private int provisioningModel_ = 0; + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + @java.lang.Override + public int getProvisioningModelValue() { + return provisioningModel_; + } + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @param value The enum numeric value on the wire for provisioningModel to set. + * @return This builder for chaining. + */ + public Builder setProvisioningModelValue(int value) { + + provisioningModel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel result = + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.valueOf( + provisioningModel_); + return result == null + ? com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @param value The provisioningModel to set. + * @return This builder for chaining. + */ + public Builder setProvisioningModel( + com.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel value) { + if (value == null) { + throw new NullPointerException(); + } + + provisioningModel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearProvisioningModel() { + + provisioningModel_ = 0; + onChanged(); + return this; + } + + private long taskPack_; + /** + * + * + *
+       * The max number of tasks can be assigned to this instance type.
+       * 
+ * + * int64 task_pack = 3; + * + * @return The taskPack. + */ + @java.lang.Override + public long getTaskPack() { + return taskPack_; + } + /** + * + * + *
+       * The max number of tasks can be assigned to this instance type.
+       * 
+ * + * int64 task_pack = 3; + * + * @param value The taskPack to set. + * @return This builder for chaining. + */ + public Builder setTaskPack(long value) { + + taskPack_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The max number of tasks can be assigned to this instance type.
+       * 
+ * + * int64 task_pack = 3; + * + * @return This builder for chaining. + */ + public Builder clearTaskPack() { + + taskPack_ = 0L; + 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.JobStatus.InstanceStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.JobStatus.InstanceStatus) + private static final com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstanceStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InstanceStatus(input, extensionRegistry); + } + }; + + 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.JobStatus.InstanceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TaskGroupStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + int getCountsCount(); + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + boolean containsCounts(java.lang.String key); + /** Use {@link #getCountsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getCounts(); + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + java.util.Map getCountsMap(); + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + long getCountsOrDefault(java.lang.String key, long defaultValue); + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + long getCountsOrThrow(java.lang.String key); + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + java.util.List getInstancesList(); + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus getInstances(int index); + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + int getInstancesCount(); + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder getInstancesOrBuilder( + int index); + } + /** + * + * + *
+   * Aggregated task status for a TaskGroup.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} + */ + public static final class TaskGroupStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) + TaskGroupStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use TaskGroupStatus.newBuilder() to construct. + private TaskGroupStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TaskGroupStatus() { + instances_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TaskGroupStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TaskGroupStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + counts_ = + com.google.protobuf.MapField.newMapField( + CountsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry counts__ = + input.readMessage( + CountsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + counts_.getMutableMap().put(counts__.getKey(), counts__.getValue()); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + instances_ = + new java.util.ArrayList< + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus>(); + mutable_bitField0_ |= 0x00000002; + } + instances_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetCounts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.class, + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.Builder.class); + } + + public static final int COUNTS_FIELD_NUMBER = 1; + + private static final class CountsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_CountsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT64, + 0L); + } + + private com.google.protobuf.MapField counts_; + + private com.google.protobuf.MapField internalGetCounts() { + if (counts_ == null) { + return com.google.protobuf.MapField.emptyMapField(CountsDefaultEntryHolder.defaultEntry); + } + return counts_; + } + + public int getCountsCount() { + return internalGetCounts().getMap().size(); + } + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public boolean containsCounts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCounts().getMap().containsKey(key); + } + /** Use {@link #getCountsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCounts() { + return getCountsMap(); + } + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public java.util.Map getCountsMap() { + return internalGetCounts().getMap(); + } + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public long getCountsOrDefault(java.lang.String key, long defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCounts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Count of task in each state in the TaskGroup.
+     * The map key is task state name.
+     * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public long getCountsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCounts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int INSTANCES_FIELD_NUMBER = 2; + private java.util.List instances_; + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public java.util.List + getInstancesList() { + return instances_; + } + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder> + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder getInstancesOrBuilder( + int index) { + return instances_.get(index); + } + + 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetCounts(), CountsDefaultEntryHolder.defaultEntry, 1); + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(2, instances_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetCounts().getMap().entrySet()) { + com.google.protobuf.MapEntry counts__ = + CountsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, counts__); + } + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instances_.get(i)); + } + size += unknownFields.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.JobStatus.TaskGroupStatus)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus other = + (com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) obj; + + if (!internalGetCounts().equals(other.internalGetCounts())) return false; + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetCounts().getMap().isEmpty()) { + hash = (37 * hash) + COUNTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetCounts().hashCode(); + } + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus 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.JobStatus.TaskGroupStatus 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; + } + /** + * + * + *
+     * Aggregated task status for a TaskGroup.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetCounts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableCounts(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.class, + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableCounts().clear(); + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + instancesBuilder_.clear(); + } + 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_JobStatus_TaskGroupStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus build() { + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus buildPartial() { + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus result = + new com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(this); + int from_bitField0_ = bitField0_; + result.counts_ = internalGetCounts(); + result.counts_.makeImmutable(); + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.JobStatus.TaskGroupStatus) { + return mergeFrom((com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus other) { + if (other == com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.getDefaultInstance()) + return this; + internalGetMutableCounts().mergeFrom(other.internalGetCounts()); + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000002); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField counts_; + + private com.google.protobuf.MapField internalGetCounts() { + if (counts_ == null) { + return com.google.protobuf.MapField.emptyMapField(CountsDefaultEntryHolder.defaultEntry); + } + return counts_; + } + + private com.google.protobuf.MapField + internalGetMutableCounts() { + onChanged(); + ; + if (counts_ == null) { + counts_ = com.google.protobuf.MapField.newMapField(CountsDefaultEntryHolder.defaultEntry); + } + if (!counts_.isMutable()) { + counts_ = counts_.copy(); + } + return counts_; + } + + public int getCountsCount() { + return internalGetCounts().getMap().size(); + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public boolean containsCounts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetCounts().getMap().containsKey(key); + } + /** Use {@link #getCountsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCounts() { + return getCountsMap(); + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public java.util.Map getCountsMap() { + return internalGetCounts().getMap(); + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public long getCountsOrDefault(java.lang.String key, long defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCounts().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + @java.lang.Override + public long getCountsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetCounts().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearCounts() { + internalGetMutableCounts().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + public Builder removeCounts(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableCounts().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableCounts() { + return internalGetMutableCounts().getMutableMap(); + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + public Builder putCounts(java.lang.String key, long value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableCounts().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * Count of task in each state in the TaskGroup.
+       * The map key is task state name.
+       * 
+ * + * map<string, int64> counts = 1; + */ + public Builder putAllCounts(java.util.Map values) { + internalGetMutableCounts().getMutableMap().putAll(values); + return this; + } + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + instances_ = + new java.util.ArrayList( + instances_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder> + instancesBuilder_; + + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public java.util.List + getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder setInstances( + int index, com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder setInstances( + int index, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances(com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances( + int index, com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances( + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances( + int index, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder addAllInstances( + java.lang.Iterable + values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder getInstancesBuilder( + int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder getInstancesOrBuilder( + int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public java.util.List< + ? extends com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder> + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder( + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.getDefaultInstance()); + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder addInstancesBuilder( + int index) { + return getInstancesFieldBuilder() + .addBuilder( + index, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.getDefaultInstance()); + } + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.cloud.batch.v1alpha.JobStatus.InstanceStatus instances = 2; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.Builder, + com.google.cloud.batch.v1alpha.JobStatus.InstanceStatusOrBuilder>( + instances_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + @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.JobStatus.TaskGroupStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) + private static final com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(); + } + + public static com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskGroupStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TaskGroupStatus(input, extensionRegistry); + } + }; + + 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.JobStatus.TaskGroupStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.JobStatus.State result = + com.google.cloud.batch.v1alpha.JobStatus.State.valueOf(state_); + return result == null ? com.google.cloud.batch.v1alpha.JobStatus.State.UNRECOGNIZED : result; + } + + public static final int STATUS_EVENTS_FIELD_NUMBER = 2; + private java.util.List statusEvents_; + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + @java.lang.Override + public java.util.List getStatusEventsList() { + return statusEvents_; + } + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + @java.lang.Override + public java.util.List + getStatusEventsOrBuilderList() { + return statusEvents_; + } + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + @java.lang.Override + public int getStatusEventsCount() { + return statusEvents_.size(); + } + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.StatusEvent getStatusEvents(int index) { + return statusEvents_.get(index); + } + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.StatusEventOrBuilder getStatusEventsOrBuilder(int index) { + return statusEvents_.get(index); + } + + public static final int TASK_GROUPS_FIELD_NUMBER = 4; + + private static final class TaskGroupsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_TaskGroupsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + .getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + taskGroups_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + internalGetTaskGroups() { + if (taskGroups_ == null) { + return com.google.protobuf.MapField.emptyMapField(TaskGroupsDefaultEntryHolder.defaultEntry); + } + return taskGroups_; + } + + public int getTaskGroupsCount() { + return internalGetTaskGroups().getMap().size(); + } + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public boolean containsTaskGroups(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTaskGroups().getMap().containsKey(key); + } + /** Use {@link #getTaskGroupsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getTaskGroups() { + return getTaskGroupsMap(); + } + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public java.util.Map + getTaskGroupsMap() { + return internalGetTaskGroups().getMap(); + } + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( + java.lang.String key, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetTaskGroups().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetTaskGroups().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RUN_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration runDuration_; + /** + * + * + *
+   * The duration of time that the Job spent in status RUNNING.
+   * 
+ * + * .google.protobuf.Duration run_duration = 5; + * + * @return Whether the runDuration field is set. + */ + @java.lang.Override + public boolean hasRunDuration() { + return runDuration_ != null; + } + /** + * + * + *
+   * The duration of time that the Job spent in status RUNNING.
+   * 
+ * + * .google.protobuf.Duration run_duration = 5; + * + * @return The runDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getRunDuration() { + return runDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : runDuration_; + } + /** + * + * + *
+   * The duration of time that the Job spent in status RUNNING.
+   * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder() { + return getRunDuration(); + } + + 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 (state_ != com.google.cloud.batch.v1alpha.JobStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + for (int i = 0; i < statusEvents_.size(); i++) { + output.writeMessage(2, statusEvents_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTaskGroups(), TaskGroupsDefaultEntryHolder.defaultEntry, 4); + if (runDuration_ != null) { + output.writeMessage(5, getRunDuration()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ != com.google.cloud.batch.v1alpha.JobStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + for (int i = 0; i < statusEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, statusEvents_.get(i)); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + entry : internalGetTaskGroups().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + taskGroups__ = + TaskGroupsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, taskGroups__); + } + if (runDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRunDuration()); + } + size += unknownFields.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.JobStatus)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.JobStatus other = (com.google.cloud.batch.v1alpha.JobStatus) obj; + + if (state_ != other.state_) return false; + if (!getStatusEventsList().equals(other.getStatusEventsList())) return false; + if (!internalGetTaskGroups().equals(other.internalGetTaskGroups())) return false; + if (hasRunDuration() != other.hasRunDuration()) return false; + if (hasRunDuration()) { + if (!getRunDuration().equals(other.getRunDuration())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (getStatusEventsCount() > 0) { + hash = (37 * hash) + STATUS_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getStatusEventsList().hashCode(); + } + if (!internalGetTaskGroups().getMap().isEmpty()) { + hash = (37 * hash) + TASK_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTaskGroups().hashCode(); + } + if (hasRunDuration()) { + hash = (37 * hash) + RUN_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getRunDuration().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.JobStatus parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus 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.JobStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus 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.JobStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.JobStatus 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.JobStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobStatus 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.JobStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.JobStatus 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.JobStatus 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.JobStatus 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.JobStatus 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; + } + /** + * + * + *
+   * Job status.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.JobStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.JobStatus) + com.google.cloud.batch.v1alpha.JobStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetTaskGroups(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableTaskGroups(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_JobStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.JobStatus.class, + com.google.cloud.batch.v1alpha.JobStatus.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.JobStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusEventsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + state_ = 0; + + if (statusEventsBuilder_ == null) { + statusEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + statusEventsBuilder_.clear(); + } + internalGetMutableTaskGroups().clear(); + if (runDurationBuilder_ == null) { + runDuration_ = null; + } else { + runDuration_ = null; + runDurationBuilder_ = null; + } + 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_JobStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.JobStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus build() { + com.google.cloud.batch.v1alpha.JobStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus buildPartial() { + com.google.cloud.batch.v1alpha.JobStatus result = + new com.google.cloud.batch.v1alpha.JobStatus(this); + int from_bitField0_ = bitField0_; + result.state_ = state_; + if (statusEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + statusEvents_ = java.util.Collections.unmodifiableList(statusEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.statusEvents_ = statusEvents_; + } else { + result.statusEvents_ = statusEventsBuilder_.build(); + } + result.taskGroups_ = internalGetTaskGroups(); + result.taskGroups_.makeImmutable(); + if (runDurationBuilder_ == null) { + result.runDuration_ = runDuration_; + } else { + result.runDuration_ = runDurationBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.JobStatus) { + return mergeFrom((com.google.cloud.batch.v1alpha.JobStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.JobStatus other) { + if (other == com.google.cloud.batch.v1alpha.JobStatus.getDefaultInstance()) return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (statusEventsBuilder_ == null) { + if (!other.statusEvents_.isEmpty()) { + if (statusEvents_.isEmpty()) { + statusEvents_ = other.statusEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStatusEventsIsMutable(); + statusEvents_.addAll(other.statusEvents_); + } + onChanged(); + } + } else { + if (!other.statusEvents_.isEmpty()) { + if (statusEventsBuilder_.isEmpty()) { + statusEventsBuilder_.dispose(); + statusEventsBuilder_ = null; + statusEvents_ = other.statusEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + statusEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStatusEventsFieldBuilder() + : null; + } else { + statusEventsBuilder_.addAllMessages(other.statusEvents_); + } + } + } + internalGetMutableTaskGroups().mergeFrom(other.internalGetTaskGroups()); + if (other.hasRunDuration()) { + mergeRunDuration(other.getRunDuration()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.JobStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.JobStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int state_ = 0; + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.JobStatus.State result = + com.google.cloud.batch.v1alpha.JobStatus.State.valueOf(state_); + return result == null ? com.google.cloud.batch.v1alpha.JobStatus.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.batch.v1alpha.JobStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.util.List statusEvents_ = + java.util.Collections.emptyList(); + + private void ensureStatusEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + statusEvents_ = + new java.util.ArrayList(statusEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.StatusEvent, + com.google.cloud.batch.v1alpha.StatusEvent.Builder, + com.google.cloud.batch.v1alpha.StatusEventOrBuilder> + statusEventsBuilder_; + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public java.util.List getStatusEventsList() { + if (statusEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(statusEvents_); + } else { + return statusEventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public int getStatusEventsCount() { + if (statusEventsBuilder_ == null) { + return statusEvents_.size(); + } else { + return statusEventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public com.google.cloud.batch.v1alpha.StatusEvent getStatusEvents(int index) { + if (statusEventsBuilder_ == null) { + return statusEvents_.get(index); + } else { + return statusEventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder setStatusEvents(int index, com.google.cloud.batch.v1alpha.StatusEvent value) { + if (statusEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatusEventsIsMutable(); + statusEvents_.set(index, value); + onChanged(); + } else { + statusEventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder setStatusEvents( + int index, com.google.cloud.batch.v1alpha.StatusEvent.Builder builderForValue) { + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + statusEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + statusEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder addStatusEvents(com.google.cloud.batch.v1alpha.StatusEvent value) { + if (statusEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatusEventsIsMutable(); + statusEvents_.add(value); + onChanged(); + } else { + statusEventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder addStatusEvents(int index, com.google.cloud.batch.v1alpha.StatusEvent value) { + if (statusEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatusEventsIsMutable(); + statusEvents_.add(index, value); + onChanged(); + } else { + statusEventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder addStatusEvents( + com.google.cloud.batch.v1alpha.StatusEvent.Builder builderForValue) { + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + statusEvents_.add(builderForValue.build()); + onChanged(); + } else { + statusEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder addStatusEvents( + int index, com.google.cloud.batch.v1alpha.StatusEvent.Builder builderForValue) { + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + statusEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + statusEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder addAllStatusEvents( + java.lang.Iterable values) { + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, statusEvents_); + onChanged(); + } else { + statusEventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder clearStatusEvents() { + if (statusEventsBuilder_ == null) { + statusEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + statusEventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public Builder removeStatusEvents(int index) { + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + statusEvents_.remove(index); + onChanged(); + } else { + statusEventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public com.google.cloud.batch.v1alpha.StatusEvent.Builder getStatusEventsBuilder(int index) { + return getStatusEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public com.google.cloud.batch.v1alpha.StatusEventOrBuilder getStatusEventsOrBuilder(int index) { + if (statusEventsBuilder_ == null) { + return statusEvents_.get(index); + } else { + return statusEventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public java.util.List + getStatusEventsOrBuilderList() { + if (statusEventsBuilder_ != null) { + return statusEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(statusEvents_); + } + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public com.google.cloud.batch.v1alpha.StatusEvent.Builder addStatusEventsBuilder() { + return getStatusEventsFieldBuilder() + .addBuilder(com.google.cloud.batch.v1alpha.StatusEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public com.google.cloud.batch.v1alpha.StatusEvent.Builder addStatusEventsBuilder(int index) { + return getStatusEventsFieldBuilder() + .addBuilder(index, com.google.cloud.batch.v1alpha.StatusEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + public java.util.List + getStatusEventsBuilderList() { + return getStatusEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.StatusEvent, + com.google.cloud.batch.v1alpha.StatusEvent.Builder, + com.google.cloud.batch.v1alpha.StatusEventOrBuilder> + getStatusEventsFieldBuilder() { + if (statusEventsBuilder_ == null) { + statusEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.StatusEvent, + com.google.cloud.batch.v1alpha.StatusEvent.Builder, + com.google.cloud.batch.v1alpha.StatusEventOrBuilder>( + statusEvents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + statusEvents_ = null; + } + return statusEventsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + taskGroups_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + internalGetTaskGroups() { + if (taskGroups_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TaskGroupsDefaultEntryHolder.defaultEntry); + } + return taskGroups_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> + internalGetMutableTaskGroups() { + onChanged(); + ; + if (taskGroups_ == null) { + taskGroups_ = + com.google.protobuf.MapField.newMapField(TaskGroupsDefaultEntryHolder.defaultEntry); + } + if (!taskGroups_.isMutable()) { + taskGroups_ = taskGroups_.copy(); + } + return taskGroups_; + } + + public int getTaskGroupsCount() { + return internalGetTaskGroups().getMap().size(); + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public boolean containsTaskGroups(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTaskGroups().getMap().containsKey(key); + } + /** Use {@link #getTaskGroupsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getTaskGroups() { + return getTaskGroupsMap(); + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public java.util.Map + getTaskGroupsMap() { + return internalGetTaskGroups().getMap(); + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( + java.lang.String key, + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetTaskGroups().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetTaskGroups().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTaskGroups() { + internalGetMutableTaskGroups().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + public Builder removeTaskGroups(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTaskGroups().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableTaskGroups() { + return internalGetMutableTaskGroups().getMutableMap(); + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + public Builder putTaskGroups( + java.lang.String key, com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableTaskGroups().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + public Builder putAllTaskGroups( + java.util.Map + values) { + internalGetMutableTaskGroups().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Duration runDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + runDurationBuilder_; + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + * + * @return Whether the runDuration field is set. + */ + public boolean hasRunDuration() { + return runDurationBuilder_ != null || runDuration_ != null; + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + * + * @return The runDuration. + */ + public com.google.protobuf.Duration getRunDuration() { + if (runDurationBuilder_ == null) { + return runDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : runDuration_; + } else { + return runDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public Builder setRunDuration(com.google.protobuf.Duration value) { + if (runDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runDuration_ = value; + onChanged(); + } else { + runDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public Builder setRunDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (runDurationBuilder_ == null) { + runDuration_ = builderForValue.build(); + onChanged(); + } else { + runDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public Builder mergeRunDuration(com.google.protobuf.Duration value) { + if (runDurationBuilder_ == null) { + if (runDuration_ != null) { + runDuration_ = + com.google.protobuf.Duration.newBuilder(runDuration_).mergeFrom(value).buildPartial(); + } else { + runDuration_ = value; + } + onChanged(); + } else { + runDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public Builder clearRunDuration() { + if (runDurationBuilder_ == null) { + runDuration_ = null; + onChanged(); + } else { + runDuration_ = null; + runDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public com.google.protobuf.Duration.Builder getRunDurationBuilder() { + + onChanged(); + return getRunDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder() { + if (runDurationBuilder_ != null) { + return runDurationBuilder_.getMessageOrBuilder(); + } else { + return runDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : runDuration_; + } + } + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRunDurationFieldBuilder() { + if (runDurationBuilder_ == null) { + runDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRunDuration(), getParentForChildren(), isClean()); + runDuration_ = null; + } + return runDurationBuilder_; + } + + @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.JobStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.JobStatus) + private static final com.google.cloud.batch.v1alpha.JobStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.JobStatus(); + } + + public static com.google.cloud.batch.v1alpha.JobStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new JobStatus(input, extensionRegistry); + } + }; + + 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.JobStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java new file mode 100644 index 0000000..8c62ba3 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/JobStatusOrBuilder.java @@ -0,0 +1,209 @@ +/* + * 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 JobStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.JobStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.cloud.batch.v1alpha.JobStatus.State state = 1; + * + * @return The state. + */ + com.google.cloud.batch.v1alpha.JobStatus.State getState(); + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + java.util.List getStatusEventsList(); + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + com.google.cloud.batch.v1alpha.StatusEvent getStatusEvents(int index); + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + int getStatusEventsCount(); + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + java.util.List + getStatusEventsOrBuilderList(); + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.StatusEvent status_events = 2; + */ + com.google.cloud.batch.v1alpha.StatusEventOrBuilder getStatusEventsOrBuilder(int index); + + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + int getTaskGroupsCount(); + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + boolean containsTaskGroups(java.lang.String key); + /** Use {@link #getTaskGroupsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getTaskGroups(); + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + java.util.Map + getTaskGroupsMap(); + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + + /* nullable */ + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus defaultValue); + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * map<string, .google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + com.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus getTaskGroupsOrThrow( + java.lang.String key); + + /** + * + * + *
+   * The duration of time that the Job spent in status RUNNING.
+   * 
+ * + * .google.protobuf.Duration run_duration = 5; + * + * @return Whether the runDuration field is set. + */ + boolean hasRunDuration(); + /** + * + * + *
+   * The duration of time that the Job spent in status RUNNING.
+   * 
+ * + * .google.protobuf.Duration run_duration = 5; + * + * @return The runDuration. + */ + com.google.protobuf.Duration getRunDuration(); + /** + * + * + *
+   * The duration of time that the Job spent in status RUNNING.
+   * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getRunDurationOrBuilder(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java new file mode 100644 index 0000000..380a0fa --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicy.java @@ -0,0 +1,1851 @@ +/* + * 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; + +/** + * + * + *
+ * LifecyclePolicy describes how to deal with task failures
+ * based on different conditions.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.LifecyclePolicy} + */ +public final class LifecyclePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.LifecyclePolicy) + LifecyclePolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use LifecyclePolicy.newBuilder() to construct. + private LifecyclePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LifecyclePolicy() { + action_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LifecyclePolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LifecyclePolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + case 18: + { + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder subBuilder = + null; + if (actionCondition_ != null) { + subBuilder = actionCondition_.toBuilder(); + } + actionCondition_ = + input.readMessage( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(actionCondition_); + actionCondition_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.LifecyclePolicy.class, + com.google.cloud.batch.v1alpha.LifecyclePolicy.Builder.class); + } + + /** + * + * + *
+   * Action on task failures based on different conditions.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.LifecyclePolicy.Action} + */ + public enum Action implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Action unspecified.
+     * 
+ * + * ACTION_UNSPECIFIED = 0; + */ + ACTION_UNSPECIFIED(0), + /** + * + * + *
+     * Action that tasks in the group will be scheduled to re-execute.
+     * 
+ * + * RETRY_TASK = 1; + */ + RETRY_TASK(1), + /** + * + * + *
+     * Action that tasks in the group will be stopped immediately.
+     * 
+ * + * FAIL_TASK = 2; + */ + FAIL_TASK(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Action unspecified.
+     * 
+ * + * ACTION_UNSPECIFIED = 0; + */ + public static final int ACTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Action that tasks in the group will be scheduled to re-execute.
+     * 
+ * + * RETRY_TASK = 1; + */ + public static final int RETRY_TASK_VALUE = 1; + /** + * + * + *
+     * Action that tasks in the group will be stopped immediately.
+     * 
+ * + * FAIL_TASK = 2; + */ + public static final int FAIL_TASK_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Action valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Action forNumber(int value) { + switch (value) { + case 0: + return ACTION_UNSPECIFIED; + case 1: + return RETRY_TASK; + case 2: + return FAIL_TASK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Action findValueByNumber(int number) { + return Action.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.LifecyclePolicy.getDescriptor().getEnumTypes().get(0); + } + + private static final Action[] VALUES = values(); + + public static Action valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Action(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.LifecyclePolicy.Action) + } + + public interface ActionConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Exit codes of a task execution.
+     * If there are more than 1 exit codes,
+     * when task executes with any of the exit code in the list,
+     * the condition is met and the action will be executed.
+     * 
+ * + * repeated int32 exit_codes = 1; + * + * @return A list containing the exitCodes. + */ + java.util.List getExitCodesList(); + /** + * + * + *
+     * Exit codes of a task execution.
+     * If there are more than 1 exit codes,
+     * when task executes with any of the exit code in the list,
+     * the condition is met and the action will be executed.
+     * 
+ * + * repeated int32 exit_codes = 1; + * + * @return The count of exitCodes. + */ + int getExitCodesCount(); + /** + * + * + *
+     * Exit codes of a task execution.
+     * If there are more than 1 exit codes,
+     * when task executes with any of the exit code in the list,
+     * the condition is met and the action will be executed.
+     * 
+ * + * repeated int32 exit_codes = 1; + * + * @param index The index of the element to return. + * @return The exitCodes at the given index. + */ + int getExitCodes(int index); + } + /** + * + * + *
+   * Conditions for actions to deal with task failures.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} + */ + public static final class ActionCondition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + ActionConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActionCondition.newBuilder() to construct. + private ActionCondition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ActionCondition() { + exitCodes_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ActionCondition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ActionCondition( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + exitCodes_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + exitCodes_.addInt(input.readInt32()); + break; + } + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + exitCodes_ = newIntList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + exitCodes_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + exitCodes_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_ActionCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_ActionCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.class, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder.class); + } + + public static final int EXIT_CODES_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.IntList exitCodes_; + /** + * + * + *
+     * Exit codes of a task execution.
+     * If there are more than 1 exit codes,
+     * when task executes with any of the exit code in the list,
+     * the condition is met and the action will be executed.
+     * 
+ * + * repeated int32 exit_codes = 1; + * + * @return A list containing the exitCodes. + */ + @java.lang.Override + public java.util.List getExitCodesList() { + return exitCodes_; + } + /** + * + * + *
+     * Exit codes of a task execution.
+     * If there are more than 1 exit codes,
+     * when task executes with any of the exit code in the list,
+     * the condition is met and the action will be executed.
+     * 
+ * + * repeated int32 exit_codes = 1; + * + * @return The count of exitCodes. + */ + public int getExitCodesCount() { + return exitCodes_.size(); + } + /** + * + * + *
+     * Exit codes of a task execution.
+     * If there are more than 1 exit codes,
+     * when task executes with any of the exit code in the list,
+     * the condition is met and the action will be executed.
+     * 
+ * + * repeated int32 exit_codes = 1; + * + * @param index The index of the element to return. + * @return The exitCodes at the given index. + */ + public int getExitCodes(int index) { + return exitCodes_.getInt(index); + } + + private int exitCodesMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getExitCodesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(exitCodesMemoizedSerializedSize); + } + for (int i = 0; i < exitCodes_.size(); i++) { + output.writeInt32NoTag(exitCodes_.getInt(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < exitCodes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(exitCodes_.getInt(i)); + } + size += dataSize; + if (!getExitCodesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + exitCodesMemoizedSerializedSize = dataSize; + } + size += unknownFields.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.LifecyclePolicy.ActionCondition)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition other = + (com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) obj; + + if (!getExitCodesList().equals(other.getExitCodesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExitCodesCount() > 0) { + hash = (37 * hash) + EXIT_CODES_FIELD_NUMBER; + hash = (53 * hash) + getExitCodesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition 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.LifecyclePolicy.ActionCondition 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; + } + /** + * + * + *
+     * Conditions for actions to deal with task failures.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_ActionCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_ActionCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.class, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + exitCodes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + 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_LifecyclePolicy_ActionCondition_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition build() { + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition buildPartial() { + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition result = + new com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + exitCodes_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.exitCodes_ = exitCodes_; + onBuilt(); + return result; + } + + @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.LifecyclePolicy.ActionCondition) { + return mergeFrom((com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition other) { + if (other + == com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.getDefaultInstance()) + return this; + if (!other.exitCodes_.isEmpty()) { + if (exitCodes_.isEmpty()) { + exitCodes_ = other.exitCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExitCodesIsMutable(); + exitCodes_.addAll(other.exitCodes_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.IntList exitCodes_ = emptyIntList(); + + private void ensureExitCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + exitCodes_ = mutableCopy(exitCodes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @return A list containing the exitCodes. + */ + public java.util.List getExitCodesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(exitCodes_) + : exitCodes_; + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @return The count of exitCodes. + */ + public int getExitCodesCount() { + return exitCodes_.size(); + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @param index The index of the element to return. + * @return The exitCodes at the given index. + */ + public int getExitCodes(int index) { + return exitCodes_.getInt(index); + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @param index The index to set the value at. + * @param value The exitCodes to set. + * @return This builder for chaining. + */ + public Builder setExitCodes(int index, int value) { + ensureExitCodesIsMutable(); + exitCodes_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @param value The exitCodes to add. + * @return This builder for chaining. + */ + public Builder addExitCodes(int value) { + ensureExitCodesIsMutable(); + exitCodes_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @param values The exitCodes to add. + * @return This builder for chaining. + */ + public Builder addAllExitCodes(java.lang.Iterable values) { + ensureExitCodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exitCodes_); + onChanged(); + return this; + } + /** + * + * + *
+       * Exit codes of a task execution.
+       * If there are more than 1 exit codes,
+       * when task executes with any of the exit code in the list,
+       * the condition is met and the action will be executed.
+       * 
+ * + * repeated int32 exit_codes = 1; + * + * @return This builder for chaining. + */ + public Builder clearExitCodes() { + exitCodes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + 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.LifecyclePolicy.ActionCondition) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + private static final com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActionCondition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ActionCondition(input, extensionRegistry); + } + }; + + 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.LifecyclePolicy.ActionCondition + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ACTION_FIELD_NUMBER = 1; + private int action_; + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return The action. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.Action getAction() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.LifecyclePolicy.Action result = + com.google.cloud.batch.v1alpha.LifecyclePolicy.Action.valueOf(action_); + return result == null + ? com.google.cloud.batch.v1alpha.LifecyclePolicy.Action.UNRECOGNIZED + : result; + } + + public static final int ACTION_CONDITION_FIELD_NUMBER = 2; + private com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition actionCondition_; + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + * @return Whether the actionCondition field is set. + */ + @java.lang.Override + public boolean hasActionCondition() { + return actionCondition_ != null; + } + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + * @return The actionCondition. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition getActionCondition() { + return actionCondition_ == null + ? com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder + getActionConditionOrBuilder() { + return getActionCondition(); + } + + 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 (action_ + != com.google.cloud.batch.v1alpha.LifecyclePolicy.Action.ACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(1, action_); + } + if (actionCondition_ != null) { + output.writeMessage(2, getActionCondition()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (action_ + != com.google.cloud.batch.v1alpha.LifecyclePolicy.Action.ACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, action_); + } + if (actionCondition_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getActionCondition()); + } + size += unknownFields.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.LifecyclePolicy)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.LifecyclePolicy other = + (com.google.cloud.batch.v1alpha.LifecyclePolicy) obj; + + if (action_ != other.action_) return false; + if (hasActionCondition() != other.hasActionCondition()) return false; + if (hasActionCondition()) { + if (!getActionCondition().equals(other.getActionCondition())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + if (hasActionCondition()) { + hash = (37 * hash) + ACTION_CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getActionCondition().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy 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.LifecyclePolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy 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.LifecyclePolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy 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.LifecyclePolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy 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.LifecyclePolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy 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.LifecyclePolicy 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.LifecyclePolicy 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.LifecyclePolicy 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; + } + /** + * + * + *
+   * LifecyclePolicy describes how to deal with task failures
+   * based on different conditions.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.LifecyclePolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.LifecyclePolicy) + com.google.cloud.batch.v1alpha.LifecyclePolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_LifecyclePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.LifecyclePolicy.class, + com.google.cloud.batch.v1alpha.LifecyclePolicy.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.LifecyclePolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + action_ = 0; + + if (actionConditionBuilder_ == null) { + actionCondition_ = null; + } else { + actionCondition_ = null; + actionConditionBuilder_ = null; + } + 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_LifecyclePolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.LifecyclePolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy build() { + com.google.cloud.batch.v1alpha.LifecyclePolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy buildPartial() { + com.google.cloud.batch.v1alpha.LifecyclePolicy result = + new com.google.cloud.batch.v1alpha.LifecyclePolicy(this); + result.action_ = action_; + if (actionConditionBuilder_ == null) { + result.actionCondition_ = actionCondition_; + } else { + result.actionCondition_ = actionConditionBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.LifecyclePolicy) { + return mergeFrom((com.google.cloud.batch.v1alpha.LifecyclePolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.LifecyclePolicy other) { + if (other == com.google.cloud.batch.v1alpha.LifecyclePolicy.getDefaultInstance()) return this; + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + if (other.hasActionCondition()) { + mergeActionCondition(other.getActionCondition()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.LifecyclePolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.LifecyclePolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int action_ = 0; + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return The action. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LifecyclePolicy.Action getAction() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.LifecyclePolicy.Action result = + com.google.cloud.batch.v1alpha.LifecyclePolicy.Action.valueOf(action_); + return result == null + ? com.google.cloud.batch.v1alpha.LifecyclePolicy.Action.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.cloud.batch.v1alpha.LifecyclePolicy.Action value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition actionCondition_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder> + actionConditionBuilder_; + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + * + * @return Whether the actionCondition field is set. + */ + public boolean hasActionCondition() { + return actionConditionBuilder_ != null || actionCondition_ != null; + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + * + * @return The actionCondition. + */ + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition getActionCondition() { + if (actionConditionBuilder_ == null) { + return actionCondition_ == null + ? com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } else { + return actionConditionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder setActionCondition( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition value) { + if (actionConditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + actionCondition_ = value; + onChanged(); + } else { + actionConditionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder setActionCondition( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder builderForValue) { + if (actionConditionBuilder_ == null) { + actionCondition_ = builderForValue.build(); + onChanged(); + } else { + actionConditionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder mergeActionCondition( + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition value) { + if (actionConditionBuilder_ == null) { + if (actionCondition_ != null) { + actionCondition_ = + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.newBuilder( + actionCondition_) + .mergeFrom(value) + .buildPartial(); + } else { + actionCondition_ = value; + } + onChanged(); + } else { + actionConditionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder clearActionCondition() { + if (actionConditionBuilder_ == null) { + actionCondition_ = null; + onChanged(); + } else { + actionCondition_ = null; + actionConditionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder + getActionConditionBuilder() { + + onChanged(); + return getActionConditionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder + getActionConditionOrBuilder() { + if (actionConditionBuilder_ != null) { + return actionConditionBuilder_.getMessageOrBuilder(); + } else { + return actionCondition_ == null + ? com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } + } + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder> + getActionConditionFieldBuilder() { + if (actionConditionBuilder_ == null) { + actionConditionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.Builder, + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder>( + getActionCondition(), getParentForChildren(), isClean()); + actionCondition_ = null; + } + return actionConditionBuilder_; + } + + @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.LifecyclePolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.LifecyclePolicy) + private static final com.google.cloud.batch.v1alpha.LifecyclePolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.LifecyclePolicy(); + } + + public static com.google.cloud.batch.v1alpha.LifecyclePolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LifecyclePolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LifecyclePolicy(input, extensionRegistry); + } + }; + + 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.LifecyclePolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java new file mode 100644 index 0000000..ec4f328 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LifecyclePolicyOrBuilder.java @@ -0,0 +1,86 @@ +/* + * 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 LifecyclePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.LifecyclePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.Action action = 1; + * + * @return The action. + */ + com.google.cloud.batch.v1alpha.LifecyclePolicy.Action getAction(); + + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + * @return Whether the actionCondition field is set. + */ + boolean hasActionCondition(); + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + * + * @return The actionCondition. + */ + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition getActionCondition(); + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition action_condition = 2; + */ + com.google.cloud.batch.v1alpha.LifecyclePolicy.ActionConditionOrBuilder + getActionConditionOrBuilder(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequest.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequest.java new file mode 100644 index 0000000..e3b2419 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequest.java @@ -0,0 +1,1084 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * ListJob Request.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListJobsRequest} + */ +public final class ListJobsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.ListJobsRequest) + ListJobsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListJobsRequest.newBuilder() to construct. + private ListJobsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListJobsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListJobsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListJobsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListJobsRequest.class, + com.google.cloud.batch.v1alpha.ListJobsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Parent path.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Parent path.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Page size.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + size += unknownFields.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.ListJobsRequest)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.ListJobsRequest other = + (com.google.cloud.batch.v1alpha.ListJobsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest 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.ListJobsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest 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.ListJobsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest 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.ListJobsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest 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.ListJobsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest 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.ListJobsRequest 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.ListJobsRequest 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.ListJobsRequest 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; + } + /** + * + * + *
+   * ListJob Request.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListJobsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.ListJobsRequest) + com.google.cloud.batch.v1alpha.ListJobsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListJobsRequest.class, + com.google.cloud.batch.v1alpha.ListJobsRequest.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.ListJobsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListJobsRequest getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.ListJobsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListJobsRequest build() { + com.google.cloud.batch.v1alpha.ListJobsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListJobsRequest buildPartial() { + com.google.cloud.batch.v1alpha.ListJobsRequest result = + new com.google.cloud.batch.v1alpha.ListJobsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @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.ListJobsRequest) { + return mergeFrom((com.google.cloud.batch.v1alpha.ListJobsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.ListJobsRequest other) { + if (other == com.google.cloud.batch.v1alpha.ListJobsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.ListJobsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.ListJobsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Parent path.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Parent path.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Parent path.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Parent path.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Parent path.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * List filter.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + 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.ListJobsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.ListJobsRequest) + private static final com.google.cloud.batch.v1alpha.ListJobsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.ListJobsRequest(); + } + + public static com.google.cloud.batch.v1alpha.ListJobsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListJobsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListJobsRequest(input, extensionRegistry); + } + }; + + 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.ListJobsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequestOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequestOrBuilder.java new file mode 100644 index 0000000..2b57adf --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface ListJobsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.ListJobsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Parent path.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Parent path.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * List filter.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Page size.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponse.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponse.java new file mode 100644 index 0000000..18551e5 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponse.java @@ -0,0 +1,1402 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * ListJob Response.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListJobsResponse} + */ +public final class ListJobsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.ListJobsResponse) + ListJobsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListJobsResponse.newBuilder() to construct. + private ListJobsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListJobsResponse() { + jobs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListJobsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListJobsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + jobs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + jobs_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.Job.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + jobs_ = java.util.Collections.unmodifiableList(jobs_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListJobsResponse.class, + com.google.cloud.batch.v1alpha.ListJobsResponse.Builder.class); + } + + public static final int JOBS_FIELD_NUMBER = 1; + private java.util.List jobs_; + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + @java.lang.Override + public java.util.List getJobsList() { + return jobs_; + } + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + @java.lang.Override + public java.util.List + getJobsOrBuilderList() { + return jobs_; + } + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + @java.lang.Override + public int getJobsCount() { + return jobs_.size(); + } + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Job getJobs(int index) { + return jobs_.get(index); + } + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.JobOrBuilder getJobsOrBuilder(int index) { + return jobs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + 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 { + for (int i = 0; i < jobs_.size(); i++) { + output.writeMessage(1, jobs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < jobs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, jobs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.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.ListJobsResponse)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.ListJobsResponse other = + (com.google.cloud.batch.v1alpha.ListJobsResponse) obj; + + if (!getJobsList().equals(other.getJobsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getJobsCount() > 0) { + hash = (37 * hash) + JOBS_FIELD_NUMBER; + hash = (53 * hash) + getJobsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse 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.ListJobsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse 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.ListJobsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse 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.ListJobsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse 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.ListJobsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse 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.ListJobsResponse 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.ListJobsResponse 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.ListJobsResponse 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; + } + /** + * + * + *
+   * ListJob Response.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListJobsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.ListJobsResponse) + com.google.cloud.batch.v1alpha.ListJobsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListJobsResponse.class, + com.google.cloud.batch.v1alpha.ListJobsResponse.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.ListJobsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getJobsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (jobsBuilder_ == null) { + jobs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + jobsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListJobsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListJobsResponse getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.ListJobsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListJobsResponse build() { + com.google.cloud.batch.v1alpha.ListJobsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListJobsResponse buildPartial() { + com.google.cloud.batch.v1alpha.ListJobsResponse result = + new com.google.cloud.batch.v1alpha.ListJobsResponse(this); + int from_bitField0_ = bitField0_; + if (jobsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + jobs_ = java.util.Collections.unmodifiableList(jobs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.jobs_ = jobs_; + } else { + result.jobs_ = jobsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @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.ListJobsResponse) { + return mergeFrom((com.google.cloud.batch.v1alpha.ListJobsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.ListJobsResponse other) { + if (other == com.google.cloud.batch.v1alpha.ListJobsResponse.getDefaultInstance()) + return this; + if (jobsBuilder_ == null) { + if (!other.jobs_.isEmpty()) { + if (jobs_.isEmpty()) { + jobs_ = other.jobs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureJobsIsMutable(); + jobs_.addAll(other.jobs_); + } + onChanged(); + } + } else { + if (!other.jobs_.isEmpty()) { + if (jobsBuilder_.isEmpty()) { + jobsBuilder_.dispose(); + jobsBuilder_ = null; + jobs_ = other.jobs_; + bitField0_ = (bitField0_ & ~0x00000001); + jobsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getJobsFieldBuilder() + : null; + } else { + jobsBuilder_.addAllMessages(other.jobs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.ListJobsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.ListJobsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List jobs_ = + java.util.Collections.emptyList(); + + private void ensureJobsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + jobs_ = new java.util.ArrayList(jobs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.Job, + com.google.cloud.batch.v1alpha.Job.Builder, + com.google.cloud.batch.v1alpha.JobOrBuilder> + jobsBuilder_; + + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public java.util.List getJobsList() { + if (jobsBuilder_ == null) { + return java.util.Collections.unmodifiableList(jobs_); + } else { + return jobsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public int getJobsCount() { + if (jobsBuilder_ == null) { + return jobs_.size(); + } else { + return jobsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public com.google.cloud.batch.v1alpha.Job getJobs(int index) { + if (jobsBuilder_ == null) { + return jobs_.get(index); + } else { + return jobsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder setJobs(int index, com.google.cloud.batch.v1alpha.Job value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.set(index, value); + onChanged(); + } else { + jobsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder setJobs(int index, com.google.cloud.batch.v1alpha.Job.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.set(index, builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder addJobs(com.google.cloud.batch.v1alpha.Job value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.add(value); + onChanged(); + } else { + jobsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder addJobs(int index, com.google.cloud.batch.v1alpha.Job value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.add(index, value); + onChanged(); + } else { + jobsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder addJobs(com.google.cloud.batch.v1alpha.Job.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder addJobs(int index, com.google.cloud.batch.v1alpha.Job.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(index, builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder addAllJobs( + java.lang.Iterable values) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, jobs_); + onChanged(); + } else { + jobsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder clearJobs() { + if (jobsBuilder_ == null) { + jobs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + jobsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public Builder removeJobs(int index) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.remove(index); + onChanged(); + } else { + jobsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public com.google.cloud.batch.v1alpha.Job.Builder getJobsBuilder(int index) { + return getJobsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public com.google.cloud.batch.v1alpha.JobOrBuilder getJobsOrBuilder(int index) { + if (jobsBuilder_ == null) { + return jobs_.get(index); + } else { + return jobsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public java.util.List + getJobsOrBuilderList() { + if (jobsBuilder_ != null) { + return jobsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(jobs_); + } + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public com.google.cloud.batch.v1alpha.Job.Builder addJobsBuilder() { + return getJobsFieldBuilder() + .addBuilder(com.google.cloud.batch.v1alpha.Job.getDefaultInstance()); + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public com.google.cloud.batch.v1alpha.Job.Builder addJobsBuilder(int index) { + return getJobsFieldBuilder() + .addBuilder(index, com.google.cloud.batch.v1alpha.Job.getDefaultInstance()); + } + /** + * + * + *
+     * Jobs.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + public java.util.List getJobsBuilderList() { + return getJobsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.Job, + com.google.cloud.batch.v1alpha.Job.Builder, + com.google.cloud.batch.v1alpha.JobOrBuilder> + getJobsFieldBuilder() { + if (jobsBuilder_ == null) { + jobsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.Job, + com.google.cloud.batch.v1alpha.Job.Builder, + com.google.cloud.batch.v1alpha.JobOrBuilder>( + jobs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + jobs_ = null; + } + return jobsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + 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.ListJobsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.ListJobsResponse) + private static final com.google.cloud.batch.v1alpha.ListJobsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.ListJobsResponse(); + } + + public static com.google.cloud.batch.v1alpha.ListJobsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListJobsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListJobsResponse(input, extensionRegistry); + } + }; + + 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.ListJobsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponseOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponseOrBuilder.java new file mode 100644 index 0000000..c121bf8 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListJobsResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface ListJobsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.ListJobsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + java.util.List getJobsList(); + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + com.google.cloud.batch.v1alpha.Job getJobs(int index); + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + int getJobsCount(); + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + java.util.List getJobsOrBuilderList(); + /** + * + * + *
+   * Jobs.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Job jobs = 1; + */ + com.google.cloud.batch.v1alpha.JobOrBuilder getJobsOrBuilder(int index); + + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequest.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequest.java new file mode 100644 index 0000000..66d8383 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequest.java @@ -0,0 +1,1127 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * ListTasks Request.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListTasksRequest} + */ +public final class ListTasksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.ListTasksRequest) + ListTasksRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTasksRequest.newBuilder() to construct. + private ListTasksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTasksRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTasksRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTasksRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListTasksRequest.class, + com.google.cloud.batch.v1alpha.ListTasksRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Task filter, null filter matches all Tasks.
+   * Filter string should be of the format State=TaskStatus.State e.g.
+   * State=RUNNING
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Task filter, null filter matches all Tasks.
+   * Filter string should be of the format State=TaskStatus.State e.g.
+   * State=RUNNING
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.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.ListTasksRequest)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.ListTasksRequest other = + (com.google.cloud.batch.v1alpha.ListTasksRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest 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.ListTasksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest 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.ListTasksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest 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.ListTasksRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest 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.ListTasksRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest 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.ListTasksRequest 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.ListTasksRequest 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.ListTasksRequest 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; + } + /** + * + * + *
+   * ListTasks Request.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListTasksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.ListTasksRequest) + com.google.cloud.batch.v1alpha.ListTasksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListTasksRequest.class, + com.google.cloud.batch.v1alpha.ListTasksRequest.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.ListTasksRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListTasksRequest getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.ListTasksRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListTasksRequest build() { + com.google.cloud.batch.v1alpha.ListTasksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListTasksRequest buildPartial() { + com.google.cloud.batch.v1alpha.ListTasksRequest result = + new com.google.cloud.batch.v1alpha.ListTasksRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @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.ListTasksRequest) { + return mergeFrom((com.google.cloud.batch.v1alpha.ListTasksRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.ListTasksRequest other) { + if (other == com.google.cloud.batch.v1alpha.ListTasksRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.ListTasksRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.ListTasksRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of a TaskGroup from which Tasks are being requested.
+     * Pattern:
+     * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Task filter, null filter matches all Tasks.
+     * Filter string should be of the format State=TaskStatus.State e.g.
+     * State=RUNNING
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Task filter, null filter matches all Tasks.
+     * Filter string should be of the format State=TaskStatus.State e.g.
+     * State=RUNNING
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Task filter, null filter matches all Tasks.
+     * Filter string should be of the format State=TaskStatus.State e.g.
+     * State=RUNNING
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Task filter, null filter matches all Tasks.
+     * Filter string should be of the format State=TaskStatus.State e.g.
+     * State=RUNNING
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Task filter, null filter matches all Tasks.
+     * Filter string should be of the format State=TaskStatus.State e.g.
+     * State=RUNNING
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page size.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + 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.ListTasksRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.ListTasksRequest) + private static final com.google.cloud.batch.v1alpha.ListTasksRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.ListTasksRequest(); + } + + public static com.google.cloud.batch.v1alpha.ListTasksRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTasksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTasksRequest(input, extensionRegistry); + } + }; + + 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.ListTasksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequestOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequestOrBuilder.java new file mode 100644 index 0000000..f113786 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface ListTasksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.ListTasksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of a TaskGroup from which Tasks are being requested.
+   * Pattern:
+   * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Task filter, null filter matches all Tasks.
+   * Filter string should be of the format State=TaskStatus.State e.g.
+   * State=RUNNING
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Task filter, null filter matches all Tasks.
+   * Filter string should be of the format State=TaskStatus.State e.g.
+   * State=RUNNING
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Page size.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponse.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponse.java new file mode 100644 index 0000000..3a62100 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponse.java @@ -0,0 +1,1404 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * ListTasks Response.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListTasksResponse} + */ +public final class ListTasksResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.ListTasksResponse) + ListTasksResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTasksResponse.newBuilder() to construct. + private ListTasksResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTasksResponse() { + tasks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTasksResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTasksResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tasks_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tasks_.add( + input.readMessage( + com.google.cloud.batch.v1alpha.Task.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tasks_ = java.util.Collections.unmodifiableList(tasks_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListTasksResponse.class, + com.google.cloud.batch.v1alpha.ListTasksResponse.Builder.class); + } + + public static final int TASKS_FIELD_NUMBER = 1; + private java.util.List tasks_; + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + @java.lang.Override + public java.util.List getTasksList() { + return tasks_; + } + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + @java.lang.Override + public java.util.List + getTasksOrBuilderList() { + return tasks_; + } + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + @java.lang.Override + public int getTasksCount() { + return tasks_.size(); + } + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.Task getTasks(int index) { + return tasks_.get(index); + } + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.TaskOrBuilder getTasksOrBuilder(int index) { + return tasks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + 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 { + for (int i = 0; i < tasks_.size(); i++) { + output.writeMessage(1, tasks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tasks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tasks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.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.ListTasksResponse)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.ListTasksResponse other = + (com.google.cloud.batch.v1alpha.ListTasksResponse) obj; + + if (!getTasksList().equals(other.getTasksList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTasksCount() > 0) { + hash = (37 * hash) + TASKS_FIELD_NUMBER; + hash = (53 * hash) + getTasksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse 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.ListTasksResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse 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.ListTasksResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse 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.ListTasksResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse 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.ListTasksResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse 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.ListTasksResponse 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.ListTasksResponse 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.ListTasksResponse 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; + } + /** + * + * + *
+   * ListTasks Response.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.ListTasksResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.ListTasksResponse) + com.google.cloud.batch.v1alpha.ListTasksResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.ListTasksResponse.class, + com.google.cloud.batch.v1alpha.ListTasksResponse.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.ListTasksResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTasksFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tasksBuilder_ == null) { + tasks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tasksBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_ListTasksResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListTasksResponse getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.ListTasksResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListTasksResponse build() { + com.google.cloud.batch.v1alpha.ListTasksResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.ListTasksResponse buildPartial() { + com.google.cloud.batch.v1alpha.ListTasksResponse result = + new com.google.cloud.batch.v1alpha.ListTasksResponse(this); + int from_bitField0_ = bitField0_; + if (tasksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tasks_ = java.util.Collections.unmodifiableList(tasks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tasks_ = tasks_; + } else { + result.tasks_ = tasksBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @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.ListTasksResponse) { + return mergeFrom((com.google.cloud.batch.v1alpha.ListTasksResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.ListTasksResponse other) { + if (other == com.google.cloud.batch.v1alpha.ListTasksResponse.getDefaultInstance()) + return this; + if (tasksBuilder_ == null) { + if (!other.tasks_.isEmpty()) { + if (tasks_.isEmpty()) { + tasks_ = other.tasks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTasksIsMutable(); + tasks_.addAll(other.tasks_); + } + onChanged(); + } + } else { + if (!other.tasks_.isEmpty()) { + if (tasksBuilder_.isEmpty()) { + tasksBuilder_.dispose(); + tasksBuilder_ = null; + tasks_ = other.tasks_; + bitField0_ = (bitField0_ & ~0x00000001); + tasksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTasksFieldBuilder() + : null; + } else { + tasksBuilder_.addAllMessages(other.tasks_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.ListTasksResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.ListTasksResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List tasks_ = + java.util.Collections.emptyList(); + + private void ensureTasksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tasks_ = new java.util.ArrayList(tasks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.Task, + com.google.cloud.batch.v1alpha.Task.Builder, + com.google.cloud.batch.v1alpha.TaskOrBuilder> + tasksBuilder_; + + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public java.util.List getTasksList() { + if (tasksBuilder_ == null) { + return java.util.Collections.unmodifiableList(tasks_); + } else { + return tasksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public int getTasksCount() { + if (tasksBuilder_ == null) { + return tasks_.size(); + } else { + return tasksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public com.google.cloud.batch.v1alpha.Task getTasks(int index) { + if (tasksBuilder_ == null) { + return tasks_.get(index); + } else { + return tasksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder setTasks(int index, com.google.cloud.batch.v1alpha.Task value) { + if (tasksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTasksIsMutable(); + tasks_.set(index, value); + onChanged(); + } else { + tasksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder setTasks( + int index, com.google.cloud.batch.v1alpha.Task.Builder builderForValue) { + if (tasksBuilder_ == null) { + ensureTasksIsMutable(); + tasks_.set(index, builderForValue.build()); + onChanged(); + } else { + tasksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder addTasks(com.google.cloud.batch.v1alpha.Task value) { + if (tasksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTasksIsMutable(); + tasks_.add(value); + onChanged(); + } else { + tasksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder addTasks(int index, com.google.cloud.batch.v1alpha.Task value) { + if (tasksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTasksIsMutable(); + tasks_.add(index, value); + onChanged(); + } else { + tasksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder addTasks(com.google.cloud.batch.v1alpha.Task.Builder builderForValue) { + if (tasksBuilder_ == null) { + ensureTasksIsMutable(); + tasks_.add(builderForValue.build()); + onChanged(); + } else { + tasksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder addTasks( + int index, com.google.cloud.batch.v1alpha.Task.Builder builderForValue) { + if (tasksBuilder_ == null) { + ensureTasksIsMutable(); + tasks_.add(index, builderForValue.build()); + onChanged(); + } else { + tasksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder addAllTasks( + java.lang.Iterable values) { + if (tasksBuilder_ == null) { + ensureTasksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tasks_); + onChanged(); + } else { + tasksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder clearTasks() { + if (tasksBuilder_ == null) { + tasks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tasksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public Builder removeTasks(int index) { + if (tasksBuilder_ == null) { + ensureTasksIsMutable(); + tasks_.remove(index); + onChanged(); + } else { + tasksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public com.google.cloud.batch.v1alpha.Task.Builder getTasksBuilder(int index) { + return getTasksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public com.google.cloud.batch.v1alpha.TaskOrBuilder getTasksOrBuilder(int index) { + if (tasksBuilder_ == null) { + return tasks_.get(index); + } else { + return tasksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public java.util.List + getTasksOrBuilderList() { + if (tasksBuilder_ != null) { + return tasksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tasks_); + } + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public com.google.cloud.batch.v1alpha.Task.Builder addTasksBuilder() { + return getTasksFieldBuilder() + .addBuilder(com.google.cloud.batch.v1alpha.Task.getDefaultInstance()); + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public com.google.cloud.batch.v1alpha.Task.Builder addTasksBuilder(int index) { + return getTasksFieldBuilder() + .addBuilder(index, com.google.cloud.batch.v1alpha.Task.getDefaultInstance()); + } + /** + * + * + *
+     * Tasks.
+     * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + public java.util.List getTasksBuilderList() { + return getTasksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.Task, + com.google.cloud.batch.v1alpha.Task.Builder, + com.google.cloud.batch.v1alpha.TaskOrBuilder> + getTasksFieldBuilder() { + if (tasksBuilder_ == null) { + tasksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.batch.v1alpha.Task, + com.google.cloud.batch.v1alpha.Task.Builder, + com.google.cloud.batch.v1alpha.TaskOrBuilder>( + tasks_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tasks_ = null; + } + return tasksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + 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.ListTasksResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.ListTasksResponse) + private static final com.google.cloud.batch.v1alpha.ListTasksResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.ListTasksResponse(); + } + + public static com.google.cloud.batch.v1alpha.ListTasksResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTasksResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTasksResponse(input, extensionRegistry); + } + }; + + 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.ListTasksResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponseOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponseOrBuilder.java new file mode 100644 index 0000000..451e97f --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/ListTasksResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface ListTasksResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.ListTasksResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + java.util.List getTasksList(); + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + com.google.cloud.batch.v1alpha.Task getTasks(int index); + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + int getTasksCount(); + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + java.util.List getTasksOrBuilderList(); + /** + * + * + *
+   * Tasks.
+   * 
+ * + * repeated .google.cloud.batch.v1alpha.Task tasks = 1; + */ + com.google.cloud.batch.v1alpha.TaskOrBuilder getTasksOrBuilder(int index); + + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LocationName.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LocationName.java new file mode 100644 index 0000000..049ed58 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicy.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicy.java new file mode 100644 index 0000000..53e55bd --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicy.java @@ -0,0 +1,967 @@ +/* + * 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; + +/** + * + * + *
+ * LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
+ * preserved.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.LogsPolicy} + */ +public final class LogsPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.LogsPolicy) + LogsPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use LogsPolicy.newBuilder() to construct. + private LogsPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogsPolicy() { + destination_ = 0; + logsPath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogsPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LogsPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + destination_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + logsPath_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_LogsPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_LogsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.LogsPolicy.class, + com.google.cloud.batch.v1alpha.LogsPolicy.Builder.class); + } + + /** + * + * + *
+   * The destination (if any) for logs.
+   * 
+ * + * Protobuf enum {@code google.cloud.batch.v1alpha.LogsPolicy.Destination} + */ + public enum Destination implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Logs are not preserved.
+     * 
+ * + * DESTINATION_UNSPECIFIED = 0; + */ + DESTINATION_UNSPECIFIED(0), + /** + * + * + *
+     * Logs are streamed to Cloud Logging.
+     * 
+ * + * CLOUD_LOGGING = 1; + */ + CLOUD_LOGGING(1), + /** + * + * + *
+     * Logs are saved to a file path.
+     * 
+ * + * PATH = 2; + */ + PATH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Logs are not preserved.
+     * 
+ * + * DESTINATION_UNSPECIFIED = 0; + */ + public static final int DESTINATION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Logs are streamed to Cloud Logging.
+     * 
+ * + * CLOUD_LOGGING = 1; + */ + public static final int CLOUD_LOGGING_VALUE = 1; + /** + * + * + *
+     * Logs are saved to a file path.
+     * 
+ * + * PATH = 2; + */ + public static final int PATH_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Destination valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Destination forNumber(int value) { + switch (value) { + case 0: + return DESTINATION_UNSPECIFIED; + case 1: + return CLOUD_LOGGING; + case 2: + return PATH; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Destination findValueByNumber(int number) { + return Destination.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.LogsPolicy.getDescriptor().getEnumTypes().get(0); + } + + private static final Destination[] VALUES = values(); + + public static Destination valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Destination(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.batch.v1alpha.LogsPolicy.Destination) + } + + public static final int DESTINATION_FIELD_NUMBER = 1; + private int destination_; + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + @java.lang.Override + public int getDestinationValue() { + return destination_; + } + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicy.Destination getDestination() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.LogsPolicy.Destination result = + com.google.cloud.batch.v1alpha.LogsPolicy.Destination.valueOf(destination_); + return result == null + ? com.google.cloud.batch.v1alpha.LogsPolicy.Destination.UNRECOGNIZED + : result; + } + + public static final int LOGS_PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object logsPath_; + /** + * + * + *
+   * The path to which logs are saved when the destination = PATH. This can be a
+   * local file path on the VM, or under the mount point of a Persistent Disk or
+   * Filestore, or a Cloud Storage path.
+   * 
+ * + * string logs_path = 2; + * + * @return The logsPath. + */ + @java.lang.Override + public java.lang.String getLogsPath() { + java.lang.Object ref = logsPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logsPath_ = s; + return s; + } + } + /** + * + * + *
+   * The path to which logs are saved when the destination = PATH. This can be a
+   * local file path on the VM, or under the mount point of a Persistent Disk or
+   * Filestore, or a Cloud Storage path.
+   * 
+ * + * string logs_path = 2; + * + * @return The bytes for logsPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogsPathBytes() { + java.lang.Object ref = logsPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logsPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (destination_ + != com.google.cloud.batch.v1alpha.LogsPolicy.Destination.DESTINATION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logsPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logsPath_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destination_ + != com.google.cloud.batch.v1alpha.LogsPolicy.Destination.DESTINATION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logsPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logsPath_); + } + size += unknownFields.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.LogsPolicy)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.LogsPolicy other = + (com.google.cloud.batch.v1alpha.LogsPolicy) obj; + + if (destination_ != other.destination_) return false; + if (!getLogsPath().equals(other.getLogsPath())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + destination_; + hash = (37 * hash) + LOGS_PATH_FIELD_NUMBER; + hash = (53 * hash) + getLogsPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy 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.LogsPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy 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.LogsPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy 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.LogsPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy 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.LogsPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy 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.LogsPolicy 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.LogsPolicy 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.LogsPolicy 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; + } + /** + * + * + *
+   * LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
+   * preserved.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.LogsPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.LogsPolicy) + com.google.cloud.batch.v1alpha.LogsPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_LogsPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.JobProto + .internal_static_google_cloud_batch_v1alpha_LogsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.LogsPolicy.class, + com.google.cloud.batch.v1alpha.LogsPolicy.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.LogsPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + destination_ = 0; + + logsPath_ = ""; + + 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_LogsPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicy getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.LogsPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicy build() { + com.google.cloud.batch.v1alpha.LogsPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicy buildPartial() { + com.google.cloud.batch.v1alpha.LogsPolicy result = + new com.google.cloud.batch.v1alpha.LogsPolicy(this); + result.destination_ = destination_; + result.logsPath_ = logsPath_; + onBuilt(); + return result; + } + + @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.LogsPolicy) { + return mergeFrom((com.google.cloud.batch.v1alpha.LogsPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.LogsPolicy other) { + if (other == com.google.cloud.batch.v1alpha.LogsPolicy.getDefaultInstance()) return this; + if (other.destination_ != 0) { + setDestinationValue(other.getDestinationValue()); + } + if (!other.getLogsPath().isEmpty()) { + logsPath_ = other.logsPath_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.LogsPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.LogsPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destination_ = 0; + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + @java.lang.Override + public int getDestinationValue() { + return destination_; + } + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @param value The enum numeric value on the wire for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationValue(int value) { + + destination_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public com.google.cloud.batch.v1alpha.LogsPolicy.Destination getDestination() { + @SuppressWarnings("deprecation") + com.google.cloud.batch.v1alpha.LogsPolicy.Destination result = + com.google.cloud.batch.v1alpha.LogsPolicy.Destination.valueOf(destination_); + return result == null + ? com.google.cloud.batch.v1alpha.LogsPolicy.Destination.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(com.google.cloud.batch.v1alpha.LogsPolicy.Destination value) { + if (value == null) { + throw new NullPointerException(); + } + + destination_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + + destination_ = 0; + onChanged(); + return this; + } + + private java.lang.Object logsPath_ = ""; + /** + * + * + *
+     * The path to which logs are saved when the destination = PATH. This can be a
+     * local file path on the VM, or under the mount point of a Persistent Disk or
+     * Filestore, or a Cloud Storage path.
+     * 
+ * + * string logs_path = 2; + * + * @return The logsPath. + */ + public java.lang.String getLogsPath() { + java.lang.Object ref = logsPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logsPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path to which logs are saved when the destination = PATH. This can be a
+     * local file path on the VM, or under the mount point of a Persistent Disk or
+     * Filestore, or a Cloud Storage path.
+     * 
+ * + * string logs_path = 2; + * + * @return The bytes for logsPath. + */ + public com.google.protobuf.ByteString getLogsPathBytes() { + java.lang.Object ref = logsPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logsPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path to which logs are saved when the destination = PATH. This can be a
+     * local file path on the VM, or under the mount point of a Persistent Disk or
+     * Filestore, or a Cloud Storage path.
+     * 
+ * + * string logs_path = 2; + * + * @param value The logsPath to set. + * @return This builder for chaining. + */ + public Builder setLogsPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + logsPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The path to which logs are saved when the destination = PATH. This can be a
+     * local file path on the VM, or under the mount point of a Persistent Disk or
+     * Filestore, or a Cloud Storage path.
+     * 
+ * + * string logs_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearLogsPath() { + + logsPath_ = getDefaultInstance().getLogsPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * The path to which logs are saved when the destination = PATH. This can be a
+     * local file path on the VM, or under the mount point of a Persistent Disk or
+     * Filestore, or a Cloud Storage path.
+     * 
+ * + * string logs_path = 2; + * + * @param value The bytes for logsPath to set. + * @return This builder for chaining. + */ + public Builder setLogsPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + logsPath_ = value; + 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.LogsPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.LogsPolicy) + private static final com.google.cloud.batch.v1alpha.LogsPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.LogsPolicy(); + } + + public static com.google.cloud.batch.v1alpha.LogsPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogsPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogsPolicy(input, extensionRegistry); + } + }; + + 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.LogsPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicyOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicyOrBuilder.java new file mode 100644 index 0000000..1515001 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/LogsPolicyOrBuilder.java @@ -0,0 +1,79 @@ +/* + * 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 LogsPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.LogsPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + int getDestinationValue(); + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.cloud.batch.v1alpha.LogsPolicy.Destination destination = 1; + * + * @return The destination. + */ + com.google.cloud.batch.v1alpha.LogsPolicy.Destination getDestination(); + + /** + * + * + *
+   * The path to which logs are saved when the destination = PATH. This can be a
+   * local file path on the VM, or under the mount point of a Persistent Disk or
+   * Filestore, or a Cloud Storage path.
+   * 
+ * + * string logs_path = 2; + * + * @return The logsPath. + */ + java.lang.String getLogsPath(); + /** + * + * + *
+   * The path to which logs are saved when the destination = PATH. This can be a
+   * local file path on the VM, or under the mount point of a Persistent Disk or
+   * Filestore, or a Cloud Storage path.
+   * 
+ * + * string logs_path = 2; + * + * @return The bytes for logsPath. + */ + com.google.protobuf.ByteString getLogsPathBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFS.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFS.java new file mode 100644 index 0000000..70da43d --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFS.java @@ -0,0 +1,812 @@ +/* + * 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/volume.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * Represents an NFS server and remote path: <server>:<remote_path>
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.NFS} + */ +public final class NFS extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.NFS) + NFSOrBuilder { + private static final long serialVersionUID = 0L; + // Use NFS.newBuilder() to construct. + private NFS(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NFS() { + server_ = ""; + remotePath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NFS(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NFS( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + server_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + remotePath_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_NFS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_NFS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.NFS.class, + com.google.cloud.batch.v1alpha.NFS.Builder.class); + } + + public static final int SERVER_FIELD_NUMBER = 1; + private volatile java.lang.Object server_; + /** + * + * + *
+   * URI of the NFS server, e.g. an IP address.
+   * 
+ * + * string server = 1; + * + * @return The server. + */ + @java.lang.Override + public java.lang.String getServer() { + java.lang.Object ref = server_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + server_ = s; + return s; + } + } + /** + * + * + *
+   * URI of the NFS server, e.g. an IP address.
+   * 
+ * + * string server = 1; + * + * @return The bytes for server. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerBytes() { + java.lang.Object ref = server_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + server_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMOTE_PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object remotePath_; + /** + * + * + *
+   * Remote source path exported from NFS, e.g., "/share".
+   * 
+ * + * string remote_path = 2; + * + * @return The remotePath. + */ + @java.lang.Override + public java.lang.String getRemotePath() { + java.lang.Object ref = remotePath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remotePath_ = s; + return s; + } + } + /** + * + * + *
+   * Remote source path exported from NFS, e.g., "/share".
+   * 
+ * + * string remote_path = 2; + * + * @return The bytes for remotePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRemotePathBytes() { + java.lang.Object ref = remotePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remotePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(server_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, server_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remotePath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, remotePath_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(server_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, server_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remotePath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, remotePath_); + } + size += unknownFields.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.NFS)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.NFS other = (com.google.cloud.batch.v1alpha.NFS) obj; + + if (!getServer().equals(other.getServer())) return false; + if (!getRemotePath().equals(other.getRemotePath())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + SERVER_FIELD_NUMBER; + hash = (53 * hash) + getServer().hashCode(); + hash = (37 * hash) + REMOTE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRemotePath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.NFS parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.NFS 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.NFS parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.NFS 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.NFS parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.NFS 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.NFS parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.NFS 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.NFS parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.NFS 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.NFS 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.NFS 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.NFS 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; + } + /** + * + * + *
+   * Represents an NFS server and remote path: <server>:<remote_path>
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.NFS} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.NFS) + com.google.cloud.batch.v1alpha.NFSOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_NFS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_NFS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.NFS.class, + com.google.cloud.batch.v1alpha.NFS.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.NFS.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + server_ = ""; + + remotePath_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_NFS_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.NFS getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.NFS.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.NFS build() { + com.google.cloud.batch.v1alpha.NFS result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.NFS buildPartial() { + com.google.cloud.batch.v1alpha.NFS result = new com.google.cloud.batch.v1alpha.NFS(this); + result.server_ = server_; + result.remotePath_ = remotePath_; + onBuilt(); + return result; + } + + @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.NFS) { + return mergeFrom((com.google.cloud.batch.v1alpha.NFS) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.NFS other) { + if (other == com.google.cloud.batch.v1alpha.NFS.getDefaultInstance()) return this; + if (!other.getServer().isEmpty()) { + server_ = other.server_; + onChanged(); + } + if (!other.getRemotePath().isEmpty()) { + remotePath_ = other.remotePath_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.NFS parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.NFS) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object server_ = ""; + /** + * + * + *
+     * URI of the NFS server, e.g. an IP address.
+     * 
+ * + * string server = 1; + * + * @return The server. + */ + public java.lang.String getServer() { + java.lang.Object ref = server_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + server_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URI of the NFS server, e.g. an IP address.
+     * 
+ * + * string server = 1; + * + * @return The bytes for server. + */ + public com.google.protobuf.ByteString getServerBytes() { + java.lang.Object ref = server_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + server_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URI of the NFS server, e.g. an IP address.
+     * 
+ * + * string server = 1; + * + * @param value The server to set. + * @return This builder for chaining. + */ + public Builder setServer(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + server_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * URI of the NFS server, e.g. an IP address.
+     * 
+ * + * string server = 1; + * + * @return This builder for chaining. + */ + public Builder clearServer() { + + server_ = getDefaultInstance().getServer(); + onChanged(); + return this; + } + /** + * + * + *
+     * URI of the NFS server, e.g. an IP address.
+     * 
+ * + * string server = 1; + * + * @param value The bytes for server to set. + * @return This builder for chaining. + */ + public Builder setServerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + server_ = value; + onChanged(); + return this; + } + + private java.lang.Object remotePath_ = ""; + /** + * + * + *
+     * Remote source path exported from NFS, e.g., "/share".
+     * 
+ * + * string remote_path = 2; + * + * @return The remotePath. + */ + public java.lang.String getRemotePath() { + java.lang.Object ref = remotePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remotePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Remote source path exported from NFS, e.g., "/share".
+     * 
+ * + * string remote_path = 2; + * + * @return The bytes for remotePath. + */ + public com.google.protobuf.ByteString getRemotePathBytes() { + java.lang.Object ref = remotePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remotePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Remote source path exported from NFS, e.g., "/share".
+     * 
+ * + * string remote_path = 2; + * + * @param value The remotePath to set. + * @return This builder for chaining. + */ + public Builder setRemotePath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remotePath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Remote source path exported from NFS, e.g., "/share".
+     * 
+ * + * string remote_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearRemotePath() { + + remotePath_ = getDefaultInstance().getRemotePath(); + onChanged(); + return this; + } + /** + * + * + *
+     * Remote source path exported from NFS, e.g., "/share".
+     * 
+ * + * string remote_path = 2; + * + * @param value The bytes for remotePath to set. + * @return This builder for chaining. + */ + public Builder setRemotePathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remotePath_ = value; + 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.NFS) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.NFS) + private static final com.google.cloud.batch.v1alpha.NFS DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.NFS(); + } + + public static com.google.cloud.batch.v1alpha.NFS getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NFS parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NFS(input, extensionRegistry); + } + }; + + 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.NFS getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFSOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFSOrBuilder.java new file mode 100644 index 0000000..882376c --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/NFSOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/volume.proto + +package com.google.cloud.batch.v1alpha; + +public interface NFSOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.NFS) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * URI of the NFS server, e.g. an IP address.
+   * 
+ * + * string server = 1; + * + * @return The server. + */ + java.lang.String getServer(); + /** + * + * + *
+   * URI of the NFS server, e.g. an IP address.
+   * 
+ * + * string server = 1; + * + * @return The bytes for server. + */ + com.google.protobuf.ByteString getServerBytes(); + + /** + * + * + *
+   * Remote source path exported from NFS, e.g., "/share".
+   * 
+ * + * string remote_path = 2; + * + * @return The remotePath. + */ + java.lang.String getRemotePath(); + /** + * + * + *
+   * Remote source path exported from NFS, e.g., "/share".
+   * 
+ * + * string remote_path = 2; + * + * @return The bytes for remotePath. + */ + com.google.protobuf.ByteString getRemotePathBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadata.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadata.java new file mode 100644 index 0000000..f1d37a8 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadata.java @@ -0,0 +1,1849 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 48: + { + requestedCancellation_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.OperationMetadata.class, + com.google.cloud.batch.v1alpha.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.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.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.OperationMetadata other = + (com.google.cloud.batch.v1alpha.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata 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.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata 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.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata 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.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata 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.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata 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.OperationMetadata 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.OperationMetadata 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.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.OperationMetadata) + com.google.cloud.batch.v1alpha.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.OperationMetadata.class, + com.google.cloud.batch.v1alpha.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusMessage_ = ""; + + requestedCancellation_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.BatchProto + .internal_static_google_cloud_batch_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.OperationMetadata build() { + com.google.cloud.batch.v1alpha.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.OperationMetadata buildPartial() { + com.google.cloud.batch.v1alpha.OperationMetadata result = + new com.google.cloud.batch.v1alpha.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusMessage_ = statusMessage_; + result.requestedCancellation_ = requestedCancellation_; + result.apiVersion_ = apiVersion_; + onBuilt(); + return result; + } + + @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.OperationMetadata) { + return mergeFrom((com.google.cloud.batch.v1alpha.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.OperationMetadata other) { + if (other == com.google.cloud.batch.v1alpha.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + 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.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.OperationMetadata) + private static final com.google.cloud.batch.v1alpha.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.OperationMetadata(); + } + + public static com.google.cloud.batch.v1alpha.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + 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.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadataOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadataOrBuilder.java new file mode 100644 index 0000000..30ec6ff --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/OperationMetadataOrBuilder.java @@ -0,0 +1,217 @@ +/* + * 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/batch.proto + +package com.google.cloud.batch.v1alpha; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PD.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PD.java new file mode 100644 index 0000000..27c3147 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PD.java @@ -0,0 +1,926 @@ +/* + * 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/volume.proto + +package com.google.cloud.batch.v1alpha; + +/** + * + * + *
+ * Represents a GCP persistent disk
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.PD} + */ +public final class PD extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.PD) + PDOrBuilder { + private static final long serialVersionUID = 0L; + // Use PD.newBuilder() to construct. + private PD(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PD() { + disk_ = ""; + device_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PD(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PD( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + disk_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + device_ = s; + break; + } + case 24: + { + existing_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_PD_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_PD_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.PD.class, + com.google.cloud.batch.v1alpha.PD.Builder.class); + } + + public static final int DISK_FIELD_NUMBER = 1; + private volatile java.lang.Object disk_; + /** + * + * + *
+   * PD disk name, e.g. pd-1.
+   * 
+ * + * string disk = 1; + * + * @return The disk. + */ + @java.lang.Override + public java.lang.String getDisk() { + java.lang.Object ref = disk_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + disk_ = s; + return s; + } + } + /** + * + * + *
+   * PD disk name, e.g. pd-1.
+   * 
+ * + * string disk = 1; + * + * @return The bytes for disk. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiskBytes() { + java.lang.Object ref = disk_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + disk_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_FIELD_NUMBER = 2; + private volatile java.lang.Object device_; + /** + * + * + *
+   * PD device name, e.g. persistent-disk-1.
+   * 
+ * + * string device = 2; + * + * @return The device. + */ + @java.lang.Override + public java.lang.String getDevice() { + java.lang.Object ref = device_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + device_ = s; + return s; + } + } + /** + * + * + *
+   * PD device name, e.g. persistent-disk-1.
+   * 
+ * + * string device = 2; + * + * @return The bytes for device. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeviceBytes() { + java.lang.Object ref = device_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + device_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXISTING_FIELD_NUMBER = 3; + private boolean existing_; + /** + * + * + *
+   * Whether this is an existing PD. Default is false. If false, i.e., new
+   * PD, we will format it into ext4 and mount to the given path. If true, i.e.,
+   * existing PD, it should be in ext4 format and we will mount it to the given
+   * path.
+   * 
+ * + * bool existing = 3 [deprecated = true]; + * + * @deprecated google.cloud.batch.v1alpha.PD.existing is deprecated. See + * google/cloud/batch/v1alpha/volume.proto;l=81 + * @return The existing. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getExisting() { + return existing_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(disk_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, disk_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, device_); + } + if (existing_ != false) { + output.writeBool(3, existing_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(disk_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, disk_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, device_); + } + if (existing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, existing_); + } + size += unknownFields.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.PD)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.PD other = (com.google.cloud.batch.v1alpha.PD) obj; + + if (!getDisk().equals(other.getDisk())) return false; + if (!getDevice().equals(other.getDevice())) return false; + if (getExisting() != other.getExisting()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + DISK_FIELD_NUMBER; + hash = (53 * hash) + getDisk().hashCode(); + hash = (37 * hash) + DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + hash = (37 * hash) + EXISTING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExisting()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.PD parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.PD 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.PD parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.PD 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.PD parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.PD 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.PD parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.PD 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.PD parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.PD 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.PD 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.PD 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.PD 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; + } + /** + * + * + *
+   * Represents a GCP persistent disk
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.PD} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.PD) + com.google.cloud.batch.v1alpha.PDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_PD_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_PD_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.PD.class, + com.google.cloud.batch.v1alpha.PD.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.PD.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + disk_ = ""; + + device_ = ""; + + existing_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.batch.v1alpha.VolumeProto + .internal_static_google_cloud_batch_v1alpha_PD_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.PD getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.PD.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.PD build() { + com.google.cloud.batch.v1alpha.PD result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.PD buildPartial() { + com.google.cloud.batch.v1alpha.PD result = new com.google.cloud.batch.v1alpha.PD(this); + result.disk_ = disk_; + result.device_ = device_; + result.existing_ = existing_; + onBuilt(); + return result; + } + + @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.PD) { + return mergeFrom((com.google.cloud.batch.v1alpha.PD) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.PD other) { + if (other == com.google.cloud.batch.v1alpha.PD.getDefaultInstance()) return this; + if (!other.getDisk().isEmpty()) { + disk_ = other.disk_; + onChanged(); + } + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + onChanged(); + } + if (other.getExisting() != false) { + setExisting(other.getExisting()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.PD parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.PD) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object disk_ = ""; + /** + * + * + *
+     * PD disk name, e.g. pd-1.
+     * 
+ * + * string disk = 1; + * + * @return The disk. + */ + public java.lang.String getDisk() { + java.lang.Object ref = disk_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + disk_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * PD disk name, e.g. pd-1.
+     * 
+ * + * string disk = 1; + * + * @return The bytes for disk. + */ + public com.google.protobuf.ByteString getDiskBytes() { + java.lang.Object ref = disk_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + disk_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * PD disk name, e.g. pd-1.
+     * 
+ * + * string disk = 1; + * + * @param value The disk to set. + * @return This builder for chaining. + */ + public Builder setDisk(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + disk_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * PD disk name, e.g. pd-1.
+     * 
+ * + * string disk = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisk() { + + disk_ = getDefaultInstance().getDisk(); + onChanged(); + return this; + } + /** + * + * + *
+     * PD disk name, e.g. pd-1.
+     * 
+ * + * string disk = 1; + * + * @param value The bytes for disk to set. + * @return This builder for chaining. + */ + public Builder setDiskBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + disk_ = value; + onChanged(); + return this; + } + + private java.lang.Object device_ = ""; + /** + * + * + *
+     * PD device name, e.g. persistent-disk-1.
+     * 
+ * + * string device = 2; + * + * @return The device. + */ + public java.lang.String getDevice() { + java.lang.Object ref = device_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + device_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * PD device name, e.g. persistent-disk-1.
+     * 
+ * + * string device = 2; + * + * @return The bytes for device. + */ + public com.google.protobuf.ByteString getDeviceBytes() { + java.lang.Object ref = device_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + device_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * PD device name, e.g. persistent-disk-1.
+     * 
+ * + * string device = 2; + * + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + device_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * PD device name, e.g. persistent-disk-1.
+     * 
+ * + * string device = 2; + * + * @return This builder for chaining. + */ + public Builder clearDevice() { + + device_ = getDefaultInstance().getDevice(); + onChanged(); + return this; + } + /** + * + * + *
+     * PD device name, e.g. persistent-disk-1.
+     * 
+ * + * string device = 2; + * + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + device_ = value; + onChanged(); + return this; + } + + private boolean existing_; + /** + * + * + *
+     * Whether this is an existing PD. Default is false. If false, i.e., new
+     * PD, we will format it into ext4 and mount to the given path. If true, i.e.,
+     * existing PD, it should be in ext4 format and we will mount it to the given
+     * path.
+     * 
+ * + * bool existing = 3 [deprecated = true]; + * + * @deprecated google.cloud.batch.v1alpha.PD.existing is deprecated. See + * google/cloud/batch/v1alpha/volume.proto;l=81 + * @return The existing. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getExisting() { + return existing_; + } + /** + * + * + *
+     * Whether this is an existing PD. Default is false. If false, i.e., new
+     * PD, we will format it into ext4 and mount to the given path. If true, i.e.,
+     * existing PD, it should be in ext4 format and we will mount it to the given
+     * path.
+     * 
+ * + * bool existing = 3 [deprecated = true]; + * + * @deprecated google.cloud.batch.v1alpha.PD.existing is deprecated. See + * google/cloud/batch/v1alpha/volume.proto;l=81 + * @param value The existing to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setExisting(boolean value) { + + existing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether this is an existing PD. Default is false. If false, i.e., new
+     * PD, we will format it into ext4 and mount to the given path. If true, i.e.,
+     * existing PD, it should be in ext4 format and we will mount it to the given
+     * path.
+     * 
+ * + * bool existing = 3 [deprecated = true]; + * + * @deprecated google.cloud.batch.v1alpha.PD.existing is deprecated. See + * google/cloud/batch/v1alpha/volume.proto;l=81 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearExisting() { + + existing_ = false; + 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.PD) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.PD) + private static final com.google.cloud.batch.v1alpha.PD DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.PD(); + } + + public static com.google.cloud.batch.v1alpha.PD getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PD parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PD(input, extensionRegistry); + } + }; + + 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.PD getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PDOrBuilder.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PDOrBuilder.java new file mode 100644 index 0000000..ec39c81 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/PDOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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/volume.proto + +package com.google.cloud.batch.v1alpha; + +public interface PDOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.PD) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * PD disk name, e.g. pd-1.
+   * 
+ * + * string disk = 1; + * + * @return The disk. + */ + java.lang.String getDisk(); + /** + * + * + *
+   * PD disk name, e.g. pd-1.
+   * 
+ * + * string disk = 1; + * + * @return The bytes for disk. + */ + com.google.protobuf.ByteString getDiskBytes(); + + /** + * + * + *
+   * PD device name, e.g. persistent-disk-1.
+   * 
+ * + * string device = 2; + * + * @return The device. + */ + java.lang.String getDevice(); + /** + * + * + *
+   * PD device name, e.g. persistent-disk-1.
+   * 
+ * + * string device = 2; + * + * @return The bytes for device. + */ + com.google.protobuf.ByteString getDeviceBytes(); + + /** + * + * + *
+   * Whether this is an existing PD. Default is false. If false, i.e., new
+   * PD, we will format it into ext4 and mount to the given path. If true, i.e.,
+   * existing PD, it should be in ext4 format and we will mount it to the given
+   * path.
+   * 
+ * + * bool existing = 3 [deprecated = true]; + * + * @deprecated google.cloud.batch.v1alpha.PD.existing is deprecated. See + * google/cloud/batch/v1alpha/volume.proto;l=81 + * @return The existing. + */ + @java.lang.Deprecated + boolean getExisting(); +} diff --git a/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java new file mode 100644 index 0000000..85c2855 --- /dev/null +++ b/proto-google-cloud-batch-v1alpha/src/main/java/com/google/cloud/batch/v1alpha/Runnable.java @@ -0,0 +1,6735 @@ +/* + * 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; + +/** + * + * + *
+ * Runnable describes instructions for executing a specific script or container
+ * as part of a Task.
+ * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Runnable} + */ +public final class Runnable extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.Runnable) + RunnableOrBuilder { + private static final long serialVersionUID = 0L; + // Use Runnable.newBuilder() to construct. + private Runnable(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Runnable() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Runnable(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Runnable( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.batch.v1alpha.Runnable.Container.Builder subBuilder = null; + if (executableCase_ == 1) { + subBuilder = + ((com.google.cloud.batch.v1alpha.Runnable.Container) executable_).toBuilder(); + } + executable_ = + input.readMessage( + com.google.cloud.batch.v1alpha.Runnable.Container.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.batch.v1alpha.Runnable.Container) executable_); + executable_ = subBuilder.buildPartial(); + } + executableCase_ = 1; + break; + } + case 18: + { + com.google.cloud.batch.v1alpha.Runnable.Script.Builder subBuilder = null; + if (executableCase_ == 2) { + subBuilder = + ((com.google.cloud.batch.v1alpha.Runnable.Script) executable_).toBuilder(); + } + executable_ = + input.readMessage( + com.google.cloud.batch.v1alpha.Runnable.Script.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.batch.v1alpha.Runnable.Script) executable_); + executable_ = subBuilder.buildPartial(); + } + executableCase_ = 2; + break; + } + case 24: + { + ignoreExitStatus_ = input.readBool(); + break; + } + case 32: + { + background_ = input.readBool(); + break; + } + case 40: + { + alwaysRun_ = input.readBool(); + break; + } + case 50: + { + com.google.cloud.batch.v1alpha.Runnable.Barrier.Builder subBuilder = null; + if (executableCase_ == 6) { + subBuilder = + ((com.google.cloud.batch.v1alpha.Runnable.Barrier) executable_).toBuilder(); + } + executable_ = + input.readMessage( + com.google.cloud.batch.v1alpha.Runnable.Barrier.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.batch.v1alpha.Runnable.Barrier) executable_); + executable_ = subBuilder.buildPartial(); + } + executableCase_ = 6; + break; + } + case 58: + { + com.google.cloud.batch.v1alpha.Environment.Builder subBuilder = null; + if (environment_ != null) { + subBuilder = environment_.toBuilder(); + } + environment_ = + input.readMessage( + com.google.cloud.batch.v1alpha.Environment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(environment_); + environment_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeout_ != null) { + subBuilder = timeout_.toBuilder(); + } + timeout_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeout_); + timeout_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 9: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Runnable.class, + com.google.cloud.batch.v1alpha.Runnable.Builder.class); + } + + public interface ContainerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.Runnable.Container) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The URI to pull the container image from.
+     * 
+ * + * string image_uri = 1; + * + * @return The imageUri. + */ + java.lang.String getImageUri(); + /** + * + * + *
+     * The URI to pull the container image from.
+     * 
+ * + * string image_uri = 1; + * + * @return The bytes for imageUri. + */ + com.google.protobuf.ByteString getImageUriBytes(); + + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @return A list containing the commands. + */ + java.util.List getCommandsList(); + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @return The count of commands. + */ + int getCommandsCount(); + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @param index The index of the element to return. + * @return The commands at the given index. + */ + java.lang.String getCommands(int index); + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @param index The index of the value to return. + * @return The bytes of the commands at the given index. + */ + com.google.protobuf.ByteString getCommandsBytes(int index); + + /** + * + * + *
+     * Overrides the `ENTRYPOINT` specified in the container.
+     * 
+ * + * string entrypoint = 3; + * + * @return The entrypoint. + */ + java.lang.String getEntrypoint(); + /** + * + * + *
+     * Overrides the `ENTRYPOINT` specified in the container.
+     * 
+ * + * string entrypoint = 3; + * + * @return The bytes for entrypoint. + */ + com.google.protobuf.ByteString getEntrypointBytes(); + + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @return A list containing the volumes. + */ + java.util.List getVolumesList(); + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @return The count of volumes. + */ + int getVolumesCount(); + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @param index The index of the element to return. + * @return The volumes at the given index. + */ + java.lang.String getVolumes(int index); + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @param index The index of the value to return. + * @return The bytes of the volumes at the given index. + */ + com.google.protobuf.ByteString getVolumesBytes(int index); + + /** + * + * + *
+     * Arbitrary additional options to include in the "docker run" command when
+     * running this container, e.g. "--network host".
+     * 
+ * + * string options = 8; + * + * @return The options. + */ + java.lang.String getOptions(); + /** + * + * + *
+     * Arbitrary additional options to include in the "docker run" command when
+     * running this container, e.g. "--network host".
+     * 
+ * + * string options = 8; + * + * @return The bytes for options. + */ + com.google.protobuf.ByteString getOptionsBytes(); + + /** + * + * + *
+     * If set to true, external network access to and from container will be
+     * blocked. The container will use the default internal network
+     * 'goog-internal'.
+     * 
+ * + * bool block_external_network = 9; + * + * @return The blockExternalNetwork. + */ + boolean getBlockExternalNetwork(); + + /** + * + * + *
+     * Optional username for logging in to a docker registry. If username
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * username from the Secret Manager.
+     * 
+ * + * string username = 10; + * + * @return The username. + */ + java.lang.String getUsername(); + /** + * + * + *
+     * Optional username for logging in to a docker registry. If username
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * username from the Secret Manager.
+     * 
+ * + * string username = 10; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+     * Optional password for logging in to a docker registry. If password
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * password from the Secret Manager;
+     * 
+ * + * string password = 11; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+     * Optional password for logging in to a docker registry. If password
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * password from the Secret Manager;
+     * 
+ * + * string password = 11; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + } + /** + * + * + *
+   * Container runnable.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Runnable.Container} + */ + public static final class Container extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.Runnable.Container) + ContainerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Container.newBuilder() to construct. + private Container(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Container() { + imageUri_ = ""; + commands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + entrypoint_ = ""; + volumes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + options_ = ""; + username_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Container(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Container( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + imageUri_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + commands_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + commands_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entrypoint_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + volumes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + volumes_.add(s); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + options_ = s; + break; + } + case 72: + { + blockExternalNetwork_ = input.readBool(); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + username_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + password_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + commands_ = commands_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + volumes_ = volumes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Container_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Runnable.Container.class, + com.google.cloud.batch.v1alpha.Runnable.Container.Builder.class); + } + + public static final int IMAGE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object imageUri_; + /** + * + * + *
+     * The URI to pull the container image from.
+     * 
+ * + * string image_uri = 1; + * + * @return The imageUri. + */ + @java.lang.Override + public java.lang.String getImageUri() { + java.lang.Object ref = imageUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + imageUri_ = s; + return s; + } + } + /** + * + * + *
+     * The URI to pull the container image from.
+     * 
+ * + * string image_uri = 1; + * + * @return The bytes for imageUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImageUriBytes() { + java.lang.Object ref = imageUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + imageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMANDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList commands_; + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @return A list containing the commands. + */ + public com.google.protobuf.ProtocolStringList getCommandsList() { + return commands_; + } + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @return The count of commands. + */ + public int getCommandsCount() { + return commands_.size(); + } + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @param index The index of the element to return. + * @return The commands at the given index. + */ + public java.lang.String getCommands(int index) { + return commands_.get(index); + } + /** + * + * + *
+     * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+     * (either in the container image or with the entrypoint field below) then
+     * commands are appended as arguments to the ENTRYPOINT.
+     * 
+ * + * repeated string commands = 2; + * + * @param index The index of the value to return. + * @return The bytes of the commands at the given index. + */ + public com.google.protobuf.ByteString getCommandsBytes(int index) { + return commands_.getByteString(index); + } + + public static final int ENTRYPOINT_FIELD_NUMBER = 3; + private volatile java.lang.Object entrypoint_; + /** + * + * + *
+     * Overrides the `ENTRYPOINT` specified in the container.
+     * 
+ * + * string entrypoint = 3; + * + * @return The entrypoint. + */ + @java.lang.Override + public java.lang.String getEntrypoint() { + java.lang.Object ref = entrypoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entrypoint_ = s; + return s; + } + } + /** + * + * + *
+     * Overrides the `ENTRYPOINT` specified in the container.
+     * 
+ * + * string entrypoint = 3; + * + * @return The bytes for entrypoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntrypointBytes() { + java.lang.Object ref = entrypoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entrypoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VOLUMES_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList volumes_; + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @return A list containing the volumes. + */ + public com.google.protobuf.ProtocolStringList getVolumesList() { + return volumes_; + } + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @return The count of volumes. + */ + public int getVolumesCount() { + return volumes_.size(); + } + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @param index The index of the element to return. + * @return The volumes at the given index. + */ + public java.lang.String getVolumes(int index) { + return volumes_.get(index); + } + /** + * + * + *
+     * Volumes to mount (bind mount) from the host machine files or directories
+     * into the container, formatted to match docker run's --volume option,
+     * e.g. /foo:/bar, or /foo:/bar:ro
+     * 
+ * + * repeated string volumes = 7; + * + * @param index The index of the value to return. + * @return The bytes of the volumes at the given index. + */ + public com.google.protobuf.ByteString getVolumesBytes(int index) { + return volumes_.getByteString(index); + } + + public static final int OPTIONS_FIELD_NUMBER = 8; + private volatile java.lang.Object options_; + /** + * + * + *
+     * Arbitrary additional options to include in the "docker run" command when
+     * running this container, e.g. "--network host".
+     * 
+ * + * string options = 8; + * + * @return The options. + */ + @java.lang.Override + public java.lang.String getOptions() { + java.lang.Object ref = options_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + options_ = s; + return s; + } + } + /** + * + * + *
+     * Arbitrary additional options to include in the "docker run" command when
+     * running this container, e.g. "--network host".
+     * 
+ * + * string options = 8; + * + * @return The bytes for options. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOptionsBytes() { + java.lang.Object ref = options_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + options_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BLOCK_EXTERNAL_NETWORK_FIELD_NUMBER = 9; + private boolean blockExternalNetwork_; + /** + * + * + *
+     * If set to true, external network access to and from container will be
+     * blocked. The container will use the default internal network
+     * 'goog-internal'.
+     * 
+ * + * bool block_external_network = 9; + * + * @return The blockExternalNetwork. + */ + @java.lang.Override + public boolean getBlockExternalNetwork() { + return blockExternalNetwork_; + } + + public static final int USERNAME_FIELD_NUMBER = 10; + private volatile java.lang.Object username_; + /** + * + * + *
+     * Optional username for logging in to a docker registry. If username
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * username from the Secret Manager.
+     * 
+ * + * string username = 10; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + /** + * + * + *
+     * Optional username for logging in to a docker registry. If username
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * username from the Secret Manager.
+     * 
+ * + * string username = 10; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 11; + private volatile java.lang.Object password_; + /** + * + * + *
+     * Optional password for logging in to a docker registry. If password
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * password from the Secret Manager;
+     * 
+ * + * string password = 11; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+     * Optional password for logging in to a docker registry. If password
+     * matches "projects/*/secrets/*/versions/*" then Batch will read the
+     * password from the Secret Manager;
+     * 
+ * + * string password = 11; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(imageUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, imageUri_); + } + for (int i = 0; i < commands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, commands_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entrypoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entrypoint_); + } + for (int i = 0; i < volumes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, volumes_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(options_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, options_); + } + if (blockExternalNetwork_ != false) { + output.writeBool(9, blockExternalNetwork_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, username_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, password_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(imageUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, imageUri_); + } + { + int dataSize = 0; + for (int i = 0; i < commands_.size(); i++) { + dataSize += computeStringSizeNoTag(commands_.getRaw(i)); + } + size += dataSize; + size += 1 * getCommandsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entrypoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entrypoint_); + } + { + int dataSize = 0; + for (int i = 0; i < volumes_.size(); i++) { + dataSize += computeStringSizeNoTag(volumes_.getRaw(i)); + } + size += dataSize; + size += 1 * getVolumesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(options_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, options_); + } + if (blockExternalNetwork_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, blockExternalNetwork_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, username_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, password_); + } + size += unknownFields.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.Runnable.Container)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.Runnable.Container other = + (com.google.cloud.batch.v1alpha.Runnable.Container) obj; + + if (!getImageUri().equals(other.getImageUri())) return false; + if (!getCommandsList().equals(other.getCommandsList())) return false; + if (!getEntrypoint().equals(other.getEntrypoint())) return false; + if (!getVolumesList().equals(other.getVolumesList())) return false; + if (!getOptions().equals(other.getOptions())) return false; + if (getBlockExternalNetwork() != other.getBlockExternalNetwork()) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + IMAGE_URI_FIELD_NUMBER; + hash = (53 * hash) + getImageUri().hashCode(); + if (getCommandsCount() > 0) { + hash = (37 * hash) + COMMANDS_FIELD_NUMBER; + hash = (53 * hash) + getCommandsList().hashCode(); + } + hash = (37 * hash) + ENTRYPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEntrypoint().hashCode(); + if (getVolumesCount() > 0) { + hash = (37 * hash) + VOLUMES_FIELD_NUMBER; + hash = (53 * hash) + getVolumesList().hashCode(); + } + hash = (37 * hash) + OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptions().hashCode(); + hash = (37 * hash) + BLOCK_EXTERNAL_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBlockExternalNetwork()); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container 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.Runnable.Container parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container 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.Runnable.Container parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container 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.Runnable.Container parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container 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.Runnable.Container parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container 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.Runnable.Container 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.Runnable.Container 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.Runnable.Container 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; + } + /** + * + * + *
+     * Container runnable.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Runnable.Container} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.Runnable.Container) + com.google.cloud.batch.v1alpha.Runnable.ContainerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Container_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Runnable.Container.class, + com.google.cloud.batch.v1alpha.Runnable.Container.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.Runnable.Container.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + imageUri_ = ""; + + commands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + entrypoint_ = ""; + + volumes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + options_ = ""; + + blockExternalNetwork_ = false; + + username_ = ""; + + password_ = ""; + + 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_Runnable_Container_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Runnable.Container getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.Runnable.Container.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Runnable.Container build() { + com.google.cloud.batch.v1alpha.Runnable.Container result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Runnable.Container buildPartial() { + com.google.cloud.batch.v1alpha.Runnable.Container result = + new com.google.cloud.batch.v1alpha.Runnable.Container(this); + int from_bitField0_ = bitField0_; + result.imageUri_ = imageUri_; + if (((bitField0_ & 0x00000001) != 0)) { + commands_ = commands_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.commands_ = commands_; + result.entrypoint_ = entrypoint_; + if (((bitField0_ & 0x00000002) != 0)) { + volumes_ = volumes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.volumes_ = volumes_; + result.options_ = options_; + result.blockExternalNetwork_ = blockExternalNetwork_; + result.username_ = username_; + result.password_ = password_; + onBuilt(); + return result; + } + + @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.Runnable.Container) { + return mergeFrom((com.google.cloud.batch.v1alpha.Runnable.Container) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.Runnable.Container other) { + if (other == com.google.cloud.batch.v1alpha.Runnable.Container.getDefaultInstance()) + return this; + if (!other.getImageUri().isEmpty()) { + imageUri_ = other.imageUri_; + onChanged(); + } + if (!other.commands_.isEmpty()) { + if (commands_.isEmpty()) { + commands_ = other.commands_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCommandsIsMutable(); + commands_.addAll(other.commands_); + } + onChanged(); + } + if (!other.getEntrypoint().isEmpty()) { + entrypoint_ = other.entrypoint_; + onChanged(); + } + if (!other.volumes_.isEmpty()) { + if (volumes_.isEmpty()) { + volumes_ = other.volumes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureVolumesIsMutable(); + volumes_.addAll(other.volumes_); + } + onChanged(); + } + if (!other.getOptions().isEmpty()) { + options_ = other.options_; + onChanged(); + } + if (other.getBlockExternalNetwork() != false) { + setBlockExternalNetwork(other.getBlockExternalNetwork()); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.Runnable.Container parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.batch.v1alpha.Runnable.Container) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object imageUri_ = ""; + /** + * + * + *
+       * The URI to pull the container image from.
+       * 
+ * + * string image_uri = 1; + * + * @return The imageUri. + */ + public java.lang.String getImageUri() { + java.lang.Object ref = imageUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + imageUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The URI to pull the container image from.
+       * 
+ * + * string image_uri = 1; + * + * @return The bytes for imageUri. + */ + public com.google.protobuf.ByteString getImageUriBytes() { + java.lang.Object ref = imageUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + imageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The URI to pull the container image from.
+       * 
+ * + * string image_uri = 1; + * + * @param value The imageUri to set. + * @return This builder for chaining. + */ + public Builder setImageUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + imageUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The URI to pull the container image from.
+       * 
+ * + * string image_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearImageUri() { + + imageUri_ = getDefaultInstance().getImageUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * The URI to pull the container image from.
+       * 
+ * + * string image_uri = 1; + * + * @param value The bytes for imageUri to set. + * @return This builder for chaining. + */ + public Builder setImageUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + imageUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList commands_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCommandsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + commands_ = new com.google.protobuf.LazyStringArrayList(commands_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @return A list containing the commands. + */ + public com.google.protobuf.ProtocolStringList getCommandsList() { + return commands_.getUnmodifiableView(); + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @return The count of commands. + */ + public int getCommandsCount() { + return commands_.size(); + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @param index The index of the element to return. + * @return The commands at the given index. + */ + public java.lang.String getCommands(int index) { + return commands_.get(index); + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @param index The index of the value to return. + * @return The bytes of the commands at the given index. + */ + public com.google.protobuf.ByteString getCommandsBytes(int index) { + return commands_.getByteString(index); + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @param index The index to set the value at. + * @param value The commands to set. + * @return This builder for chaining. + */ + public Builder setCommands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @param value The commands to add. + * @return This builder for chaining. + */ + public Builder addCommands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @param values The commands to add. + * @return This builder for chaining. + */ + public Builder addAllCommands(java.lang.Iterable values) { + ensureCommandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, commands_); + onChanged(); + return this; + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @return This builder for chaining. + */ + public Builder clearCommands() { + commands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
+       * (either in the container image or with the entrypoint field below) then
+       * commands are appended as arguments to the ENTRYPOINT.
+       * 
+ * + * repeated string commands = 2; + * + * @param value The bytes of the commands to add. + * @return This builder for chaining. + */ + public Builder addCommandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCommandsIsMutable(); + commands_.add(value); + onChanged(); + return this; + } + + private java.lang.Object entrypoint_ = ""; + /** + * + * + *
+       * Overrides the `ENTRYPOINT` specified in the container.
+       * 
+ * + * string entrypoint = 3; + * + * @return The entrypoint. + */ + public java.lang.String getEntrypoint() { + java.lang.Object ref = entrypoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entrypoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Overrides the `ENTRYPOINT` specified in the container.
+       * 
+ * + * string entrypoint = 3; + * + * @return The bytes for entrypoint. + */ + public com.google.protobuf.ByteString getEntrypointBytes() { + java.lang.Object ref = entrypoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entrypoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Overrides the `ENTRYPOINT` specified in the container.
+       * 
+ * + * string entrypoint = 3; + * + * @param value The entrypoint to set. + * @return This builder for chaining. + */ + public Builder setEntrypoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entrypoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Overrides the `ENTRYPOINT` specified in the container.
+       * 
+ * + * string entrypoint = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntrypoint() { + + entrypoint_ = getDefaultInstance().getEntrypoint(); + onChanged(); + return this; + } + /** + * + * + *
+       * Overrides the `ENTRYPOINT` specified in the container.
+       * 
+ * + * string entrypoint = 3; + * + * @param value The bytes for entrypoint to set. + * @return This builder for chaining. + */ + public Builder setEntrypointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entrypoint_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList volumes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureVolumesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + volumes_ = new com.google.protobuf.LazyStringArrayList(volumes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @return A list containing the volumes. + */ + public com.google.protobuf.ProtocolStringList getVolumesList() { + return volumes_.getUnmodifiableView(); + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @return The count of volumes. + */ + public int getVolumesCount() { + return volumes_.size(); + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @param index The index of the element to return. + * @return The volumes at the given index. + */ + public java.lang.String getVolumes(int index) { + return volumes_.get(index); + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @param index The index of the value to return. + * @return The bytes of the volumes at the given index. + */ + public com.google.protobuf.ByteString getVolumesBytes(int index) { + return volumes_.getByteString(index); + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @param index The index to set the value at. + * @param value The volumes to set. + * @return This builder for chaining. + */ + public Builder setVolumes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumesIsMutable(); + volumes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @param value The volumes to add. + * @return This builder for chaining. + */ + public Builder addVolumes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureVolumesIsMutable(); + volumes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @param values The volumes to add. + * @return This builder for chaining. + */ + public Builder addAllVolumes(java.lang.Iterable values) { + ensureVolumesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumes_); + onChanged(); + return this; + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @return This builder for chaining. + */ + public Builder clearVolumes() { + volumes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Volumes to mount (bind mount) from the host machine files or directories
+       * into the container, formatted to match docker run's --volume option,
+       * e.g. /foo:/bar, or /foo:/bar:ro
+       * 
+ * + * repeated string volumes = 7; + * + * @param value The bytes of the volumes to add. + * @return This builder for chaining. + */ + public Builder addVolumesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureVolumesIsMutable(); + volumes_.add(value); + onChanged(); + return this; + } + + private java.lang.Object options_ = ""; + /** + * + * + *
+       * Arbitrary additional options to include in the "docker run" command when
+       * running this container, e.g. "--network host".
+       * 
+ * + * string options = 8; + * + * @return The options. + */ + public java.lang.String getOptions() { + java.lang.Object ref = options_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + options_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Arbitrary additional options to include in the "docker run" command when
+       * running this container, e.g. "--network host".
+       * 
+ * + * string options = 8; + * + * @return The bytes for options. + */ + public com.google.protobuf.ByteString getOptionsBytes() { + java.lang.Object ref = options_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + options_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Arbitrary additional options to include in the "docker run" command when
+       * running this container, e.g. "--network host".
+       * 
+ * + * string options = 8; + * + * @param value The options to set. + * @return This builder for chaining. + */ + public Builder setOptions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + options_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Arbitrary additional options to include in the "docker run" command when
+       * running this container, e.g. "--network host".
+       * 
+ * + * string options = 8; + * + * @return This builder for chaining. + */ + public Builder clearOptions() { + + options_ = getDefaultInstance().getOptions(); + onChanged(); + return this; + } + /** + * + * + *
+       * Arbitrary additional options to include in the "docker run" command when
+       * running this container, e.g. "--network host".
+       * 
+ * + * string options = 8; + * + * @param value The bytes for options to set. + * @return This builder for chaining. + */ + public Builder setOptionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + options_ = value; + onChanged(); + return this; + } + + private boolean blockExternalNetwork_; + /** + * + * + *
+       * If set to true, external network access to and from container will be
+       * blocked. The container will use the default internal network
+       * 'goog-internal'.
+       * 
+ * + * bool block_external_network = 9; + * + * @return The blockExternalNetwork. + */ + @java.lang.Override + public boolean getBlockExternalNetwork() { + return blockExternalNetwork_; + } + /** + * + * + *
+       * If set to true, external network access to and from container will be
+       * blocked. The container will use the default internal network
+       * 'goog-internal'.
+       * 
+ * + * bool block_external_network = 9; + * + * @param value The blockExternalNetwork to set. + * @return This builder for chaining. + */ + public Builder setBlockExternalNetwork(boolean value) { + + blockExternalNetwork_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If set to true, external network access to and from container will be
+       * blocked. The container will use the default internal network
+       * 'goog-internal'.
+       * 
+ * + * bool block_external_network = 9; + * + * @return This builder for chaining. + */ + public Builder clearBlockExternalNetwork() { + + blockExternalNetwork_ = false; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + /** + * + * + *
+       * Optional username for logging in to a docker registry. If username
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * username from the Secret Manager.
+       * 
+ * + * string username = 10; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional username for logging in to a docker registry. If username
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * username from the Secret Manager.
+       * 
+ * + * string username = 10; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional username for logging in to a docker registry. If username
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * username from the Secret Manager.
+       * 
+ * + * string username = 10; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + username_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional username for logging in to a docker registry. If username
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * username from the Secret Manager.
+       * 
+ * + * string username = 10; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional username for logging in to a docker registry. If username
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * username from the Secret Manager.
+       * 
+ * + * string username = 10; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + username_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+       * Optional password for logging in to a docker registry. If password
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * password from the Secret Manager;
+       * 
+ * + * string password = 11; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional password for logging in to a docker registry. If password
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * password from the Secret Manager;
+       * 
+ * + * string password = 11; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional password for logging in to a docker registry. If password
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * password from the Secret Manager;
+       * 
+ * + * string password = 11; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + password_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional password for logging in to a docker registry. If password
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * password from the Secret Manager;
+       * 
+ * + * string password = 11; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional password for logging in to a docker registry. If password
+       * matches "projects/*/secrets/*/versions/*" then Batch will read the
+       * password from the Secret Manager;
+       * 
+ * + * string password = 11; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + password_ = value; + 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.Runnable.Container) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.Runnable.Container) + private static final com.google.cloud.batch.v1alpha.Runnable.Container DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.Runnable.Container(); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Container getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Container parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Container(input, extensionRegistry); + } + }; + + 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.Runnable.Container getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ScriptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.batch.v1alpha.Runnable.Script) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Script file path on the host VM.
+     * 
+ * + * string path = 1; + * + * @return Whether the path field is set. + */ + boolean hasPath(); + /** + * + * + *
+     * Script file path on the host VM.
+     * 
+ * + * string path = 1; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+     * Script file path on the host VM.
+     * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + + /** + * + * + *
+     * Shell script text.
+     * 
+ * + * string text = 2; + * + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * + * + *
+     * Shell script text.
+     * 
+ * + * string text = 2; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+     * Shell script text.
+     * 
+ * + * string text = 2; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + public com.google.cloud.batch.v1alpha.Runnable.Script.CommandCase getCommandCase(); + } + /** + * + * + *
+   * Script runnable.
+   * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Runnable.Script} + */ + public static final class Script extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.batch.v1alpha.Runnable.Script) + ScriptOrBuilder { + private static final long serialVersionUID = 0L; + // Use Script.newBuilder() to construct. + private Script(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Script() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Script(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Script( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + commandCase_ = 1; + command_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + commandCase_ = 2; + command_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Script_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Script_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Runnable.Script.class, + com.google.cloud.batch.v1alpha.Runnable.Script.Builder.class); + } + + private int commandCase_ = 0; + private java.lang.Object command_; + + public enum CommandCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PATH(1), + TEXT(2), + COMMAND_NOT_SET(0); + private final int value; + + private CommandCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CommandCase valueOf(int value) { + return forNumber(value); + } + + public static CommandCase forNumber(int value) { + switch (value) { + case 1: + return PATH; + case 2: + return TEXT; + case 0: + return COMMAND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CommandCase getCommandCase() { + return CommandCase.forNumber(commandCase_); + } + + public static final int PATH_FIELD_NUMBER = 1; + /** + * + * + *
+     * Script file path on the host VM.
+     * 
+ * + * string path = 1; + * + * @return Whether the path field is set. + */ + public boolean hasPath() { + return commandCase_ == 1; + } + /** + * + * + *
+     * Script file path on the host VM.
+     * 
+ * + * string path = 1; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = ""; + if (commandCase_ == 1) { + ref = command_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (commandCase_ == 1) { + command_ = s; + } + return s; + } + } + /** + * + * + *
+     * Script file path on the host VM.
+     * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = ""; + if (commandCase_ == 1) { + ref = command_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (commandCase_ == 1) { + command_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_FIELD_NUMBER = 2; + /** + * + * + *
+     * Shell script text.
+     * 
+ * + * string text = 2; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return commandCase_ == 2; + } + /** + * + * + *
+     * Shell script text.
+     * 
+ * + * string text = 2; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (commandCase_ == 2) { + ref = command_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (commandCase_ == 2) { + command_ = s; + } + return s; + } + } + /** + * + * + *
+     * Shell script text.
+     * 
+ * + * string text = 2; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (commandCase_ == 2) { + ref = command_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (commandCase_ == 2) { + command_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (commandCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, command_); + } + if (commandCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, command_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commandCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, command_); + } + if (commandCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, command_); + } + size += unknownFields.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.Runnable.Script)) { + return super.equals(obj); + } + com.google.cloud.batch.v1alpha.Runnable.Script other = + (com.google.cloud.batch.v1alpha.Runnable.Script) obj; + + if (!getCommandCase().equals(other.getCommandCase())) return false; + switch (commandCase_) { + case 1: + if (!getPath().equals(other.getPath())) return false; + break; + case 2: + if (!getText().equals(other.getText())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (commandCase_) { + case 1: + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + break; + case 2: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script 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.Runnable.Script parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script 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.Runnable.Script parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script 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.Runnable.Script parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script 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.Runnable.Script parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script 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.Runnable.Script 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.Runnable.Script 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.Runnable.Script 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; + } + /** + * + * + *
+     * Script runnable.
+     * 
+ * + * Protobuf type {@code google.cloud.batch.v1alpha.Runnable.Script} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.batch.v1alpha.Runnable.Script) + com.google.cloud.batch.v1alpha.Runnable.ScriptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Script_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.batch.v1alpha.TaskProto + .internal_static_google_cloud_batch_v1alpha_Runnable_Script_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.batch.v1alpha.Runnable.Script.class, + com.google.cloud.batch.v1alpha.Runnable.Script.Builder.class); + } + + // Construct using com.google.cloud.batch.v1alpha.Runnable.Script.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + commandCase_ = 0; + command_ = null; + 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_Runnable_Script_descriptor; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Runnable.Script getDefaultInstanceForType() { + return com.google.cloud.batch.v1alpha.Runnable.Script.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Runnable.Script build() { + com.google.cloud.batch.v1alpha.Runnable.Script result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.batch.v1alpha.Runnable.Script buildPartial() { + com.google.cloud.batch.v1alpha.Runnable.Script result = + new com.google.cloud.batch.v1alpha.Runnable.Script(this); + if (commandCase_ == 1) { + result.command_ = command_; + } + if (commandCase_ == 2) { + result.command_ = command_; + } + result.commandCase_ = commandCase_; + onBuilt(); + return result; + } + + @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.Runnable.Script) { + return mergeFrom((com.google.cloud.batch.v1alpha.Runnable.Script) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.batch.v1alpha.Runnable.Script other) { + if (other == com.google.cloud.batch.v1alpha.Runnable.Script.getDefaultInstance()) + return this; + switch (other.getCommandCase()) { + case PATH: + { + commandCase_ = 1; + command_ = other.command_; + onChanged(); + break; + } + case TEXT: + { + commandCase_ = 2; + command_ = other.command_; + onChanged(); + break; + } + case COMMAND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.batch.v1alpha.Runnable.Script parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.batch.v1alpha.Runnable.Script) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int commandCase_ = 0; + private java.lang.Object command_; + + public CommandCase getCommandCase() { + return CommandCase.forNumber(commandCase_); + } + + public Builder clearCommand() { + commandCase_ = 0; + command_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+       * Script file path on the host VM.
+       * 
+ * + * string path = 1; + * + * @return Whether the path field is set. + */ + @java.lang.Override + public boolean hasPath() { + return commandCase_ == 1; + } + /** + * + * + *
+       * Script file path on the host VM.
+       * 
+ * + * string path = 1; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = ""; + if (commandCase_ == 1) { + ref = command_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (commandCase_ == 1) { + command_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Script file path on the host VM.
+       * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = ""; + if (commandCase_ == 1) { + ref = command_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (commandCase_ == 1) { + command_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Script file path on the host VM.
+       * 
+ * + * string path = 1; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + commandCase_ = 1; + command_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Script file path on the host VM.
+       * 
+ * + * string path = 1; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + if (commandCase_ == 1) { + commandCase_ = 0; + command_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Script file path on the host VM.
+       * 
+ * + * string path = 1; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + commandCase_ = 1; + command_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Shell script text.
+       * 
+ * + * string text = 2; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return commandCase_ == 2; + } + /** + * + * + *
+       * Shell script text.
+       * 
+ * + * string text = 2; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (commandCase_ == 2) { + ref = command_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (commandCase_ == 2) { + command_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Shell script text.
+       * 
+ * + * string text = 2; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (commandCase_ == 2) { + ref = command_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (commandCase_ == 2) { + command_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Shell script text.
+       * 
+ * + * string text = 2; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + commandCase_ = 2; + command_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Shell script text.
+       * 
+ * + * string text = 2; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (commandCase_ == 2) { + commandCase_ = 0; + command_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Shell script text.
+       * 
+ * + * string text = 2; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + commandCase_ = 2; + command_ = value; + 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.Runnable.Script) + } + + // @@protoc_insertion_point(class_scope:google.cloud.batch.v1alpha.Runnable.Script) + private static final com.google.cloud.batch.v1alpha.Runnable.Script DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.batch.v1alpha.Runnable.Script(); + } + + public static com.google.cloud.batch.v1alpha.Runnable.Script getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser