diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af4cab8..40e563a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [0.15.0](https://github.com/googleapis/google-cloudevents-java/compare/v0.14.1...v0.15.0) (2024-03-29) + + +### Features + +* Add event types for [Cloud Batch](https://cloud.google.com/eventarc/docs/reference/supported-events#batch) ([#240](https://github.com/googleapis/google-cloudevents-java/issues/240)) ([67b543b](https://github.com/googleapis/google-cloudevents-java/commit/67b543bf964f9d907328515b840c8957b2fa28ee)) +* Add event types for [Network Services](https://cloud.google.com/eventarc/docs/reference/supported-events#network-services) ([#240](https://github.com/googleapis/google-cloudevents-java/issues/240)) ([67b543b](https://github.com/googleapis/google-cloudevents-java/commit/67b543bf964f9d907328515b840c8957b2fa28ee)) +* Add event types for Speech-to-Text ([#240](https://github.com/googleapis/google-cloudevents-java/issues/240)) ([67b543b](https://github.com/googleapis/google-cloudevents-java/commit/67b543bf964f9d907328515b840c8957b2fa28ee)) + ## [0.14.1](https://github.com/googleapis/google-cloudevents-java/compare/v0.14.0...v0.14.1) (2024-01-03) diff --git a/google-cloudevent-types/pom.xml b/google-cloudevent-types/pom.xml index 46690c68..4e475fcd 100644 --- a/google-cloudevent-types/pom.xml +++ b/google-cloudevent-types/pom.xml @@ -6,7 +6,7 @@ com.google.cloud google-cloudevent-types - 0.14.1 + 0.15.0 google-cloudevent-types https://github.com/googleapis/google-cloudevents-java @@ -16,7 +16,7 @@ com.google.cloud google-cloudevent-types-parent - 0.14.1 + 0.15.0 diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/AllocationPolicy.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/AllocationPolicy.java new file mode 100644 index 00000000..bea181fc --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/AllocationPolicy.java @@ -0,0 +1,14974 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * A Job's resource allocation policy describes when, where, and how compute
+ * resources should be allocated for the Job.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy} + */ +public final class AllocationPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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(); + } + + @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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.Builder.class); + } + + /** + * + * + *
+   * Compute Engine VM instance provisioning model.
+   * 
+ * + * Protobuf enum {@code google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel) + } + + public interface LocationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of allowed location names represented by internal URLs.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * repeated string allowed_locations = 1; + * + * @return The count of allowedLocations. + */ + int getAllowedLocationsCount(); + + /** + * + * + *
+     * A list of allowed location names represented by internal URLs.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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); + } + + /** Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy} */ + public static final class LocationPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + @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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder.class); + } + + public static final int ALLOWED_LOCATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList allowedLocations_; + + /** + * + * + *
+     * A list of allowed location names represented by internal URLs.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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.
+     * Each location can be a region or a zone.
+     * Only one region or multiple zones in one region is supported now.
+     * For example,
+     * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+     * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+     * in zones us-central1-a and us-central1-c.
+     * All locations end up in different regions would cause errors.
+     * For example,
+     * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+     * "zones/us-west1-a"] contains 2 regions "us-central1" and
+     * "us-west1". An error is expected in this case.
+     * 
+ * + * 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); + } + + 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)); + } + getUnknownFields().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(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy other = + (com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) obj; + + if (!getAllowedLocationsList().equals(other.getAllowedLocationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAllowedLocationsCount() > 0) { + hash = (37 * hash) + ALLOWED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedLocationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder.class); + } + + // Construct using + // com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy build() { + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy result = + new com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy result) { + if (((bitField0_ & 0x00000001) != 0)) { + allowedLocations_ = allowedLocations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedLocations_ = allowedLocations_; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy result) { + int from_bitField0_ = bitField0_; + } + + @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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) { + return mergeFrom( + (com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy other) { + if (other + == com.google.events.cloud.batch.v1.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowedLocationsIsMutable(); + allowedLocations_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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.
+       * Each location can be a region or a zone.
+       * Only one region or multiple zones in one region is supported now.
+       * For example,
+       * ["regions/us-central1"] allow VMs in any zones in region us-central1.
+       * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
+       * in zones us-central1-a and us-central1-c.
+       * All locations end up in different regions would cause errors.
+       * For example,
+       * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
+       * "zones/us-west1-a"] contains 2 regions "us-central1" and
+       * "us-west1". An error is expected in this case.
+       * 
+ * + * 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; + } + + @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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.Disk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * For example, the following are all valid URLs:
+     * * Specify the image by its family name:
+     * projects/{project}/global/images/family/{image_family}
+     * * Specify the image version:
+     * projects/{project}/global/images/{image_version}
+     * You can also use Batch customized image in short names.
+     * The following image values are supported for a boot disk:
+     * * "batch-debian": use Batch Debian images.
+     * * "batch-centos": use Batch CentOS images.
+     * * "batch-cos": use Batch Container-Optimized images.
+     * * "batch-hpc-centos": use Batch HPC CentOS images.
+     * 
+ * + * string image = 4; + * + * @return Whether the image field is set. + */ + boolean hasImage(); + + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * For example, the following are all valid URLs:
+     * * Specify the image by its family name:
+     * projects/{project}/global/images/family/{image_family}
+     * * Specify the image version:
+     * projects/{project}/global/images/{image_version}
+     * You can also use Batch customized image in short names.
+     * The following image values are supported for a boot disk:
+     * * "batch-debian": use Batch Debian images.
+     * * "batch-centos": use Batch CentOS images.
+     * * "batch-cos": use Batch Container-Optimized images.
+     * * "batch-hpc-centos": use Batch HPC CentOS images.
+     * 
+ * + * string image = 4; + * + * @return The image. + */ + java.lang.String getImage(); + + /** + * + * + *
+     * Name of a public or custom image used as the data source.
+     * For example, the following are all valid URLs:
+     * * Specify the image by its family name:
+     * projects/{project}/global/images/family/{image_family}
+     * * Specify the image version:
+     * projects/{project}/global/images/{image_version}
+     * You can also use Batch customized image in short names.
+     * The following image values are supported for a boot disk:
+     * * "batch-debian": use Batch Debian images.
+     * * "batch-centos": use Batch CentOS images.
+     * * "batch-cos": use Batch Container-Optimized images.
+     * * "batch-hpc-centos": use Batch HPC CentOS images.
+     * 
+ * + * string image = 4; + * + * @return The bytes for image. + */ + com.google.protobuf.ByteString getImageBytes(); + + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * Snapshot is not supported as boot disk now.
+     * 
+ * + * string snapshot = 5; + * + * @return Whether the snapshot field is set. + */ + boolean hasSnapshot(); + + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * Snapshot is not supported as boot disk now.
+     * 
+ * + * string snapshot = 5; + * + * @return The snapshot. + */ + java.lang.String getSnapshot(); + + /** + * + * + *
+     * Name of a snapshot used as the data source.
+     * Snapshot is not supported as boot disk now.
+     * 
+ * + * 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, local SSD uses type "local-ssd".
+     * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+     * or "pd-standard".
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + + /** + * + * + *
+     * Disk type as shown in `gcloud compute disk-types list`.
+     * For example, local SSD uses type "local-ssd".
+     * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+     * or "pd-standard".
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+     * Disk size in GB.
+     * For persistent disk, this field is ignored if `data_source` is `image` or
+     * `snapshot`.
+     * For local SSD, size_gb should be a multiple of 375GB,
+     * otherwise, the final size will be the next greater multiple of 375 GB.
+     * For boot disk, Batch will calculate the boot disk size based on source
+     * image and task requirements if you do not speicify the size.
+     * If both this field and the boot_disk_mib field in task spec's
+     * compute_resource are defined, Batch will only honor this field.
+     * 
+ * + * int64 size_gb = 2; + * + * @return The sizeGb. + */ + long getSizeGb(); + + /** + * + * + *
+     * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+     * If not indicated, "NVMe" will be the default one for local ssds.
+     * We only support "SCSI" for persistent disks now.
+     * 
+ * + * string disk_interface = 6; + * + * @return The diskInterface. + */ + java.lang.String getDiskInterface(); + + /** + * + * + *
+     * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+     * If not indicated, "NVMe" will be the default one for local ssds.
+     * We only support "SCSI" for persistent disks now.
+     * 
+ * + * string disk_interface = 6; + * + * @return The bytes for diskInterface. + */ + com.google.protobuf.ByteString getDiskInterfaceBytes(); + + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk.DataSourceCase + getDataSourceCase(); + } + + /** + * + * + *
+   * A new persistent disk or a local ssd.
+   * A VM can only have one local SSD setting but multiple local SSD partitions.
+   * See https://cloud.google.com/compute/docs/disks#pdspecs and
+   * https://cloud.google.com/compute/docs/disks#localssds.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.Disk} + */ + public static final class Disk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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_ = ""; + diskInterface_ = ""; + } + + @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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.class, + com.google.events.cloud.batch.v1.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.
+     * For example, the following are all valid URLs:
+     * * Specify the image by its family name:
+     * projects/{project}/global/images/family/{image_family}
+     * * Specify the image version:
+     * projects/{project}/global/images/{image_version}
+     * You can also use Batch customized image in short names.
+     * The following image values are supported for a boot disk:
+     * * "batch-debian": use Batch Debian images.
+     * * "batch-centos": use Batch CentOS images.
+     * * "batch-cos": use Batch Container-Optimized images.
+     * * "batch-hpc-centos": use Batch HPC CentOS images.
+     * 
+ * + * 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.
+     * For example, the following are all valid URLs:
+     * * Specify the image by its family name:
+     * projects/{project}/global/images/family/{image_family}
+     * * Specify the image version:
+     * projects/{project}/global/images/{image_version}
+     * You can also use Batch customized image in short names.
+     * The following image values are supported for a boot disk:
+     * * "batch-debian": use Batch Debian images.
+     * * "batch-centos": use Batch CentOS images.
+     * * "batch-cos": use Batch Container-Optimized images.
+     * * "batch-hpc-centos": use Batch HPC CentOS images.
+     * 
+ * + * 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.
+     * For example, the following are all valid URLs:
+     * * Specify the image by its family name:
+     * projects/{project}/global/images/family/{image_family}
+     * * Specify the image version:
+     * projects/{project}/global/images/{image_version}
+     * You can also use Batch customized image in short names.
+     * The following image values are supported for a boot disk:
+     * * "batch-debian": use Batch Debian images.
+     * * "batch-centos": use Batch CentOS images.
+     * * "batch-cos": use Batch Container-Optimized images.
+     * * "batch-hpc-centos": use Batch HPC CentOS images.
+     * 
+ * + * 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.
+     * Snapshot is not supported as boot disk now.
+     * 
+ * + * 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.
+     * Snapshot is not supported as boot disk now.
+     * 
+ * + * 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.
+     * Snapshot is not supported as boot disk now.
+     * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + + /** + * + * + *
+     * Disk type as shown in `gcloud compute disk-types list`.
+     * For example, local SSD uses type "local-ssd".
+     * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+     * or "pd-standard".
+     * 
+ * + * 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, local SSD uses type "local-ssd".
+     * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+     * or "pd-standard".
+     * 
+ * + * 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_ = 0L; + + /** + * + * + *
+     * Disk size in GB.
+     * For persistent disk, this field is ignored if `data_source` is `image` or
+     * `snapshot`.
+     * For local SSD, size_gb should be a multiple of 375GB,
+     * otherwise, the final size will be the next greater multiple of 375 GB.
+     * For boot disk, Batch will calculate the boot disk size based on source
+     * image and task requirements if you do not speicify the size.
+     * If both this field and the boot_disk_mib field in task spec's
+     * compute_resource are defined, Batch will only honor this field.
+     * 
+ * + * int64 size_gb = 2; + * + * @return The sizeGb. + */ + @java.lang.Override + public long getSizeGb() { + return sizeGb_; + } + + public static final int DISK_INTERFACE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object diskInterface_ = ""; + + /** + * + * + *
+     * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+     * If not indicated, "NVMe" will be the default one for local ssds.
+     * We only support "SCSI" for persistent disks now.
+     * 
+ * + * string disk_interface = 6; + * + * @return The diskInterface. + */ + @java.lang.Override + public java.lang.String getDiskInterface() { + java.lang.Object ref = diskInterface_; + 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(); + diskInterface_ = s; + return s; + } + } + + /** + * + * + *
+     * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+     * If not indicated, "NVMe" will be the default one for local ssds.
+     * We only support "SCSI" for persistent disks now.
+     * 
+ * + * string disk_interface = 6; + * + * @return The bytes for diskInterface. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiskInterfaceBytes() { + java.lang.Object ref = diskInterface_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diskInterface_ = 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(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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diskInterface_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, diskInterface_); + } + getUnknownFields().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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diskInterface_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, diskInterface_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.Disk)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.Disk other = + (com.google.events.cloud.batch.v1.AllocationPolicy.Disk) obj; + + if (!getType().equals(other.getType())) return false; + if (getSizeGb() != other.getSizeGb()) return false; + if (!getDiskInterface().equals(other.getDiskInterface())) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeGb()); + hash = (37 * hash) + DISK_INTERFACE_FIELD_NUMBER; + hash = (53 * hash) + getDiskInterface().hashCode(); + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.Disk parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Disk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Disk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.Disk parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.Disk parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Disk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Disk parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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 or a local ssd.
+     * A VM can only have one local SSD setting but multiple local SSD partitions.
+     * See https://cloud.google.com/compute/docs/disks#pdspecs and
+     * https://cloud.google.com/compute/docs/disks#localssds.
+     * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.Disk} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.Disk) + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.class, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.AllocationPolicy.Disk.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = ""; + sizeGb_ = 0L; + diskInterface_ = ""; + dataSourceCase_ = 0; + dataSource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk build() { + com.google.events.cloud.batch.v1.AllocationPolicy.Disk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.Disk result = + new com.google.events.cloud.batch.v1.AllocationPolicy.Disk(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.AllocationPolicy.Disk result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sizeGb_ = sizeGb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.diskInterface_ = diskInterface_; + } + } + + private void buildPartialOneofs( + com.google.events.cloud.batch.v1.AllocationPolicy.Disk result) { + result.dataSourceCase_ = dataSourceCase_; + result.dataSource_ = this.dataSource_; + } + + @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.events.cloud.batch.v1.AllocationPolicy.Disk) { + return mergeFrom((com.google.events.cloud.batch.v1.AllocationPolicy.Disk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.AllocationPolicy.Disk other) { + if (other == com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getSizeGb() != 0L) { + setSizeGb(other.getSizeGb()); + } + if (!other.getDiskInterface().isEmpty()) { + diskInterface_ = other.diskInterface_; + bitField0_ |= 0x00000010; + onChanged(); + } + 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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 16: + { + sizeGb_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + dataSourceCase_ = 4; + dataSource_ = s; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + dataSourceCase_ = 5; + dataSource_ = s; + break; + } // case 42 + case 50: + { + diskInterface_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int dataSourceCase_ = 0; + private java.lang.Object dataSource_; + + public DataSourceCase getDataSourceCase() { + return DataSourceCase.forNumber(dataSourceCase_); + } + + public Builder clearDataSource() { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+       * Name of a public or custom image used as the data source.
+       * For example, the following are all valid URLs:
+       * * Specify the image by its family name:
+       * projects/{project}/global/images/family/{image_family}
+       * * Specify the image version:
+       * projects/{project}/global/images/{image_version}
+       * You can also use Batch customized image in short names.
+       * The following image values are supported for a boot disk:
+       * * "batch-debian": use Batch Debian images.
+       * * "batch-centos": use Batch CentOS images.
+       * * "batch-cos": use Batch Container-Optimized images.
+       * * "batch-hpc-centos": use Batch HPC CentOS images.
+       * 
+ * + * 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.
+       * For example, the following are all valid URLs:
+       * * Specify the image by its family name:
+       * projects/{project}/global/images/family/{image_family}
+       * * Specify the image version:
+       * projects/{project}/global/images/{image_version}
+       * You can also use Batch customized image in short names.
+       * The following image values are supported for a boot disk:
+       * * "batch-debian": use Batch Debian images.
+       * * "batch-centos": use Batch CentOS images.
+       * * "batch-cos": use Batch Container-Optimized images.
+       * * "batch-hpc-centos": use Batch HPC CentOS images.
+       * 
+ * + * 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.
+       * For example, the following are all valid URLs:
+       * * Specify the image by its family name:
+       * projects/{project}/global/images/family/{image_family}
+       * * Specify the image version:
+       * projects/{project}/global/images/{image_version}
+       * You can also use Batch customized image in short names.
+       * The following image values are supported for a boot disk:
+       * * "batch-debian": use Batch Debian images.
+       * * "batch-centos": use Batch CentOS images.
+       * * "batch-cos": use Batch Container-Optimized images.
+       * * "batch-hpc-centos": use Batch HPC CentOS images.
+       * 
+ * + * 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.
+       * For example, the following are all valid URLs:
+       * * Specify the image by its family name:
+       * projects/{project}/global/images/family/{image_family}
+       * * Specify the image version:
+       * projects/{project}/global/images/{image_version}
+       * You can also use Batch customized image in short names.
+       * The following image values are supported for a boot disk:
+       * * "batch-debian": use Batch Debian images.
+       * * "batch-centos": use Batch CentOS images.
+       * * "batch-cos": use Batch Container-Optimized images.
+       * * "batch-hpc-centos": use Batch HPC CentOS images.
+       * 
+ * + * 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.
+       * For example, the following are all valid URLs:
+       * * Specify the image by its family name:
+       * projects/{project}/global/images/family/{image_family}
+       * * Specify the image version:
+       * projects/{project}/global/images/{image_version}
+       * You can also use Batch customized image in short names.
+       * The following image values are supported for a boot disk:
+       * * "batch-debian": use Batch Debian images.
+       * * "batch-centos": use Batch CentOS images.
+       * * "batch-cos": use Batch Container-Optimized images.
+       * * "batch-hpc-centos": use Batch HPC CentOS images.
+       * 
+ * + * 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.
+       * For example, the following are all valid URLs:
+       * * Specify the image by its family name:
+       * projects/{project}/global/images/family/{image_family}
+       * * Specify the image version:
+       * projects/{project}/global/images/{image_version}
+       * You can also use Batch customized image in short names.
+       * The following image values are supported for a boot disk:
+       * * "batch-debian": use Batch Debian images.
+       * * "batch-centos": use Batch CentOS images.
+       * * "batch-cos": use Batch Container-Optimized images.
+       * * "batch-hpc-centos": use Batch HPC CentOS images.
+       * 
+ * + * 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.
+       * Snapshot is not supported as boot disk now.
+       * 
+ * + * 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.
+       * Snapshot is not supported as boot disk now.
+       * 
+ * + * 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.
+       * Snapshot is not supported as boot disk now.
+       * 
+ * + * 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.
+       * Snapshot is not supported as boot disk now.
+       * 
+ * + * 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.
+       * Snapshot is not supported as boot disk now.
+       * 
+ * + * 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.
+       * Snapshot is not supported as boot disk now.
+       * 
+ * + * 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, local SSD uses type "local-ssd".
+       * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+       * or "pd-standard".
+       * 
+ * + * 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, local SSD uses type "local-ssd".
+       * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+       * or "pd-standard".
+       * 
+ * + * 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, local SSD uses type "local-ssd".
+       * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+       * or "pd-standard".
+       * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`.
+       * For example, local SSD uses type "local-ssd".
+       * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+       * or "pd-standard".
+       * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Disk type as shown in `gcloud compute disk-types list`.
+       * For example, local SSD uses type "local-ssd".
+       * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
+       * or "pd-standard".
+       * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long sizeGb_; + + /** + * + * + *
+       * Disk size in GB.
+       * For persistent disk, this field is ignored if `data_source` is `image` or
+       * `snapshot`.
+       * For local SSD, size_gb should be a multiple of 375GB,
+       * otherwise, the final size will be the next greater multiple of 375 GB.
+       * For boot disk, Batch will calculate the boot disk size based on source
+       * image and task requirements if you do not speicify the size.
+       * If both this field and the boot_disk_mib field in task spec's
+       * compute_resource are defined, Batch will only honor this field.
+       * 
+ * + * int64 size_gb = 2; + * + * @return The sizeGb. + */ + @java.lang.Override + public long getSizeGb() { + return sizeGb_; + } + + /** + * + * + *
+       * Disk size in GB.
+       * For persistent disk, this field is ignored if `data_source` is `image` or
+       * `snapshot`.
+       * For local SSD, size_gb should be a multiple of 375GB,
+       * otherwise, the final size will be the next greater multiple of 375 GB.
+       * For boot disk, Batch will calculate the boot disk size based on source
+       * image and task requirements if you do not speicify the size.
+       * If both this field and the boot_disk_mib field in task spec's
+       * compute_resource are defined, Batch will only honor this field.
+       * 
+ * + * int64 size_gb = 2; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(long value) { + + sizeGb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Disk size in GB.
+       * For persistent disk, this field is ignored if `data_source` is `image` or
+       * `snapshot`.
+       * For local SSD, size_gb should be a multiple of 375GB,
+       * otherwise, the final size will be the next greater multiple of 375 GB.
+       * For boot disk, Batch will calculate the boot disk size based on source
+       * image and task requirements if you do not speicify the size.
+       * If both this field and the boot_disk_mib field in task spec's
+       * compute_resource are defined, Batch will only honor this field.
+       * 
+ * + * int64 size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + bitField0_ = (bitField0_ & ~0x00000008); + sizeGb_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object diskInterface_ = ""; + + /** + * + * + *
+       * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+       * If not indicated, "NVMe" will be the default one for local ssds.
+       * We only support "SCSI" for persistent disks now.
+       * 
+ * + * string disk_interface = 6; + * + * @return The diskInterface. + */ + public java.lang.String getDiskInterface() { + java.lang.Object ref = diskInterface_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diskInterface_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+       * If not indicated, "NVMe" will be the default one for local ssds.
+       * We only support "SCSI" for persistent disks now.
+       * 
+ * + * string disk_interface = 6; + * + * @return The bytes for diskInterface. + */ + public com.google.protobuf.ByteString getDiskInterfaceBytes() { + java.lang.Object ref = diskInterface_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diskInterface_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+       * If not indicated, "NVMe" will be the default one for local ssds.
+       * We only support "SCSI" for persistent disks now.
+       * 
+ * + * string disk_interface = 6; + * + * @param value The diskInterface to set. + * @return This builder for chaining. + */ + public Builder setDiskInterface(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + diskInterface_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+       * If not indicated, "NVMe" will be the default one for local ssds.
+       * We only support "SCSI" for persistent disks now.
+       * 
+ * + * string disk_interface = 6; + * + * @return This builder for chaining. + */ + public Builder clearDiskInterface() { + diskInterface_ = getDefaultInstance().getDiskInterface(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * Local SSDs are available through both "SCSI" and "NVMe" interfaces.
+       * If not indicated, "NVMe" will be the default one for local ssds.
+       * We only support "SCSI" for persistent disks now.
+       * 
+ * + * string disk_interface = 6; + * + * @param value The bytes for diskInterface to set. + * @return This builder for chaining. + */ + public Builder setDiskInterfaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + diskInterface_ = value; + bitField0_ |= 0x00000010; + 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.events.cloud.batch.v1.AllocationPolicy.Disk) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.Disk) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.Disk DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.Disk(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AttachedDiskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * + * @return Whether the newDisk field is set. + */ + boolean hasNewDisk(); + + /** + * .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * + * @return The newDisk. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.Disk getNewDisk(); + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + com.google.events.cloud.batch.v1.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.
+     * It is used by Runnable.volumes field to mount disks. So please specify
+     * the device_name if you want Batch to help mount the disk, and it should
+     * match the device_name field in volumes.
+     * 
+ * + * string device_name = 3; + * + * @return The deviceName. + */ + java.lang.String getDeviceName(); + + /** + * + * + *
+     * Device name that the guest operating system will see.
+     * It is used by Runnable.volumes field to mount disks. So please specify
+     * the device_name if you want Batch to help mount the disk, and it should
+     * match the device_name field in volumes.
+     * 
+ * + * string device_name = 3; + * + * @return The bytes for deviceName. + */ + com.google.protobuf.ByteString getDeviceNameBytes(); + + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.AttachedCase + getAttachedCase(); + } + + /** + * + * + *
+   * A new or an existing persistent disk (PD) or a local ssd attached to a VM
+   * instance.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk} + */ + public static final class AttachedDisk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.class, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * + * @return Whether the newDisk field is set. + */ + @java.lang.Override + public boolean hasNewDisk() { + return attachedCase_ == 1; + } + + /** + * .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * + * @return The newDisk. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getNewDisk() { + if (attachedCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.Disk) attached_; + } + return com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance(); + } + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder getNewDiskOrBuilder() { + if (attachedCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.Disk) attached_; + } + return com.google.events.cloud.batch.v1.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; + + @SuppressWarnings("serial") + private volatile java.lang.Object deviceName_ = ""; + + /** + * + * + *
+     * Device name that the guest operating system will see.
+     * It is used by Runnable.volumes field to mount disks. So please specify
+     * the device_name if you want Batch to help mount the disk, and it should
+     * match the device_name field in volumes.
+     * 
+ * + * 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.
+     * It is used by Runnable.volumes field to mount disks. So please specify
+     * the device_name if you want Batch to help mount the disk, and it should
+     * match the device_name field in volumes.
+     * 
+ * + * 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.events.cloud.batch.v1.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_); + } + getUnknownFields().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.events.cloud.batch.v1.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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk other = + (com.google.events.cloud.batch.v1.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.AttachedDisk parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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 (PD) or a local ssd attached to a VM
+     * instance.
+     * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk) + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDiskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.class, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (newDiskBuilder_ != null) { + newDiskBuilder_.clear(); + } + deviceName_ = ""; + attachedCase_ = 0; + attached_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk build() { + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk result = + new com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deviceName_ = deviceName_; + } + } + + private void buildPartialOneofs( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk result) { + result.attachedCase_ = attachedCase_; + result.attached_ = this.attached_; + if (attachedCase_ == 1 && newDiskBuilder_ != null) { + result.attached_ = newDiskBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.AllocationPolicy.AttachedDisk) { + return mergeFrom((com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk other) { + if (other + == com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.getDefaultInstance()) + return this; + if (!other.getDeviceName().isEmpty()) { + deviceName_ = other.deviceName_; + bitField0_ |= 0x00000004; + 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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getNewDiskFieldBuilder().getBuilder(), extensionRegistry); + attachedCase_ = 1; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + attachedCase_ = 2; + attached_ = s; + break; + } // case 18 + case 26: + { + deviceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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 int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder> + newDiskBuilder_; + + /** + * .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * + * @return Whether the newDisk field is set. + */ + @java.lang.Override + public boolean hasNewDisk() { + return attachedCase_ == 1; + } + + /** + * .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * + * @return The newDisk. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getNewDisk() { + if (newDiskBuilder_ == null) { + if (attachedCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.Disk) attached_; + } + return com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance(); + } else { + if (attachedCase_ == 1) { + return newDiskBuilder_.getMessage(); + } + return com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance(); + } + } + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + public Builder setNewDisk(com.google.events.cloud.batch.v1.AllocationPolicy.Disk value) { + if (newDiskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attached_ = value; + onChanged(); + } else { + newDiskBuilder_.setMessage(value); + } + attachedCase_ = 1; + return this; + } + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + public Builder setNewDisk( + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder builderForValue) { + if (newDiskBuilder_ == null) { + attached_ = builderForValue.build(); + onChanged(); + } else { + newDiskBuilder_.setMessage(builderForValue.build()); + } + attachedCase_ = 1; + return this; + } + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + public Builder mergeNewDisk(com.google.events.cloud.batch.v1.AllocationPolicy.Disk value) { + if (newDiskBuilder_ == null) { + if (attachedCase_ == 1 + && attached_ + != com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance()) { + attached_ = + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.newBuilder( + (com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder getNewDiskBuilder() { + return getNewDiskFieldBuilder().getBuilder(); + } + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder getNewDiskOrBuilder() { + if ((attachedCase_ == 1) && (newDiskBuilder_ != null)) { + return newDiskBuilder_.getMessageOrBuilder(); + } else { + if (attachedCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.Disk) attached_; + } + return com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance(); + } + } + + /** .google.events.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder> + getNewDiskFieldBuilder() { + if (newDiskBuilder_ == null) { + if (!(attachedCase_ == 1)) { + attached_ = com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance(); + } + newDiskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder>( + (com.google.events.cloud.batch.v1.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.
+       * It is used by Runnable.volumes field to mount disks. So please specify
+       * the device_name if you want Batch to help mount the disk, and it should
+       * match the device_name field in volumes.
+       * 
+ * + * 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.
+       * It is used by Runnable.volumes field to mount disks. So please specify
+       * the device_name if you want Batch to help mount the disk, and it should
+       * match the device_name field in volumes.
+       * 
+ * + * 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.
+       * It is used by Runnable.volumes field to mount disks. So please specify
+       * the device_name if you want Batch to help mount the disk, and it should
+       * match the device_name field in volumes.
+       * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * It is used by Runnable.volumes field to mount disks. So please specify
+       * the device_name if you want Batch to help mount the disk, and it should
+       * match the device_name field in volumes.
+       * 
+ * + * string device_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDeviceName() { + deviceName_ = getDefaultInstance().getDeviceName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Device name that the guest operating system will see.
+       * It is used by Runnable.volumes field to mount disks. So please specify
+       * the device_name if you want Batch to help mount the disk, and it should
+       * match the device_name field in volumes.
+       * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.events.cloud.batch.v1.AllocationPolicy.AttachedDisk) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AcceleratorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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(); + + /** + * + * + *
+     * Deprecated: please use instances[0].install_gpu_drivers instead.
+     * 
+ * + * bool install_gpu_drivers = 3; + * + * @return The installGpuDrivers. + */ + boolean getInstallGpuDrivers(); + } + + /** + * + * + *
+   * Accelerator describes Compute Engine accelerators to be attached to the VM.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.Accelerator} + */ + public static final class Accelerator extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.class, + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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_ = 0L; + + /** + * + * + *
+     * The number of accelerators of this type.
+     * 
+ * + * int64 count = 2; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + public static final int INSTALL_GPU_DRIVERS_FIELD_NUMBER = 3; + private boolean installGpuDrivers_ = false; + + /** + * + * + *
+     * Deprecated: please use instances[0].install_gpu_drivers instead.
+     * 
+ * + * bool install_gpu_drivers = 3; + * + * @return The installGpuDrivers. + */ + @java.lang.Override + public boolean getInstallGpuDrivers() { + return installGpuDrivers_; + } + + 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_); + } + if (installGpuDrivers_ != false) { + output.writeBool(3, installGpuDrivers_); + } + getUnknownFields().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_); + } + if (installGpuDrivers_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, installGpuDrivers_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator other = + (com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator) obj; + + if (!getType().equals(other.getType())) return false; + if (getCount() != other.getCount()) return false; + if (getInstallGpuDrivers() != other.getInstallGpuDrivers()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (37 * hash) + INSTALL_GPU_DRIVERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInstallGpuDrivers()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Accelerator parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Accelerator parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Accelerator parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.Accelerator parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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 the VM.
+     * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.Accelerator} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.Accelerator) + com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.class, + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = ""; + count_ = 0L; + installGpuDrivers_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator build() { + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator result = + new com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.count_ = count_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.installGpuDrivers_ = installGpuDrivers_; + } + } + + @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.events.cloud.batch.v1.AllocationPolicy.Accelerator) { + return mergeFrom((com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator other) { + if (other + == com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + if (other.getInstallGpuDrivers() != false) { + setInstallGpuDrivers(other.getInstallGpuDrivers()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + count_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + installGpuDrivers_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The number of accelerators of this type.
+       * 
+ * + * int64 count = 2; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000002); + count_ = 0L; + onChanged(); + return this; + } + + private boolean installGpuDrivers_; + + /** + * + * + *
+       * Deprecated: please use instances[0].install_gpu_drivers instead.
+       * 
+ * + * bool install_gpu_drivers = 3; + * + * @return The installGpuDrivers. + */ + @java.lang.Override + public boolean getInstallGpuDrivers() { + return installGpuDrivers_; + } + + /** + * + * + *
+       * Deprecated: please use instances[0].install_gpu_drivers instead.
+       * 
+ * + * bool install_gpu_drivers = 3; + * + * @param value The installGpuDrivers to set. + * @return This builder for chaining. + */ + public Builder setInstallGpuDrivers(boolean value) { + + installGpuDrivers_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Deprecated: please use instances[0].install_gpu_drivers instead.
+       * 
+ * + * bool install_gpu_drivers = 3; + * + * @return This builder for chaining. + */ + public Builder clearInstallGpuDrivers() { + bitField0_ = (bitField0_ & ~0x00000004); + installGpuDrivers_ = 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.events.cloud.batch.v1.AllocationPolicy.Accelerator) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.Accelerator) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InstancePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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.
+     * 
+ * + * 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.
+     * 
+ * + * string min_cpu_platform = 3; + * + * @return The bytes for minCpuPlatform. + */ + com.google.protobuf.ByteString getMinCpuPlatformBytes(); + + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + int getProvisioningModelValue(); + + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The provisioningModel. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel getProvisioningModel(); + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + java.util.List + getAcceleratorsList(); + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator getAccelerators(int index); + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + int getAcceleratorsCount(); + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + java.util.List + getAcceleratorsOrBuilderList(); + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder getAcceleratorsOrBuilder( + int index); + + /** + * + * + *
+     * Boot disk to be created and attached to each VM by this InstancePolicy.
+     * Boot disk will be deleted when the VM is deleted.
+     * Batch API now only supports booting from image.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * + * @return Whether the bootDisk field is set. + */ + boolean hasBootDisk(); + + /** + * + * + *
+     * Boot disk to be created and attached to each VM by this InstancePolicy.
+     * Boot disk will be deleted when the VM is deleted.
+     * Batch API now only supports booting from image.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * + * @return The bootDisk. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.Disk getBootDisk(); + + /** + * + * + *
+     * Boot disk to be created and attached to each VM by this InstancePolicy.
+     * Boot disk will be deleted when the VM is deleted.
+     * Batch API now only supports booting from image.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder getBootDiskOrBuilder(); + + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + com.google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + java.util.List< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDiskOrBuilder> + getDisksOrBuilderList(); + + /** + * + * + *
+     * Non-boot disks to be attached for each VM created by this InstancePolicy.
+     * New disks will be deleted when the VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDiskOrBuilder getDisksOrBuilder( + int index); + } + + /** + * + * + *
+   * InstancePolicy describes an instance type and resources attached to each VM
+   * created by this InstancePolicy.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy} + */ + public static final class InstancePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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() { + 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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder.class); + } + + public static final int MACHINE_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object minCpuPlatform_ = ""; + + /** + * + * + *
+     * The minimum CPU platform.
+     * See
+     * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
+     * 
+ * + * 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.
+     * 
+ * + * 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_ = 0; + + /** + * + * + *
+     * The provisioning model.
+     * 
+ * + * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel result = + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.forNumber( + provisioningModel_); + return result == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + + public static final int ACCELERATORS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List + accelerators_; + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public java.util.List + getAcceleratorsList() { + return accelerators_; + } + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder> + getAcceleratorsOrBuilderList() { + return accelerators_; + } + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public int getAcceleratorsCount() { + return accelerators_.size(); + } + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator getAccelerators( + int index) { + return accelerators_.get(index); + } + + /** + * + * + *
+     * The accelerators attached to each VM instance.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder + getAcceleratorsOrBuilder(int index) { + return accelerators_.get(index); + } + + public static final int BOOT_DISK_FIELD_NUMBER = 8; + private com.google.events.cloud.batch.v1.AllocationPolicy.Disk bootDisk_; + + /** + * + * + *
+     * Boot disk to be created and attached to each VM by this InstancePolicy.
+     * Boot disk will be deleted when the VM is deleted.
+     * Batch API now only supports booting from image.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * + * @return Whether the bootDisk field is set. + */ + @java.lang.Override + public boolean hasBootDisk() { + return bootDisk_ != null; + } + + /** + * + * + *
+     * Boot disk to be created and attached to each VM by this InstancePolicy.
+     * Boot disk will be deleted when the VM is deleted.
+     * Batch API now only supports booting from image.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * + * @return The bootDisk. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getBootDisk() { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } + + /** + * + * + *
+     * Boot disk to be created and attached to each VM by this InstancePolicy.
+     * Boot disk will be deleted when the VM is deleted.
+     * Batch API now only supports booting from image.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder getBootDiskOrBuilder() { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } + + public static final int DISKS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + 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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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 VM is deleted.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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 { + 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.events.cloud.batch.v1.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)); + } + if (bootDisk_ != null) { + output.writeMessage(8, getBootDisk()); + } + getUnknownFields().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(2, machineType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(minCpuPlatform_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, minCpuPlatform_); + } + if (provisioningModel_ + != com.google.events.cloud.batch.v1.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)); + } + if (bootDisk_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getBootDisk()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy other = + (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) obj; + + 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 (hasBootDisk() != other.hasBootDisk()) return false; + if (hasBootDisk()) { + if (!getBootDisk().equals(other.getBootDisk())) return false; + } + if (!getDisksList().equals(other.getDisksList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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 (hasBootDisk()) { + hash = (37 * hash) + BOOT_DISK_FIELD_NUMBER; + hash = (53 * hash) + getBootDisk().hashCode(); + } + if (getDisksCount() > 0) { + hash = (37 * hash) + DISKS_FIELD_NUMBER; + hash = (53 * hash) + getDisksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder.class); + } + + // Construct using + // com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + machineType_ = ""; + minCpuPlatform_ = ""; + provisioningModel_ = 0; + if (acceleratorsBuilder_ == null) { + accelerators_ = java.util.Collections.emptyList(); + } else { + accelerators_ = null; + acceleratorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + bootDisk_ = null; + if (bootDiskBuilder_ != null) { + bootDiskBuilder_.dispose(); + bootDiskBuilder_ = null; + } + if (disksBuilder_ == null) { + disks_ = java.util.Collections.emptyList(); + } else { + disks_ = null; + disksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy build() { + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy result = + new com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy result) { + if (acceleratorsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + accelerators_ = java.util.Collections.unmodifiableList(accelerators_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.accelerators_ = accelerators_; + } else { + result.accelerators_ = acceleratorsBuilder_.build(); + } + if (disksBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + disks_ = java.util.Collections.unmodifiableList(disks_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.disks_ = disks_; + } else { + result.disks_ = disksBuilder_.build(); + } + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.machineType_ = machineType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minCpuPlatform_ = minCpuPlatform_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.provisioningModel_ = provisioningModel_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.bootDisk_ = bootDiskBuilder_ == null ? bootDisk_ : bootDiskBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) { + return mergeFrom( + (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy other) { + if (other + == com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance()) return this; + if (!other.getMachineType().isEmpty()) { + machineType_ = other.machineType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getMinCpuPlatform().isEmpty()) { + minCpuPlatform_ = other.minCpuPlatform_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.provisioningModel_ != 0) { + setProvisioningModelValue(other.getProvisioningModelValue()); + } + if (acceleratorsBuilder_ == null) { + if (!other.accelerators_.isEmpty()) { + if (accelerators_.isEmpty()) { + accelerators_ = other.accelerators_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAcceleratorsIsMutable(); + accelerators_.addAll(other.accelerators_); + } + onChanged(); + } + } else { + if (!other.accelerators_.isEmpty()) { + if (acceleratorsBuilder_.isEmpty()) { + acceleratorsBuilder_.dispose(); + acceleratorsBuilder_ = null; + accelerators_ = other.accelerators_; + bitField0_ = (bitField0_ & ~0x00000008); + acceleratorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAcceleratorsFieldBuilder() + : null; + } else { + acceleratorsBuilder_.addAllMessages(other.accelerators_); + } + } + } + if (other.hasBootDisk()) { + mergeBootDisk(other.getBootDisk()); + } + if (disksBuilder_ == null) { + if (!other.disks_.isEmpty()) { + if (disks_.isEmpty()) { + disks_ = other.disks_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureDisksIsMutable(); + disks_.addAll(other.disks_); + } + onChanged(); + } + } else { + if (!other.disks_.isEmpty()) { + if (disksBuilder_.isEmpty()) { + disksBuilder_.dispose(); + disksBuilder_ = null; + disks_ = other.disks_; + bitField0_ = (bitField0_ & ~0x00000020); + disksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDisksFieldBuilder() + : null; + } else { + disksBuilder_.addAllMessages(other.disks_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + machineType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 26: + { + minCpuPlatform_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + provisioningModel_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator m = + input.readMessage( + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.parser(), + extensionRegistry); + if (acceleratorsBuilder_ == null) { + ensureAcceleratorsIsMutable(); + accelerators_.add(m); + } else { + acceleratorsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk m = + input.readMessage( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.parser(), + extensionRegistry); + if (disksBuilder_ == null) { + ensureDisksIsMutable(); + disks_.add(m); + } else { + disksBuilder_.addMessage(m); + } + break; + } // case 50 + case 66: + { + input.readMessage(getBootDiskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearMachineType() { + machineType_ = getDefaultInstance().getMachineType(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object minCpuPlatform_ = ""; + + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
+       * 
+ * + * 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.
+       * 
+ * + * 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.
+       * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
+       * 
+ * + * string min_cpu_platform = 3; + * + * @return This builder for chaining. + */ + public Builder clearMinCpuPlatform() { + minCpuPlatform_ = getDefaultInstance().getMinCpuPlatform(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum CPU platform.
+       * See
+       * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
+       * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int provisioningModel_ = 0; + + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel result = + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.forNumber( + provisioningModel_); + return result == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @param value The provisioningModel to set. + * @return This builder for chaining. + */ + public Builder setProvisioningModel( + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + provisioningModel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearProvisioningModel() { + bitField0_ = (bitField0_ & ~0x00000004); + provisioningModel_ = 0; + onChanged(); + return this; + } + + private java.util.List + accelerators_ = java.util.Collections.emptyList(); + + private void ensureAcceleratorsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + accelerators_ = + new java.util.ArrayList< + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator>(accelerators_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator, + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder> + acceleratorsBuilder_; + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public int getAcceleratorsCount() { + if (acceleratorsBuilder_ == null) { + return accelerators_.size(); + } else { + return acceleratorsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator getAccelerators( + int index) { + if (acceleratorsBuilder_ == null) { + return accelerators_.get(index); + } else { + return acceleratorsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder setAccelerators( + int index, com.google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder setAccelerators( + int index, + com.google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + com.google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + int index, com.google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + com.google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAccelerators( + int index, + com.google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder addAllAccelerators( + java.lang.Iterable< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator> + 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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public Builder clearAccelerators() { + if (acceleratorsBuilder_ == null) { + accelerators_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + acceleratorsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.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.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder + getAcceleratorsBuilder(int index) { + return getAcceleratorsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder + getAcceleratorsOrBuilder(int index) { + if (acceleratorsBuilder_ == null) { + return accelerators_.get(index); + } else { + return acceleratorsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public java.util.List< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder> + getAcceleratorsOrBuilderList() { + if (acceleratorsBuilder_ != null) { + return acceleratorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(accelerators_); + } + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder + addAcceleratorsBuilder() { + return getAcceleratorsFieldBuilder() + .addBuilder( + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.getDefaultInstance()); + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder + addAcceleratorsBuilder(int index) { + return getAcceleratorsFieldBuilder() + .addBuilder( + index, + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.getDefaultInstance()); + } + + /** + * + * + *
+       * The accelerators attached to each VM instance.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * + */ + public java.util.List + getAcceleratorsBuilderList() { + return getAcceleratorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator, + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder> + getAcceleratorsFieldBuilder() { + if (acceleratorsBuilder_ == null) { + acceleratorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator, + com.google.events.cloud.batch.v1.AllocationPolicy.Accelerator.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.AcceleratorOrBuilder>( + accelerators_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + accelerators_ = null; + } + return acceleratorsBuilder_; + } + + private com.google.events.cloud.batch.v1.AllocationPolicy.Disk bootDisk_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder> + bootDiskBuilder_; + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * + * @return Whether the bootDisk field is set. + */ + public boolean hasBootDisk() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * + * @return The bootDisk. + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getBootDisk() { + if (bootDiskBuilder_ == null) { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } else { + return bootDiskBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + public Builder setBootDisk(com.google.events.cloud.batch.v1.AllocationPolicy.Disk value) { + if (bootDiskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bootDisk_ = value; + } else { + bootDiskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + public Builder setBootDisk( + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder builderForValue) { + if (bootDiskBuilder_ == null) { + bootDisk_ = builderForValue.build(); + } else { + bootDiskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + public Builder mergeBootDisk(com.google.events.cloud.batch.v1.AllocationPolicy.Disk value) { + if (bootDiskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && bootDisk_ != null + && bootDisk_ + != com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance()) { + getBootDiskBuilder().mergeFrom(value); + } else { + bootDisk_ = value; + } + } else { + bootDiskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + public Builder clearBootDisk() { + bitField0_ = (bitField0_ & ~0x00000010); + bootDisk_ = null; + if (bootDiskBuilder_ != null) { + bootDiskBuilder_.dispose(); + bootDiskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder getBootDiskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBootDiskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder + getBootDiskOrBuilder() { + if (bootDiskBuilder_ != null) { + return bootDiskBuilder_.getMessageOrBuilder(); + } else { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } + } + + /** + * + * + *
+       * Boot disk to be created and attached to each VM by this InstancePolicy.
+       * Boot disk will be deleted when the VM is deleted.
+       * Batch API now only supports booting from image.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder> + getBootDiskFieldBuilder() { + if (bootDiskBuilder_ == null) { + bootDiskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder>( + getBootDisk(), getParentForChildren(), isClean()); + bootDisk_ = null; + } + return bootDiskBuilder_; + } + + private java.util.List + disks_ = java.util.Collections.emptyList(); + + private void ensureDisksIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + disks_ = + new java.util.ArrayList< + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk>(disks_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDiskOrBuilder> + disksBuilder_; + + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder setDisks( + int index, com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder setDisks( + int index, + com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder addDisks( + com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder addDisks( + int index, com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder addDisks( + com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder addDisks( + int index, + com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder addAllDisks( + java.lang.Iterable< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk> + 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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public Builder clearDisks() { + if (disksBuilder_ == null) { + disks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + 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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public java.util.List< + ? extends com.google.events.cloud.batch.v1.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 VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.Builder + addDisksBuilder() { + return getDisksFieldBuilder() + .addBuilder( + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk + .getDefaultInstance()); + } + + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.Builder addDisksBuilder( + int index) { + return getDisksFieldBuilder() + .addBuilder( + index, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk + .getDefaultInstance()); + } + + /** + * + * + *
+       * Non-boot disks to be attached for each VM created by this InstancePolicy.
+       * New disks will be deleted when the VM is deleted.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * + */ + public java.util.List + getDisksBuilderList() { + return getDisksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDiskOrBuilder> + getDisksFieldBuilder() { + if (disksBuilder_ == null) { + disksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDisk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.AttachedDiskOrBuilder>( + disks_, ((bitField0_ & 0x00000020) != 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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InstancePolicyOrTemplateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * + * @return The policy. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy getPolicy(); + + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + com.google.events.cloud.batch.v1.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(); + + /** + * + * + *
+     * Set this field true if users want Batch to help fetch drivers from a
+     * third party location and install them for GPUs specified in
+     * policy.accelerators or instance_template on their behalf. Default is
+     * false.
+     * 
+ * + * bool install_gpu_drivers = 3; + * + * @return The installGpuDrivers. + */ + boolean getInstallGpuDrivers(); + + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + .PolicyTemplateCase + getPolicyTemplateCase(); + } + + /** + * + * + *
+   * Either an InstancePolicy or an instance template.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} + */ + public static final class InstancePolicyOrTemplate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.class, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policyTemplateCase_ == 1; + } + + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * + * @return The policy. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy getPolicy() { + if (policyTemplateCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) policyTemplate_; + } + return com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.getDefaultInstance(); + } + + /** + * + * + *
+     * InstancePolicy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrBuilder + getPolicyOrBuilder() { + if (policyTemplateCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) policyTemplate_; + } + return com.google.events.cloud.batch.v1.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; + } + } + + public static final int INSTALL_GPU_DRIVERS_FIELD_NUMBER = 3; + private boolean installGpuDrivers_ = false; + + /** + * + * + *
+     * Set this field true if users want Batch to help fetch drivers from a
+     * third party location and install them for GPUs specified in
+     * policy.accelerators or instance_template on their behalf. Default is
+     * false.
+     * 
+ * + * bool install_gpu_drivers = 3; + * + * @return The installGpuDrivers. + */ + @java.lang.Override + public boolean getInstallGpuDrivers() { + return installGpuDrivers_; + } + + 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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) policyTemplate_); + } + if (policyTemplateCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, policyTemplate_); + } + if (installGpuDrivers_ != false) { + output.writeBool(3, installGpuDrivers_); + } + getUnknownFields().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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) policyTemplate_); + } + if (policyTemplateCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, policyTemplate_); + } + if (installGpuDrivers_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, installGpuDrivers_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate other = + (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) obj; + + if (getInstallGpuDrivers() != other.getInstallGpuDrivers()) return false; + 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INSTALL_GPU_DRIVERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInstallGpuDrivers()); + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.class, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder + .class); + } + + // Construct using + // com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBuilder_ != null) { + policyBuilder_.clear(); + } + installGpuDrivers_ = false; + policyTemplateCase_ = 0; + policyTemplate_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate build() { + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate result = + new com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.installGpuDrivers_ = installGpuDrivers_; + } + } + + private void buildPartialOneofs( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate result) { + result.policyTemplateCase_ = policyTemplateCase_; + result.policyTemplate_ = this.policyTemplate_; + if (policyTemplateCase_ == 1 && policyBuilder_ != null) { + result.policyTemplate_ = policyBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) { + return mergeFrom( + (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate other) { + if (other + == com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance()) return this; + if (other.getInstallGpuDrivers() != false) { + setInstallGpuDrivers(other.getInstallGpuDrivers()); + } + 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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + policyTemplateCase_ = 1; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + policyTemplateCase_ = 2; + policyTemplate_ = s; + break; + } // case 18 + case 24: + { + installGpuDrivers_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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 int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrBuilder> + policyBuilder_; + + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policyTemplateCase_ == 1; + } + + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * + * @return The policy. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy getPolicy() { + if (policyBuilder_ == null) { + if (policyTemplateCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) + policyTemplate_; + } + return com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } else { + if (policyTemplateCase_ == 1) { + return policyBuilder_.getMessage(); + } + return com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder setPolicy( + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder setPolicy( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder + builderForValue) { + if (policyBuilder_ == null) { + policyTemplate_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + policyTemplateCase_ = 1; + return this; + } + + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + public Builder mergePolicy( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy value) { + if (policyBuilder_ == null) { + if (policyTemplateCase_ == 1 + && policyTemplate_ + != com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance()) { + policyTemplate_ = + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.newBuilder( + (com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder + getPolicyBuilder() { + return getPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrBuilder + getPolicyOrBuilder() { + if ((policyTemplateCase_ == 1) && (policyBuilder_ != null)) { + return policyBuilder_.getMessageOrBuilder(); + } else { + if (policyTemplateCase_ == 1) { + return (com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy) + policyTemplate_; + } + return com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * InstancePolicy.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + if (!(policyTemplateCase_ == 1)) { + policyTemplate_ = + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy + .getDefaultInstance(); + } + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrBuilder>( + (com.google.events.cloud.batch.v1.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; + } + + private boolean installGpuDrivers_; + + /** + * + * + *
+       * Set this field true if users want Batch to help fetch drivers from a
+       * third party location and install them for GPUs specified in
+       * policy.accelerators or instance_template on their behalf. Default is
+       * false.
+       * 
+ * + * bool install_gpu_drivers = 3; + * + * @return The installGpuDrivers. + */ + @java.lang.Override + public boolean getInstallGpuDrivers() { + return installGpuDrivers_; + } + + /** + * + * + *
+       * Set this field true if users want Batch to help fetch drivers from a
+       * third party location and install them for GPUs specified in
+       * policy.accelerators or instance_template on their behalf. Default is
+       * false.
+       * 
+ * + * bool install_gpu_drivers = 3; + * + * @param value The installGpuDrivers to set. + * @return This builder for chaining. + */ + public Builder setInstallGpuDrivers(boolean value) { + + installGpuDrivers_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Set this field true if users want Batch to help fetch drivers from a
+       * third party location and install them for GPUs specified in
+       * policy.accelerators or instance_template on their behalf. Default is
+       * false.
+       * 
+ * + * bool install_gpu_drivers = 3; + * + * @return This builder for chaining. + */ + public Builder clearInstallGpuDrivers() { + bitField0_ = (bitField0_ & ~0x00000004); + installGpuDrivers_ = 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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NetworkInterfaceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The URL of an existing network resource.
+     * You can specify the network as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+     * * projects/{project}/global/networks/{network}
+     * * global/networks/{network}
+     * 
+ * + * string network = 1; + * + * @return The network. + */ + java.lang.String getNetwork(); + + /** + * + * + *
+     * The URL of an existing network resource.
+     * You can specify the network as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+     * * projects/{project}/global/networks/{network}
+     * * global/networks/{network}
+     * 
+ * + * string network = 1; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+     * The URL of an existing subnetwork resource in the network.
+     * You can specify the subnetwork as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * regions/{region}/subnetworks/{subnetwork}
+     * 
+ * + * string subnetwork = 2; + * + * @return The subnetwork. + */ + java.lang.String getSubnetwork(); + + /** + * + * + *
+     * The URL of an existing subnetwork resource in the network.
+     * You can specify the subnetwork as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * regions/{region}/subnetworks/{subnetwork}
+     * 
+ * + * 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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface} + */ + public static final class NetworkInterface extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.class, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + + /** + * + * + *
+     * The URL of an existing network resource.
+     * You can specify the network as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+     * * projects/{project}/global/networks/{network}
+     * * global/networks/{network}
+     * 
+ * + * 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 an existing network resource.
+     * You can specify the network as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+     * * projects/{project}/global/networks/{network}
+     * * global/networks/{network}
+     * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object subnetwork_ = ""; + + /** + * + * + *
+     * The URL of an existing subnetwork resource in the network.
+     * You can specify the subnetwork as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * regions/{region}/subnetworks/{subnetwork}
+     * 
+ * + * 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 an existing subnetwork resource in the network.
+     * You can specify the subnetwork as a full or partial URL.
+     * For example, the following are all valid URLs:
+     * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+     * * regions/{region}/subnetworks/{subnetwork}
+     * 
+ * + * 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_ = false; + + /** + * + * + *
+     * 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface other = + (com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) obj; + + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getSubnetwork().equals(other.getSubnetwork())) return false; + if (getNoExternalIpAddress() != other.getNoExternalIpAddress()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.class, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder.class); + } + + // Construct using + // com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + network_ = ""; + subnetwork_ = ""; + noExternalIpAddress_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface build() { + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface result = + new com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.subnetwork_ = subnetwork_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.noExternalIpAddress_ = noExternalIpAddress_; + } + } + + @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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) { + return mergeFrom( + (com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface other) { + if (other + == com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + .getDefaultInstance()) return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSubnetwork().isEmpty()) { + subnetwork_ = other.subnetwork_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getNoExternalIpAddress() != false) { + setNoExternalIpAddress(other.getNoExternalIpAddress()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + subnetwork_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + noExternalIpAddress_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object network_ = ""; + + /** + * + * + *
+       * The URL of an existing network resource.
+       * You can specify the network as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+       * * projects/{project}/global/networks/{network}
+       * * global/networks/{network}
+       * 
+ * + * 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 an existing network resource.
+       * You can specify the network as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+       * * projects/{project}/global/networks/{network}
+       * * global/networks/{network}
+       * 
+ * + * 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 an existing network resource.
+       * You can specify the network as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+       * * projects/{project}/global/networks/{network}
+       * * global/networks/{network}
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The URL of an existing network resource.
+       * You can specify the network as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+       * * projects/{project}/global/networks/{network}
+       * * global/networks/{network}
+       * 
+ * + * string network = 1; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The URL of an existing network resource.
+       * You can specify the network as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
+       * * projects/{project}/global/networks/{network}
+       * * global/networks/{network}
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object subnetwork_ = ""; + + /** + * + * + *
+       * The URL of an existing subnetwork resource in the network.
+       * You can specify the subnetwork as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * regions/{region}/subnetworks/{subnetwork}
+       * 
+ * + * 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 an existing subnetwork resource in the network.
+       * You can specify the subnetwork as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * regions/{region}/subnetworks/{subnetwork}
+       * 
+ * + * 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 an existing subnetwork resource in the network.
+       * You can specify the subnetwork as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * regions/{region}/subnetworks/{subnetwork}
+       * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The URL of an existing subnetwork resource in the network.
+       * You can specify the subnetwork as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * regions/{region}/subnetworks/{subnetwork}
+       * 
+ * + * string subnetwork = 2; + * + * @return This builder for chaining. + */ + public Builder clearSubnetwork() { + subnetwork_ = getDefaultInstance().getSubnetwork(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The URL of an existing subnetwork resource in the network.
+       * You can specify the subnetwork as a full or partial URL.
+       * For example, the following are all valid URLs:
+       * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * projects/{project}/regions/{region}/subnetworks/{subnetwork}
+       * * regions/{region}/subnetworks/{subnetwork}
+       * 
+ * + * 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; + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + 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() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NetworkPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + java.util.List + getNetworkInterfacesList(); + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface getNetworkInterfaces( + int index); + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + int getNetworkInterfacesCount(); + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + java.util.List< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesOrBuilderList(); + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder + getNetworkInterfacesOrBuilder(int index); + } + + /** + * + * + *
+   * NetworkPolicy describes VM instance network configurations.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy} + */ + public static final class NetworkPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder.class); + } + + public static final int NETWORK_INTERFACES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + networkInterfaces_; + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public java.util.List + getNetworkInterfacesList() { + return networkInterfaces_; + } + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesOrBuilderList() { + return networkInterfaces_; + } + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public int getNetworkInterfacesCount() { + return networkInterfaces_.size(); + } + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface getNetworkInterfaces( + int index) { + return networkInterfaces_.get(index); + } + + /** + * + * + *
+     * Network configurations.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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)); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy other = + (com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) obj; + + if (!getNetworkInterfacesList().equals(other.getNetworkInterfacesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNetworkInterfacesCount() > 0) { + hash = (37 * hash) + NETWORK_INTERFACES_FIELD_NUMBER; + hash = (53 * hash) + getNetworkInterfacesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder.class); + } + + // Construct using + // com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (networkInterfacesBuilder_ == null) { + networkInterfaces_ = java.util.Collections.emptyList(); + } else { + networkInterfaces_ = null; + networkInterfacesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy build() { + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy result = + new com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy result) { + if (networkInterfacesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + networkInterfaces_ = java.util.Collections.unmodifiableList(networkInterfaces_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.networkInterfaces_ = networkInterfaces_; + } else { + result.networkInterfaces_ = networkInterfacesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy result) { + int from_bitField0_ = bitField0_; + } + + @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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) { + return mergeFrom((com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy other) { + if (other + == com.google.events.cloud.batch.v1.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface m = + input.readMessage( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + .parser(), + extensionRegistry); + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.add(m); + } else { + networkInterfacesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + networkInterfaces_ = java.util.Collections.emptyList(); + + private void ensureNetworkInterfacesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + networkInterfaces_ = + new java.util.ArrayList< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface>( + networkInterfaces_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder> + networkInterfacesBuilder_; + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public int getNetworkInterfacesCount() { + if (networkInterfacesBuilder_ == null) { + return networkInterfaces_.size(); + } else { + return networkInterfacesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + getNetworkInterfaces(int index) { + if (networkInterfacesBuilder_ == null) { + return networkInterfaces_.get(index); + } else { + return networkInterfacesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder setNetworkInterfaces( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder setNetworkInterfaces( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder + builderForValue) { + if (networkInterfacesBuilder_ == null) { + ensureNetworkInterfacesIsMutable(); + networkInterfaces_.add(builderForValue.build()); + onChanged(); + } else { + networkInterfacesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addNetworkInterfaces( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public Builder addAllNetworkInterfaces( + java.lang.Iterable< + ? extends com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder + getNetworkInterfacesBuilder(int index) { + return getNetworkInterfacesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder + getNetworkInterfacesOrBuilder(int index) { + if (networkInterfacesBuilder_ == null) { + return networkInterfaces_.get(index); + } else { + return networkInterfacesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public java.util.List< + ? extends com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesOrBuilderList() { + if (networkInterfacesBuilder_ != null) { + return networkInterfacesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(networkInterfaces_); + } + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder + addNetworkInterfacesBuilder() { + return getNetworkInterfacesFieldBuilder() + .addBuilder( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + .getDefaultInstance()); + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder + addNetworkInterfacesBuilder(int index) { + return getNetworkInterfacesFieldBuilder() + .addBuilder( + index, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface + .getDefaultInstance()); + } + + /** + * + * + *
+       * Network configurations.
+       * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * + */ + public java.util.List< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder> + getNetworkInterfacesBuilderList() { + return getNetworkInterfacesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterfaceOrBuilder> + getNetworkInterfacesFieldBuilder() { + if (networkInterfacesBuilder_ == null) { + networkInterfacesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkInterface.Builder, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PlacementPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+     * want VMs to be located close to each other for low network latency
+     * between the VMs. No placement policy will be generated when collocation
+     * is UNSPECIFIED.
+     * 
+ * + * string collocation = 1; + * + * @return The collocation. + */ + java.lang.String getCollocation(); + + /** + * + * + *
+     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+     * want VMs to be located close to each other for low network latency
+     * between the VMs. No placement policy will be generated when collocation
+     * is UNSPECIFIED.
+     * 
+ * + * string collocation = 1; + * + * @return The bytes for collocation. + */ + com.google.protobuf.ByteString getCollocationBytes(); + + /** + * + * + *
+     * When specified, causes the job to fail if more than max_distance logical
+     * switches are required between VMs. Batch uses the most compact possible
+     * placement of VMs even when max_distance is not specified. An explicit
+     * max_distance makes that level of compactness a strict requirement.
+     * Not yet implemented
+     * 
+ * + * int64 max_distance = 2; + * + * @return The maxDistance. + */ + long getMaxDistance(); + } + + /** + * + * + *
+   * PlacementPolicy describes a group placement policy for the VMs controlled
+   * by this AllocationPolicy.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy} + */ + public static final class PlacementPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + PlacementPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PlacementPolicy.newBuilder() to construct. + private PlacementPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PlacementPolicy() { + collocation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PlacementPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder.class); + } + + public static final int COLLOCATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object collocation_ = ""; + + /** + * + * + *
+     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+     * want VMs to be located close to each other for low network latency
+     * between the VMs. No placement policy will be generated when collocation
+     * is UNSPECIFIED.
+     * 
+ * + * string collocation = 1; + * + * @return The collocation. + */ + @java.lang.Override + public java.lang.String getCollocation() { + java.lang.Object ref = collocation_; + 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(); + collocation_ = s; + return s; + } + } + + /** + * + * + *
+     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+     * want VMs to be located close to each other for low network latency
+     * between the VMs. No placement policy will be generated when collocation
+     * is UNSPECIFIED.
+     * 
+ * + * string collocation = 1; + * + * @return The bytes for collocation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCollocationBytes() { + java.lang.Object ref = collocation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_DISTANCE_FIELD_NUMBER = 2; + private long maxDistance_ = 0L; + + /** + * + * + *
+     * When specified, causes the job to fail if more than max_distance logical
+     * switches are required between VMs. Batch uses the most compact possible
+     * placement of VMs even when max_distance is not specified. An explicit
+     * max_distance makes that level of compactness a strict requirement.
+     * Not yet implemented
+     * 
+ * + * int64 max_distance = 2; + * + * @return The maxDistance. + */ + @java.lang.Override + public long getMaxDistance() { + return maxDistance_; + } + + 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(collocation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, collocation_); + } + if (maxDistance_ != 0L) { + output.writeInt64(2, maxDistance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(collocation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, collocation_); + } + if (maxDistance_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, maxDistance_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy other = + (com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) obj; + + if (!getCollocation().equals(other.getCollocation())) return false; + if (getMaxDistance() != other.getMaxDistance()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COLLOCATION_FIELD_NUMBER; + hash = (53 * hash) + getCollocation().hashCode(); + hash = (37 * hash) + MAX_DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxDistance()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy 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.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy 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.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + 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.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy 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.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy 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; + } + + /** + * + * + *
+     * PlacementPolicy describes a group placement policy for the VMs controlled
+     * by this AllocationPolicy.
+     * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder.class); + } + + // Construct using + // com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + collocation_ = ""; + maxDistance_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy build() { + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy result = + new com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.collocation_ = collocation_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxDistance_ = maxDistance_; + } + } + + @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.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) { + return mergeFrom( + (com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy other) { + if (other + == com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + .getDefaultInstance()) return this; + if (!other.getCollocation().isEmpty()) { + collocation_ = other.collocation_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxDistance() != 0L) { + setMaxDistance(other.getMaxDistance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + collocation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxDistance_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object collocation_ = ""; + + /** + * + * + *
+       * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+       * want VMs to be located close to each other for low network latency
+       * between the VMs. No placement policy will be generated when collocation
+       * is UNSPECIFIED.
+       * 
+ * + * string collocation = 1; + * + * @return The collocation. + */ + public java.lang.String getCollocation() { + java.lang.Object ref = collocation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collocation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+       * want VMs to be located close to each other for low network latency
+       * between the VMs. No placement policy will be generated when collocation
+       * is UNSPECIFIED.
+       * 
+ * + * string collocation = 1; + * + * @return The bytes for collocation. + */ + public com.google.protobuf.ByteString getCollocationBytes() { + java.lang.Object ref = collocation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+       * want VMs to be located close to each other for low network latency
+       * between the VMs. No placement policy will be generated when collocation
+       * is UNSPECIFIED.
+       * 
+ * + * string collocation = 1; + * + * @param value The collocation to set. + * @return This builder for chaining. + */ + public Builder setCollocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + collocation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+       * want VMs to be located close to each other for low network latency
+       * between the VMs. No placement policy will be generated when collocation
+       * is UNSPECIFIED.
+       * 
+ * + * string collocation = 1; + * + * @return This builder for chaining. + */ + public Builder clearCollocation() { + collocation_ = getDefaultInstance().getCollocation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
+       * want VMs to be located close to each other for low network latency
+       * between the VMs. No placement policy will be generated when collocation
+       * is UNSPECIFIED.
+       * 
+ * + * string collocation = 1; + * + * @param value The bytes for collocation to set. + * @return This builder for chaining. + */ + public Builder setCollocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + collocation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long maxDistance_; + + /** + * + * + *
+       * When specified, causes the job to fail if more than max_distance logical
+       * switches are required between VMs. Batch uses the most compact possible
+       * placement of VMs even when max_distance is not specified. An explicit
+       * max_distance makes that level of compactness a strict requirement.
+       * Not yet implemented
+       * 
+ * + * int64 max_distance = 2; + * + * @return The maxDistance. + */ + @java.lang.Override + public long getMaxDistance() { + return maxDistance_; + } + + /** + * + * + *
+       * When specified, causes the job to fail if more than max_distance logical
+       * switches are required between VMs. Batch uses the most compact possible
+       * placement of VMs even when max_distance is not specified. An explicit
+       * max_distance makes that level of compactness a strict requirement.
+       * Not yet implemented
+       * 
+ * + * int64 max_distance = 2; + * + * @param value The maxDistance to set. + * @return This builder for chaining. + */ + public Builder setMaxDistance(long value) { + + maxDistance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * When specified, causes the job to fail if more than max_distance logical
+       * switches are required between VMs. Batch uses the most compact possible
+       * placement of VMs even when max_distance is not specified. An explicit
+       * max_distance makes that level of compactness a strict requirement.
+       * Not yet implemented
+       * 
+ * + * int64 max_distance = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxDistance() { + bitField0_ = (bitField0_ & ~0x00000002); + maxDistance_ = 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.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + private static final com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlacementPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int LOCATION_FIELD_NUMBER = 1; + private com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location_; + + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * + * @return The location. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy getLocation() { + return location_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } + + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder + getLocationOrBuilder() { + return location_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } + + public static final int INSTANCES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List + instances_; + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesOrBuilderList() { + return instances_; + } + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder + getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 9; + private com.google.events.cloud.batch.v1.ServiceAccount serviceAccount_; + + /** + * + * + *
+   * Service account that VMs will run as.
+   * 
+ * + * .google.events.cloud.batch.v1.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.
+   * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + * + * @return The serviceAccount. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.ServiceAccount getServiceAccount() { + return serviceAccount_ == null + ? com.google.events.cloud.batch.v1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + + /** + * + * + *
+   * Service account that VMs will run as.
+   * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + return serviceAccount_ == null + ? com.google.events.cloud.batch.v1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + + 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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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 /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network_; + + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * + * @return Whether the network field is set. + */ + @java.lang.Override + public boolean hasNetwork() { + return network_ != null; + } + + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * + * @return The network. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy getNetwork() { + return network_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } + + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder + getNetworkOrBuilder() { + return network_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } + + public static final int PLACEMENT_FIELD_NUMBER = 10; + private com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement_; + + /** + * + * + *
+   * The placement policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * + * @return Whether the placement field is set. + */ + @java.lang.Override + public boolean hasPlacement() { + return placement_ != null; + } + + /** + * + * + *
+   * The placement policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * + * @return The placement. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy getPlacement() { + return placement_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.getDefaultInstance() + : placement_; + } + + /** + * + * + *
+   * The placement policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder + getPlacementOrBuilder() { + return placement_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.getDefaultInstance() + : placement_; + } + + 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 (location_ != null) { + output.writeMessage(1, getLocation()); + } + 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()); + } + if (placement_ != null) { + output.writeMessage(10, getPlacement()); + } + getUnknownFields().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()); + } + 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()); + } + if (placement_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPlacement()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.AllocationPolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.AllocationPolicy other = + (com.google.events.cloud.batch.v1.AllocationPolicy) obj; + + if (hasLocation() != other.hasLocation()) return false; + if (hasLocation()) { + if (!getLocation().equals(other.getLocation())) return false; + } + if (!getInstancesList().equals(other.getInstancesList())) 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 (hasPlacement() != other.hasPlacement()) return false; + if (hasPlacement()) { + if (!getPlacement().equals(other.getPlacement())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLocation()) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + } + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().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(); + } + if (hasPlacement()) { + hash = (37 * hash) + PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + getPlacement().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.AllocationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.AllocationPolicy) + com.google.events.cloud.batch.v1.AllocationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.AllocationPolicy.class, + com.google.events.cloud.batch.v1.AllocationPolicy.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.AllocationPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + location_ = null; + if (locationBuilder_ != null) { + locationBuilder_.dispose(); + locationBuilder_ = null; + } + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + serviceAccount_ = null; + if (serviceAccountBuilder_ != null) { + serviceAccountBuilder_.dispose(); + serviceAccountBuilder_ = null; + } + internalGetMutableLabels().clear(); + network_ = null; + if (networkBuilder_ != null) { + networkBuilder_.dispose(); + networkBuilder_ = null; + } + placement_ = null; + if (placementBuilder_ != null) { + placementBuilder_.dispose(); + placementBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy build() { + com.google.events.cloud.batch.v1.AllocationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy buildPartial() { + com.google.events.cloud.batch.v1.AllocationPolicy result = + new com.google.events.cloud.batch.v1.AllocationPolicy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.AllocationPolicy result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.events.cloud.batch.v1.AllocationPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.location_ = locationBuilder_ == null ? location_ : locationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serviceAccount_ = + serviceAccountBuilder_ == null ? serviceAccount_ : serviceAccountBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.network_ = networkBuilder_ == null ? network_ : networkBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.placement_ = placementBuilder_ == null ? placement_ : placementBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.AllocationPolicy) { + return mergeFrom((com.google.events.cloud.batch.v1.AllocationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.AllocationPolicy other) { + if (other == com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance()) + return this; + if (other.hasLocation()) { + mergeLocation(other.getLocation()); + } + 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_); + } + } + } + if (other.hasServiceAccount()) { + mergeServiceAccount(other.getServiceAccount()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; + if (other.hasNetwork()) { + mergeNetwork(other.getNetwork()); + } + if (other.hasPlacement()) { + mergePlacement(other.getPlacement()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 50: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 50 + case 58: + { + input.readMessage(getNetworkFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 66: + { + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate m = + input.readMessage( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + .parser(), + extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: + { + input.readMessage(getServiceAccountFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 74 + case 82: + { + input.readMessage(getPlacementFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder> + locationBuilder_; + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * + * @return Whether the location field is set. + */ + public boolean hasLocation() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * + * @return The location. + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy getLocation() { + if (locationBuilder_ == null) { + return location_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } else { + return locationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder setLocation( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + } else { + locationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder setLocation( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder builderForValue) { + if (locationBuilder_ == null) { + location_ = builderForValue.build(); + } else { + locationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder mergeLocation( + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy value) { + if (locationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && location_ != null + && location_ + != com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy + .getDefaultInstance()) { + getLocationBuilder().mergeFrom(value); + } else { + location_ = value; + } + } else { + locationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + public Builder clearLocation() { + bitField0_ = (bitField0_ & ~0x00000001); + location_ = null; + if (locationBuilder_ != null) { + locationBuilder_.dispose(); + locationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder + getLocationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getLocationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder + getLocationOrBuilder() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilder(); + } else { + return location_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.getDefaultInstance() + : location_; + } + } + + /** + * + * + *
+     * Location where compute resources should be allocated for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder>( + getLocation(), getParentForChildren(), isClean()); + location_ = null; + } + return locationBuilder_; + } + + private java.util.List< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate> + instances_ = java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + instances_ = + new java.util.ArrayList< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate>( + instances_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public java.util.List< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate> + 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.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder setInstances( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder setInstances( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addInstances( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder addAllInstances( + java.lang.Iterable< + ? extends + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public java.util.List< + ? extends + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder + addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder( + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance()); + } + + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder + addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder( + index, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + .getDefaultInstance()); + } + + /** + * + * + *
+     * Describe instances that can be created by this AllocationPolicy.
+     * Only instances[0] is supported now.
+     * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + public java.util.List< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder> + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy + .InstancePolicyOrTemplateOrBuilder>( + instances_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private com.google.events.cloud.batch.v1.ServiceAccount serviceAccount_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.ServiceAccount, + com.google.events.cloud.batch.v1.ServiceAccount.Builder, + com.google.events.cloud.batch.v1.ServiceAccountOrBuilder> + serviceAccountBuilder_; + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + * + * @return Whether the serviceAccount field is set. + */ + public boolean hasServiceAccount() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + * + * @return The serviceAccount. + */ + public com.google.events.cloud.batch.v1.ServiceAccount getServiceAccount() { + if (serviceAccountBuilder_ == null) { + return serviceAccount_ == null + ? com.google.events.cloud.batch.v1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } else { + return serviceAccountBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + public Builder setServiceAccount(com.google.events.cloud.batch.v1.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccount_ = value; + } else { + serviceAccountBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + public Builder setServiceAccount( + com.google.events.cloud.batch.v1.ServiceAccount.Builder builderForValue) { + if (serviceAccountBuilder_ == null) { + serviceAccount_ = builderForValue.build(); + } else { + serviceAccountBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + public Builder mergeServiceAccount(com.google.events.cloud.batch.v1.ServiceAccount value) { + if (serviceAccountBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && serviceAccount_ != null + && serviceAccount_ + != com.google.events.cloud.batch.v1.ServiceAccount.getDefaultInstance()) { + getServiceAccountBuilder().mergeFrom(value); + } else { + serviceAccount_ = value; + } + } else { + serviceAccountBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + public Builder clearServiceAccount() { + bitField0_ = (bitField0_ & ~0x00000004); + serviceAccount_ = null; + if (serviceAccountBuilder_ != null) { + serviceAccountBuilder_.dispose(); + serviceAccountBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + public com.google.events.cloud.batch.v1.ServiceAccount.Builder getServiceAccountBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getServiceAccountFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + public com.google.events.cloud.batch.v1.ServiceAccountOrBuilder getServiceAccountOrBuilder() { + if (serviceAccountBuilder_ != null) { + return serviceAccountBuilder_.getMessageOrBuilder(); + } else { + return serviceAccount_ == null + ? com.google.events.cloud.batch.v1.ServiceAccount.getDefaultInstance() + : serviceAccount_; + } + } + + /** + * + * + *
+     * Service account that VMs will run as.
+     * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.ServiceAccount, + com.google.events.cloud.batch.v1.ServiceAccount.Builder, + com.google.events.cloud.batch.v1.ServiceAccountOrBuilder> + getServiceAccountFieldBuilder() { + if (serviceAccountBuilder_ == null) { + serviceAccountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.ServiceAccount, + com.google.events.cloud.batch.v1.ServiceAccount.Builder, + com.google.events.cloud.batch.v1.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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + 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 /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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() { + bitField0_ = (bitField0_ & ~0x00000008); + 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() { + bitField0_ |= 0x00000008; + 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); + bitField0_ |= 0x00000008; + 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); + bitField0_ |= 0x00000008; + return this; + } + + private com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder> + networkBuilder_; + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * + * @return Whether the network field is set. + */ + public boolean hasNetwork() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * + * @return The network. + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy getNetwork() { + if (networkBuilder_ == null) { + return network_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } else { + return networkBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder setNetwork( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy value) { + if (networkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + } else { + networkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder setNetwork( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder builderForValue) { + if (networkBuilder_ == null) { + network_ = builderForValue.build(); + } else { + networkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder mergeNetwork( + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy value) { + if (networkBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && network_ != null + && network_ + != com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy + .getDefaultInstance()) { + getNetworkBuilder().mergeFrom(value); + } else { + network_ = value; + } + } else { + networkBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + public Builder clearNetwork() { + bitField0_ = (bitField0_ & ~0x00000010); + network_ = null; + if (networkBuilder_ != null) { + networkBuilder_.dispose(); + networkBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder + getNetworkBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getNetworkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder + getNetworkOrBuilder() { + if (networkBuilder_ != null) { + return networkBuilder_.getMessageOrBuilder(); + } else { + return network_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.getDefaultInstance() + : network_; + } + } + + /** + * + * + *
+     * The network policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder> + getNetworkFieldBuilder() { + if (networkBuilder_ == null) { + networkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder>( + getNetwork(), getParentForChildren(), isClean()); + network_ = null; + } + return networkBuilder_; + } + + private com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder> + placementBuilder_; + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * + * @return Whether the placement field is set. + */ + public boolean hasPlacement() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * + * @return The placement. + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy getPlacement() { + if (placementBuilder_ == null) { + return placement_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.getDefaultInstance() + : placement_; + } else { + return placementBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + public Builder setPlacement( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy value) { + if (placementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + placement_ = value; + } else { + placementBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + public Builder setPlacement( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder builderForValue) { + if (placementBuilder_ == null) { + placement_ = builderForValue.build(); + } else { + placementBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + public Builder mergePlacement( + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy value) { + if (placementBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && placement_ != null + && placement_ + != com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy + .getDefaultInstance()) { + getPlacementBuilder().mergeFrom(value); + } else { + placement_ = value; + } + } else { + placementBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + public Builder clearPlacement() { + bitField0_ = (bitField0_ & ~0x00000020); + placement_ = null; + if (placementBuilder_ != null) { + placementBuilder_.dispose(); + placementBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder + getPlacementBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getPlacementFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder + getPlacementOrBuilder() { + if (placementBuilder_ != null) { + return placementBuilder_.getMessageOrBuilder(); + } else { + return placement_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.getDefaultInstance() + : placement_; + } + } + + /** + * + * + *
+     * The placement policy.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder> + getPlacementFieldBuilder() { + if (placementBuilder_ == null) { + placementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder>( + getPlacement(), getParentForChildren(), isClean()); + placement_ = null; + } + return placementBuilder_; + } + + @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.events.cloud.batch.v1.AllocationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.AllocationPolicy) + private static final com.google.events.cloud.batch.v1.AllocationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.AllocationPolicy(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/AllocationPolicyOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/AllocationPolicyOrBuilder.java new file mode 100644 index 00000000..ee955efb --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/AllocationPolicyOrBuilder.java @@ -0,0 +1,343 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface AllocationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.AllocationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * + * @return Whether the location field is set. + */ + boolean hasLocation(); + + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * + * @return The location. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy getLocation(); + + /** + * + * + *
+   * Location where compute resources should be allocated for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + com.google.events.cloud.batch.v1.AllocationPolicy.LocationPolicyOrBuilder getLocationOrBuilder(); + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate getInstances( + int index); + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + int getInstancesCount(); + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + java.util.List< + ? extends + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder> + getInstancesOrBuilderList(); + + /** + * + * + *
+   * Describe instances that can be created by this AllocationPolicy.
+   * Only instances[0] is supported now.
+   * 
+ * + * + * repeated .google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * + */ + com.google.events.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder + getInstancesOrBuilder(int index); + + /** + * + * + *
+   * Service account that VMs will run as.
+   * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + * + * @return Whether the serviceAccount field is set. + */ + boolean hasServiceAccount(); + + /** + * + * + *
+   * Service account that VMs will run as.
+   * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + * + * @return The serviceAccount. + */ + com.google.events.cloud.batch.v1.ServiceAccount getServiceAccount(); + + /** + * + * + *
+   * Service account that VMs will run as.
+   * 
+ * + * .google.events.cloud.batch.v1.ServiceAccount service_account = 9; + */ + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * + * @return Whether the network field is set. + */ + boolean hasNetwork(); + + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * + * @return The network. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy getNetwork(); + + /** + * + * + *
+   * The network policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + com.google.events.cloud.batch.v1.AllocationPolicy.NetworkPolicyOrBuilder getNetworkOrBuilder(); + + /** + * + * + *
+   * The placement policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * + * @return Whether the placement field is set. + */ + boolean hasPlacement(); + + /** + * + * + *
+   * The placement policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + * + * @return The placement. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy getPlacement(); + + /** + * + * + *
+   * The placement policy.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10; + */ + com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder + getPlacementOrBuilder(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/ComputeResource.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/ComputeResource.java new file mode 100644 index 00000000..c6bde551 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/ComputeResource.java @@ -0,0 +1,739 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * Compute resource requirements
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.ComputeResource} + */ +public final class ComputeResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_ComputeResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_ComputeResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.ComputeResource.class, + com.google.events.cloud.batch.v1.ComputeResource.Builder.class); + } + + public static final int CPU_MILLI_FIELD_NUMBER = 1; + private long cpuMilli_ = 0L; + + /** + * + * + *
+   * 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_ = 0L; + + /** + * + * + *
+   * Memory in MiB.
+   * 
+ * + * int64 memory_mib = 2; + * + * @return The memoryMib. + */ + @java.lang.Override + public long getMemoryMib() { + return memoryMib_; + } + + public static final int BOOT_DISK_MIB_FIELD_NUMBER = 4; + private long bootDiskMib_ = 0L; + + /** + * + * + *
+   * 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 (bootDiskMib_ != 0L) { + output.writeInt64(4, bootDiskMib_); + } + getUnknownFields().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 (bootDiskMib_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, bootDiskMib_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.ComputeResource)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.ComputeResource other = + (com.google.events.cloud.batch.v1.ComputeResource) obj; + + if (getCpuMilli() != other.getCpuMilli()) return false; + if (getMemoryMib() != other.getMemoryMib()) return false; + if (getBootDiskMib() != other.getBootDiskMib()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + BOOT_DISK_MIB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBootDiskMib()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.ComputeResource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.ComputeResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.ComputeResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.ComputeResource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.ComputeResource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.ComputeResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.ComputeResource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.ComputeResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.ComputeResource) + com.google.events.cloud.batch.v1.ComputeResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_ComputeResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_ComputeResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.ComputeResource.class, + com.google.events.cloud.batch.v1.ComputeResource.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.ComputeResource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cpuMilli_ = 0L; + memoryMib_ = 0L; + bootDiskMib_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_ComputeResource_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.ComputeResource getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.ComputeResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.ComputeResource build() { + com.google.events.cloud.batch.v1.ComputeResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.ComputeResource buildPartial() { + com.google.events.cloud.batch.v1.ComputeResource result = + new com.google.events.cloud.batch.v1.ComputeResource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.ComputeResource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cpuMilli_ = cpuMilli_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.memoryMib_ = memoryMib_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bootDiskMib_ = bootDiskMib_; + } + } + + @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.events.cloud.batch.v1.ComputeResource) { + return mergeFrom((com.google.events.cloud.batch.v1.ComputeResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.ComputeResource other) { + if (other == com.google.events.cloud.batch.v1.ComputeResource.getDefaultInstance()) + return this; + if (other.getCpuMilli() != 0L) { + setCpuMilli(other.getCpuMilli()); + } + if (other.getMemoryMib() != 0L) { + setMemoryMib(other.getMemoryMib()); + } + if (other.getBootDiskMib() != 0L) { + setBootDiskMib(other.getBootDiskMib()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + cpuMilli_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + memoryMib_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 32: + { + bootDiskMib_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The milliCPU count.
+     * 
+ * + * int64 cpu_milli = 1; + * + * @return This builder for chaining. + */ + public Builder clearCpuMilli() { + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Memory in MiB.
+     * 
+ * + * int64 memory_mib = 2; + * + * @return This builder for chaining. + */ + public Builder clearMemoryMib() { + bitField0_ = (bitField0_ & ~0x00000002); + memoryMib_ = 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; + bitField0_ |= 0x00000004; + 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() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.events.cloud.batch.v1.ComputeResource) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.ComputeResource) + private static final com.google.events.cloud.batch.v1.ComputeResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.ComputeResource(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.ComputeResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/ComputeResourceOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/ComputeResourceOrBuilder.java new file mode 100644 index 00000000..8f65adb1 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/ComputeResourceOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface ComputeResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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(); + + /** + * + * + *
+   * Extra boot disk size in MiB for each task.
+   * 
+ * + * int64 boot_disk_mib = 4; + * + * @return The bootDiskMib. + */ + long getBootDiskMib(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Data.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Data.java new file mode 100644 index 00000000..26bed886 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Data.java @@ -0,0 +1,842 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public final class Data { + private Data() {} + + 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_events_cloud_batch_v1_Volume_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Volume_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_NFS_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_NFS_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_GCS_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_GCS_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_ComputeResource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_ComputeResource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_StatusEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_StatusEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_TaskExecution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_TaskExecution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_TaskStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_TaskStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Runnable_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Runnable_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Runnable_Container_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Runnable_Container_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Runnable_Script_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Runnable_Script_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Runnable_Barrier_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Runnable_Barrier_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Runnable_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Runnable_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_TaskSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_TaskSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_TaskSpec_EnvironmentsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_TaskSpec_EnvironmentsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Environment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Environment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Environment_VariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Environment_VariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Environment_SecretVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Environment_SecretVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Job_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Job_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_Job_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_Job_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_LogsPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_LogsPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_CountsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_CountsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobNotification_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobNotification_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobNotification_Message_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobNotification_Message_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_TaskGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_TaskGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_ServiceAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_ServiceAccount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_events_cloud_batch_v1_JobEventData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_events_cloud_batch_v1_JobEventData_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/events/cloud/batch/v1/data.prot" + + "o\022\034google.events.cloud.batch.v1\032\036google/" + + "protobuf/duration.proto\032\037google/protobuf" + + "/timestamp.proto\"\270\001\n\006Volume\0220\n\003nfs\030\001 \001(\013" + + "2!.google.events.cloud.batch.v1.NFSH\000\0220\n" + + "\003gcs\030\003 \001(\0132!.google.events.cloud.batch.v" + + "1.GCSH\000\022\025\n\013device_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\006sou" + + "rce\"*\n\003NFS\022\016\n\006server\030\001 \001(\t\022\023\n\013remote_pat" + + "h\030\002 \001(\t\"\032\n\003GCS\022\023\n\013remote_path\030\001 \001(\t\"O\n\017C" + + "omputeResource\022\021\n\tcpu_milli\030\001 \001(\003\022\022\n\nmem" + + "ory_mib\030\002 \001(\003\022\025\n\rboot_disk_mib\030\004 \001(\003\"\351\001\n" + + "\013StatusEvent\022\014\n\004type\030\003 \001(\t\022\023\n\013descriptio" + + "n\030\001 \001(\t\022.\n\nevent_time\030\002 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022C\n\016task_execution\030\004 \001(\0132" + + "+.google.events.cloud.batch.v1.TaskExecu" + + "tion\022B\n\ntask_state\030\005 \001(\0162..google.events" + + ".cloud.batch.v1.TaskStatus.State\"\"\n\rTask" + + "Execution\022\021\n\texit_code\030\001 \001(\005\"\177\n\nTaskStat" + + "us\"q\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PE" + + "NDING\020\001\022\014\n\010ASSIGNED\020\002\022\013\n\007RUNNING\020\003\022\n\n\006FA" + + "ILED\020\004\022\r\n\tSUCCEEDED\020\005\022\016\n\nUNEXECUTED\020\006\"\201\006" + + "\n\010Runnable\022E\n\tcontainer\030\001 \001(\01320.google.e" + + "vents.cloud.batch.v1.Runnable.ContainerH" + + "\000\022?\n\006script\030\002 \001(\0132-.google.events.cloud." + + "batch.v1.Runnable.ScriptH\000\022A\n\007barrier\030\006 " + + "\001(\0132..google.events.cloud.batch.v1.Runna" + + "ble.BarrierH\000\022\032\n\022ignore_exit_status\030\003 \001(" + + "\010\022\022\n\nbackground\030\004 \001(\010\022\022\n\nalways_run\030\005 \001(" + + "\010\022>\n\013environment\030\007 \001(\0132).google.events.c" + + "loud.batch.v1.Environment\022*\n\007timeout\030\010 \001" + + "(\0132\031.google.protobuf.Duration\022B\n\006labels\030" + + "\t \003(\01322.google.events.cloud.batch.v1.Run" + + "nable.LabelsEntry\032\252\001\n\tContainer\022\021\n\timage" + + "_uri\030\001 \001(\t\022\020\n\010commands\030\002 \003(\t\022\022\n\nentrypoi" + + "nt\030\003 \001(\t\022\017\n\007volumes\030\007 \003(\t\022\017\n\007options\030\010 \001" + + "(\t\022\036\n\026block_external_network\030\t \001(\010\022\020\n\010us" + + "ername\030\n \001(\t\022\020\n\010password\030\013 \001(\t\0323\n\006Script" + + "\022\016\n\004path\030\001 \001(\tH\000\022\016\n\004text\030\002 \001(\tH\000B\t\n\007comm" + + "and\032\027\n\007Barrier\022\014\n\004name\030\001 \001(\t\032-\n\013LabelsEn" + + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\014\n\ne" + + "xecutable\"\243\004\n\010TaskSpec\0229\n\trunnables\030\010 \003(" + + "\0132&.google.events.cloud.batch.v1.Runnabl" + + "e\022G\n\020compute_resource\030\003 \001(\0132-.google.eve" + + "nts.cloud.batch.v1.ComputeResource\0223\n\020ma" + + "x_run_duration\030\004 \001(\0132\031.google.protobuf.D" + + "uration\022\027\n\017max_retry_count\030\005 \001(\005\022I\n\022life" + + "cycle_policies\030\t \003(\0132-.google.events.clo" + + "ud.batch.v1.LifecyclePolicy\022N\n\014environme" + + "nts\030\006 \003(\01328.google.events.cloud.batch.v1" + + ".TaskSpec.EnvironmentsEntry\0225\n\007volumes\030\007" + + " \003(\0132$.google.events.cloud.batch.v1.Volu" + + "me\022>\n\013environment\030\n \001(\0132).google.events." + + "cloud.batch.v1.Environment\0323\n\021Environmen" + + "tsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"" + + "\230\002\n\017LifecyclePolicy\022D\n\006action\030\001 \001(\01624.go" + + "ogle.events.cloud.batch.v1.LifecyclePoli" + + "cy.Action\022W\n\020action_condition\030\002 \001(\0132=.go" + + "ogle.events.cloud.batch.v1.LifecyclePoli" + + "cy.ActionCondition\032%\n\017ActionCondition\022\022\n" + + "\nexit_codes\030\001 \003(\005\"?\n\006Action\022\026\n\022ACTION_UN" + + "SPECIFIED\020\000\022\016\n\nRETRY_TASK\020\001\022\r\n\tFAIL_TASK" + + "\020\002\"\244\003\n\013Environment\022K\n\tvariables\030\001 \003(\01328." + + "google.events.cloud.batch.v1.Environment" + + ".VariablesEntry\022X\n\020secret_variables\030\002 \003(" + + "\0132>.google.events.cloud.batch.v1.Environ" + + "ment.SecretVariablesEntry\022P\n\023encrypted_v" + + "ariables\030\003 \001(\01323.google.events.cloud.bat" + + "ch.v1.Environment.KMSEnvMap\0322\n\tKMSEnvMap" + + "\022\020\n\010key_name\030\001 \001(\t\022\023\n\013cipher_text\030\002 \001(\t\032" + + "0\n\016VariablesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001\0326\n\024SecretVariablesEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\311\004\n\003Job\022\014\n\004nam" + + "e\030\001 \001(\t\022\013\n\003uid\030\002 \001(\t\022\020\n\010priority\030\003 \001(\003\022<" + + "\n\013task_groups\030\004 \003(\0132\'.google.events.clou" + + "d.batch.v1.TaskGroup\022I\n\021allocation_polic" + + "y\030\007 \001(\0132..google.events.cloud.batch.v1.A" + + "llocationPolicy\022=\n\006labels\030\010 \003(\0132-.google" + + ".events.cloud.batch.v1.Job.LabelsEntry\0227" + + "\n\006status\030\t \001(\0132\'.google.events.cloud.bat" + + "ch.v1.JobStatus\022/\n\013create_time\030\013 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022/\n\013update_time\030" + + "\014 \001(\0132\032.google.protobuf.Timestamp\022=\n\013log" + + "s_policy\030\r \001(\0132(.google.events.cloud.bat" + + "ch.v1.LogsPolicy\022D\n\rnotifications\030\016 \003(\0132" + + "-.google.events.cloud.batch.v1.JobNotifi" + + "cation\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\263\001\n\nLogsPolicy\022I\n\013destinat" + + "ion\030\001 \001(\01624.google.events.cloud.batch.v1" + + ".LogsPolicy.Destination\022\021\n\tlogs_path\030\002 \001" + + "(\t\"G\n\013Destination\022\033\n\027DESTINATION_UNSPECI" + + "FIED\020\000\022\021\n\rCLOUD_LOGGING\020\001\022\010\n\004PATH\020\002\"\270\007\n\t" + + "JobStatus\022<\n\005state\030\001 \001(\0162-.google.events" + + ".cloud.batch.v1.JobStatus.State\022@\n\rstatu" + + "s_events\030\002 \003(\0132).google.events.cloud.bat" + + "ch.v1.StatusEvent\022L\n\013task_groups\030\004 \003(\01327" + + ".google.events.cloud.batch.v1.JobStatus." + + "TaskGroupsEntry\022/\n\014run_duration\030\005 \001(\0132\031." + + "google.protobuf.Duration\032\337\001\n\016InstanceSta" + + "tus\022\024\n\014machine_type\030\001 \001(\t\022\\\n\022provisionin" + + "g_model\030\002 \001(\0162@.google.events.cloud.batc" + + "h.v1.AllocationPolicy.ProvisioningModel\022" + + "\021\n\ttask_pack\030\003 \001(\003\022F\n\tboot_disk\030\004 \001(\01323." + + "google.events.cloud.batch.v1.AllocationP" + + "olicy.Disk\032\340\001\n\017TaskGroupStatus\022S\n\006counts" + + "\030\001 \003(\0132C.google.events.cloud.batch.v1.Jo" + + "bStatus.TaskGroupStatus.CountsEntry\022I\n\ti" + + "nstances\030\002 \003(\01326.google.events.cloud.bat" + + "ch.v1.JobStatus.InstanceStatus\032-\n\013Counts" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001\032j\n" + + "\017TaskGroupsEntry\022\013\n\003key\030\001 \001(\t\022F\n\005value\030\002" + + " \001(\01327.google.events.cloud.batch.v1.JobS" + + "tatus.TaskGroupStatus:\0028\001\"{\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\n\n\006QUEUED\020\001\022\r\n\tSCHEDUL" + + "ED\020\002\022\013\n\007RUNNING\020\003\022\r\n\tSUCCEEDED\020\004\022\n\n\006FAIL" + + "ED\020\005\022\030\n\024DELETION_IN_PROGRESS\020\006\"\230\003\n\017JobNo" + + "tification\022\024\n\014pubsub_topic\030\001 \001(\t\022F\n\007mess" + + "age\030\002 \001(\01325.google.events.cloud.batch.v1" + + ".JobNotification.Message\032\331\001\n\007Message\022@\n\004" + + "type\030\001 \001(\01622.google.events.cloud.batch.v" + + "1.JobNotification.Type\022D\n\rnew_job_state\030" + + "\002 \001(\0162-.google.events.cloud.batch.v1.Job" + + "Status.State\022F\n\016new_task_state\030\003 \001(\0162..g" + + "oogle.events.cloud.batch.v1.TaskStatus.S" + + "tate\"K\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\025\n\021JO" + + "B_STATE_CHANGED\020\001\022\026\n\022TASK_STATE_CHANGED\020" + + "\002\"\311\016\n\020AllocationPolicy\022O\n\010location\030\001 \001(\013" + + "2=.google.events.cloud.batch.v1.Allocati" + + "onPolicy.LocationPolicy\022Z\n\tinstances\030\010 \003" + + "(\0132G.google.events.cloud.batch.v1.Alloca" + + "tionPolicy.InstancePolicyOrTemplate\022E\n\017s" + + "ervice_account\030\t \001(\0132,.google.events.clo" + + "ud.batch.v1.ServiceAccount\022J\n\006labels\030\006 \003" + + "(\0132:.google.events.cloud.batch.v1.Alloca" + + "tionPolicy.LabelsEntry\022M\n\007network\030\007 \001(\0132" + + "<.google.events.cloud.batch.v1.Allocatio" + + "nPolicy.NetworkPolicy\022Q\n\tplacement\030\n \001(\013" + + "2>.google.events.cloud.batch.v1.Allocati" + + "onPolicy.PlacementPolicy\032+\n\016LocationPoli" + + "cy\022\031\n\021allowed_locations\030\001 \003(\t\032q\n\004Disk\022\017\n" + + "\005image\030\004 \001(\tH\000\022\022\n\010snapshot\030\005 \001(\tH\000\022\014\n\004ty" + + "pe\030\001 \001(\t\022\017\n\007size_gb\030\002 \001(\003\022\026\n\016disk_interf" + + "ace\030\006 \001(\tB\r\n\013data_source\032\221\001\n\014AttachedDis" + + "k\022G\n\010new_disk\030\001 \001(\01323.google.events.clou" + + "d.batch.v1.AllocationPolicy.DiskH\000\022\027\n\rex" + + "isting_disk\030\002 \001(\tH\000\022\023\n\013device_name\030\003 \001(\t" + + "B\n\n\010attached\032G\n\013Accelerator\022\014\n\004type\030\001 \001(" + + "\t\022\r\n\005count\030\002 \001(\003\022\033\n\023install_gpu_drivers\030" + + "\003 \001(\010\032\204\003\n\016InstancePolicy\022\024\n\014machine_type" + + "\030\002 \001(\t\022\030\n\020min_cpu_platform\030\003 \001(\t\022\\\n\022prov" + + "isioning_model\030\004 \001(\0162@.google.events.clo" + + "ud.batch.v1.AllocationPolicy.Provisionin" + + "gModel\022P\n\014accelerators\030\005 \003(\0132:.google.ev" + + "ents.cloud.batch.v1.AllocationPolicy.Acc" + + "elerator\022F\n\tboot_disk\030\010 \001(\01323.google.eve" + + "nts.cloud.batch.v1.AllocationPolicy.Disk" + + "\022J\n\005disks\030\006 \003(\0132;.google.events.cloud.ba" + + "tch.v1.AllocationPolicy.AttachedDisk\032\270\001\n" + + "\030InstancePolicyOrTemplate\022O\n\006policy\030\001 \001(" + + "\0132=.google.events.cloud.batch.v1.Allocat" + + "ionPolicy.InstancePolicyH\000\022\033\n\021instance_t" + + "emplate\030\002 \001(\tH\000\022\033\n\023install_gpu_drivers\030\003" + + " \001(\010B\021\n\017policy_template\032W\n\020NetworkInterf" + + "ace\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\032l\n\rNetw" + + "orkPolicy\022[\n\022network_interfaces\030\001 \003(\0132?." + + "google.events.cloud.batch.v1.AllocationP" + + "olicy.NetworkInterface\032<\n\017PlacementPolic" + + "y\022\023\n\013collocation\030\001 \001(\t\022\024\n\014max_distance\030\002" + + " \001(\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\"`\n\021ProvisioningModel\022\"\n\036PROV" + + "ISIONING_MODEL_UNSPECIFIED\020\000\022\014\n\010STANDARD" + + "\020\001\022\010\n\004SPOT\020\002\022\017\n\013PREEMPTIBLE\020\003\"\307\003\n\tTaskGr" + + "oup\022\014\n\004name\030\001 \001(\t\0229\n\ttask_spec\030\003 \001(\0132&.g" + + "oogle.events.cloud.batch.v1.TaskSpec\022\022\n\n" + + "task_count\030\004 \001(\003\022\023\n\013parallelism\030\005 \001(\003\022S\n" + + "\021scheduling_policy\030\006 \001(\01628.google.events" + + ".cloud.batch.v1.TaskGroup.SchedulingPoli" + + "cy\022D\n\021task_environments\030\t \003(\0132).google.e" + + "vents.cloud.batch.v1.Environment\022\033\n\023task" + + "_count_per_node\030\n \001(\003\022\032\n\022require_hosts_f" + + "ile\030\013 \001(\010\022\026\n\016permissive_ssh\030\014 \001(\010\"\\\n\020Sch" + + "edulingPolicy\022!\n\035SCHEDULING_POLICY_UNSPE" + + "CIFIED\020\000\022\027\n\023AS_SOON_AS_POSSIBLE\020\001\022\014\n\010IN_" + + "ORDER\020\002\"/\n\016ServiceAccount\022\r\n\005email\030\001 \001(\t" + + "\022\016\n\006scopes\030\002 \003(\t\"S\n\014JobEventData\0227\n\007payl" + + "oad\030\001 \001(\0132!.google.events.cloud.batch.v1" + + ".JobH\000\210\001\001B\n\n\010_payloadB\216\001\n com.google.eve" + + "nts.cloud.batch.v1P\001\252\002%Google.Events.Pro" + + "tobuf.Cloud.Batch.V1\312\002\034Google\\Events\\Clo" + + "ud\\Batch\\V1\352\002 Google::Events::Cloud::Bat" + + "ch::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_events_cloud_batch_v1_Volume_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_events_cloud_batch_v1_Volume_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Volume_descriptor, + new java.lang.String[] { + "Nfs", "Gcs", "DeviceName", "MountPath", "MountOptions", "Source", + }); + internal_static_google_events_cloud_batch_v1_NFS_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_events_cloud_batch_v1_NFS_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_NFS_descriptor, + new java.lang.String[] { + "Server", "RemotePath", + }); + internal_static_google_events_cloud_batch_v1_GCS_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_events_cloud_batch_v1_GCS_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_GCS_descriptor, + new java.lang.String[] { + "RemotePath", + }); + internal_static_google_events_cloud_batch_v1_ComputeResource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_events_cloud_batch_v1_ComputeResource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_ComputeResource_descriptor, + new java.lang.String[] { + "CpuMilli", "MemoryMib", "BootDiskMib", + }); + internal_static_google_events_cloud_batch_v1_StatusEvent_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_events_cloud_batch_v1_StatusEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_StatusEvent_descriptor, + new java.lang.String[] { + "Type", "Description", "EventTime", "TaskExecution", "TaskState", + }); + internal_static_google_events_cloud_batch_v1_TaskExecution_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_events_cloud_batch_v1_TaskExecution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_TaskExecution_descriptor, + new java.lang.String[] { + "ExitCode", + }); + internal_static_google_events_cloud_batch_v1_TaskStatus_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_events_cloud_batch_v1_TaskStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_TaskStatus_descriptor, + new java.lang.String[] {}); + internal_static_google_events_cloud_batch_v1_Runnable_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_events_cloud_batch_v1_Runnable_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Runnable_descriptor, + new java.lang.String[] { + "Container", + "Script", + "Barrier", + "IgnoreExitStatus", + "Background", + "AlwaysRun", + "Environment", + "Timeout", + "Labels", + "Executable", + }); + internal_static_google_events_cloud_batch_v1_Runnable_Container_descriptor = + internal_static_google_events_cloud_batch_v1_Runnable_descriptor.getNestedTypes().get(0); + internal_static_google_events_cloud_batch_v1_Runnable_Container_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Runnable_Container_descriptor, + new java.lang.String[] { + "ImageUri", + "Commands", + "Entrypoint", + "Volumes", + "Options", + "BlockExternalNetwork", + "Username", + "Password", + }); + internal_static_google_events_cloud_batch_v1_Runnable_Script_descriptor = + internal_static_google_events_cloud_batch_v1_Runnable_descriptor.getNestedTypes().get(1); + internal_static_google_events_cloud_batch_v1_Runnable_Script_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Runnable_Script_descriptor, + new java.lang.String[] { + "Path", "Text", "Command", + }); + internal_static_google_events_cloud_batch_v1_Runnable_Barrier_descriptor = + internal_static_google_events_cloud_batch_v1_Runnable_descriptor.getNestedTypes().get(2); + internal_static_google_events_cloud_batch_v1_Runnable_Barrier_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Runnable_Barrier_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_events_cloud_batch_v1_Runnable_LabelsEntry_descriptor = + internal_static_google_events_cloud_batch_v1_Runnable_descriptor.getNestedTypes().get(3); + internal_static_google_events_cloud_batch_v1_Runnable_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Runnable_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_TaskSpec_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_events_cloud_batch_v1_TaskSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_TaskSpec_descriptor, + new java.lang.String[] { + "Runnables", + "ComputeResource", + "MaxRunDuration", + "MaxRetryCount", + "LifecyclePolicies", + "Environments", + "Volumes", + "Environment", + }); + internal_static_google_events_cloud_batch_v1_TaskSpec_EnvironmentsEntry_descriptor = + internal_static_google_events_cloud_batch_v1_TaskSpec_descriptor.getNestedTypes().get(0); + internal_static_google_events_cloud_batch_v1_TaskSpec_EnvironmentsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_TaskSpec_EnvironmentsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor, + new java.lang.String[] { + "Action", "ActionCondition", + }); + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_descriptor = + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_descriptor, + new java.lang.String[] { + "ExitCodes", + }); + internal_static_google_events_cloud_batch_v1_Environment_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_events_cloud_batch_v1_Environment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Environment_descriptor, + new java.lang.String[] { + "Variables", "SecretVariables", "EncryptedVariables", + }); + internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_descriptor = + internal_static_google_events_cloud_batch_v1_Environment_descriptor.getNestedTypes().get(0); + internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_descriptor, + new java.lang.String[] { + "KeyName", "CipherText", + }); + internal_static_google_events_cloud_batch_v1_Environment_VariablesEntry_descriptor = + internal_static_google_events_cloud_batch_v1_Environment_descriptor.getNestedTypes().get(1); + internal_static_google_events_cloud_batch_v1_Environment_VariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Environment_VariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_Environment_SecretVariablesEntry_descriptor = + internal_static_google_events_cloud_batch_v1_Environment_descriptor.getNestedTypes().get(2); + internal_static_google_events_cloud_batch_v1_Environment_SecretVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Environment_SecretVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_Job_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_events_cloud_batch_v1_Job_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Job_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Priority", + "TaskGroups", + "AllocationPolicy", + "Labels", + "Status", + "CreateTime", + "UpdateTime", + "LogsPolicy", + "Notifications", + }); + internal_static_google_events_cloud_batch_v1_Job_LabelsEntry_descriptor = + internal_static_google_events_cloud_batch_v1_Job_descriptor.getNestedTypes().get(0); + internal_static_google_events_cloud_batch_v1_Job_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_Job_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_LogsPolicy_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_events_cloud_batch_v1_LogsPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_LogsPolicy_descriptor, + new java.lang.String[] { + "Destination", "LogsPath", + }); + internal_static_google_events_cloud_batch_v1_JobStatus_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_events_cloud_batch_v1_JobStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobStatus_descriptor, + new java.lang.String[] { + "State", "StatusEvents", "TaskGroups", "RunDuration", + }); + internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_descriptor = + internal_static_google_events_cloud_batch_v1_JobStatus_descriptor.getNestedTypes().get(0); + internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_descriptor, + new java.lang.String[] { + "MachineType", "ProvisioningModel", "TaskPack", "BootDisk", + }); + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_descriptor = + internal_static_google_events_cloud_batch_v1_JobStatus_descriptor.getNestedTypes().get(1); + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_descriptor, + new java.lang.String[] { + "Counts", "Instances", + }); + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_CountsEntry_descriptor = + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_descriptor + .getNestedTypes() + .get(0); + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_CountsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_CountsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupsEntry_descriptor = + internal_static_google_events_cloud_batch_v1_JobStatus_descriptor.getNestedTypes().get(2); + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_JobNotification_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_events_cloud_batch_v1_JobNotification_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobNotification_descriptor, + new java.lang.String[] { + "PubsubTopic", "Message", + }); + internal_static_google_events_cloud_batch_v1_JobNotification_Message_descriptor = + internal_static_google_events_cloud_batch_v1_JobNotification_descriptor + .getNestedTypes() + .get(0); + internal_static_google_events_cloud_batch_v1_JobNotification_Message_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobNotification_Message_descriptor, + new java.lang.String[] { + "Type", "NewJobState", "NewTaskState", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor, + new java.lang.String[] { + "Location", "Instances", "ServiceAccount", "Labels", "Network", "Placement", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LocationPolicy_descriptor, + new java.lang.String[] { + "AllowedLocations", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Disk_descriptor, + new java.lang.String[] { + "Image", "Snapshot", "Type", "SizeGb", "DiskInterface", "DataSource", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(2); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_AttachedDisk_descriptor, + new java.lang.String[] { + "NewDisk", "ExistingDisk", "DeviceName", "Attached", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(3); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_Accelerator_descriptor, + new java.lang.String[] { + "Type", "Count", "InstallGpuDrivers", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(4); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicy_descriptor, + new java.lang.String[] { + "MachineType", + "MinCpuPlatform", + "ProvisioningModel", + "Accelerators", + "BootDisk", + "Disks", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(5); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_InstancePolicyOrTemplate_descriptor, + new java.lang.String[] { + "Policy", "InstanceTemplate", "InstallGpuDrivers", "PolicyTemplate", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(6); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkInterface_descriptor, + new java.lang.String[] { + "Network", "Subnetwork", "NoExternalIpAddress", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(7); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_NetworkPolicy_descriptor, + new java.lang.String[] { + "NetworkInterfaces", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(8); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_PlacementPolicy_descriptor, + new java.lang.String[] { + "Collocation", "MaxDistance", + }); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor = + internal_static_google_events_cloud_batch_v1_AllocationPolicy_descriptor + .getNestedTypes() + .get(9); + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_AllocationPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_events_cloud_batch_v1_TaskGroup_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_events_cloud_batch_v1_TaskGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_TaskGroup_descriptor, + new java.lang.String[] { + "Name", + "TaskSpec", + "TaskCount", + "Parallelism", + "SchedulingPolicy", + "TaskEnvironments", + "TaskCountPerNode", + "RequireHostsFile", + "PermissiveSsh", + }); + internal_static_google_events_cloud_batch_v1_ServiceAccount_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_events_cloud_batch_v1_ServiceAccount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_ServiceAccount_descriptor, + new java.lang.String[] { + "Email", "Scopes", + }); + internal_static_google_events_cloud_batch_v1_JobEventData_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_events_cloud_batch_v1_JobEventData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_events_cloud_batch_v1_JobEventData_descriptor, + new java.lang.String[] { + "Payload", "Payload", + }); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Environment.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Environment.java new file mode 100644 index 00000000..daacfb21 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Environment.java @@ -0,0 +1,2302 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * An Environment describes a collection of environment variables to set when
+ * executing Tasks.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.Environment} + */ +public final class Environment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Environment.class, + com.google.events.cloud.batch.v1.Environment.Builder.class); + } + + public interface KMSEnvMapOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap} */ + public static final class KMSEnvMap extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.class, + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder.class); + } + + public static final int KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.Environment.KMSEnvMap)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.Environment.KMSEnvMap other = + (com.google.events.cloud.batch.v1.Environment.KMSEnvMap) obj; + + if (!getKeyName().equals(other.getKeyName())) return false; + if (!getCipherText().equals(other.getCipherText())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKeyName().hashCode(); + hash = (37 * hash) + CIPHER_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getCipherText().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.Environment.KMSEnvMap parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.Environment.KMSEnvMap parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.Environment.KMSEnvMap parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.Environment.KMSEnvMap) + com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.class, + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.Environment.KMSEnvMap.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + keyName_ = ""; + cipherText_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_KMSEnvMap_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment.KMSEnvMap getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.Environment.KMSEnvMap.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment.KMSEnvMap build() { + com.google.events.cloud.batch.v1.Environment.KMSEnvMap result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment.KMSEnvMap buildPartial() { + com.google.events.cloud.batch.v1.Environment.KMSEnvMap result = + new com.google.events.cloud.batch.v1.Environment.KMSEnvMap(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.Environment.KMSEnvMap result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.keyName_ = keyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cipherText_ = cipherText_; + } + } + + @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.events.cloud.batch.v1.Environment.KMSEnvMap) { + return mergeFrom((com.google.events.cloud.batch.v1.Environment.KMSEnvMap) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.Environment.KMSEnvMap other) { + if (other == com.google.events.cloud.batch.v1.Environment.KMSEnvMap.getDefaultInstance()) + return this; + if (!other.getKeyName().isEmpty()) { + keyName_ = other.keyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCipherText().isEmpty()) { + cipherText_ = other.cipherText_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + keyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + cipherText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + 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; + bitField0_ |= 0x00000002; + 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(); + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000002; + 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.events.cloud.batch.v1.Environment.KMSEnvMap) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.Environment.KMSEnvMap) + private static final com.google.events.cloud.batch.v1.Environment.KMSEnvMap DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.Environment.KMSEnvMap(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_VariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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 /* nullable */ java.lang.String getVariablesOrDefault( + java.lang.String key, + /* nullable */ + 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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_SecretVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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 /* nullable */ java.lang.String getSecretVariablesOrDefault( + java.lang.String key, + /* nullable */ + 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.events.cloud.batch.v1.Environment.KMSEnvMap encryptedVariables_; + + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return The encryptedVariables. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment.KMSEnvMap getEncryptedVariables() { + return encryptedVariables_ == null + ? com.google.events.cloud.batch.v1.Environment.KMSEnvMap.getDefaultInstance() + : encryptedVariables_; + } + + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder + getEncryptedVariablesOrBuilder() { + return encryptedVariables_ == null + ? com.google.events.cloud.batch.v1.Environment.KMSEnvMap.getDefaultInstance() + : encryptedVariables_; + } + + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.Environment)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.Environment other = + (com.google.events.cloud.batch.v1.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.Environment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.Environment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.Environment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.Environment) + com.google.events.cloud.batch.v1.EnvironmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Environment.class, + com.google.events.cloud.batch.v1.Environment.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.Environment.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVariables().clear(); + internalGetMutableSecretVariables().clear(); + encryptedVariables_ = null; + if (encryptedVariablesBuilder_ != null) { + encryptedVariablesBuilder_.dispose(); + encryptedVariablesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Environment_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.Environment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment build() { + com.google.events.cloud.batch.v1.Environment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment buildPartial() { + com.google.events.cloud.batch.v1.Environment result = + new com.google.events.cloud.batch.v1.Environment(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.Environment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.variables_ = internalGetVariables(); + result.variables_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.secretVariables_ = internalGetSecretVariables(); + result.secretVariables_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.encryptedVariables_ = + encryptedVariablesBuilder_ == null + ? encryptedVariables_ + : encryptedVariablesBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.Environment) { + return mergeFrom((com.google.events.cloud.batch.v1.Environment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.Environment other) { + if (other == com.google.events.cloud.batch.v1.Environment.getDefaultInstance()) return this; + internalGetMutableVariables().mergeFrom(other.internalGetVariables()); + bitField0_ |= 0x00000001; + internalGetMutableSecretVariables().mergeFrom(other.internalGetSecretVariables()); + bitField0_ |= 0x00000002; + if (other.hasEncryptedVariables()) { + mergeEncryptedVariables(other.getEncryptedVariables()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry variables__ = + input.readMessage( + VariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableVariables() + .getMutableMap() + .put(variables__.getKey(), variables__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry secretVariables__ = + input.readMessage( + SecretVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableSecretVariables() + .getMutableMap() + .put(secretVariables__.getKey(), secretVariables__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getEncryptedVariablesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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() { + if (variables_ == null) { + variables_ = + com.google.protobuf.MapField.newMapField(VariablesDefaultEntryHolder.defaultEntry); + } + if (!variables_.isMutable()) { + variables_ = variables_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + 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 /* nullable */ java.lang.String getVariablesOrDefault( + java.lang.String key, + /* nullable */ + 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() { + bitField0_ = (bitField0_ & ~0x00000001); + 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() { + bitField0_ |= 0x00000001; + 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); + bitField0_ |= 0x00000001; + 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); + bitField0_ |= 0x00000001; + 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() { + if (secretVariables_ == null) { + secretVariables_ = + com.google.protobuf.MapField.newMapField( + SecretVariablesDefaultEntryHolder.defaultEntry); + } + if (!secretVariables_.isMutable()) { + secretVariables_ = secretVariables_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 /* nullable */ java.lang.String getSecretVariablesOrDefault( + java.lang.String key, + /* nullable */ + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + 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() { + bitField0_ |= 0x00000002; + 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); + bitField0_ |= 0x00000002; + 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); + bitField0_ |= 0x00000002; + return this; + } + + private com.google.events.cloud.batch.v1.Environment.KMSEnvMap encryptedVariables_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.Environment.KMSEnvMap, + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder, + com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder> + encryptedVariablesBuilder_; + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return Whether the encryptedVariables field is set. + */ + public boolean hasEncryptedVariables() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return The encryptedVariables. + */ + public com.google.events.cloud.batch.v1.Environment.KMSEnvMap getEncryptedVariables() { + if (encryptedVariablesBuilder_ == null) { + return encryptedVariables_ == null + ? com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder setEncryptedVariables( + com.google.events.cloud.batch.v1.Environment.KMSEnvMap value) { + if (encryptedVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptedVariables_ = value; + } else { + encryptedVariablesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder setEncryptedVariables( + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder builderForValue) { + if (encryptedVariablesBuilder_ == null) { + encryptedVariables_ = builderForValue.build(); + } else { + encryptedVariablesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder mergeEncryptedVariables( + com.google.events.cloud.batch.v1.Environment.KMSEnvMap value) { + if (encryptedVariablesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && encryptedVariables_ != null + && encryptedVariables_ + != com.google.events.cloud.batch.v1.Environment.KMSEnvMap.getDefaultInstance()) { + getEncryptedVariablesBuilder().mergeFrom(value); + } else { + encryptedVariables_ = value; + } + } else { + encryptedVariablesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + public Builder clearEncryptedVariables() { + bitField0_ = (bitField0_ & ~0x00000004); + encryptedVariables_ = null; + if (encryptedVariablesBuilder_ != null) { + encryptedVariablesBuilder_.dispose(); + encryptedVariablesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + public com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder + getEncryptedVariablesBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEncryptedVariablesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + public com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder + getEncryptedVariablesOrBuilder() { + if (encryptedVariablesBuilder_ != null) { + return encryptedVariablesBuilder_.getMessageOrBuilder(); + } else { + return encryptedVariables_ == null + ? com.google.events.cloud.batch.v1.Environment.KMSEnvMap.getDefaultInstance() + : encryptedVariables_; + } + } + + /** + * + * + *
+     * An encrypted JSON dictionary where the key/value pairs correspond to
+     * environment variable names and their values.
+     * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.Environment.KMSEnvMap, + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder, + com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder> + getEncryptedVariablesFieldBuilder() { + if (encryptedVariablesBuilder_ == null) { + encryptedVariablesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.Environment.KMSEnvMap, + com.google.events.cloud.batch.v1.Environment.KMSEnvMap.Builder, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.Environment) + private static final com.google.events.cloud.batch.v1.Environment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.Environment(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Environment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/EnvironmentOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/EnvironmentOrBuilder.java new file mode 100644 index 00000000..6a2d1ba2 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/EnvironmentOrBuilder.java @@ -0,0 +1,201 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface EnvironmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * + * @return The encryptedVariables. + */ + com.google.events.cloud.batch.v1.Environment.KMSEnvMap getEncryptedVariables(); + + /** + * + * + *
+   * An encrypted JSON dictionary where the key/value pairs correspond to
+   * environment variable names and their values.
+   * 
+ * + * .google.events.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + com.google.events.cloud.batch.v1.Environment.KMSEnvMapOrBuilder getEncryptedVariablesOrBuilder(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/GCS.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/GCS.java new file mode 100644 index 00000000..abe5702b --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/GCS.java @@ -0,0 +1,641 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * Represents a Google Cloud Storage volume.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.GCS} + */ +public final class GCS extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_GCS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_GCS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.GCS.class, + com.google.events.cloud.batch.v1.GCS.Builder.class); + } + + public static final int REMOTE_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.GCS)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.GCS other = (com.google.events.cloud.batch.v1.GCS) obj; + + if (!getRemotePath().equals(other.getRemotePath())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REMOTE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRemotePath().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.GCS parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.GCS parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.GCS parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.GCS parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.GCS parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.GCS parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.GCS parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.GCS} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.GCS) + com.google.events.cloud.batch.v1.GCSOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_GCS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_GCS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.GCS.class, + com.google.events.cloud.batch.v1.GCS.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.GCS.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + remotePath_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_GCS_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.GCS getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.GCS.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.GCS build() { + com.google.events.cloud.batch.v1.GCS result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.GCS buildPartial() { + com.google.events.cloud.batch.v1.GCS result = new com.google.events.cloud.batch.v1.GCS(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.GCS result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.remotePath_ = remotePath_; + } + } + + @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.events.cloud.batch.v1.GCS) { + return mergeFrom((com.google.events.cloud.batch.v1.GCS) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.GCS other) { + if (other == com.google.events.cloud.batch.v1.GCS.getDefaultInstance()) return this; + if (!other.getRemotePath().isEmpty()) { + remotePath_ = other.remotePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + remotePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + 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.events.cloud.batch.v1.GCS) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.GCS) + private static final com.google.events.cloud.batch.v1.GCS DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.GCS(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.GCS getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/GCSOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/GCSOrBuilder.java new file mode 100644 index 00000000..b0cc816f --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/GCSOrBuilder.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface GCSOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Job.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Job.java new file mode 100644 index 00000000..bea2b3eb --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Job.java @@ -0,0 +1,3805 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * The Cloud Batch Job description.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.Job} + */ +public final class Job extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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(); + 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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Job_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Job.class, + com.google.events.cloud.batch.v1.Job.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * 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; + } + } + + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * 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 UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
+   * Output only. A system generated unique ID (in UUID4 format) for the Job.
+   * 
+ * + * string uid = 2; + * + * @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; + * + * @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_ = 0L; + + /** + * + * + *
+   * Priority of the Job.
+   * The valid value range is [0, 100). Default value is 0.
+   * Higher value indicates higher priority.
+   * A job with higher priority value is more likely to run earlier if all other
+   * requirements are satisfied.
+   * 
+ * + * int64 priority = 3; + * + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + + public static final int TASK_GROUPS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List taskGroups_; + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + @java.lang.Override + public java.util.List getTaskGroupsList() { + return taskGroups_; + } + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + @java.lang.Override + public java.util.List + getTaskGroupsOrBuilderList() { + return taskGroups_; + } + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + @java.lang.Override + public int getTaskGroupsCount() { + return taskGroups_.size(); + } + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.TaskGroup getTaskGroups(int index) { + return taskGroups_.get(index); + } + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.TaskGroupOrBuilder getTaskGroupsOrBuilder(int index) { + return taskGroups_.get(index); + } + + public static final int ALLOCATION_POLICY_FIELD_NUMBER = 7; + private com.google.events.cloud.batch.v1.AllocationPolicy allocationPolicy_; + + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * + * @return The allocationPolicy. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy getAllocationPolicy() { + return allocationPolicy_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder() { + return allocationPolicy_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + + 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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Job_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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 /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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.events.cloud.batch.v1.JobStatus status_; + + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + * + * @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.events.cloud.batch.v1.JobStatus status = 9; + * + * @return The status. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus getStatus() { + return status_ == null + ? com.google.events.cloud.batch.v1.JobStatus.getDefaultInstance() + : status_; + } + + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatusOrBuilder getStatusOrBuilder() { + return status_ == null + ? com.google.events.cloud.batch.v1.JobStatus.getDefaultInstance() + : status_; + } + + 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; + * + * @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; + * + * @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; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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; + * + * @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; + * + * @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; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LOGS_POLICY_FIELD_NUMBER = 13; + private com.google.events.cloud.batch.v1.LogsPolicy logsPolicy_; + + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + * + * @return The logsPolicy. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy getLogsPolicy() { + return logsPolicy_ == null + ? com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } + + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicyOrBuilder getLogsPolicyOrBuilder() { + return logsPolicy_ == null + ? com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } + + public static final int NOTIFICATIONS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List notifications_; + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + @java.lang.Override + public java.util.List getNotificationsList() { + return notifications_; + } + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + @java.lang.Override + public java.util.List + getNotificationsOrBuilderList() { + return notifications_; + } + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + @java.lang.Override + public int getNotificationsCount() { + return notifications_.size(); + } + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification getNotifications(int index) { + return notifications_.get(index); + } + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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 (allocationPolicy_ != null) { + output.writeMessage(7, getAllocationPolicy()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + if (status_ != null) { + output.writeMessage(9, getStatus()); + } + 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)); + } + getUnknownFields().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 (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 (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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.Job)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.Job other = (com.google.events.cloud.batch.v1.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 (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 (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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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(); + } + 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 (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.Job parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Job parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Job parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.Job parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.Job parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Job parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Job parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.Job} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.Job) + com.google.events.cloud.batch.v1.JobOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Job_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Job.class, + com.google.events.cloud.batch.v1.Job.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.Job.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + uid_ = ""; + priority_ = 0L; + if (taskGroupsBuilder_ == null) { + taskGroups_ = java.util.Collections.emptyList(); + } else { + taskGroups_ = null; + taskGroupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + allocationPolicy_ = null; + if (allocationPolicyBuilder_ != null) { + allocationPolicyBuilder_.dispose(); + allocationPolicyBuilder_ = null; + } + internalGetMutableLabels().clear(); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + logsPolicy_ = null; + if (logsPolicyBuilder_ != null) { + logsPolicyBuilder_.dispose(); + logsPolicyBuilder_ = null; + } + if (notificationsBuilder_ == null) { + notifications_ = java.util.Collections.emptyList(); + } else { + notifications_ = null; + notificationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Job_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Job getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.Job.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Job build() { + com.google.events.cloud.batch.v1.Job result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Job buildPartial() { + com.google.events.cloud.batch.v1.Job result = new com.google.events.cloud.batch.v1.Job(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.events.cloud.batch.v1.Job result) { + if (taskGroupsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + taskGroups_ = java.util.Collections.unmodifiableList(taskGroups_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.taskGroups_ = taskGroups_; + } else { + result.taskGroups_ = taskGroupsBuilder_.build(); + } + if (notificationsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + notifications_ = java.util.Collections.unmodifiableList(notifications_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.notifications_ = notifications_; + } else { + result.notifications_ = notificationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.events.cloud.batch.v1.Job result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.priority_ = priority_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allocationPolicy_ = + allocationPolicyBuilder_ == null ? allocationPolicy_ : allocationPolicyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.logsPolicy_ = logsPolicyBuilder_ == null ? logsPolicy_ : logsPolicyBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.Job) { + return mergeFrom((com.google.events.cloud.batch.v1.Job) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.Job other) { + if (other == com.google.events.cloud.batch.v1.Job.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPriority() != 0L) { + setPriority(other.getPriority()); + } + if (taskGroupsBuilder_ == null) { + if (!other.taskGroups_.isEmpty()) { + if (taskGroups_.isEmpty()) { + taskGroups_ = other.taskGroups_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureTaskGroupsIsMutable(); + taskGroups_.addAll(other.taskGroups_); + } + onChanged(); + } + } else { + if (!other.taskGroups_.isEmpty()) { + if (taskGroupsBuilder_.isEmpty()) { + taskGroupsBuilder_.dispose(); + taskGroupsBuilder_ = null; + taskGroups_ = other.taskGroups_; + bitField0_ = (bitField0_ & ~0x00000008); + taskGroupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTaskGroupsFieldBuilder() + : null; + } else { + taskGroupsBuilder_.addAllMessages(other.taskGroups_); + } + } + } + if (other.hasAllocationPolicy()) { + mergeAllocationPolicy(other.getAllocationPolicy()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000020; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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_ & ~0x00000400); + } else { + ensureNotificationsIsMutable(); + notifications_.addAll(other.notifications_); + } + onChanged(); + } + } else { + if (!other.notifications_.isEmpty()) { + if (notificationsBuilder_.isEmpty()) { + notificationsBuilder_.dispose(); + notificationsBuilder_ = null; + notifications_ = other.notifications_; + bitField0_ = (bitField0_ & ~0x00000400); + notificationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNotificationsFieldBuilder() + : null; + } else { + notificationsBuilder_.addAllMessages(other.notifications_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + priority_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.events.cloud.batch.v1.TaskGroup m = + input.readMessage( + com.google.events.cloud.batch.v1.TaskGroup.parser(), extensionRegistry); + if (taskGroupsBuilder_ == null) { + ensureTaskGroupsIsMutable(); + taskGroups_.add(m); + } else { + taskGroupsBuilder_.addMessage(m); + } + break; + } // case 34 + case 58: + { + input.readMessage( + getAllocationPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 66: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 74: + { + input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 74 + case 90: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 90 + case 98: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 98 + case 106: + { + input.readMessage(getLogsPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 106 + case 114: + { + com.google.events.cloud.batch.v1.JobNotification m = + input.readMessage( + com.google.events.cloud.batch.v1.JobNotification.parser(), + extensionRegistry); + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + notifications_.add(m); + } else { + notificationsBuilder_.addMessage(m); + } + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Job name.
+     * For example: "projects/123456/locations/us-central1/jobs/job01".
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2; + * + * @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; + * + * @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; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. A system generated unique ID (in UUID4 format) for the Job.
+     * 
+ * + * string uid = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long priority_; + + /** + * + * + *
+     * Priority of the Job.
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
+     * 
+ * + * int64 priority = 3; + * + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + + /** + * + * + *
+     * Priority of the Job.
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
+     * 
+ * + * int64 priority = 3; + * + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(long value) { + + priority_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Priority of the Job.
+     * The valid value range is [0, 100). Default value is 0.
+     * Higher value indicates higher priority.
+     * A job with higher priority value is more likely to run earlier if all other
+     * requirements are satisfied.
+     * 
+ * + * int64 priority = 3; + * + * @return This builder for chaining. + */ + public Builder clearPriority() { + bitField0_ = (bitField0_ & ~0x00000004); + priority_ = 0L; + onChanged(); + return this; + } + + private java.util.List taskGroups_ = + java.util.Collections.emptyList(); + + private void ensureTaskGroupsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + taskGroups_ = + new java.util.ArrayList(taskGroups_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.TaskGroup, + com.google.events.cloud.batch.v1.TaskGroup.Builder, + com.google.events.cloud.batch.v1.TaskGroupOrBuilder> + taskGroupsBuilder_; + + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + 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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + 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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder setTaskGroups(int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder setTaskGroups( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder addTaskGroups(com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder addTaskGroups(int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder addTaskGroups( + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder addTaskGroups( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + 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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public Builder clearTaskGroups() { + if (taskGroupsBuilder_ == null) { + taskGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + taskGroupsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + 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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public com.google.events.cloud.batch.v1.TaskGroup.Builder getTaskGroupsBuilder(int index) { + return getTaskGroupsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + 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.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public com.google.events.cloud.batch.v1.TaskGroup.Builder addTaskGroupsBuilder() { + return getTaskGroupsFieldBuilder() + .addBuilder(com.google.events.cloud.batch.v1.TaskGroup.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public com.google.events.cloud.batch.v1.TaskGroup.Builder addTaskGroupsBuilder(int index) { + return getTaskGroupsFieldBuilder() + .addBuilder(index, com.google.events.cloud.batch.v1.TaskGroup.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + public java.util.List + getTaskGroupsBuilderList() { + return getTaskGroupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.TaskGroup, + com.google.events.cloud.batch.v1.TaskGroup.Builder, + com.google.events.cloud.batch.v1.TaskGroupOrBuilder> + getTaskGroupsFieldBuilder() { + if (taskGroupsBuilder_ == null) { + taskGroupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.TaskGroup, + com.google.events.cloud.batch.v1.TaskGroup.Builder, + com.google.events.cloud.batch.v1.TaskGroupOrBuilder>( + taskGroups_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + taskGroups_ = null; + } + return taskGroupsBuilder_; + } + + private com.google.events.cloud.batch.v1.AllocationPolicy allocationPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicyOrBuilder> + allocationPolicyBuilder_; + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * + * @return Whether the allocationPolicy field is set. + */ + public boolean hasAllocationPolicy() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * + * @return The allocationPolicy. + */ + public com.google.events.cloud.batch.v1.AllocationPolicy getAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + return allocationPolicy_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } else { + return allocationPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + public Builder setAllocationPolicy(com.google.events.cloud.batch.v1.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allocationPolicy_ = value; + } else { + allocationPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + public Builder setAllocationPolicy( + com.google.events.cloud.batch.v1.AllocationPolicy.Builder builderForValue) { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = builderForValue.build(); + } else { + allocationPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + public Builder mergeAllocationPolicy(com.google.events.cloud.batch.v1.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && allocationPolicy_ != null + && allocationPolicy_ + != com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance()) { + getAllocationPolicyBuilder().mergeFrom(value); + } else { + allocationPolicy_ = value; + } + } else { + allocationPolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + public Builder clearAllocationPolicy() { + bitField0_ = (bitField0_ & ~0x00000010); + allocationPolicy_ = null; + if (allocationPolicyBuilder_ != null) { + allocationPolicyBuilder_.dispose(); + allocationPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Builder getAllocationPolicyBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getAllocationPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + public com.google.events.cloud.batch.v1.AllocationPolicyOrBuilder + getAllocationPolicyOrBuilder() { + if (allocationPolicyBuilder_ != null) { + return allocationPolicyBuilder_.getMessageOrBuilder(); + } else { + return allocationPolicy_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + } + + /** + * + * + *
+     * Compute resource allocation for all TaskGroups in the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.Builder, + com.google.events.cloud.batch.v1.AllocationPolicyOrBuilder> + getAllocationPolicyFieldBuilder() { + if (allocationPolicyBuilder_ == null) { + allocationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy, + com.google.events.cloud.batch.v1.AllocationPolicy.Builder, + com.google.events.cloud.batch.v1.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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + 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 /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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() { + bitField0_ = (bitField0_ & ~0x00000020); + 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() { + bitField0_ |= 0x00000020; + 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); + bitField0_ |= 0x00000020; + 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); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.events.cloud.batch.v1.JobStatus status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.JobStatus, + com.google.events.cloud.batch.v1.JobStatus.Builder, + com.google.events.cloud.batch.v1.JobStatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + * + * @return The status. + */ + public com.google.events.cloud.batch.v1.JobStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null + ? com.google.events.cloud.batch.v1.JobStatus.getDefaultInstance() + : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + public Builder setStatus(com.google.events.cloud.batch.v1.JobStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + public Builder setStatus(com.google.events.cloud.batch.v1.JobStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + public Builder mergeStatus(com.google.events.cloud.batch.v1.JobStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && status_ != null + && status_ != com.google.events.cloud.batch.v1.JobStatus.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000040); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + public com.google.events.cloud.batch.v1.JobStatus.Builder getStatusBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + public com.google.events.cloud.batch.v1.JobStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null + ? com.google.events.cloud.batch.v1.JobStatus.getDefaultInstance() + : status_; + } + } + + /** + * + * + *
+     * Output only. Job status. It is read only for users.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.JobStatus, + com.google.events.cloud.batch.v1.JobStatus.Builder, + com.google.events.cloud.batch.v1.JobStatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.JobStatus, + com.google.events.cloud.batch.v1.JobStatus.Builder, + com.google.events.cloud.batch.v1.JobStatusOrBuilder>( + getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + 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; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 11; + * + * @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; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 11; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 11; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 11; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 11; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. When the Job was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 11; + */ + 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; + */ + 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; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 12; + * + * @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; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 12; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 12; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 12; + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 12; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The last time the Job was updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 12; + */ + 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; + */ + 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.events.cloud.batch.v1.LogsPolicy logsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.LogsPolicy, + com.google.events.cloud.batch.v1.LogsPolicy.Builder, + com.google.events.cloud.batch.v1.LogsPolicyOrBuilder> + logsPolicyBuilder_; + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + * + * @return Whether the logsPolicy field is set. + */ + public boolean hasLogsPolicy() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + * + * @return The logsPolicy. + */ + public com.google.events.cloud.batch.v1.LogsPolicy getLogsPolicy() { + if (logsPolicyBuilder_ == null) { + return logsPolicy_ == null + ? com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } else { + return logsPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + public Builder setLogsPolicy(com.google.events.cloud.batch.v1.LogsPolicy value) { + if (logsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + logsPolicy_ = value; + } else { + logsPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + public Builder setLogsPolicy( + com.google.events.cloud.batch.v1.LogsPolicy.Builder builderForValue) { + if (logsPolicyBuilder_ == null) { + logsPolicy_ = builderForValue.build(); + } else { + logsPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + public Builder mergeLogsPolicy(com.google.events.cloud.batch.v1.LogsPolicy value) { + if (logsPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && logsPolicy_ != null + && logsPolicy_ != com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance()) { + getLogsPolicyBuilder().mergeFrom(value); + } else { + logsPolicy_ = value; + } + } else { + logsPolicyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + public Builder clearLogsPolicy() { + bitField0_ = (bitField0_ & ~0x00000200); + logsPolicy_ = null; + if (logsPolicyBuilder_ != null) { + logsPolicyBuilder_.dispose(); + logsPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + public com.google.events.cloud.batch.v1.LogsPolicy.Builder getLogsPolicyBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getLogsPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + public com.google.events.cloud.batch.v1.LogsPolicyOrBuilder getLogsPolicyOrBuilder() { + if (logsPolicyBuilder_ != null) { + return logsPolicyBuilder_.getMessageOrBuilder(); + } else { + return logsPolicy_ == null + ? com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance() + : logsPolicy_; + } + } + + /** + * + * + *
+     * Log preservation policy for the Job.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.LogsPolicy, + com.google.events.cloud.batch.v1.LogsPolicy.Builder, + com.google.events.cloud.batch.v1.LogsPolicyOrBuilder> + getLogsPolicyFieldBuilder() { + if (logsPolicyBuilder_ == null) { + logsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.LogsPolicy, + com.google.events.cloud.batch.v1.LogsPolicy.Builder, + com.google.events.cloud.batch.v1.LogsPolicyOrBuilder>( + getLogsPolicy(), getParentForChildren(), isClean()); + logsPolicy_ = null; + } + return logsPolicyBuilder_; + } + + private java.util.List notifications_ = + java.util.Collections.emptyList(); + + private void ensureNotificationsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + notifications_ = + new java.util.ArrayList( + notifications_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.JobNotification, + com.google.events.cloud.batch.v1.JobNotification.Builder, + com.google.events.cloud.batch.v1.JobNotificationOrBuilder> + notificationsBuilder_; + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public int getNotificationsCount() { + if (notificationsBuilder_ == null) { + return notifications_.size(); + } else { + return notificationsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public com.google.events.cloud.batch.v1.JobNotification getNotifications(int index) { + if (notificationsBuilder_ == null) { + return notifications_.get(index); + } else { + return notificationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder setNotifications( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder setNotifications( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder addNotifications(com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder addNotifications( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder addNotifications( + com.google.events.cloud.batch.v1.JobNotification.Builder builderForValue) { + if (notificationsBuilder_ == null) { + ensureNotificationsIsMutable(); + notifications_.add(builderForValue.build()); + onChanged(); + } else { + notificationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder addNotifications( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public Builder clearNotifications() { + if (notificationsBuilder_ == null) { + notifications_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + notificationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public com.google.events.cloud.batch.v1.JobNotification.Builder getNotificationsBuilder( + int index) { + return getNotificationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public com.google.events.cloud.batch.v1.JobNotificationOrBuilder getNotificationsOrBuilder( + int index) { + if (notificationsBuilder_ == null) { + return notifications_.get(index); + } else { + return notificationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public com.google.events.cloud.batch.v1.JobNotification.Builder addNotificationsBuilder() { + return getNotificationsFieldBuilder() + .addBuilder(com.google.events.cloud.batch.v1.JobNotification.getDefaultInstance()); + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public com.google.events.cloud.batch.v1.JobNotification.Builder addNotificationsBuilder( + int index) { + return getNotificationsFieldBuilder() + .addBuilder(index, com.google.events.cloud.batch.v1.JobNotification.getDefaultInstance()); + } + + /** + * + * + *
+     * Notification configurations.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + public java.util.List + getNotificationsBuilderList() { + return getNotificationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.JobNotification, + com.google.events.cloud.batch.v1.JobNotification.Builder, + com.google.events.cloud.batch.v1.JobNotificationOrBuilder> + getNotificationsFieldBuilder() { + if (notificationsBuilder_ == null) { + notificationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.JobNotification, + com.google.events.cloud.batch.v1.JobNotification.Builder, + com.google.events.cloud.batch.v1.JobNotificationOrBuilder>( + notifications_, + ((bitField0_ & 0x00000400) != 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.events.cloud.batch.v1.Job) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.Job) + private static final com.google.events.cloud.batch.v1.Job DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.Job(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Job getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobEventData.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobEventData.java new file mode 100644 index 00000000..60047d82 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobEventData.java @@ -0,0 +1,732 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * The data within all Job events.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.JobEventData} + */ +public final class JobEventData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.JobEventData) + JobEventDataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use JobEventData.newBuilder() to construct. + private JobEventData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private JobEventData() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new JobEventData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobEventData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobEventData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobEventData.class, + com.google.events.cloud.batch.v1.JobEventData.Builder.class); + } + + private int bitField0_; + public static final int PAYLOAD_FIELD_NUMBER = 1; + private com.google.events.cloud.batch.v1.Job payload_; + + /** + * + * + *
+   * Optional. The Job event payload. Unset for deletion events.
+   * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. The Job event payload. Unset for deletion events.
+   * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.Job getPayload() { + return payload_ == null ? com.google.events.cloud.batch.v1.Job.getDefaultInstance() : payload_; + } + + /** + * + * + *
+   * Optional. The Job event payload. Unset for deletion events.
+   * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobOrBuilder getPayloadOrBuilder() { + return payload_ == null ? com.google.events.cloud.batch.v1.Job.getDefaultInstance() : payload_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPayload()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPayload()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.JobEventData)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.JobEventData other = + (com.google.events.cloud.batch.v1.JobEventData) obj; + + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.JobEventData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobEventData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobEventData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobEventData 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.events.cloud.batch.v1.JobEventData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobEventData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobEventData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.JobEventData 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.events.cloud.batch.v1.JobEventData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.JobEventData 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.events.cloud.batch.v1.JobEventData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.JobEventData 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.events.cloud.batch.v1.JobEventData 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 data within all Job events.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.JobEventData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.JobEventData) + com.google.events.cloud.batch.v1.JobEventDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobEventData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobEventData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobEventData.class, + com.google.events.cloud.batch.v1.JobEventData.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.JobEventData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPayloadFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + payload_ = null; + if (payloadBuilder_ != null) { + payloadBuilder_.dispose(); + payloadBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobEventData_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobEventData getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.JobEventData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobEventData build() { + com.google.events.cloud.batch.v1.JobEventData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobEventData buildPartial() { + com.google.events.cloud.batch.v1.JobEventData result = + new com.google.events.cloud.batch.v1.JobEventData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.JobEventData result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.payload_ = payloadBuilder_ == null ? payload_ : payloadBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.events.cloud.batch.v1.JobEventData) { + return mergeFrom((com.google.events.cloud.batch.v1.JobEventData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.JobEventData other) { + if (other == com.google.events.cloud.batch.v1.JobEventData.getDefaultInstance()) return this; + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPayloadFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.events.cloud.batch.v1.Job payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.Job, + com.google.events.cloud.batch.v1.Job.Builder, + com.google.events.cloud.batch.v1.JobOrBuilder> + payloadBuilder_; + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + * + * @return Whether the payload field is set. + */ + public boolean hasPayload() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + * + * @return The payload. + */ + public com.google.events.cloud.batch.v1.Job getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null + ? com.google.events.cloud.batch.v1.Job.getDefaultInstance() + : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + public Builder setPayload(com.google.events.cloud.batch.v1.Job value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + } else { + payloadBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + public Builder setPayload(com.google.events.cloud.batch.v1.Job.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + public Builder mergePayload(com.google.events.cloud.batch.v1.Job value) { + if (payloadBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && payload_ != null + && payload_ != com.google.events.cloud.batch.v1.Job.getDefaultInstance()) { + getPayloadBuilder().mergeFrom(value); + } else { + payload_ = value; + } + } else { + payloadBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000001); + payload_ = null; + if (payloadBuilder_ != null) { + payloadBuilder_.dispose(); + payloadBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + public com.google.events.cloud.batch.v1.Job.Builder getPayloadBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + public com.google.events.cloud.batch.v1.JobOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null + ? com.google.events.cloud.batch.v1.Job.getDefaultInstance() + : payload_; + } + } + + /** + * + * + *
+     * Optional. The Job event payload. Unset for deletion events.
+     * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.Job, + com.google.events.cloud.batch.v1.Job.Builder, + com.google.events.cloud.batch.v1.JobOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.Job, + com.google.events.cloud.batch.v1.Job.Builder, + com.google.events.cloud.batch.v1.JobOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + @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.events.cloud.batch.v1.JobEventData) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.JobEventData) + private static final com.google.events.cloud.batch.v1.JobEventData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.JobEventData(); + } + + public static com.google.events.cloud.batch.v1.JobEventData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobEventData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobEventData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobEventDataOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobEventDataOrBuilder.java new file mode 100644 index 00000000..eecefe30 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobEventDataOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface JobEventDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.JobEventData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The Job event payload. Unset for deletion events.
+   * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + + /** + * + * + *
+   * Optional. The Job event payload. Unset for deletion events.
+   * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + * + * @return The payload. + */ + com.google.events.cloud.batch.v1.Job getPayload(); + + /** + * + * + *
+   * Optional. The Job event payload. Unset for deletion events.
+   * 
+ * + * optional .google.events.cloud.batch.v1.Job payload = 1; + */ + com.google.events.cloud.batch.v1.JobOrBuilder getPayloadOrBuilder(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobNotification.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobNotification.java new file mode 100644 index 00000000..7d9227ac --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobNotification.java @@ -0,0 +1,2123 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * Notification configurations.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.JobNotification} + */ +public final class JobNotification extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobNotification.class, + com.google.events.cloud.batch.v1.JobNotification.Builder.class); + } + + /** + * + * + *
+   * The message type.
+   * 
+ * + * Protobuf enum {@code google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Type) + } + + public interface MessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.JobNotification.Message) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Type type = 1; + * + * @return The type. + */ + com.google.events.cloud.batch.v1.JobNotification.Type getType(); + + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State new_job_state = 2; + * + * @return The enum numeric value on the wire for newJobState. + */ + int getNewJobStateValue(); + + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State new_job_state = 2; + * + * @return The newJobState. + */ + com.google.events.cloud.batch.v1.JobStatus.State getNewJobState(); + + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.events.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * + * @return The enum numeric value on the wire for newTaskState. + */ + int getNewTaskStateValue(); + + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.events.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * + * @return The newTaskState. + */ + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message} + */ + public static final class Message extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobNotification.Message.class, + com.google.events.cloud.batch.v1.JobNotification.Message.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
+     * The message type.
+     * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Type getType() { + com.google.events.cloud.batch.v1.JobNotification.Type result = + com.google.events.cloud.batch.v1.JobNotification.Type.forNumber(type_); + return result == null + ? com.google.events.cloud.batch.v1.JobNotification.Type.UNRECOGNIZED + : result; + } + + public static final int NEW_JOB_STATE_FIELD_NUMBER = 2; + private int newJobState_ = 0; + + /** + * + * + *
+     * The new job state.
+     * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.State new_job_state = 2; + * + * @return The newJobState. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.State getNewJobState() { + com.google.events.cloud.batch.v1.JobStatus.State result = + com.google.events.cloud.batch.v1.JobStatus.State.forNumber(newJobState_); + return result == null + ? com.google.events.cloud.batch.v1.JobStatus.State.UNRECOGNIZED + : result; + } + + public static final int NEW_TASK_STATE_FIELD_NUMBER = 3; + private int newTaskState_ = 0; + + /** + * + * + *
+     * The new task state.
+     * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * + * @return The newTaskState. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.TaskStatus.State getNewTaskState() { + com.google.events.cloud.batch.v1.TaskStatus.State result = + com.google.events.cloud.batch.v1.TaskStatus.State.forNumber(newTaskState_); + return result == null + ? com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (newJobState_ + != com.google.events.cloud.batch.v1.JobStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, newJobState_); + } + if (newTaskState_ + != com.google.events.cloud.batch.v1.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, newTaskState_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.events.cloud.batch.v1.JobNotification.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (newJobState_ + != com.google.events.cloud.batch.v1.JobStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, newJobState_); + } + if (newTaskState_ + != com.google.events.cloud.batch.v1.TaskStatus.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, newTaskState_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.JobNotification.Message)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.JobNotification.Message other = + (com.google.events.cloud.batch.v1.JobNotification.Message) obj; + + if (type_ != other.type_) return false; + if (newJobState_ != other.newJobState_) return false; + if (newTaskState_ != other.newTaskState_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.JobNotification.Message parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobNotification.Message parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobNotification.Message parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.JobNotification.Message) + com.google.events.cloud.batch.v1.JobNotification.MessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobNotification.Message.class, + com.google.events.cloud.batch.v1.JobNotification.Message.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.JobNotification.Message.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + newJobState_ = 0; + newTaskState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_Message_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Message getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.JobNotification.Message.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Message build() { + com.google.events.cloud.batch.v1.JobNotification.Message result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Message buildPartial() { + com.google.events.cloud.batch.v1.JobNotification.Message result = + new com.google.events.cloud.batch.v1.JobNotification.Message(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.JobNotification.Message result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.newJobState_ = newJobState_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.newTaskState_ = newTaskState_; + } + } + + @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.events.cloud.batch.v1.JobNotification.Message) { + return mergeFrom((com.google.events.cloud.batch.v1.JobNotification.Message) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.JobNotification.Message other) { + if (other == com.google.events.cloud.batch.v1.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + newJobState_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + newTaskState_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Type getType() { + com.google.events.cloud.batch.v1.JobNotification.Type result = + com.google.events.cloud.batch.v1.JobNotification.Type.forNumber(type_); + return result == null + ? com.google.events.cloud.batch.v1.JobNotification.Type.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.events.cloud.batch.v1.JobNotification.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The message type.
+       * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private int newJobState_ = 0; + + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State new_job_state = 2; + * + * @return The newJobState. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.State getNewJobState() { + com.google.events.cloud.batch.v1.JobStatus.State result = + com.google.events.cloud.batch.v1.JobStatus.State.forNumber(newJobState_); + return result == null + ? com.google.events.cloud.batch.v1.JobStatus.State.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State new_job_state = 2; + * + * @param value The newJobState to set. + * @return This builder for chaining. + */ + public Builder setNewJobState(com.google.events.cloud.batch.v1.JobStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + newJobState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The new job state.
+       * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State new_job_state = 2; + * + * @return This builder for chaining. + */ + public Builder clearNewJobState() { + bitField0_ = (bitField0_ & ~0x00000002); + newJobState_ = 0; + onChanged(); + return this; + } + + private int newTaskState_ = 0; + + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.events.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * + * @return The newTaskState. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.TaskStatus.State getNewTaskState() { + com.google.events.cloud.batch.v1.TaskStatus.State result = + com.google.events.cloud.batch.v1.TaskStatus.State.forNumber(newTaskState_); + return result == null + ? com.google.events.cloud.batch.v1.TaskStatus.State.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.events.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * + * @param value The newTaskState to set. + * @return This builder for chaining. + */ + public Builder setNewTaskState(com.google.events.cloud.batch.v1.TaskStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + newTaskState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The new task state.
+       * 
+ * + * .google.events.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * + * @return This builder for chaining. + */ + public Builder clearNewTaskState() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.events.cloud.batch.v1.JobNotification.Message) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.JobNotification.Message) + private static final com.google.events.cloud.batch.v1.JobNotification.Message DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.JobNotification.Message(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Message getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + * + * @return The message. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.Message getMessage() { + return message_ == null + ? com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification.MessageOrBuilder getMessageOrBuilder() { + return message_ == null + ? com.google.events.cloud.batch.v1.JobNotification.Message.getDefaultInstance() + : message_; + } + + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.JobNotification)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.JobNotification other = + (com.google.events.cloud.batch.v1.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.JobNotification parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobNotification parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobNotification parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.JobNotification) + com.google.events.cloud.batch.v1.JobNotificationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobNotification.class, + com.google.events.cloud.batch.v1.JobNotification.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.JobNotification.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pubsubTopic_ = ""; + message_ = null; + if (messageBuilder_ != null) { + messageBuilder_.dispose(); + messageBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobNotification_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.JobNotification.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification build() { + com.google.events.cloud.batch.v1.JobNotification result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification buildPartial() { + com.google.events.cloud.batch.v1.JobNotification result = + new com.google.events.cloud.batch.v1.JobNotification(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.JobNotification result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pubsubTopic_ = pubsubTopic_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = messageBuilder_ == null ? message_ : messageBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.JobNotification) { + return mergeFrom((com.google.events.cloud.batch.v1.JobNotification) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.JobNotification other) { + if (other == com.google.events.cloud.batch.v1.JobNotification.getDefaultInstance()) + return this; + if (!other.getPubsubTopic().isEmpty()) { + pubsubTopic_ = other.pubsubTopic_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + pubsubTopic_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMessageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.events.cloud.batch.v1.JobNotification.Message message_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.JobNotification.Message, + com.google.events.cloud.batch.v1.JobNotification.Message.Builder, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Message message = 2; + * + * @return The message. + */ + public com.google.events.cloud.batch.v1.JobNotification.Message getMessage() { + if (messageBuilder_ == null) { + return message_ == null + ? com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + public Builder setMessage(com.google.events.cloud.batch.v1.JobNotification.Message value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + } else { + messageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + public Builder setMessage( + com.google.events.cloud.batch.v1.JobNotification.Message.Builder builderForValue) { + if (messageBuilder_ == null) { + message_ = builderForValue.build(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + public Builder mergeMessage(com.google.events.cloud.batch.v1.JobNotification.Message value) { + if (messageBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && message_ != null + && message_ + != com.google.events.cloud.batch.v1.JobNotification.Message.getDefaultInstance()) { + getMessageBuilder().mergeFrom(value); + } else { + message_ = value; + } + } else { + messageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000002); + message_ = null; + if (messageBuilder_ != null) { + messageBuilder_.dispose(); + messageBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The attribute requirements of messages to be sent to this Pub/Sub topic.
+     * Without this field, no message will be sent.
+     * 
+ * + * .google.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + public com.google.events.cloud.batch.v1.JobNotification.Message.Builder getMessageBuilder() { + bitField0_ |= 0x00000002; + 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.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + public com.google.events.cloud.batch.v1.JobNotification.MessageOrBuilder getMessageOrBuilder() { + if (messageBuilder_ != null) { + return messageBuilder_.getMessageOrBuilder(); + } else { + return message_ == null + ? com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.JobNotification.Message, + com.google.events.cloud.batch.v1.JobNotification.Message.Builder, + com.google.events.cloud.batch.v1.JobNotification.MessageOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + messageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.JobNotification.Message, + com.google.events.cloud.batch.v1.JobNotification.Message.Builder, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.JobNotification) + private static final com.google.events.cloud.batch.v1.JobNotification DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.JobNotification(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobNotification getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobNotificationOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobNotificationOrBuilder.java new file mode 100644 index 00000000..19539d5f --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobNotificationOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface JobNotificationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + * + * @return The message. + */ + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobNotification.Message message = 2; + */ + com.google.events.cloud.batch.v1.JobNotification.MessageOrBuilder getMessageOrBuilder(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobOrBuilder.java new file mode 100644 index 00000000..bcccffba --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobOrBuilder.java @@ -0,0 +1,501 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface JobOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.Job) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. Job name.
+   * For example: "projects/123456/locations/us-central1/jobs/job01".
+   * 
+ * + * string name = 1; + * + * @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; + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
+   * Output only. A system generated unique ID (in UUID4 format) for the Job.
+   * 
+ * + * string uid = 2; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Priority of the Job.
+   * The valid value range is [0, 100). Default value is 0.
+   * Higher value indicates higher priority.
+   * A job with higher priority value is more likely to run earlier if all other
+   * requirements are satisfied.
+   * 
+ * + * int64 priority = 3; + * + * @return The priority. + */ + long getPriority(); + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + java.util.List getTaskGroupsList(); + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + com.google.events.cloud.batch.v1.TaskGroup getTaskGroups(int index); + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + int getTaskGroupsCount(); + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + java.util.List + getTaskGroupsOrBuilderList(); + + /** + * + * + *
+   * Required. TaskGroups in the Job. Only one TaskGroup is supported now.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.TaskGroup task_groups = 4; + */ + com.google.events.cloud.batch.v1.TaskGroupOrBuilder getTaskGroupsOrBuilder(int index); + + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * + * @return Whether the allocationPolicy field is set. + */ + boolean hasAllocationPolicy(); + + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * + * @return The allocationPolicy. + */ + com.google.events.cloud.batch.v1.AllocationPolicy getAllocationPolicy(); + + /** + * + * + *
+   * Compute resource allocation for all TaskGroups in the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus status = 9; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + * + * @return The status. + */ + com.google.events.cloud.batch.v1.JobStatus getStatus(); + + /** + * + * + *
+   * Output only. Job status. It is read only for users.
+   * 
+ * + * .google.events.cloud.batch.v1.JobStatus status = 9; + */ + com.google.events.cloud.batch.v1.JobStatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. When the Job was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The last time the Job was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + * + * @return Whether the logsPolicy field is set. + */ + boolean hasLogsPolicy(); + + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + * + * @return The logsPolicy. + */ + com.google.events.cloud.batch.v1.LogsPolicy getLogsPolicy(); + + /** + * + * + *
+   * Log preservation policy for the Job.
+   * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + com.google.events.cloud.batch.v1.LogsPolicyOrBuilder getLogsPolicyOrBuilder(); + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + java.util.List getNotificationsList(); + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + com.google.events.cloud.batch.v1.JobNotification getNotifications(int index); + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + int getNotificationsCount(); + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + java.util.List + getNotificationsOrBuilderList(); + + /** + * + * + *
+   * Notification configurations.
+   * 
+ * + * repeated .google.events.cloud.batch.v1.JobNotification notifications = 14; + */ + com.google.events.cloud.batch.v1.JobNotificationOrBuilder getNotificationsOrBuilder(int index); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobStatus.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobStatus.java new file mode 100644 index 00000000..fab048c7 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobStatus.java @@ -0,0 +1,4825 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * Job status.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.JobStatus} + */ +public final class JobStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobStatus.class, + com.google.events.cloud.batch.v1.JobStatus.Builder.class); + } + + /** + * + * + *
+   * Valid Job states.
+   * 
+ * + * Protobuf enum {@code google.events.cloud.batch.v1.JobStatus.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Job state unspecified.
+     * 
+ * + * 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), + ; + + /** + * + * + *
+     * Job state unspecified.
+     * 
+ * + * 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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.State) + } + + public interface InstanceStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The enum numeric value on the wire for provisioningModel. + */ + int getProvisioningModelValue(); + + /** + * + * + *
+     * The VM instance provisioning model.
+     * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The provisioningModel. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel getProvisioningModel(); + + /** + * + * + *
+     * The max number of tasks can be assigned to this instance type.
+     * 
+ * + * int64 task_pack = 3; + * + * @return The taskPack. + */ + long getTaskPack(); + + /** + * + * + *
+     * The VM boot disk.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * + * @return Whether the bootDisk field is set. + */ + boolean hasBootDisk(); + + /** + * + * + *
+     * The VM boot disk.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * + * @return The bootDisk. + */ + com.google.events.cloud.batch.v1.AllocationPolicy.Disk getBootDisk(); + + /** + * + * + *
+     * The VM boot disk.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder getBootDiskOrBuilder(); + } + + /** + * + * + *
+   * VM instance status.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.JobStatus.InstanceStatus} + */ + public static final class InstanceStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.class, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder.class); + } + + public static final int MACHINE_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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_ = 0; + + /** + * + * + *
+     * The VM instance provisioning model.
+     * 
+ * + * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel result = + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.forNumber( + provisioningModel_); + return result == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + + public static final int TASK_PACK_FIELD_NUMBER = 3; + private long taskPack_ = 0L; + + /** + * + * + *
+     * 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_; + } + + public static final int BOOT_DISK_FIELD_NUMBER = 4; + private com.google.events.cloud.batch.v1.AllocationPolicy.Disk bootDisk_; + + /** + * + * + *
+     * The VM boot disk.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * + * @return Whether the bootDisk field is set. + */ + @java.lang.Override + public boolean hasBootDisk() { + return bootDisk_ != null; + } + + /** + * + * + *
+     * The VM boot disk.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * + * @return The bootDisk. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getBootDisk() { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } + + /** + * + * + *
+     * The VM boot disk.
+     * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder getBootDiskOrBuilder() { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } + + 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.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel + .PROVISIONING_MODEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, provisioningModel_); + } + if (taskPack_ != 0L) { + output.writeInt64(3, taskPack_); + } + if (bootDisk_ != null) { + output.writeMessage(4, getBootDisk()); + } + getUnknownFields().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.events.cloud.batch.v1.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_); + } + if (bootDisk_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBootDisk()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.JobStatus.InstanceStatus)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus other = + (com.google.events.cloud.batch.v1.JobStatus.InstanceStatus) obj; + + if (!getMachineType().equals(other.getMachineType())) return false; + if (provisioningModel_ != other.provisioningModel_) return false; + if (getTaskPack() != other.getTaskPack()) return false; + if (hasBootDisk() != other.hasBootDisk()) return false; + if (hasBootDisk()) { + if (!getBootDisk().equals(other.getBootDisk())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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()); + if (hasBootDisk()) { + hash = (37 * hash) + BOOT_DISK_FIELD_NUMBER; + hash = (53 * hash) + getBootDisk().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.JobStatus.InstanceStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobStatus.InstanceStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobStatus.InstanceStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.JobStatus.InstanceStatus) + com.google.events.cloud.batch.v1.JobStatus.InstanceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.class, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + machineType_ = ""; + provisioningModel_ = 0; + taskPack_ = 0L; + bootDisk_ = null; + if (bootDiskBuilder_ != null) { + bootDiskBuilder_.dispose(); + bootDiskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_InstanceStatus_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus build() { + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus buildPartial() { + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus result = + new com.google.events.cloud.batch.v1.JobStatus.InstanceStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.JobStatus.InstanceStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.machineType_ = machineType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.provisioningModel_ = provisioningModel_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.taskPack_ = taskPack_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bootDisk_ = bootDiskBuilder_ == null ? bootDisk_ : bootDiskBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.JobStatus.InstanceStatus) { + return mergeFrom((com.google.events.cloud.batch.v1.JobStatus.InstanceStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.JobStatus.InstanceStatus other) { + if (other == com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.getDefaultInstance()) + return this; + if (!other.getMachineType().isEmpty()) { + machineType_ = other.machineType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.provisioningModel_ != 0) { + setProvisioningModelValue(other.getProvisioningModelValue()); + } + if (other.getTaskPack() != 0L) { + setTaskPack(other.getTaskPack()); + } + if (other.hasBootDisk()) { + mergeBootDisk(other.getBootDisk()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + machineType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + provisioningModel_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + taskPack_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(getBootDiskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The Compute Engine machine type.
+       * 
+ * + * string machine_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearMachineType() { + machineType_ = getDefaultInstance().getMachineType(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int provisioningModel_ = 0; + + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return The provisioningModel. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel + getProvisioningModel() { + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel result = + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.forNumber( + provisioningModel_); + return result == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @param value The provisioningModel to set. + * @return This builder for chaining. + */ + public Builder setProvisioningModel( + com.google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + provisioningModel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The VM instance provisioning model.
+       * 
+ * + * + * .google.events.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearProvisioningModel() { + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000004; + 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() { + bitField0_ = (bitField0_ & ~0x00000004); + taskPack_ = 0L; + onChanged(); + return this; + } + + private com.google.events.cloud.batch.v1.AllocationPolicy.Disk bootDisk_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder> + bootDiskBuilder_; + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * + * @return Whether the bootDisk field is set. + */ + public boolean hasBootDisk() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * + * @return The bootDisk. + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk getBootDisk() { + if (bootDiskBuilder_ == null) { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } else { + return bootDiskBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + public Builder setBootDisk(com.google.events.cloud.batch.v1.AllocationPolicy.Disk value) { + if (bootDiskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bootDisk_ = value; + } else { + bootDiskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + public Builder setBootDisk( + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder builderForValue) { + if (bootDiskBuilder_ == null) { + bootDisk_ = builderForValue.build(); + } else { + bootDiskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + public Builder mergeBootDisk(com.google.events.cloud.batch.v1.AllocationPolicy.Disk value) { + if (bootDiskBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && bootDisk_ != null + && bootDisk_ + != com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance()) { + getBootDiskBuilder().mergeFrom(value); + } else { + bootDisk_ = value; + } + } else { + bootDiskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + public Builder clearBootDisk() { + bitField0_ = (bitField0_ & ~0x00000008); + bootDisk_ = null; + if (bootDiskBuilder_ != null) { + bootDiskBuilder_.dispose(); + bootDiskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder getBootDiskBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getBootDiskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + public com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder + getBootDiskOrBuilder() { + if (bootDiskBuilder_ != null) { + return bootDiskBuilder_.getMessageOrBuilder(); + } else { + return bootDisk_ == null + ? com.google.events.cloud.batch.v1.AllocationPolicy.Disk.getDefaultInstance() + : bootDisk_; + } + } + + /** + * + * + *
+       * The VM boot disk.
+       * 
+ * + * .google.events.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder> + getBootDiskFieldBuilder() { + if (bootDiskBuilder_ == null) { + bootDiskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.AllocationPolicy.Disk, + com.google.events.cloud.batch.v1.AllocationPolicy.Disk.Builder, + com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder>( + getBootDisk(), getParentForChildren(), isClean()); + bootDisk_ = null; + } + return bootDiskBuilder_; + } + + @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.events.cloud.batch.v1.JobStatus.InstanceStatus) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.JobStatus.InstanceStatus) + private static final com.google.events.cloud.batch.v1.JobStatus.InstanceStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.JobStatus.InstanceStatus(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TaskGroupStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + java.util.List getInstancesList(); + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus getInstances(int index); + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + int getInstancesCount(); + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + java.util.List + getInstancesOrBuilderList(); + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + com.google.events.cloud.batch.v1.JobStatus.InstanceStatusOrBuilder getInstancesOrBuilder( + int index); + } + + /** + * + * + *
+   * Aggregated task status for a TaskGroup.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.JobStatus.TaskGroupStatus} + */ + public static final class TaskGroupStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus.class, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_CountsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT64, + 0L); + } + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + private java.util.List instances_; + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public java.util.List + getInstancesList() { + return instances_; + } + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.events.cloud.batch.v1.JobStatus.InstanceStatusOrBuilder> + getInstancesOrBuilderList() { + return instances_; + } + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus getInstances(int index) { + return instances_.get(index); + } + + /** + * + * + *
+     * Status of instances allocated for the TaskGroup.
+     * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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)); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus other = + (com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus) obj; + + if (!internalGetCounts().equals(other.internalGetCounts())) return false; + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.JobStatus.TaskGroupStatus) + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus.class, + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableCounts().clear(); + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupStatus_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus build() { + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus buildPartial() { + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus result = + new com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.counts_ = internalGetCounts(); + result.counts_.makeImmutable(); + } + } + + @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.events.cloud.batch.v1.JobStatus.TaskGroupStatus) { + return mergeFrom((com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus other) { + if (other + == com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus.getDefaultInstance()) + return this; + internalGetMutableCounts().mergeFrom(other.internalGetCounts()); + bitField0_ |= 0x00000001; + 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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry counts__ = + input.readMessage( + CountsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableCounts() + .getMutableMap() + .put(counts__.getKey(), counts__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus m = + input.readMessage( + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.parser(), + extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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() { + if (counts_ == null) { + counts_ = com.google.protobuf.MapField.newMapField(CountsDefaultEntryHolder.defaultEntry); + } + if (!counts_.isMutable()) { + counts_ = counts_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000001); + 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() { + bitField0_ |= 0x00000001; + 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); + bitField0_ |= 0x00000001; + 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); + bitField0_ |= 0x00000001; + 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.events.cloud.batch.v1.JobStatus.InstanceStatus, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatusOrBuilder> + instancesBuilder_; + + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public Builder setInstances( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public Builder setInstances( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances(com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances( + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public Builder addInstances( + int index, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder getInstancesBuilder( + int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public java.util.List< + ? extends com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder + addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder( + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.getDefaultInstance()); + } + + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder addInstancesBuilder( + int index) { + return getInstancesFieldBuilder() + .addBuilder( + index, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.getDefaultInstance()); + } + + /** + * + * + *
+       * Status of instances allocated for the TaskGroup.
+       * 
+ * + * repeated .google.events.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatusOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus, + com.google.events.cloud.batch.v1.JobStatus.InstanceStatus.Builder, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.JobStatus.TaskGroupStatus) + private static final com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.State getState() { + com.google.events.cloud.batch.v1.JobStatus.State result = + com.google.events.cloud.batch.v1.JobStatus.State.forNumber(state_); + return result == null ? com.google.events.cloud.batch.v1.JobStatus.State.UNRECOGNIZED : result; + } + + public static final int STATUS_EVENTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List statusEvents_; + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + @java.lang.Override + public java.util.List getStatusEventsList() { + return statusEvents_; + } + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + @java.lang.Override + public java.util.List + getStatusEventsOrBuilderList() { + return statusEvents_; + } + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + @java.lang.Override + public int getStatusEventsCount() { + return statusEvents_.size(); + } + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.StatusEvent getStatusEvents(int index) { + return statusEvents_.get(index); + } + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_TaskGroupsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + taskGroups_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus + getTaskGroupsOrDefault( + java.lang.String key, + /* nullable */ + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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 runDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : runDuration_; + } + + 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.events.cloud.batch.v1.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()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ != com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + entry : internalGetTaskGroups().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.events.cloud.batch.v1.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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.JobStatus)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.JobStatus other = + (com.google.events.cloud.batch.v1.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.JobStatus parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.JobStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.JobStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.JobStatus) + com.google.events.cloud.batch.v1.JobStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.JobStatus.class, + com.google.events.cloud.batch.v1.JobStatus.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.JobStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + if (statusEventsBuilder_ == null) { + statusEvents_ = java.util.Collections.emptyList(); + } else { + statusEvents_ = null; + statusEventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableTaskGroups().clear(); + runDuration_ = null; + if (runDurationBuilder_ != null) { + runDurationBuilder_.dispose(); + runDurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_JobStatus_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.JobStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus build() { + com.google.events.cloud.batch.v1.JobStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus buildPartial() { + com.google.events.cloud.batch.v1.JobStatus result = + new com.google.events.cloud.batch.v1.JobStatus(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.events.cloud.batch.v1.JobStatus result) { + if (statusEventsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + statusEvents_ = java.util.Collections.unmodifiableList(statusEvents_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.statusEvents_ = statusEvents_; + } else { + result.statusEvents_ = statusEventsBuilder_.build(); + } + } + + private void buildPartial0(com.google.events.cloud.batch.v1.JobStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.taskGroups_ = internalGetTaskGroups(); + result.taskGroups_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.runDuration_ = + runDurationBuilder_ == null ? runDuration_ : runDurationBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.JobStatus) { + return mergeFrom((com.google.events.cloud.batch.v1.JobStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.JobStatus other) { + if (other == com.google.events.cloud.batch.v1.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_ & ~0x00000002); + } else { + ensureStatusEventsIsMutable(); + statusEvents_.addAll(other.statusEvents_); + } + onChanged(); + } + } else { + if (!other.statusEvents_.isEmpty()) { + if (statusEventsBuilder_.isEmpty()) { + statusEventsBuilder_.dispose(); + statusEventsBuilder_ = null; + statusEvents_ = other.statusEvents_; + bitField0_ = (bitField0_ & ~0x00000002); + statusEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStatusEventsFieldBuilder() + : null; + } else { + statusEventsBuilder_.addAllMessages(other.statusEvents_); + } + } + } + internalGetMutableTaskGroups().mergeFrom(other.internalGetTaskGroups()); + bitField0_ |= 0x00000004; + if (other.hasRunDuration()) { + mergeRunDuration(other.getRunDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.events.cloud.batch.v1.StatusEvent m = + input.readMessage( + com.google.events.cloud.batch.v1.StatusEvent.parser(), extensionRegistry); + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + statusEvents_.add(m); + } else { + statusEventsBuilder_.addMessage(m); + } + break; + } // case 18 + case 34: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + taskGroups__ = + input.readMessage( + TaskGroupsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableTaskGroups() + .getMutableMap() + .put(taskGroups__.getKey(), taskGroups__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage(getRunDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int state_ = 0; + + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus.State getState() { + com.google.events.cloud.batch.v1.JobStatus.State result = + com.google.events.cloud.batch.v1.JobStatus.State.forNumber(state_); + return result == null + ? com.google.events.cloud.batch.v1.JobStatus.State.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.events.cloud.batch.v1.JobStatus.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Job state
+     * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private java.util.List statusEvents_ = + java.util.Collections.emptyList(); + + private void ensureStatusEventsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + statusEvents_ = + new java.util.ArrayList(statusEvents_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.StatusEvent, + com.google.events.cloud.batch.v1.StatusEvent.Builder, + com.google.events.cloud.batch.v1.StatusEventOrBuilder> + statusEventsBuilder_; + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public int getStatusEventsCount() { + if (statusEventsBuilder_ == null) { + return statusEvents_.size(); + } else { + return statusEventsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public com.google.events.cloud.batch.v1.StatusEvent getStatusEvents(int index) { + if (statusEventsBuilder_ == null) { + return statusEvents_.get(index); + } else { + return statusEventsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder setStatusEvents(int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder setStatusEvents( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder addStatusEvents(com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder addStatusEvents(int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder addStatusEvents( + com.google.events.cloud.batch.v1.StatusEvent.Builder builderForValue) { + if (statusEventsBuilder_ == null) { + ensureStatusEventsIsMutable(); + statusEvents_.add(builderForValue.build()); + onChanged(); + } else { + statusEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder addStatusEvents( + int index, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public Builder clearStatusEvents() { + if (statusEventsBuilder_ == null) { + statusEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + statusEventsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public com.google.events.cloud.batch.v1.StatusEvent.Builder getStatusEventsBuilder(int index) { + return getStatusEventsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public com.google.events.cloud.batch.v1.StatusEventOrBuilder getStatusEventsOrBuilder( + int index) { + if (statusEventsBuilder_ == null) { + return statusEvents_.get(index); + } else { + return statusEventsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.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.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public com.google.events.cloud.batch.v1.StatusEvent.Builder addStatusEventsBuilder() { + return getStatusEventsFieldBuilder() + .addBuilder(com.google.events.cloud.batch.v1.StatusEvent.getDefaultInstance()); + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public com.google.events.cloud.batch.v1.StatusEvent.Builder addStatusEventsBuilder(int index) { + return getStatusEventsFieldBuilder() + .addBuilder(index, com.google.events.cloud.batch.v1.StatusEvent.getDefaultInstance()); + } + + /** + * + * + *
+     * Job status events
+     * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + public java.util.List + getStatusEventsBuilderList() { + return getStatusEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.StatusEvent, + com.google.events.cloud.batch.v1.StatusEvent.Builder, + com.google.events.cloud.batch.v1.StatusEventOrBuilder> + getStatusEventsFieldBuilder() { + if (statusEventsBuilder_ == null) { + statusEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.events.cloud.batch.v1.StatusEvent, + com.google.events.cloud.batch.v1.StatusEvent.Builder, + com.google.events.cloud.batch.v1.StatusEventOrBuilder>( + statusEvents_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + statusEvents_ = null; + } + return statusEventsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + taskGroups_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + internalGetMutableTaskGroups() { + if (taskGroups_ == null) { + taskGroups_ = + com.google.protobuf.MapField.newMapField(TaskGroupsDefaultEntryHolder.defaultEntry); + } + if (!taskGroups_.isMutable()) { + taskGroups_ = taskGroups_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + 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.events.cloud.batch.v1.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< + java.lang.String, com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + getTaskGroups() { + return getTaskGroupsMap(); + } + + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + getTaskGroupsMap() { + return internalGetTaskGroups().getMap(); + } + + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus + getTaskGroupsOrDefault( + java.lang.String key, + /* nullable */ + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.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() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableTaskGroups().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.events.cloud.batch.v1.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< + java.lang.String, com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> + getMutableTaskGroups() { + bitField0_ |= 0x00000004; + return internalGetMutableTaskGroups().getMutableMap(); + } + + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + public Builder putTaskGroups( + java.lang.String key, com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTaskGroups().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * Aggregated task status for each TaskGroup in the Job.
+     * The map key is TaskGroup ID.
+     * 
+ * + * + * map<string, .google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + public Builder putAllTaskGroups( + java.util.Map + values) { + internalGetMutableTaskGroups().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + 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 ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * 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; + } else { + runDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + 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(); + } else { + runDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + 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 (((bitField0_ & 0x00000008) != 0) + && runDuration_ != null + && runDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRunDurationBuilder().mergeFrom(value); + } else { + runDuration_ = value; + } + } else { + runDurationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The duration of time that the Job spent in status RUNNING.
+     * 
+ * + * .google.protobuf.Duration run_duration = 5; + */ + public Builder clearRunDuration() { + bitField0_ = (bitField0_ & ~0x00000008); + runDuration_ = null; + if (runDurationBuilder_ != null) { + runDurationBuilder_.dispose(); + runDurationBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000008; + 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.events.cloud.batch.v1.JobStatus) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.JobStatus) + private static final com.google.events.cloud.batch.v1.JobStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.JobStatus(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.JobStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobStatusOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobStatusOrBuilder.java new file mode 100644 index 00000000..91020642 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/JobStatusOrBuilder.java @@ -0,0 +1,225 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface JobStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.JobStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Job state
+   * 
+ * + * .google.events.cloud.batch.v1.JobStatus.State state = 1; + * + * @return The state. + */ + com.google.events.cloud.batch.v1.JobStatus.State getState(); + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + java.util.List getStatusEventsList(); + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + com.google.events.cloud.batch.v1.StatusEvent getStatusEvents(int index); + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + int getStatusEventsCount(); + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + java.util.List + getStatusEventsOrBuilderList(); + + /** + * + * + *
+   * Job status events
+   * 
+ * + * repeated .google.events.cloud.batch.v1.StatusEvent status_events = 2; + */ + com.google.events.cloud.batch.v1.StatusEventOrBuilder getStatusEventsOrBuilder(int index); + + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * + * map<string, .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + /* nullable */ + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus getTaskGroupsOrDefault( + java.lang.String key, + /* nullable */ + com.google.events.cloud.batch.v1.JobStatus.TaskGroupStatus defaultValue); + + /** + * + * + *
+   * Aggregated task status for each TaskGroup in the Job.
+   * The map key is TaskGroup ID.
+   * 
+ * + * + * map<string, .google.events.cloud.batch.v1.JobStatus.TaskGroupStatus> task_groups = 4; + * + */ + com.google.events.cloud.batch.v1.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/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LifecyclePolicy.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LifecyclePolicy.java new file mode 100644 index 00000000..a000bbd1 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LifecyclePolicy.java @@ -0,0 +1,1884 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * LifecyclePolicy describes how to deal with task failures
+ * based on different conditions.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.LifecyclePolicy} + */ +public final class LifecyclePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.LifecyclePolicy.class, + com.google.events.cloud.batch.v1.LifecyclePolicy.Builder.class); + } + + /** + * + * + *
+   * Action on task failures based on different conditions.
+   * 
+ * + * Protobuf enum {@code google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.Action) + } + + public interface ActionConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition} + */ + public static final class ActionCondition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.class, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder.class); + } + + public static final int EXIT_CODES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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)); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition other = + (com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition) obj; + + if (!getExitCodesList().equals(other.getExitCodesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExitCodesCount() > 0) { + hash = (37 * hash) + EXIT_CODES_FIELD_NUMBER; + hash = (53 * hash) + getExitCodesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition) + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.class, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder.class); + } + + // Construct using + // com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + exitCodes_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_ActionCondition_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition + getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition build() { + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition buildPartial() { + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition result = + new com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition result) { + if (((bitField0_ & 0x00000001) != 0)) { + exitCodes_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.exitCodes_ = exitCodes_; + } + + private void buildPartial0( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition result) { + int from_bitField0_ = bitField0_; + } + + @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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition) { + return mergeFrom( + (com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition other) { + if (other + == com.google.events.cloud.batch.v1.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int v = input.readInt32(); + ensureExitCodesIsMutable(); + exitCodes_.addInt(v); + break; + } // case 8 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExitCodesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + exitCodes_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition) + private static final com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ACTION_FIELD_NUMBER = 1; + private int action_ = 0; + + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
+   * 
+ * + * .google.events.cloud.batch.v1.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.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
+   * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * + * @return The action. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.Action getAction() { + com.google.events.cloud.batch.v1.LifecyclePolicy.Action result = + com.google.events.cloud.batch.v1.LifecyclePolicy.Action.forNumber(action_); + return result == null + ? com.google.events.cloud.batch.v1.LifecyclePolicy.Action.UNRECOGNIZED + : result; + } + + public static final int ACTION_CONDITION_FIELD_NUMBER = 2; + private com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition actionCondition_; + + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + * + * @return The actionCondition. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition getActionCondition() { + return actionCondition_ == null + ? com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } + + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder + getActionConditionOrBuilder() { + return actionCondition_ == null + ? com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } + + 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.events.cloud.batch.v1.LifecyclePolicy.Action.ACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(1, action_); + } + if (actionCondition_ != null) { + output.writeMessage(2, getActionCondition()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (action_ + != com.google.events.cloud.batch.v1.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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.LifecyclePolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.LifecyclePolicy other = + (com.google.events.cloud.batch.v1.LifecyclePolicy) obj; + + if (action_ != other.action_) return false; + if (hasActionCondition() != other.hasActionCondition()) return false; + if (hasActionCondition()) { + if (!getActionCondition().equals(other.getActionCondition())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + if (hasActionCondition()) { + hash = (37 * hash) + ACTION_CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getActionCondition().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.LifecyclePolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.LifecyclePolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.LifecyclePolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.LifecyclePolicy) + com.google.events.cloud.batch.v1.LifecyclePolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.LifecyclePolicy.class, + com.google.events.cloud.batch.v1.LifecyclePolicy.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.LifecyclePolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + action_ = 0; + actionCondition_ = null; + if (actionConditionBuilder_ != null) { + actionConditionBuilder_.dispose(); + actionConditionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LifecyclePolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.LifecyclePolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy build() { + com.google.events.cloud.batch.v1.LifecyclePolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy buildPartial() { + com.google.events.cloud.batch.v1.LifecyclePolicy result = + new com.google.events.cloud.batch.v1.LifecyclePolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.LifecyclePolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.action_ = action_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.actionCondition_ = + actionConditionBuilder_ == null ? actionCondition_ : actionConditionBuilder_.build(); + } + } + + @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.events.cloud.batch.v1.LifecyclePolicy) { + return mergeFrom((com.google.events.cloud.batch.v1.LifecyclePolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.LifecyclePolicy other) { + if (other == com.google.events.cloud.batch.v1.LifecyclePolicy.getDefaultInstance()) + return this; + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + if (other.hasActionCondition()) { + mergeActionCondition(other.getActionCondition()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + action_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getActionConditionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int action_ = 0; + + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
+     * 
+ * + * .google.events.cloud.batch.v1.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.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
+     * 
+ * + * .google.events.cloud.batch.v1.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * + * @return The action. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy.Action getAction() { + com.google.events.cloud.batch.v1.LifecyclePolicy.Action result = + com.google.events.cloud.batch.v1.LifecyclePolicy.Action.forNumber(action_); + return result == null + ? com.google.events.cloud.batch.v1.LifecyclePolicy.Action.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.events.cloud.batch.v1.LifecyclePolicy.Action value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + action_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Action to execute when ActionCondition is true.
+     * When RETRY_TASK is specified, we will retry failed tasks
+     * if we notice any exit code match and fail tasks if no match is found.
+     * Likewise, when FAIL_TASK is specified, we will fail tasks
+     * if we notice any exit code match and retry tasks if no match is found.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * + * @return This builder for chaining. + */ + public Builder clearAction() { + bitField0_ = (bitField0_ & ~0x00000001); + action_ = 0; + onChanged(); + return this; + } + + private com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition actionCondition_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder> + actionConditionBuilder_; + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + * + * @return Whether the actionCondition field is set. + */ + public boolean hasActionCondition() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + * + * @return The actionCondition. + */ + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition getActionCondition() { + if (actionConditionBuilder_ == null) { + return actionCondition_ == null + ? com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } else { + return actionConditionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder setActionCondition( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition value) { + if (actionConditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + actionCondition_ = value; + } else { + actionConditionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder setActionCondition( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder builderForValue) { + if (actionConditionBuilder_ == null) { + actionCondition_ = builderForValue.build(); + } else { + actionConditionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder mergeActionCondition( + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition value) { + if (actionConditionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && actionCondition_ != null + && actionCondition_ + != com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition + .getDefaultInstance()) { + getActionConditionBuilder().mergeFrom(value); + } else { + actionCondition_ = value; + } + } else { + actionConditionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public Builder clearActionCondition() { + bitField0_ = (bitField0_ & ~0x00000002); + actionCondition_ = null; + if (actionConditionBuilder_ != null) { + actionConditionBuilder_.dispose(); + actionConditionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder + getActionConditionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getActionConditionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + public com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder + getActionConditionOrBuilder() { + if (actionConditionBuilder_ != null) { + return actionConditionBuilder_.getMessageOrBuilder(); + } else { + return actionCondition_ == null + ? com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.getDefaultInstance() + : actionCondition_; + } + } + + /** + * + * + *
+     * Conditions that decide why a task failure is dealt with a specific action.
+     * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder> + getActionConditionFieldBuilder() { + if (actionConditionBuilder_ == null) { + actionConditionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition, + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition.Builder, + com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.LifecyclePolicy) + private static final com.google.events.cloud.batch.v1.LifecyclePolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.LifecyclePolicy(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LifecyclePolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LifecyclePolicyOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LifecyclePolicyOrBuilder.java new file mode 100644 index 00000000..e9bf07ea --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LifecyclePolicyOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface LifecyclePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.LifecyclePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
+   * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + + /** + * + * + *
+   * Action to execute when ActionCondition is true.
+   * When RETRY_TASK is specified, we will retry failed tasks
+   * if we notice any exit code match and fail tasks if no match is found.
+   * Likewise, when FAIL_TASK is specified, we will fail tasks
+   * if we notice any exit code match and retry tasks if no match is found.
+   * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * + * @return The action. + */ + com.google.events.cloud.batch.v1.LifecyclePolicy.Action getAction(); + + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + * + * @return The actionCondition. + */ + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition getActionCondition(); + + /** + * + * + *
+   * Conditions that decide why a task failure is dealt with a specific action.
+   * 
+ * + * .google.events.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * + */ + com.google.events.cloud.batch.v1.LifecyclePolicy.ActionConditionOrBuilder + getActionConditionOrBuilder(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LogsPolicy.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LogsPolicy.java new file mode 100644 index 00000000..c4bf1aab --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LogsPolicy.java @@ -0,0 +1,975 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
+ * preserved.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.LogsPolicy} + */ +public final class LogsPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LogsPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LogsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.LogsPolicy.class, + com.google.events.cloud.batch.v1.LogsPolicy.Builder.class); + } + + /** + * + * + *
+   * The destination (if any) for logs.
+   * 
+ * + * Protobuf enum {@code google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy.Destination) + } + + public static final int DESTINATION_FIELD_NUMBER = 1; + private int destination_ = 0; + + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy.Destination getDestination() { + com.google.events.cloud.batch.v1.LogsPolicy.Destination result = + com.google.events.cloud.batch.v1.LogsPolicy.Destination.forNumber(destination_); + return result == null + ? com.google.events.cloud.batch.v1.LogsPolicy.Destination.UNRECOGNIZED + : result; + } + + public static final int LOGS_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + 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.events.cloud.batch.v1.LogsPolicy.Destination.DESTINATION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logsPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logsPath_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destination_ + != com.google.events.cloud.batch.v1.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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.LogsPolicy)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.LogsPolicy other = + (com.google.events.cloud.batch.v1.LogsPolicy) obj; + + if (destination_ != other.destination_) return false; + if (!getLogsPath().equals(other.getLogsPath())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + destination_; + hash = (37 * hash) + LOGS_PATH_FIELD_NUMBER; + hash = (53 * hash) + getLogsPath().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.LogsPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.LogsPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.LogsPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.LogsPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.LogsPolicy) + com.google.events.cloud.batch.v1.LogsPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LogsPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LogsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.LogsPolicy.class, + com.google.events.cloud.batch.v1.LogsPolicy.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.LogsPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + destination_ = 0; + logsPath_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_LogsPolicy_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy build() { + com.google.events.cloud.batch.v1.LogsPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy buildPartial() { + com.google.events.cloud.batch.v1.LogsPolicy result = + new com.google.events.cloud.batch.v1.LogsPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.LogsPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.destination_ = destination_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.logsPath_ = logsPath_; + } + } + + @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.events.cloud.batch.v1.LogsPolicy) { + return mergeFrom((com.google.events.cloud.batch.v1.LogsPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.LogsPolicy other) { + if (other == com.google.events.cloud.batch.v1.LogsPolicy.getDefaultInstance()) return this; + if (other.destination_ != 0) { + setDestinationValue(other.getDestinationValue()); + } + if (!other.getLogsPath().isEmpty()) { + logsPath_ = other.logsPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + destination_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + logsPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int destination_ = 0; + + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.events.cloud.batch.v1.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.events.cloud.batch.v1.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy.Destination getDestination() { + com.google.events.cloud.batch.v1.LogsPolicy.Destination result = + com.google.events.cloud.batch.v1.LogsPolicy.Destination.forNumber(destination_); + return result == null + ? com.google.events.cloud.batch.v1.LogsPolicy.Destination.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(com.google.events.cloud.batch.v1.LogsPolicy.Destination value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Where logs should be saved.
+     * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000002; + 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(); + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000002; + 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.events.cloud.batch.v1.LogsPolicy) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.LogsPolicy) + private static final com.google.events.cloud.batch.v1.LogsPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.LogsPolicy(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.LogsPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LogsPolicyOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LogsPolicyOrBuilder.java new file mode 100644 index 00000000..f2e74ed0 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/LogsPolicyOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface LogsPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.LogsPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + int getDestinationValue(); + + /** + * + * + *
+   * Where logs should be saved.
+   * 
+ * + * .google.events.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * + * @return The destination. + */ + com.google.events.cloud.batch.v1.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/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/NFS.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/NFS.java new file mode 100644 index 00000000..cb0a9355 --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/NFS.java @@ -0,0 +1,823 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * Represents an NFS volume.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.NFS} + */ +public final class NFS extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_NFS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_NFS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.NFS.class, + com.google.events.cloud.batch.v1.NFS.Builder.class); + } + + public static final int SERVER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object server_ = ""; + + /** + * + * + *
+   * The IP address of the NFS.
+   * 
+ * + * 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; + } + } + + /** + * + * + *
+   * The IP address of the NFS.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object remotePath_ = ""; + + /** + * + * + *
+   * Remote source path exported from the 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 the 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.NFS)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.NFS other = (com.google.events.cloud.batch.v1.NFS) obj; + + if (!getServer().equals(other.getServer())) return false; + if (!getRemotePath().equals(other.getRemotePath())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVER_FIELD_NUMBER; + hash = (53 * hash) + getServer().hashCode(); + hash = (37 * hash) + REMOTE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRemotePath().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.NFS parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.NFS parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.NFS parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.NFS parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.NFS parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.NFS parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.NFS parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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 volume.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.NFS} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.NFS) + com.google.events.cloud.batch.v1.NFSOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_NFS_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_NFS_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.NFS.class, + com.google.events.cloud.batch.v1.NFS.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.NFS.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + server_ = ""; + remotePath_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_NFS_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.NFS getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.NFS.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.NFS build() { + com.google.events.cloud.batch.v1.NFS result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.NFS buildPartial() { + com.google.events.cloud.batch.v1.NFS result = new com.google.events.cloud.batch.v1.NFS(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.NFS result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.server_ = server_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.remotePath_ = remotePath_; + } + } + + @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.events.cloud.batch.v1.NFS) { + return mergeFrom((com.google.events.cloud.batch.v1.NFS) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.NFS other) { + if (other == com.google.events.cloud.batch.v1.NFS.getDefaultInstance()) return this; + if (!other.getServer().isEmpty()) { + server_ = other.server_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRemotePath().isEmpty()) { + remotePath_ = other.remotePath_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + server_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + remotePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object server_ = ""; + + /** + * + * + *
+     * The IP address of the NFS.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * The IP address of the NFS.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * The IP address of the NFS.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The IP address of the NFS.
+     * 
+ * + * string server = 1; + * + * @return This builder for chaining. + */ + public Builder clearServer() { + server_ = getDefaultInstance().getServer(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IP address of the NFS.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object remotePath_ = ""; + + /** + * + * + *
+     * Remote source path exported from the 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 the 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 the 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Remote source path exported from the NFS, e.g., "/share".
+     * 
+ * + * string remote_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearRemotePath() { + remotePath_ = getDefaultInstance().getRemotePath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Remote source path exported from the 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; + bitField0_ |= 0x00000002; + 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.events.cloud.batch.v1.NFS) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.NFS) + private static final com.google.events.cloud.batch.v1.NFS DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.NFS(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.NFS getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/NFSOrBuilder.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/NFSOrBuilder.java new file mode 100644 index 00000000..92ba9a6c --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/NFSOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +public interface NFSOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.NFS) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The IP address of the NFS.
+   * 
+ * + * string server = 1; + * + * @return The server. + */ + java.lang.String getServer(); + + /** + * + * + *
+   * The IP address of the NFS.
+   * 
+ * + * string server = 1; + * + * @return The bytes for server. + */ + com.google.protobuf.ByteString getServerBytes(); + + /** + * + * + *
+   * Remote source path exported from the NFS, e.g., "/share".
+   * 
+ * + * string remote_path = 2; + * + * @return The remotePath. + */ + java.lang.String getRemotePath(); + + /** + * + * + *
+   * Remote source path exported from the NFS, e.g., "/share".
+   * 
+ * + * string remote_path = 2; + * + * @return The bytes for remotePath. + */ + com.google.protobuf.ByteString getRemotePathBytes(); +} diff --git a/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Runnable.java b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Runnable.java new file mode 100644 index 00000000..3a3b151c --- /dev/null +++ b/google-cloudevent-types/src/main/java/com/google/events/cloud/batch/v1/Runnable.java @@ -0,0 +1,7016 @@ +/* + * Copyright 2024 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/events/cloud/batch/v1/data.proto + +package com.google.events.cloud.batch.v1; + +/** + * + * + *
+ * Runnable describes instructions for executing a specific script or container
+ * as part of a Task.
+ * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.Runnable} + */ +public final class Runnable extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_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.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Runnable.class, + com.google.events.cloud.batch.v1.Runnable.Builder.class); + } + + public interface ContainerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.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, containers that are with block_external_network as true can
+     * still communicate with each other, network cannot be specified in the
+     * `container.options` field.
+     * 
+ * + * 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.events.cloud.batch.v1.Runnable.Container} + */ + public static final class Container extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Container_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Runnable.Container.class, + com.google.events.cloud.batch.v1.Runnable.Container.Builder.class); + } + + public static final int IMAGE_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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_ = false; + + /** + * + * + *
+     * If set to true, external network access to and from container will be
+     * blocked, containers that are with block_external_network as true can
+     * still communicate with each other, network cannot be specified in the
+     * `container.options` field.
+     * 
+ * + * bool block_external_network = 9; + * + * @return The blockExternalNetwork. + */ + @java.lang.Override + public boolean getBlockExternalNetwork() { + return blockExternalNetwork_; + } + + public static final int USERNAME_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.Runnable.Container)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.Runnable.Container other = + (com.google.events.cloud.batch.v1.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.Runnable.Container parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Container parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Container parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.Runnable.Container parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.Runnable.Container parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Container parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Container parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Container} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.Runnable.Container) + com.google.events.cloud.batch.v1.Runnable.ContainerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Container_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Runnable.Container.class, + com.google.events.cloud.batch.v1.Runnable.Container.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.Runnable.Container.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + imageUri_ = ""; + commands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + entrypoint_ = ""; + volumes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + options_ = ""; + blockExternalNetwork_ = false; + username_ = ""; + password_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Container_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Container getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.Runnable.Container.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Container build() { + com.google.events.cloud.batch.v1.Runnable.Container result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Container buildPartial() { + com.google.events.cloud.batch.v1.Runnable.Container result = + new com.google.events.cloud.batch.v1.Runnable.Container(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.events.cloud.batch.v1.Runnable.Container result) { + if (((bitField0_ & 0x00000002) != 0)) { + commands_ = commands_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.commands_ = commands_; + if (((bitField0_ & 0x00000008) != 0)) { + volumes_ = volumes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.volumes_ = volumes_; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.Runnable.Container result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.imageUri_ = imageUri_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.entrypoint_ = entrypoint_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.options_ = options_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.blockExternalNetwork_ = blockExternalNetwork_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.password_ = password_; + } + } + + @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.events.cloud.batch.v1.Runnable.Container) { + return mergeFrom((com.google.events.cloud.batch.v1.Runnable.Container) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.Runnable.Container other) { + if (other == com.google.events.cloud.batch.v1.Runnable.Container.getDefaultInstance()) + return this; + if (!other.getImageUri().isEmpty()) { + imageUri_ = other.imageUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.commands_.isEmpty()) { + if (commands_.isEmpty()) { + commands_ = other.commands_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCommandsIsMutable(); + commands_.addAll(other.commands_); + } + onChanged(); + } + if (!other.getEntrypoint().isEmpty()) { + entrypoint_ = other.entrypoint_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.volumes_.isEmpty()) { + if (volumes_.isEmpty()) { + volumes_ = other.volumes_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureVolumesIsMutable(); + volumes_.addAll(other.volumes_); + } + onChanged(); + } + if (!other.getOptions().isEmpty()) { + options_ = other.options_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getBlockExternalNetwork() != false) { + setBlockExternalNetwork(other.getBlockExternalNetwork()); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000080; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + imageUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCommandsIsMutable(); + commands_.add(s); + break; + } // case 18 + case 26: + { + entrypoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureVolumesIsMutable(); + volumes_.add(s); + break; + } // case 58 + case 66: + { + options_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 66 + case 72: + { + blockExternalNetwork_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 72 + case 82: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 82 + case 90: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList commands_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCommandsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + commands_ = new com.google.protobuf.LazyStringArrayList(commands_); + bitField0_ |= 0x00000002; + } + } + + /** + * + * + *
+       * 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_ & ~0x00000002); + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Overrides the `ENTRYPOINT` specified in the container.
+       * 
+ * + * string entrypoint = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntrypoint() { + entrypoint_ = getDefaultInstance().getEntrypoint(); + bitField0_ = (bitField0_ & ~0x00000004); + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList volumes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureVolumesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + volumes_ = new com.google.protobuf.LazyStringArrayList(volumes_); + bitField0_ |= 0x00000008; + } + } + + /** + * + * + *
+       * 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_ & ~0x00000008); + 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; + bitField0_ |= 0x00000010; + 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(); + bitField0_ = (bitField0_ & ~0x00000010); + 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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean blockExternalNetwork_; + + /** + * + * + *
+       * If set to true, external network access to and from container will be
+       * blocked, containers that are with block_external_network as true can
+       * still communicate with each other, network cannot be specified in the
+       * `container.options` field.
+       * 
+ * + * 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, containers that are with block_external_network as true can
+       * still communicate with each other, network cannot be specified in the
+       * `container.options` field.
+       * 
+ * + * bool block_external_network = 9; + * + * @param value The blockExternalNetwork to set. + * @return This builder for chaining. + */ + public Builder setBlockExternalNetwork(boolean value) { + + blockExternalNetwork_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * If set to true, external network access to and from container will be
+       * blocked, containers that are with block_external_network as true can
+       * still communicate with each other, network cannot be specified in the
+       * `container.options` field.
+       * 
+ * + * bool block_external_network = 9; + * + * @return This builder for chaining. + */ + public Builder clearBlockExternalNetwork() { + bitField0_ = (bitField0_ & ~0x00000020); + 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; + bitField0_ |= 0x00000040; + 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(); + bitField0_ = (bitField0_ & ~0x00000040); + 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; + bitField0_ |= 0x00000040; + 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; + bitField0_ |= 0x00000080; + 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(); + bitField0_ = (bitField0_ & ~0x00000080); + 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; + bitField0_ |= 0x00000080; + 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.events.cloud.batch.v1.Runnable.Container) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.Runnable.Container) + private static final com.google.events.cloud.batch.v1.Runnable.Container DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.Runnable.Container(); + } + + public static com.google.events.cloud.batch.v1.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Container getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ScriptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.events.cloud.batch.v1.Runnable.Script) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
+     * 
+ * + * string path = 1; + * + * @return Whether the path field is set. + */ + boolean hasPath(); + + /** + * + * + *
+     * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
+     * 
+ * + * string path = 1; + * + * @return The path. + */ + java.lang.String getPath(); + + /** + * + * + *
+     * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
+     * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + + /** + * + * + *
+     * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
+     * 
+ * + * string text = 2; + * + * @return Whether the text field is set. + */ + boolean hasText(); + + /** + * + * + *
+     * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
+     * 
+ * + * string text = 2; + * + * @return The text. + */ + java.lang.String getText(); + + /** + * + * + *
+     * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
+     * 
+ * + * string text = 2; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + public com.google.events.cloud.batch.v1.Runnable.Script.CommandCase getCommandCase(); + } + + /** + * + * + *
+   * Script runnable.
+   * 
+ * + * Protobuf type {@code google.events.cloud.batch.v1.Runnable.Script} + */ + public static final class Script extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.events.cloud.batch.v1.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Script_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Script_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Runnable.Script.class, + com.google.events.cloud.batch.v1.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.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
+     * 
+ * + * string path = 1; + * + * @return Whether the path field is set. + */ + public boolean hasPath() { + return commandCase_ == 1; + } + + /** + * + * + *
+     * Script file path on the host VM.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
+     * 
+ * + * string path = 1; + * + * @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.
+     * To specify an interpreter, please add a `#!<interpreter>`(also known as
+     * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+     * first line of the file.(For example, to execute the script using bash,
+     * `#!/bin/bash` should be the first line of the file. To execute the
+     * script using`Python3`, `#!/usr/bin/env python3` should be the first
+     * line of the file.) Otherwise, the file will by default be excuted by
+     * `/bin/sh`.
+     * 
+ * + * string path = 1; + * + * @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.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
+     * 
+ * + * string text = 2; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return commandCase_ == 2; + } + + /** + * + * + *
+     * Shell script text.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
+     * 
+ * + * string text = 2; + * + * @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.
+     * To specify an interpreter, please add a `#!<interpreter>\n` at the
+     * beginning of the text.(For example, to execute the script using bash,
+     * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+     * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+     * by default be excuted by `/bin/sh`.
+     * 
+ * + * string text = 2; + * + * @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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.events.cloud.batch.v1.Runnable.Script)) { + return super.equals(obj); + } + com.google.events.cloud.batch.v1.Runnable.Script other = + (com.google.events.cloud.batch.v1.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.events.cloud.batch.v1.Runnable.Script parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Script parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Script parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.events.cloud.batch.v1.Runnable.Script parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.events.cloud.batch.v1.Runnable.Script parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Script parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Script parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.events.cloud.batch.v1.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.events.cloud.batch.v1.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.events.cloud.batch.v1.Runnable.Script} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.events.cloud.batch.v1.Runnable.Script) + com.google.events.cloud.batch.v1.Runnable.ScriptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Script_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Script_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.events.cloud.batch.v1.Runnable.Script.class, + com.google.events.cloud.batch.v1.Runnable.Script.Builder.class); + } + + // Construct using com.google.events.cloud.batch.v1.Runnable.Script.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commandCase_ = 0; + command_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.events.cloud.batch.v1.Data + .internal_static_google_events_cloud_batch_v1_Runnable_Script_descriptor; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Script getDefaultInstanceForType() { + return com.google.events.cloud.batch.v1.Runnable.Script.getDefaultInstance(); + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Script build() { + com.google.events.cloud.batch.v1.Runnable.Script result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.events.cloud.batch.v1.Runnable.Script buildPartial() { + com.google.events.cloud.batch.v1.Runnable.Script result = + new com.google.events.cloud.batch.v1.Runnable.Script(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.events.cloud.batch.v1.Runnable.Script result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.events.cloud.batch.v1.Runnable.Script result) { + result.commandCase_ = commandCase_; + result.command_ = this.command_; + } + + @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.events.cloud.batch.v1.Runnable.Script) { + return mergeFrom((com.google.events.cloud.batch.v1.Runnable.Script) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.events.cloud.batch.v1.Runnable.Script other) { + if (other == com.google.events.cloud.batch.v1.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + commandCase_ = 1; + command_ = s; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + commandCase_ = 2; + command_ = s; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int commandCase_ = 0; + private java.lang.Object command_; + + public CommandCase getCommandCase() { + return CommandCase.forNumber(commandCase_); + } + + public Builder clearCommand() { + commandCase_ = 0; + command_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+       * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
+       * 
+ * + * string path = 1; + * + * @return Whether the path field is set. + */ + @java.lang.Override + public boolean hasPath() { + return commandCase_ == 1; + } + + /** + * + * + *
+       * Script file path on the host VM.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
+       * 
+ * + * string path = 1; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
+       * 
+ * + * string path = 1; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
+       * 
+ * + * string path = 1; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
+       * 
+ * + * string path = 1; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>`(also known as
+       * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
+       * first line of the file.(For example, to execute the script using bash,
+       * `#!/bin/bash` should be the first line of the file. To execute the
+       * script using`Python3`, `#!/usr/bin/env python3` should be the first
+       * line of the file.) Otherwise, the file will by default be excuted by
+       * `/bin/sh`.
+       * 
+ * + * string path = 1; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
+       * 
+ * + * string text = 2; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return commandCase_ == 2; + } + + /** + * + * + *
+       * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
+       * 
+ * + * string text = 2; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
+       * 
+ * + * string text = 2; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
+       * 
+ * + * string text = 2; + * + * @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.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
+       * 
+ * + * string text = 2; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (commandCase_ == 2) { + commandCase_ = 0; + command_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Shell script text.
+       * To specify an interpreter, please add a `#!<interpreter>\n` at the
+       * beginning of the text.(For example, to execute the script using bash,
+       * `#!/bin/bash\n` should be added. To execute the script using`Python3`,
+       * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
+       * by default be excuted by `/bin/sh`.
+       * 
+ * + * string text = 2; + * + * @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.events.cloud.batch.v1.Runnable.Script) + } + + // @@protoc_insertion_point(class_scope:google.events.cloud.batch.v1.Runnable.Script) + private static final com.google.events.cloud.batch.v1.Runnable.Script DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.events.cloud.batch.v1.Runnable.Script(); + } + + public static com.google.events.cloud.batch.v1.Runnable.Script getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser