+ * Datastore query for running an aggregation over a [Query][google.datastore.v1.Query]. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationQuery} + */ +public final class AggregationQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.AggregationQuery) + AggregationQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use AggregationQuery.newBuilder() to construct. + private AggregationQuery(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private AggregationQuery() { + aggregations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AggregationQuery(); + } + + @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.datastore.v1.QueryProto + .internal_static_google_datastore_v1_AggregationQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProto + .internal_static_google_datastore_v1_AggregationQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.AggregationQuery.class, + com.google.datastore.v1.AggregationQuery.Builder.class); + } + + public interface AggregationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.AggregationQuery.Aggregation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+ * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ *
+ * @return Whether the count field is set.
+ */
+ boolean hasCount();
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ *
+ * @return The count.
+ */
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count getCount();
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ com.google.datastore.v1.AggregationQuery.Aggregation.CountOrBuilder getCountOrBuilder();
+
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The alias.
+ */
+ java.lang.String getAlias();
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for alias.
+ */
+ com.google.protobuf.ByteString getAliasBytes();
+
+ public com.google.datastore.v1.AggregationQuery.Aggregation.OperatorCase getOperatorCase();
+ }
+ /**
+ *
+ *
+ * + * Defines a aggregation that produces a single result. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationQuery.Aggregation} + */ + public static final class Aggregation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.AggregationQuery.Aggregation) + AggregationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Aggregation.newBuilder() to construct. + private Aggregation(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private Aggregation() { + alias_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Aggregation(); + } + + @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.datastore.v1.QueryProto + .internal_static_google_datastore_v1_AggregationQuery_Aggregation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProto + .internal_static_google_datastore_v1_AggregationQuery_Aggregation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.AggregationQuery.Aggregation.class, + com.google.datastore.v1.AggregationQuery.Aggregation.Builder.class); + } + + public interface CountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.AggregationQuery.Aggregation.Count) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+ * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the upTo field is set.
+ */
+ boolean hasUpTo();
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The upTo.
+ */
+ com.google.protobuf.Int64Value getUpTo();
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.protobuf.Int64ValueOrBuilder getUpToOrBuilder();
+ }
+ /**
+ *
+ *
+ * + * Count of entities that match the query. + * The `COUNT(*)` aggregation function operates on the entire entity + * so it does not require a field reference. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationQuery.Aggregation.Count} + */ + public static final class Count extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.AggregationQuery.Aggregation.Count) + CountOrBuilder { + private static final long serialVersionUID = 0L; + // Use Count.newBuilder() to construct. + private Count(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private Count() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Count(); + } + + @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.datastore.v1.QueryProto + .internal_static_google_datastore_v1_AggregationQuery_Aggregation_Count_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProto + .internal_static_google_datastore_v1_AggregationQuery_Aggregation_Count_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.AggregationQuery.Aggregation.Count.class, + com.google.datastore.v1.AggregationQuery.Aggregation.Count.Builder.class); + } + + public static final int UP_TO_FIELD_NUMBER = 1; + private com.google.protobuf.Int64Value upTo_; + /** + * + * + *
+ * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the upTo field is set.
+ */
+ @java.lang.Override
+ public boolean hasUpTo() {
+ return upTo_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The upTo.
+ */
+ @java.lang.Override
+ public com.google.protobuf.Int64Value getUpTo() {
+ return upTo_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : upTo_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.protobuf.Int64ValueOrBuilder getUpToOrBuilder() {
+ return getUpTo();
+ }
+
+ 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 (upTo_ != null) {
+ output.writeMessage(1, getUpTo());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (upTo_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpTo());
+ }
+ 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.datastore.v1.AggregationQuery.Aggregation.Count)) {
+ return super.equals(obj);
+ }
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count other =
+ (com.google.datastore.v1.AggregationQuery.Aggregation.Count) obj;
+
+ if (hasUpTo() != other.hasUpTo()) return false;
+ if (hasUpTo()) {
+ if (!getUpTo().equals(other.getUpTo())) 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 (hasUpTo()) {
+ hash = (37 * hash) + UP_TO_FIELD_NUMBER;
+ hash = (53 * hash) + getUpTo().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count 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.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count 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.datastore.v1.AggregationQuery.Aggregation.Count parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count 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.datastore.v1.AggregationQuery.Aggregation.Count parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count 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.datastore.v1.AggregationQuery.Aggregation.Count 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;
+ }
+ /**
+ *
+ *
+ * + * Count of entities that match the query. + * The `COUNT(*)` aggregation function operates on the entire entity + * so it does not require a field reference. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationQuery.Aggregation.Count} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the upTo field is set.
+ */
+ public boolean hasUpTo() {
+ return upToBuilder_ != null || upTo_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The upTo.
+ */
+ public com.google.protobuf.Int64Value getUpTo() {
+ if (upToBuilder_ == null) {
+ return upTo_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : upTo_;
+ } else {
+ return upToBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setUpTo(com.google.protobuf.Int64Value value) {
+ if (upToBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ upTo_ = value;
+ onChanged();
+ } else {
+ upToBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setUpTo(com.google.protobuf.Int64Value.Builder builderForValue) {
+ if (upToBuilder_ == null) {
+ upTo_ = builderForValue.build();
+ onChanged();
+ } else {
+ upToBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder mergeUpTo(com.google.protobuf.Int64Value value) {
+ if (upToBuilder_ == null) {
+ if (upTo_ != null) {
+ upTo_ =
+ com.google.protobuf.Int64Value.newBuilder(upTo_).mergeFrom(value).buildPartial();
+ } else {
+ upTo_ = value;
+ }
+ onChanged();
+ } else {
+ upToBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder clearUpTo() {
+ if (upToBuilder_ == null) {
+ upTo_ = null;
+ onChanged();
+ } else {
+ upTo_ = null;
+ upToBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.protobuf.Int64Value.Builder getUpToBuilder() {
+
+ onChanged();
+ return getUpToFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.protobuf.Int64ValueOrBuilder getUpToOrBuilder() {
+ if (upToBuilder_ != null) {
+ return upToBuilder_.getMessageOrBuilder();
+ } else {
+ return upTo_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : upTo_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional constraint on the maximum number of entities to count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + *+ * + *
.google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Int64Value,
+ com.google.protobuf.Int64Value.Builder,
+ com.google.protobuf.Int64ValueOrBuilder>
+ getUpToFieldBuilder() {
+ if (upToBuilder_ == null) {
+ upToBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Int64Value,
+ com.google.protobuf.Int64Value.Builder,
+ com.google.protobuf.Int64ValueOrBuilder>(
+ getUpTo(), getParentForChildren(), isClean());
+ upTo_ = null;
+ }
+ return upToBuilder_;
+ }
+
+ @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.datastore.v1.AggregationQuery.Aggregation.Count)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.datastore.v1.AggregationQuery.Aggregation.Count)
+ private static final com.google.datastore.v1.AggregationQuery.Aggregation.Count
+ DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.datastore.v1.AggregationQuery.Aggregation.Count();
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation.Count
+ getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ *
+ * @return Whether the count field is set.
+ */
+ @java.lang.Override
+ public boolean hasCount() {
+ return operatorCase_ == 1;
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ *
+ * @return The count.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery.Aggregation.Count getCount() {
+ if (operatorCase_ == 1) {
+ return (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_;
+ }
+ return com.google.datastore.v1.AggregationQuery.Aggregation.Count.getDefaultInstance();
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery.Aggregation.CountOrBuilder getCountOrBuilder() {
+ if (operatorCase_ == 1) {
+ return (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_;
+ }
+ return com.google.datastore.v1.AggregationQuery.Aggregation.Count.getDefaultInstance();
+ }
+
+ public static final int ALIAS_FIELD_NUMBER = 7;
+ private volatile java.lang.Object alias_;
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The alias.
+ */
+ @java.lang.Override
+ public java.lang.String getAlias() {
+ java.lang.Object ref = alias_;
+ 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();
+ alias_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for alias.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getAliasBytes() {
+ java.lang.Object ref = alias_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ alias_ = 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 (operatorCase_ == 1) {
+ output.writeMessage(
+ 1, (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(alias_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 7, alias_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (operatorCase_ == 1) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 1, (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(alias_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, alias_);
+ }
+ 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.datastore.v1.AggregationQuery.Aggregation)) {
+ return super.equals(obj);
+ }
+ com.google.datastore.v1.AggregationQuery.Aggregation other =
+ (com.google.datastore.v1.AggregationQuery.Aggregation) obj;
+
+ if (!getAlias().equals(other.getAlias())) return false;
+ if (!getOperatorCase().equals(other.getOperatorCase())) return false;
+ switch (operatorCase_) {
+ case 1:
+ if (!getCount().equals(other.getCount())) 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) + ALIAS_FIELD_NUMBER;
+ hash = (53 * hash) + getAlias().hashCode();
+ switch (operatorCase_) {
+ case 1:
+ hash = (37 * hash) + COUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getCount().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation 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.datastore.v1.AggregationQuery.Aggregation parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation 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.datastore.v1.AggregationQuery.Aggregation parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation 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.datastore.v1.AggregationQuery.Aggregation parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation 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.datastore.v1.AggregationQuery.Aggregation 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;
+ }
+ /**
+ *
+ *
+ * + * Defines a aggregation that produces a single result. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationQuery.Aggregation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ *
+ * @return Whether the count field is set.
+ */
+ @java.lang.Override
+ public boolean hasCount() {
+ return operatorCase_ == 1;
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ *
+ * @return The count.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery.Aggregation.Count getCount() {
+ if (countBuilder_ == null) {
+ if (operatorCase_ == 1) {
+ return (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_;
+ }
+ return com.google.datastore.v1.AggregationQuery.Aggregation.Count.getDefaultInstance();
+ } else {
+ if (operatorCase_ == 1) {
+ return countBuilder_.getMessage();
+ }
+ return com.google.datastore.v1.AggregationQuery.Aggregation.Count.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ public Builder setCount(com.google.datastore.v1.AggregationQuery.Aggregation.Count value) {
+ if (countBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ operator_ = value;
+ onChanged();
+ } else {
+ countBuilder_.setMessage(value);
+ }
+ operatorCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ public Builder setCount(
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count.Builder builderForValue) {
+ if (countBuilder_ == null) {
+ operator_ = builderForValue.build();
+ onChanged();
+ } else {
+ countBuilder_.setMessage(builderForValue.build());
+ }
+ operatorCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ public Builder mergeCount(com.google.datastore.v1.AggregationQuery.Aggregation.Count value) {
+ if (countBuilder_ == null) {
+ if (operatorCase_ == 1
+ && operator_
+ != com.google.datastore.v1.AggregationQuery.Aggregation.Count
+ .getDefaultInstance()) {
+ operator_ =
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count.newBuilder(
+ (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ operator_ = value;
+ }
+ onChanged();
+ } else {
+ if (operatorCase_ == 1) {
+ countBuilder_.mergeFrom(value);
+ } else {
+ countBuilder_.setMessage(value);
+ }
+ }
+ operatorCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ public Builder clearCount() {
+ if (countBuilder_ == null) {
+ if (operatorCase_ == 1) {
+ operatorCase_ = 0;
+ operator_ = null;
+ onChanged();
+ }
+ } else {
+ if (operatorCase_ == 1) {
+ operatorCase_ = 0;
+ operator_ = null;
+ }
+ countBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ public com.google.datastore.v1.AggregationQuery.Aggregation.Count.Builder getCountBuilder() {
+ return getCountFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery.Aggregation.CountOrBuilder
+ getCountOrBuilder() {
+ if ((operatorCase_ == 1) && (countBuilder_ != null)) {
+ return countBuilder_.getMessageOrBuilder();
+ } else {
+ if (operatorCase_ == 1) {
+ return (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_;
+ }
+ return com.google.datastore.v1.AggregationQuery.Aggregation.Count.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * Count aggregator. + *+ * + *
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count,
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count.Builder,
+ com.google.datastore.v1.AggregationQuery.Aggregation.CountOrBuilder>
+ getCountFieldBuilder() {
+ if (countBuilder_ == null) {
+ if (!(operatorCase_ == 1)) {
+ operator_ =
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count.getDefaultInstance();
+ }
+ countBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count,
+ com.google.datastore.v1.AggregationQuery.Aggregation.Count.Builder,
+ com.google.datastore.v1.AggregationQuery.Aggregation.CountOrBuilder>(
+ (com.google.datastore.v1.AggregationQuery.Aggregation.Count) operator_,
+ getParentForChildren(),
+ isClean());
+ operator_ = null;
+ }
+ operatorCase_ = 1;
+ onChanged();
+ ;
+ return countBuilder_;
+ }
+
+ private java.lang.Object alias_ = "";
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The alias.
+ */
+ public java.lang.String getAlias() {
+ java.lang.Object ref = alias_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ alias_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for alias.
+ */
+ public com.google.protobuf.ByteString getAliasBytes() {
+ java.lang.Object ref = alias_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ alias_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The alias to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAlias(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ alias_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearAlias() {
+
+ alias_ = getDefaultInstance().getAlias();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Optional name of the property to store the result of the aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_<incremental_id++>`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT_UP_TO(4) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property name][google.datastore.v1.Entity.properties] limitations. + *+ * + *
string alias = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes for alias to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAliasBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ alias_ = 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.datastore.v1.AggregationQuery.Aggregation)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.datastore.v1.AggregationQuery.Aggregation)
+ private static final com.google.datastore.v1.AggregationQuery.Aggregation DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.datastore.v1.AggregationQuery.Aggregation();
+ }
+
+ public static com.google.datastore.v1.AggregationQuery.Aggregation getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ *
+ * @return Whether the nestedQuery field is set.
+ */
+ @java.lang.Override
+ public boolean hasNestedQuery() {
+ return queryTypeCase_ == 1;
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ *
+ * @return The nestedQuery.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.Query getNestedQuery() {
+ if (queryTypeCase_ == 1) {
+ return (com.google.datastore.v1.Query) queryType_;
+ }
+ return com.google.datastore.v1.Query.getDefaultInstance();
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.QueryOrBuilder getNestedQueryOrBuilder() {
+ if (queryTypeCase_ == 1) {
+ return (com.google.datastore.v1.Query) queryType_;
+ }
+ return com.google.datastore.v1.Query.getDefaultInstance();
+ }
+
+ public static final int AGGREGATIONS_FIELD_NUMBER = 3;
+ private java.util.List+ * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public java.util.List+ * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.datastore.v1.AggregationQuery.AggregationOrBuilder>
+ getAggregationsOrBuilderList() {
+ return aggregations_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public int getAggregationsCount() {
+ return aggregations_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery.Aggregation getAggregations(int index) {
+ return aggregations_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery.AggregationOrBuilder getAggregationsOrBuilder(
+ int index) {
+ return aggregations_.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 (queryTypeCase_ == 1) {
+ output.writeMessage(1, (com.google.datastore.v1.Query) queryType_);
+ }
+ for (int i = 0; i < aggregations_.size(); i++) {
+ output.writeMessage(3, aggregations_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (queryTypeCase_ == 1) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 1, (com.google.datastore.v1.Query) queryType_);
+ }
+ for (int i = 0; i < aggregations_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, aggregations_.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.datastore.v1.AggregationQuery)) {
+ return super.equals(obj);
+ }
+ com.google.datastore.v1.AggregationQuery other = (com.google.datastore.v1.AggregationQuery) obj;
+
+ if (!getAggregationsList().equals(other.getAggregationsList())) return false;
+ if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false;
+ switch (queryTypeCase_) {
+ case 1:
+ if (!getNestedQuery().equals(other.getNestedQuery())) 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();
+ if (getAggregationsCount() > 0) {
+ hash = (37 * hash) + AGGREGATIONS_FIELD_NUMBER;
+ hash = (53 * hash) + getAggregationsList().hashCode();
+ }
+ switch (queryTypeCase_) {
+ case 1:
+ hash = (37 * hash) + NESTED_QUERY_FIELD_NUMBER;
+ hash = (53 * hash) + getNestedQuery().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.datastore.v1.AggregationQuery parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery 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.datastore.v1.AggregationQuery parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery 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.datastore.v1.AggregationQuery parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery 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.datastore.v1.AggregationQuery parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationQuery 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.datastore.v1.AggregationQuery 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;
+ }
+ /**
+ *
+ *
+ * + * Datastore query for running an aggregation over a [Query][google.datastore.v1.Query]. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationQuery} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ *
+ * @return Whether the nestedQuery field is set.
+ */
+ @java.lang.Override
+ public boolean hasNestedQuery() {
+ return queryTypeCase_ == 1;
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ *
+ * @return The nestedQuery.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.Query getNestedQuery() {
+ if (nestedQueryBuilder_ == null) {
+ if (queryTypeCase_ == 1) {
+ return (com.google.datastore.v1.Query) queryType_;
+ }
+ return com.google.datastore.v1.Query.getDefaultInstance();
+ } else {
+ if (queryTypeCase_ == 1) {
+ return nestedQueryBuilder_.getMessage();
+ }
+ return com.google.datastore.v1.Query.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ public Builder setNestedQuery(com.google.datastore.v1.Query value) {
+ if (nestedQueryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ queryType_ = value;
+ onChanged();
+ } else {
+ nestedQueryBuilder_.setMessage(value);
+ }
+ queryTypeCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ public Builder setNestedQuery(com.google.datastore.v1.Query.Builder builderForValue) {
+ if (nestedQueryBuilder_ == null) {
+ queryType_ = builderForValue.build();
+ onChanged();
+ } else {
+ nestedQueryBuilder_.setMessage(builderForValue.build());
+ }
+ queryTypeCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ public Builder mergeNestedQuery(com.google.datastore.v1.Query value) {
+ if (nestedQueryBuilder_ == null) {
+ if (queryTypeCase_ == 1
+ && queryType_ != com.google.datastore.v1.Query.getDefaultInstance()) {
+ queryType_ =
+ com.google.datastore.v1.Query.newBuilder((com.google.datastore.v1.Query) queryType_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ queryType_ = value;
+ }
+ onChanged();
+ } else {
+ if (queryTypeCase_ == 1) {
+ nestedQueryBuilder_.mergeFrom(value);
+ } else {
+ nestedQueryBuilder_.setMessage(value);
+ }
+ }
+ queryTypeCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ public Builder clearNestedQuery() {
+ if (nestedQueryBuilder_ == null) {
+ if (queryTypeCase_ == 1) {
+ queryTypeCase_ = 0;
+ queryType_ = null;
+ onChanged();
+ }
+ } else {
+ if (queryTypeCase_ == 1) {
+ queryTypeCase_ = 0;
+ queryType_ = null;
+ }
+ nestedQueryBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ public com.google.datastore.v1.Query.Builder getNestedQueryBuilder() {
+ return getNestedQueryFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.QueryOrBuilder getNestedQueryOrBuilder() {
+ if ((queryTypeCase_ == 1) && (nestedQueryBuilder_ != null)) {
+ return nestedQueryBuilder_.getMessageOrBuilder();
+ } else {
+ if (queryTypeCase_ == 1) {
+ return (com.google.datastore.v1.Query) queryType_;
+ }
+ return com.google.datastore.v1.Query.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.Query,
+ com.google.datastore.v1.Query.Builder,
+ com.google.datastore.v1.QueryOrBuilder>
+ getNestedQueryFieldBuilder() {
+ if (nestedQueryBuilder_ == null) {
+ if (!(queryTypeCase_ == 1)) {
+ queryType_ = com.google.datastore.v1.Query.getDefaultInstance();
+ }
+ nestedQueryBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.Query,
+ com.google.datastore.v1.Query.Builder,
+ com.google.datastore.v1.QueryOrBuilder>(
+ (com.google.datastore.v1.Query) queryType_, getParentForChildren(), isClean());
+ queryType_ = null;
+ }
+ queryTypeCase_ = 1;
+ onChanged();
+ ;
+ return nestedQueryBuilder_;
+ }
+
+ private java.util.List+ * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public java.util.List+ * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public int getAggregationsCount() {
+ if (aggregationsBuilder_ == null) {
+ return aggregations_.size();
+ } else {
+ return aggregationsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.datastore.v1.AggregationQuery.Aggregation getAggregations(int index) {
+ if (aggregationsBuilder_ == null) {
+ return aggregations_.get(index);
+ } else {
+ return aggregationsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setAggregations(
+ int index, com.google.datastore.v1.AggregationQuery.Aggregation value) {
+ if (aggregationsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAggregationsIsMutable();
+ aggregations_.set(index, value);
+ onChanged();
+ } else {
+ aggregationsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setAggregations(
+ int index, com.google.datastore.v1.AggregationQuery.Aggregation.Builder builderForValue) {
+ if (aggregationsBuilder_ == null) {
+ ensureAggregationsIsMutable();
+ aggregations_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ aggregationsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addAggregations(com.google.datastore.v1.AggregationQuery.Aggregation value) {
+ if (aggregationsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAggregationsIsMutable();
+ aggregations_.add(value);
+ onChanged();
+ } else {
+ aggregationsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addAggregations(
+ int index, com.google.datastore.v1.AggregationQuery.Aggregation value) {
+ if (aggregationsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAggregationsIsMutable();
+ aggregations_.add(index, value);
+ onChanged();
+ } else {
+ aggregationsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addAggregations(
+ com.google.datastore.v1.AggregationQuery.Aggregation.Builder builderForValue) {
+ if (aggregationsBuilder_ == null) {
+ ensureAggregationsIsMutable();
+ aggregations_.add(builderForValue.build());
+ onChanged();
+ } else {
+ aggregationsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addAggregations(
+ int index, com.google.datastore.v1.AggregationQuery.Aggregation.Builder builderForValue) {
+ if (aggregationsBuilder_ == null) {
+ ensureAggregationsIsMutable();
+ aggregations_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ aggregationsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addAllAggregations(
+ java.lang.Iterable extends com.google.datastore.v1.AggregationQuery.Aggregation> values) {
+ if (aggregationsBuilder_ == null) {
+ ensureAggregationsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregations_);
+ onChanged();
+ } else {
+ aggregationsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder clearAggregations() {
+ if (aggregationsBuilder_ == null) {
+ aggregations_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ aggregationsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder removeAggregations(int index) {
+ if (aggregationsBuilder_ == null) {
+ ensureAggregationsIsMutable();
+ aggregations_.remove(index);
+ onChanged();
+ } else {
+ aggregationsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.datastore.v1.AggregationQuery.Aggregation.Builder getAggregationsBuilder(
+ int index) {
+ return getAggregationsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.datastore.v1.AggregationQuery.AggregationOrBuilder getAggregationsOrBuilder(
+ int index) {
+ if (aggregationsBuilder_ == null) {
+ return aggregations_.get(index);
+ } else {
+ return aggregationsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public java.util.List extends com.google.datastore.v1.AggregationQuery.AggregationOrBuilder>
+ getAggregationsOrBuilderList() {
+ if (aggregationsBuilder_ != null) {
+ return aggregationsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(aggregations_);
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.datastore.v1.AggregationQuery.Aggregation.Builder addAggregationsBuilder() {
+ return getAggregationsFieldBuilder()
+ .addBuilder(com.google.datastore.v1.AggregationQuery.Aggregation.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.datastore.v1.AggregationQuery.Aggregation.Builder addAggregationsBuilder(
+ int index) {
+ return getAggregationsFieldBuilder()
+ .addBuilder(
+ index, com.google.datastore.v1.AggregationQuery.Aggregation.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public java.util.List+ * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ *
+ * @return Whether the nestedQuery field is set.
+ */
+ boolean hasNestedQuery();
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ *
+ * @return The nestedQuery.
+ */
+ com.google.datastore.v1.Query getNestedQuery();
+ /**
+ *
+ *
+ * + * Nested query for aggregation + *+ * + *
.google.datastore.v1.Query nested_query = 1;
+ */
+ com.google.datastore.v1.QueryOrBuilder getNestedQueryOrBuilder();
+
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ java.util.List+ * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.datastore.v1.AggregationQuery.Aggregation getAggregations(int index);
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ int getAggregationsCount();
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ java.util.List extends com.google.datastore.v1.AggregationQuery.AggregationOrBuilder>
+ getAggregationsOrBuilderList();
+ /**
+ *
+ *
+ * + * Optional. Series of aggregations to apply over the results of the `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + *+ * + *
+ * repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.datastore.v1.AggregationQuery.AggregationOrBuilder getAggregationsOrBuilder(int index);
+
+ public com.google.datastore.v1.AggregationQuery.QueryTypeCase getQueryTypeCase();
+}
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResult.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResult.java
new file mode 100644
index 000000000..9d3276499
--- /dev/null
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResult.java
@@ -0,0 +1,822 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/datastore/v1/aggregation_result.proto
+
+package com.google.datastore.v1;
+
+/**
+ *
+ *
+ * + * The result of a single bucket from a Datastore aggregation query. + * The keys of `aggregate_properties` are the same for all results in an + * aggregation query, unlike entity queries which can have different fields + * present for each result. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationResult} + */ +public final class AggregationResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.AggregationResult) + AggregationResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use AggregationResult.newBuilder() to construct. + private AggregationResult(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private AggregationResult() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AggregationResult(); + } + + @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.datastore.v1.AggregationResultProto + .internal_static_google_datastore_v1_AggregationResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetAggregateProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.AggregationResultProto + .internal_static_google_datastore_v1_AggregationResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.AggregationResult.class, + com.google.datastore.v1.AggregationResult.Builder.class); + } + + public static final int AGGREGATE_PROPERTIES_FIELD_NUMBER = 2; + + private static final class AggregatePropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry
+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public boolean containsAggregateProperties(java.lang.String key) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ return internalGetAggregateProperties().getMap().containsKey(key);
+ }
+ /** Use {@link #getAggregatePropertiesMap()} instead. */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.Value getAggregatePropertiesOrDefault(
+ java.lang.String key, com.google.datastore.v1.Value defaultValue) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.Value getAggregatePropertiesOrThrow(java.lang.String key) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ java.util.Map+ * The result of a single bucket from a Datastore aggregation query. + * The keys of `aggregate_properties` are the same for all results in an + * aggregation query, unlike entity queries which can have different fields + * present for each result. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public boolean containsAggregateProperties(java.lang.String key) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ return internalGetAggregateProperties().getMap().containsKey(key);
+ }
+ /** Use {@link #getAggregatePropertiesMap()} instead. */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.Value getAggregatePropertiesOrDefault(
+ java.lang.String key, com.google.datastore.v1.Value defaultValue) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.Value getAggregatePropertiesOrThrow(java.lang.String key) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ public Builder removeAggregateProperties(java.lang.String key) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ internalGetMutableAggregateProperties().getMutableMap().remove(key);
+ return this;
+ }
+ /** Use alternate mutation accessors instead. */
+ @java.lang.Deprecated
+ public java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ public Builder putAggregateProperties(
+ java.lang.String key, com.google.datastore.v1.Value value) {
+ if (key == null) {
+ throw new NullPointerException("map key");
+ }
+ if (value == null) {
+ throw new NullPointerException("map value");
+ }
+
+ internalGetMutableAggregateProperties().getMutableMap().put(key, value);
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ public Builder putAllAggregateProperties(
+ java.util.Map+ * A batch of aggregation results produced by an aggregation query. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationResultBatch} + */ +public final class AggregationResultBatch extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.AggregationResultBatch) + AggregationResultBatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use AggregationResultBatch.newBuilder() to construct. + private AggregationResultBatch(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private AggregationResultBatch() { + aggregationResults_ = java.util.Collections.emptyList(); + moreResults_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AggregationResultBatch(); + } + + @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.datastore.v1.AggregationResultProto + .internal_static_google_datastore_v1_AggregationResultBatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.AggregationResultProto + .internal_static_google_datastore_v1_AggregationResultBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.AggregationResultBatch.class, + com.google.datastore.v1.AggregationResultBatch.Builder.class); + } + + public static final int AGGREGATION_RESULTS_FIELD_NUMBER = 1; + private java.util.List
+ * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ @java.lang.Override
+ public java.util.List+ * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.datastore.v1.AggregationResultOrBuilder>
+ getAggregationResultsOrBuilderList() {
+ return aggregationResults_;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ @java.lang.Override
+ public int getAggregationResultsCount() {
+ return aggregationResults_.size();
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationResult getAggregationResults(int index) {
+ return aggregationResults_.get(index);
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationResultOrBuilder getAggregationResultsOrBuilder(
+ int index) {
+ return aggregationResults_.get(index);
+ }
+
+ public static final int MORE_RESULTS_FIELD_NUMBER = 2;
+ private int moreResults_;
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return The enum numeric value on the wire for moreResults.
+ */
+ @java.lang.Override
+ public int getMoreResultsValue() {
+ return moreResults_;
+ }
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return The moreResults.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.QueryResultBatch.MoreResultsType getMoreResults() {
+ @SuppressWarnings("deprecation")
+ com.google.datastore.v1.QueryResultBatch.MoreResultsType result =
+ com.google.datastore.v1.QueryResultBatch.MoreResultsType.valueOf(moreResults_);
+ return result == null
+ ? com.google.datastore.v1.QueryResultBatch.MoreResultsType.UNRECOGNIZED
+ : result;
+ }
+
+ public static final int READ_TIME_FIELD_NUMBER = 3;
+ private com.google.protobuf.Timestamp readTime_;
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ *
+ * @return Whether the readTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasReadTime() {
+ return readTime_ != null;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ *
+ * @return The readTime.
+ */
+ @java.lang.Override
+ public com.google.protobuf.Timestamp getReadTime() {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ @java.lang.Override
+ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
+ return getReadTime();
+ }
+
+ 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 < aggregationResults_.size(); i++) {
+ output.writeMessage(1, aggregationResults_.get(i));
+ }
+ if (moreResults_
+ != com.google.datastore.v1.QueryResultBatch.MoreResultsType.MORE_RESULTS_TYPE_UNSPECIFIED
+ .getNumber()) {
+ output.writeEnum(2, moreResults_);
+ }
+ if (readTime_ != null) {
+ output.writeMessage(3, getReadTime());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < aggregationResults_.size(); i++) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(1, aggregationResults_.get(i));
+ }
+ if (moreResults_
+ != com.google.datastore.v1.QueryResultBatch.MoreResultsType.MORE_RESULTS_TYPE_UNSPECIFIED
+ .getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, moreResults_);
+ }
+ if (readTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReadTime());
+ }
+ 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.datastore.v1.AggregationResultBatch)) {
+ return super.equals(obj);
+ }
+ com.google.datastore.v1.AggregationResultBatch other =
+ (com.google.datastore.v1.AggregationResultBatch) obj;
+
+ if (!getAggregationResultsList().equals(other.getAggregationResultsList())) return false;
+ if (moreResults_ != other.moreResults_) return false;
+ if (hasReadTime() != other.hasReadTime()) return false;
+ if (hasReadTime()) {
+ if (!getReadTime().equals(other.getReadTime())) 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 (getAggregationResultsCount() > 0) {
+ hash = (37 * hash) + AGGREGATION_RESULTS_FIELD_NUMBER;
+ hash = (53 * hash) + getAggregationResultsList().hashCode();
+ }
+ hash = (37 * hash) + MORE_RESULTS_FIELD_NUMBER;
+ hash = (53 * hash) + moreResults_;
+ if (hasReadTime()) {
+ hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getReadTime().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch 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.datastore.v1.AggregationResultBatch parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch 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.datastore.v1.AggregationResultBatch parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch 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.datastore.v1.AggregationResultBatch parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch 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.datastore.v1.AggregationResultBatch 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 batch of aggregation results produced by an aggregation query. + *+ * + * Protobuf type {@code google.datastore.v1.AggregationResultBatch} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public java.util.List+ * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public int getAggregationResultsCount() {
+ if (aggregationResultsBuilder_ == null) {
+ return aggregationResults_.size();
+ } else {
+ return aggregationResultsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public com.google.datastore.v1.AggregationResult getAggregationResults(int index) {
+ if (aggregationResultsBuilder_ == null) {
+ return aggregationResults_.get(index);
+ } else {
+ return aggregationResultsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder setAggregationResults(
+ int index, com.google.datastore.v1.AggregationResult value) {
+ if (aggregationResultsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.set(index, value);
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder setAggregationResults(
+ int index, com.google.datastore.v1.AggregationResult.Builder builderForValue) {
+ if (aggregationResultsBuilder_ == null) {
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder addAggregationResults(com.google.datastore.v1.AggregationResult value) {
+ if (aggregationResultsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.add(value);
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder addAggregationResults(
+ int index, com.google.datastore.v1.AggregationResult value) {
+ if (aggregationResultsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.add(index, value);
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder addAggregationResults(
+ com.google.datastore.v1.AggregationResult.Builder builderForValue) {
+ if (aggregationResultsBuilder_ == null) {
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.add(builderForValue.build());
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder addAggregationResults(
+ int index, com.google.datastore.v1.AggregationResult.Builder builderForValue) {
+ if (aggregationResultsBuilder_ == null) {
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder addAllAggregationResults(
+ java.lang.Iterable extends com.google.datastore.v1.AggregationResult> values) {
+ if (aggregationResultsBuilder_ == null) {
+ ensureAggregationResultsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregationResults_);
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder clearAggregationResults() {
+ if (aggregationResultsBuilder_ == null) {
+ aggregationResults_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public Builder removeAggregationResults(int index) {
+ if (aggregationResultsBuilder_ == null) {
+ ensureAggregationResultsIsMutable();
+ aggregationResults_.remove(index);
+ onChanged();
+ } else {
+ aggregationResultsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public com.google.datastore.v1.AggregationResult.Builder getAggregationResultsBuilder(
+ int index) {
+ return getAggregationResultsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public com.google.datastore.v1.AggregationResultOrBuilder getAggregationResultsOrBuilder(
+ int index) {
+ if (aggregationResultsBuilder_ == null) {
+ return aggregationResults_.get(index);
+ } else {
+ return aggregationResultsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public java.util.List extends com.google.datastore.v1.AggregationResultOrBuilder>
+ getAggregationResultsOrBuilderList() {
+ if (aggregationResultsBuilder_ != null) {
+ return aggregationResultsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(aggregationResults_);
+ }
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public com.google.datastore.v1.AggregationResult.Builder addAggregationResultsBuilder() {
+ return getAggregationResultsFieldBuilder()
+ .addBuilder(com.google.datastore.v1.AggregationResult.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public com.google.datastore.v1.AggregationResult.Builder addAggregationResultsBuilder(
+ int index) {
+ return getAggregationResultsFieldBuilder()
+ .addBuilder(index, com.google.datastore.v1.AggregationResult.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ public java.util.List+ * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return The enum numeric value on the wire for moreResults.
+ */
+ @java.lang.Override
+ public int getMoreResultsValue() {
+ return moreResults_;
+ }
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @param value The enum numeric value on the wire for moreResults to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMoreResultsValue(int value) {
+
+ moreResults_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return The moreResults.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.QueryResultBatch.MoreResultsType getMoreResults() {
+ @SuppressWarnings("deprecation")
+ com.google.datastore.v1.QueryResultBatch.MoreResultsType result =
+ com.google.datastore.v1.QueryResultBatch.MoreResultsType.valueOf(moreResults_);
+ return result == null
+ ? com.google.datastore.v1.QueryResultBatch.MoreResultsType.UNRECOGNIZED
+ : result;
+ }
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @param value The moreResults to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMoreResults(com.google.datastore.v1.QueryResultBatch.MoreResultsType value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ moreResults_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearMoreResults() {
+
+ moreResults_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.Timestamp readTime_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ readTimeBuilder_;
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ *
+ * @return Whether the readTime field is set.
+ */
+ public boolean hasReadTime() {
+ return readTimeBuilder_ != null || readTime_ != null;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ *
+ * @return The readTime.
+ */
+ public com.google.protobuf.Timestamp getReadTime() {
+ if (readTimeBuilder_ == null) {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ } else {
+ return readTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ public Builder setReadTime(com.google.protobuf.Timestamp value) {
+ if (readTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ readTime_ = value;
+ onChanged();
+ } else {
+ readTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (readTimeBuilder_ == null) {
+ readTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ readTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
+ if (readTimeBuilder_ == null) {
+ if (readTime_ != null) {
+ readTime_ =
+ com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial();
+ } else {
+ readTime_ = value;
+ }
+ onChanged();
+ } else {
+ readTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ public Builder clearReadTime() {
+ if (readTimeBuilder_ == null) {
+ readTime_ = null;
+ onChanged();
+ } else {
+ readTime_ = null;
+ readTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
+
+ onChanged();
+ return getReadTimeFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
+ if (readTimeBuilder_ != null) {
+ return readTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ getReadTimeFieldBuilder() {
+ if (readTimeBuilder_ == null) {
+ readTimeBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>(
+ getReadTime(), getParentForChildren(), isClean());
+ readTime_ = null;
+ }
+ return readTimeBuilder_;
+ }
+
+ @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.datastore.v1.AggregationResultBatch)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.datastore.v1.AggregationResultBatch)
+ private static final com.google.datastore.v1.AggregationResultBatch DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.datastore.v1.AggregationResultBatch();
+ }
+
+ public static com.google.datastore.v1.AggregationResultBatch getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ java.util.List+ * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ com.google.datastore.v1.AggregationResult getAggregationResults(int index);
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ int getAggregationResultsCount();
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ java.util.List extends com.google.datastore.v1.AggregationResultOrBuilder>
+ getAggregationResultsOrBuilderList();
+ /**
+ *
+ *
+ * + * The aggregation results for this batch. + *+ * + *
repeated .google.datastore.v1.AggregationResult aggregation_results = 1;
+ */
+ com.google.datastore.v1.AggregationResultOrBuilder getAggregationResultsOrBuilder(int index);
+
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return The enum numeric value on the wire for moreResults.
+ */
+ int getMoreResultsValue();
+ /**
+ *
+ *
+ * + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + *+ * + *
.google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2;
+ *
+ * @return The moreResults.
+ */
+ com.google.datastore.v1.QueryResultBatch.MoreResultsType getMoreResults();
+
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ *
+ * @return Whether the readTime field is set.
+ */
+ boolean hasReadTime();
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ *
+ * @return The readTime.
+ */
+ com.google.protobuf.Timestamp getReadTime();
+ /**
+ *
+ *
+ * + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + *+ * + *
.google.protobuf.Timestamp read_time = 3;
+ */
+ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder();
+}
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResultOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResultOrBuilder.java
new file mode 100644
index 000000000..7d03c654b
--- /dev/null
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResultOrBuilder.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/datastore/v1/aggregation_result.proto
+
+package com.google.datastore.v1;
+
+public interface AggregationResultOrBuilder
+ extends
+ // @@protoc_insertion_point(interface_extends:google.datastore.v1.AggregationResult)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ *
+ * + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ int getAggregatePropertiesCount();
+ /**
+ *
+ *
+ * + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ boolean containsAggregateProperties(java.lang.String key);
+ /** Use {@link #getAggregatePropertiesMap()} instead. */
+ @java.lang.Deprecated
+ java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ java.util.Map+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+
+ /* nullable */
+ com.google.datastore.v1.Value getAggregatePropertiesOrDefault(
+ java.lang.String key,
+ /* nullable */
+ com.google.datastore.v1.Value defaultValue);
+ /**
+ *
+ *
+ * + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + *+ * + *
map<string, .google.datastore.v1.Value> aggregate_properties = 2;
+ */
+ com.google.datastore.v1.Value getAggregatePropertiesOrThrow(java.lang.String key);
+}
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResultProto.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResultProto.java
new file mode 100644
index 000000000..5f055196f
--- /dev/null
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationResultProto.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/datastore/v1/aggregation_result.proto
+
+package com.google.datastore.v1;
+
+public final class AggregationResultProto {
+ private AggregationResultProto() {}
+
+ 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_datastore_v1_AggregationResult_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_datastore_v1_AggregationResult_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_datastore_v1_AggregationResult_AggregatePropertiesEntry_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_datastore_v1_AggregationResult_AggregatePropertiesEntry_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_datastore_v1_AggregationResultBatch_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_datastore_v1_AggregationResultBatch_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/datastore/v1/aggregation_result"
+ + ".proto\022\023google.datastore.v1\032 google/data"
+ + "store/v1/entity.proto\032\037google/datastore/"
+ + "v1/query.proto\032\037google/protobuf/timestam"
+ + "p.proto\"\312\001\n\021AggregationResult\022]\n\024aggrega"
+ + "te_properties\030\002 \003(\0132?.google.datastore.v"
+ + "1.AggregationResult.AggregatePropertiesE"
+ + "ntry\032V\n\030AggregatePropertiesEntry\022\013\n\003key\030"
+ + "\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.google.datastore."
+ + "v1.Value:\0028\001\"\331\001\n\026AggregationResultBatch\022"
+ + "C\n\023aggregation_results\030\001 \003(\0132&.google.da"
+ + "tastore.v1.AggregationResult\022K\n\014more_res"
+ + "ults\030\002 \001(\01625.google.datastore.v1.QueryRe"
+ + "sultBatch.MoreResultsType\022-\n\tread_time\030\003"
+ + " \001(\0132\032.google.protobuf.TimestampB\310\001\n\027com"
+ + ".google.datastore.v1B\026AggregationResultP"
+ + "rotoP\001Z+ * The request for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. + *+ * + * Protobuf type {@code google.datastore.v1.RunAggregationQueryRequest} + */ +public final class RunAggregationQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.RunAggregationQueryRequest) + RunAggregationQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunAggregationQueryRequest.newBuilder() to construct. + private RunAggregationQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private RunAggregationQueryRequest() { + projectId_ = ""; + databaseId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RunAggregationQueryRequest(); + } + + @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.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_RunAggregationQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_RunAggregationQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.RunAggregationQueryRequest.class, + com.google.datastore.v1.RunAggregationQueryRequest.Builder.class); + } + + private int queryTypeCase_ = 0; + private java.lang.Object queryType_; + + public enum QueryTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AGGREGATION_QUERY(3), + GQL_QUERY(7), + QUERYTYPE_NOT_SET(0); + private final int value; + + private QueryTypeCase(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 QueryTypeCase valueOf(int value) { + return forNumber(value); + } + + public static QueryTypeCase forNumber(int value) { + switch (value) { + case 3: + return AGGREGATION_QUERY; + case 7: + return GQL_QUERY; + case 0: + return QUERYTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public QueryTypeCase getQueryTypeCase() { + return QueryTypeCase.forNumber(queryTypeCase_); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object projectId_; + /** + * + * + *
+ * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The projectId.
+ */
+ @java.lang.Override
+ public java.lang.String getProjectId() {
+ java.lang.Object ref = projectId_;
+ 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();
+ projectId_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for projectId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getProjectIdBytes() {
+ java.lang.Object ref = projectId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ projectId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DATABASE_ID_FIELD_NUMBER = 9;
+ private volatile java.lang.Object databaseId_;
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return The databaseId.
+ */
+ @java.lang.Override
+ public java.lang.String getDatabaseId() {
+ java.lang.Object ref = databaseId_;
+ 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();
+ databaseId_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return The bytes for databaseId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getDatabaseIdBytes() {
+ java.lang.Object ref = databaseId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ databaseId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int PARTITION_ID_FIELD_NUMBER = 2;
+ private com.google.datastore.v1.PartitionId partitionId_;
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ *
+ * @return Whether the partitionId field is set.
+ */
+ @java.lang.Override
+ public boolean hasPartitionId() {
+ return partitionId_ != null;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ *
+ * @return The partitionId.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.PartitionId getPartitionId() {
+ return partitionId_ == null
+ ? com.google.datastore.v1.PartitionId.getDefaultInstance()
+ : partitionId_;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.PartitionIdOrBuilder getPartitionIdOrBuilder() {
+ return getPartitionId();
+ }
+
+ public static final int READ_OPTIONS_FIELD_NUMBER = 1;
+ private com.google.datastore.v1.ReadOptions readOptions_;
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ *
+ * @return Whether the readOptions field is set.
+ */
+ @java.lang.Override
+ public boolean hasReadOptions() {
+ return readOptions_ != null;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ *
+ * @return The readOptions.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.ReadOptions getReadOptions() {
+ return readOptions_ == null
+ ? com.google.datastore.v1.ReadOptions.getDefaultInstance()
+ : readOptions_;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.ReadOptionsOrBuilder getReadOptionsOrBuilder() {
+ return getReadOptions();
+ }
+
+ public static final int AGGREGATION_QUERY_FIELD_NUMBER = 3;
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ *
+ * @return Whether the aggregationQuery field is set.
+ */
+ @java.lang.Override
+ public boolean hasAggregationQuery() {
+ return queryTypeCase_ == 3;
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ *
+ * @return The aggregationQuery.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery getAggregationQuery() {
+ if (queryTypeCase_ == 3) {
+ return (com.google.datastore.v1.AggregationQuery) queryType_;
+ }
+ return com.google.datastore.v1.AggregationQuery.getDefaultInstance();
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQueryOrBuilder getAggregationQueryOrBuilder() {
+ if (queryTypeCase_ == 3) {
+ return (com.google.datastore.v1.AggregationQuery) queryType_;
+ }
+ return com.google.datastore.v1.AggregationQuery.getDefaultInstance();
+ }
+
+ public static final int GQL_QUERY_FIELD_NUMBER = 7;
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ *
+ * @return Whether the gqlQuery field is set.
+ */
+ @java.lang.Override
+ public boolean hasGqlQuery() {
+ return queryTypeCase_ == 7;
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ *
+ * @return The gqlQuery.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.GqlQuery getGqlQuery() {
+ if (queryTypeCase_ == 7) {
+ return (com.google.datastore.v1.GqlQuery) queryType_;
+ }
+ return com.google.datastore.v1.GqlQuery.getDefaultInstance();
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() {
+ if (queryTypeCase_ == 7) {
+ return (com.google.datastore.v1.GqlQuery) queryType_;
+ }
+ return com.google.datastore.v1.GqlQuery.getDefaultInstance();
+ }
+
+ 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 (readOptions_ != null) {
+ output.writeMessage(1, getReadOptions());
+ }
+ if (partitionId_ != null) {
+ output.writeMessage(2, getPartitionId());
+ }
+ if (queryTypeCase_ == 3) {
+ output.writeMessage(3, (com.google.datastore.v1.AggregationQuery) queryType_);
+ }
+ if (queryTypeCase_ == 7) {
+ output.writeMessage(7, (com.google.datastore.v1.GqlQuery) queryType_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 8, projectId_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (readOptions_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReadOptions());
+ }
+ if (partitionId_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPartitionId());
+ }
+ if (queryTypeCase_ == 3) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 3, (com.google.datastore.v1.AggregationQuery) queryType_);
+ }
+ if (queryTypeCase_ == 7) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 7, (com.google.datastore.v1.GqlQuery) queryType_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, projectId_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_);
+ }
+ 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.datastore.v1.RunAggregationQueryRequest)) {
+ return super.equals(obj);
+ }
+ com.google.datastore.v1.RunAggregationQueryRequest other =
+ (com.google.datastore.v1.RunAggregationQueryRequest) obj;
+
+ if (!getProjectId().equals(other.getProjectId())) return false;
+ if (!getDatabaseId().equals(other.getDatabaseId())) return false;
+ if (hasPartitionId() != other.hasPartitionId()) return false;
+ if (hasPartitionId()) {
+ if (!getPartitionId().equals(other.getPartitionId())) return false;
+ }
+ if (hasReadOptions() != other.hasReadOptions()) return false;
+ if (hasReadOptions()) {
+ if (!getReadOptions().equals(other.getReadOptions())) return false;
+ }
+ if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false;
+ switch (queryTypeCase_) {
+ case 3:
+ if (!getAggregationQuery().equals(other.getAggregationQuery())) return false;
+ break;
+ case 7:
+ if (!getGqlQuery().equals(other.getGqlQuery())) 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) + PROJECT_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getProjectId().hashCode();
+ hash = (37 * hash) + DATABASE_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getDatabaseId().hashCode();
+ if (hasPartitionId()) {
+ hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getPartitionId().hashCode();
+ }
+ if (hasReadOptions()) {
+ hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER;
+ hash = (53 * hash) + getReadOptions().hashCode();
+ }
+ switch (queryTypeCase_) {
+ case 3:
+ hash = (37 * hash) + AGGREGATION_QUERY_FIELD_NUMBER;
+ hash = (53 * hash) + getAggregationQuery().hashCode();
+ break;
+ case 7:
+ hash = (37 * hash) + GQL_QUERY_FIELD_NUMBER;
+ hash = (53 * hash) + getGqlQuery().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest 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.datastore.v1.RunAggregationQueryRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest 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.datastore.v1.RunAggregationQueryRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest 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.datastore.v1.RunAggregationQueryRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest 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.datastore.v1.RunAggregationQueryRequest 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 request for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. + *+ * + * Protobuf type {@code google.datastore.v1.RunAggregationQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The projectId.
+ */
+ public java.lang.String getProjectId() {
+ java.lang.Object ref = projectId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ projectId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for projectId.
+ */
+ public com.google.protobuf.ByteString getProjectIdBytes() {
+ java.lang.Object ref = projectId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ projectId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @param value The projectId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setProjectId(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ projectId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearProjectId() {
+
+ projectId_ = getDefaultInstance().getProjectId();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @param value The bytes for projectId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setProjectIdBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ projectId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object databaseId_ = "";
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return The databaseId.
+ */
+ public java.lang.String getDatabaseId() {
+ java.lang.Object ref = databaseId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ databaseId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return The bytes for databaseId.
+ */
+ public com.google.protobuf.ByteString getDatabaseIdBytes() {
+ java.lang.Object ref = databaseId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ databaseId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @param value The databaseId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDatabaseId(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ databaseId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearDatabaseId() {
+
+ databaseId_ = getDefaultInstance().getDatabaseId();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @param value The bytes for databaseId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDatabaseIdBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ databaseId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.datastore.v1.PartitionId partitionId_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.PartitionId,
+ com.google.datastore.v1.PartitionId.Builder,
+ com.google.datastore.v1.PartitionIdOrBuilder>
+ partitionIdBuilder_;
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ *
+ * @return Whether the partitionId field is set.
+ */
+ public boolean hasPartitionId() {
+ return partitionIdBuilder_ != null || partitionId_ != null;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ *
+ * @return The partitionId.
+ */
+ public com.google.datastore.v1.PartitionId getPartitionId() {
+ if (partitionIdBuilder_ == null) {
+ return partitionId_ == null
+ ? com.google.datastore.v1.PartitionId.getDefaultInstance()
+ : partitionId_;
+ } else {
+ return partitionIdBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ public Builder setPartitionId(com.google.datastore.v1.PartitionId value) {
+ if (partitionIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ partitionId_ = value;
+ onChanged();
+ } else {
+ partitionIdBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ public Builder setPartitionId(com.google.datastore.v1.PartitionId.Builder builderForValue) {
+ if (partitionIdBuilder_ == null) {
+ partitionId_ = builderForValue.build();
+ onChanged();
+ } else {
+ partitionIdBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ public Builder mergePartitionId(com.google.datastore.v1.PartitionId value) {
+ if (partitionIdBuilder_ == null) {
+ if (partitionId_ != null) {
+ partitionId_ =
+ com.google.datastore.v1.PartitionId.newBuilder(partitionId_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ partitionId_ = value;
+ }
+ onChanged();
+ } else {
+ partitionIdBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ public Builder clearPartitionId() {
+ if (partitionIdBuilder_ == null) {
+ partitionId_ = null;
+ onChanged();
+ } else {
+ partitionId_ = null;
+ partitionIdBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ public com.google.datastore.v1.PartitionId.Builder getPartitionIdBuilder() {
+
+ onChanged();
+ return getPartitionIdFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ public com.google.datastore.v1.PartitionIdOrBuilder getPartitionIdOrBuilder() {
+ if (partitionIdBuilder_ != null) {
+ return partitionIdBuilder_.getMessageOrBuilder();
+ } else {
+ return partitionId_ == null
+ ? com.google.datastore.v1.PartitionId.getDefaultInstance()
+ : partitionId_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.PartitionId,
+ com.google.datastore.v1.PartitionId.Builder,
+ com.google.datastore.v1.PartitionIdOrBuilder>
+ getPartitionIdFieldBuilder() {
+ if (partitionIdBuilder_ == null) {
+ partitionIdBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.PartitionId,
+ com.google.datastore.v1.PartitionId.Builder,
+ com.google.datastore.v1.PartitionIdOrBuilder>(
+ getPartitionId(), getParentForChildren(), isClean());
+ partitionId_ = null;
+ }
+ return partitionIdBuilder_;
+ }
+
+ private com.google.datastore.v1.ReadOptions readOptions_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.ReadOptions,
+ com.google.datastore.v1.ReadOptions.Builder,
+ com.google.datastore.v1.ReadOptionsOrBuilder>
+ readOptionsBuilder_;
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ *
+ * @return Whether the readOptions field is set.
+ */
+ public boolean hasReadOptions() {
+ return readOptionsBuilder_ != null || readOptions_ != null;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ *
+ * @return The readOptions.
+ */
+ public com.google.datastore.v1.ReadOptions getReadOptions() {
+ if (readOptionsBuilder_ == null) {
+ return readOptions_ == null
+ ? com.google.datastore.v1.ReadOptions.getDefaultInstance()
+ : readOptions_;
+ } else {
+ return readOptionsBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ public Builder setReadOptions(com.google.datastore.v1.ReadOptions value) {
+ if (readOptionsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ readOptions_ = value;
+ onChanged();
+ } else {
+ readOptionsBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ public Builder setReadOptions(com.google.datastore.v1.ReadOptions.Builder builderForValue) {
+ if (readOptionsBuilder_ == null) {
+ readOptions_ = builderForValue.build();
+ onChanged();
+ } else {
+ readOptionsBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ public Builder mergeReadOptions(com.google.datastore.v1.ReadOptions value) {
+ if (readOptionsBuilder_ == null) {
+ if (readOptions_ != null) {
+ readOptions_ =
+ com.google.datastore.v1.ReadOptions.newBuilder(readOptions_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ readOptions_ = value;
+ }
+ onChanged();
+ } else {
+ readOptionsBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ public Builder clearReadOptions() {
+ if (readOptionsBuilder_ == null) {
+ readOptions_ = null;
+ onChanged();
+ } else {
+ readOptions_ = null;
+ readOptionsBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ public com.google.datastore.v1.ReadOptions.Builder getReadOptionsBuilder() {
+
+ onChanged();
+ return getReadOptionsFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ public com.google.datastore.v1.ReadOptionsOrBuilder getReadOptionsOrBuilder() {
+ if (readOptionsBuilder_ != null) {
+ return readOptionsBuilder_.getMessageOrBuilder();
+ } else {
+ return readOptions_ == null
+ ? com.google.datastore.v1.ReadOptions.getDefaultInstance()
+ : readOptions_;
+ }
+ }
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.ReadOptions,
+ com.google.datastore.v1.ReadOptions.Builder,
+ com.google.datastore.v1.ReadOptionsOrBuilder>
+ getReadOptionsFieldBuilder() {
+ if (readOptionsBuilder_ == null) {
+ readOptionsBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.ReadOptions,
+ com.google.datastore.v1.ReadOptions.Builder,
+ com.google.datastore.v1.ReadOptionsOrBuilder>(
+ getReadOptions(), getParentForChildren(), isClean());
+ readOptions_ = null;
+ }
+ return readOptionsBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery,
+ com.google.datastore.v1.AggregationQuery.Builder,
+ com.google.datastore.v1.AggregationQueryOrBuilder>
+ aggregationQueryBuilder_;
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ *
+ * @return Whether the aggregationQuery field is set.
+ */
+ @java.lang.Override
+ public boolean hasAggregationQuery() {
+ return queryTypeCase_ == 3;
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ *
+ * @return The aggregationQuery.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery getAggregationQuery() {
+ if (aggregationQueryBuilder_ == null) {
+ if (queryTypeCase_ == 3) {
+ return (com.google.datastore.v1.AggregationQuery) queryType_;
+ }
+ return com.google.datastore.v1.AggregationQuery.getDefaultInstance();
+ } else {
+ if (queryTypeCase_ == 3) {
+ return aggregationQueryBuilder_.getMessage();
+ }
+ return com.google.datastore.v1.AggregationQuery.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ public Builder setAggregationQuery(com.google.datastore.v1.AggregationQuery value) {
+ if (aggregationQueryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ queryType_ = value;
+ onChanged();
+ } else {
+ aggregationQueryBuilder_.setMessage(value);
+ }
+ queryTypeCase_ = 3;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ public Builder setAggregationQuery(
+ com.google.datastore.v1.AggregationQuery.Builder builderForValue) {
+ if (aggregationQueryBuilder_ == null) {
+ queryType_ = builderForValue.build();
+ onChanged();
+ } else {
+ aggregationQueryBuilder_.setMessage(builderForValue.build());
+ }
+ queryTypeCase_ = 3;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ public Builder mergeAggregationQuery(com.google.datastore.v1.AggregationQuery value) {
+ if (aggregationQueryBuilder_ == null) {
+ if (queryTypeCase_ == 3
+ && queryType_ != com.google.datastore.v1.AggregationQuery.getDefaultInstance()) {
+ queryType_ =
+ com.google.datastore.v1.AggregationQuery.newBuilder(
+ (com.google.datastore.v1.AggregationQuery) queryType_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ queryType_ = value;
+ }
+ onChanged();
+ } else {
+ if (queryTypeCase_ == 3) {
+ aggregationQueryBuilder_.mergeFrom(value);
+ } else {
+ aggregationQueryBuilder_.setMessage(value);
+ }
+ }
+ queryTypeCase_ = 3;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ public Builder clearAggregationQuery() {
+ if (aggregationQueryBuilder_ == null) {
+ if (queryTypeCase_ == 3) {
+ queryTypeCase_ = 0;
+ queryType_ = null;
+ onChanged();
+ }
+ } else {
+ if (queryTypeCase_ == 3) {
+ queryTypeCase_ = 0;
+ queryType_ = null;
+ }
+ aggregationQueryBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ public com.google.datastore.v1.AggregationQuery.Builder getAggregationQueryBuilder() {
+ return getAggregationQueryFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQueryOrBuilder getAggregationQueryOrBuilder() {
+ if ((queryTypeCase_ == 3) && (aggregationQueryBuilder_ != null)) {
+ return aggregationQueryBuilder_.getMessageOrBuilder();
+ } else {
+ if (queryTypeCase_ == 3) {
+ return (com.google.datastore.v1.AggregationQuery) queryType_;
+ }
+ return com.google.datastore.v1.AggregationQuery.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery,
+ com.google.datastore.v1.AggregationQuery.Builder,
+ com.google.datastore.v1.AggregationQueryOrBuilder>
+ getAggregationQueryFieldBuilder() {
+ if (aggregationQueryBuilder_ == null) {
+ if (!(queryTypeCase_ == 3)) {
+ queryType_ = com.google.datastore.v1.AggregationQuery.getDefaultInstance();
+ }
+ aggregationQueryBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery,
+ com.google.datastore.v1.AggregationQuery.Builder,
+ com.google.datastore.v1.AggregationQueryOrBuilder>(
+ (com.google.datastore.v1.AggregationQuery) queryType_,
+ getParentForChildren(),
+ isClean());
+ queryType_ = null;
+ }
+ queryTypeCase_ = 3;
+ onChanged();
+ ;
+ return aggregationQueryBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.GqlQuery,
+ com.google.datastore.v1.GqlQuery.Builder,
+ com.google.datastore.v1.GqlQueryOrBuilder>
+ gqlQueryBuilder_;
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ *
+ * @return Whether the gqlQuery field is set.
+ */
+ @java.lang.Override
+ public boolean hasGqlQuery() {
+ return queryTypeCase_ == 7;
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ *
+ * @return The gqlQuery.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.GqlQuery getGqlQuery() {
+ if (gqlQueryBuilder_ == null) {
+ if (queryTypeCase_ == 7) {
+ return (com.google.datastore.v1.GqlQuery) queryType_;
+ }
+ return com.google.datastore.v1.GqlQuery.getDefaultInstance();
+ } else {
+ if (queryTypeCase_ == 7) {
+ return gqlQueryBuilder_.getMessage();
+ }
+ return com.google.datastore.v1.GqlQuery.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ public Builder setGqlQuery(com.google.datastore.v1.GqlQuery value) {
+ if (gqlQueryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ queryType_ = value;
+ onChanged();
+ } else {
+ gqlQueryBuilder_.setMessage(value);
+ }
+ queryTypeCase_ = 7;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ public Builder setGqlQuery(com.google.datastore.v1.GqlQuery.Builder builderForValue) {
+ if (gqlQueryBuilder_ == null) {
+ queryType_ = builderForValue.build();
+ onChanged();
+ } else {
+ gqlQueryBuilder_.setMessage(builderForValue.build());
+ }
+ queryTypeCase_ = 7;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ public Builder mergeGqlQuery(com.google.datastore.v1.GqlQuery value) {
+ if (gqlQueryBuilder_ == null) {
+ if (queryTypeCase_ == 7
+ && queryType_ != com.google.datastore.v1.GqlQuery.getDefaultInstance()) {
+ queryType_ =
+ com.google.datastore.v1.GqlQuery.newBuilder(
+ (com.google.datastore.v1.GqlQuery) queryType_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ queryType_ = value;
+ }
+ onChanged();
+ } else {
+ if (queryTypeCase_ == 7) {
+ gqlQueryBuilder_.mergeFrom(value);
+ } else {
+ gqlQueryBuilder_.setMessage(value);
+ }
+ }
+ queryTypeCase_ = 7;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ public Builder clearGqlQuery() {
+ if (gqlQueryBuilder_ == null) {
+ if (queryTypeCase_ == 7) {
+ queryTypeCase_ = 0;
+ queryType_ = null;
+ onChanged();
+ }
+ } else {
+ if (queryTypeCase_ == 7) {
+ queryTypeCase_ = 0;
+ queryType_ = null;
+ }
+ gqlQueryBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ public com.google.datastore.v1.GqlQuery.Builder getGqlQueryBuilder() {
+ return getGqlQueryFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() {
+ if ((queryTypeCase_ == 7) && (gqlQueryBuilder_ != null)) {
+ return gqlQueryBuilder_.getMessageOrBuilder();
+ } else {
+ if (queryTypeCase_ == 7) {
+ return (com.google.datastore.v1.GqlQuery) queryType_;
+ }
+ return com.google.datastore.v1.GqlQuery.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.GqlQuery,
+ com.google.datastore.v1.GqlQuery.Builder,
+ com.google.datastore.v1.GqlQueryOrBuilder>
+ getGqlQueryFieldBuilder() {
+ if (gqlQueryBuilder_ == null) {
+ if (!(queryTypeCase_ == 7)) {
+ queryType_ = com.google.datastore.v1.GqlQuery.getDefaultInstance();
+ }
+ gqlQueryBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.GqlQuery,
+ com.google.datastore.v1.GqlQuery.Builder,
+ com.google.datastore.v1.GqlQueryOrBuilder>(
+ (com.google.datastore.v1.GqlQuery) queryType_, getParentForChildren(), isClean());
+ queryType_ = null;
+ }
+ queryTypeCase_ = 7;
+ onChanged();
+ ;
+ return gqlQueryBuilder_;
+ }
+
+ @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.datastore.v1.RunAggregationQueryRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.datastore.v1.RunAggregationQueryRequest)
+ private static final com.google.datastore.v1.RunAggregationQueryRequest DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.datastore.v1.RunAggregationQueryRequest();
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The projectId.
+ */
+ java.lang.String getProjectId();
+ /**
+ *
+ *
+ * + * Required. The ID of the project against which to make the request. + *+ * + *
string project_id = 8 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The bytes for projectId.
+ */
+ com.google.protobuf.ByteString getProjectIdBytes();
+
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return The databaseId.
+ */
+ java.lang.String getDatabaseId();
+ /**
+ *
+ *
+ * + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + *+ * + *
string database_id = 9;
+ *
+ * @return The bytes for databaseId.
+ */
+ com.google.protobuf.ByteString getDatabaseIdBytes();
+
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ *
+ * @return Whether the partitionId field is set.
+ */
+ boolean hasPartitionId();
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ *
+ * @return The partitionId.
+ */
+ com.google.datastore.v1.PartitionId getPartitionId();
+ /**
+ *
+ *
+ * + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + *+ * + *
.google.datastore.v1.PartitionId partition_id = 2;
+ */
+ com.google.datastore.v1.PartitionIdOrBuilder getPartitionIdOrBuilder();
+
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ *
+ * @return Whether the readOptions field is set.
+ */
+ boolean hasReadOptions();
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ *
+ * @return The readOptions.
+ */
+ com.google.datastore.v1.ReadOptions getReadOptions();
+ /**
+ *
+ *
+ * + * The options for this query. + *+ * + *
.google.datastore.v1.ReadOptions read_options = 1;
+ */
+ com.google.datastore.v1.ReadOptionsOrBuilder getReadOptionsOrBuilder();
+
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ *
+ * @return Whether the aggregationQuery field is set.
+ */
+ boolean hasAggregationQuery();
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ *
+ * @return The aggregationQuery.
+ */
+ com.google.datastore.v1.AggregationQuery getAggregationQuery();
+ /**
+ *
+ *
+ * + * The query to run. + *+ * + *
.google.datastore.v1.AggregationQuery aggregation_query = 3;
+ */
+ com.google.datastore.v1.AggregationQueryOrBuilder getAggregationQueryOrBuilder();
+
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ *
+ * @return Whether the gqlQuery field is set.
+ */
+ boolean hasGqlQuery();
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ *
+ * @return The gqlQuery.
+ */
+ com.google.datastore.v1.GqlQuery getGqlQuery();
+ /**
+ *
+ *
+ * + * The GQL query to run. This query must be an aggregation query. + *+ * + *
.google.datastore.v1.GqlQuery gql_query = 7;
+ */
+ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder();
+
+ public com.google.datastore.v1.RunAggregationQueryRequest.QueryTypeCase getQueryTypeCase();
+}
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java
new file mode 100644
index 000000000..230d90f47
--- /dev/null
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java
@@ -0,0 +1,969 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/datastore/v1/datastore.proto
+
+package com.google.datastore.v1;
+
+/**
+ *
+ *
+ * + * The response for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. + *+ * + * Protobuf type {@code google.datastore.v1.RunAggregationQueryResponse} + */ +public final class RunAggregationQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.RunAggregationQueryResponse) + RunAggregationQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunAggregationQueryResponse.newBuilder() to construct. + private RunAggregationQueryResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private RunAggregationQueryResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RunAggregationQueryResponse(); + } + + @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.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_RunAggregationQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_RunAggregationQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.RunAggregationQueryResponse.class, + com.google.datastore.v1.RunAggregationQueryResponse.Builder.class); + } + + public static final int BATCH_FIELD_NUMBER = 1; + private com.google.datastore.v1.AggregationResultBatch batch_; + /** + * + * + *
+ * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ *
+ * @return Whether the batch field is set.
+ */
+ @java.lang.Override
+ public boolean hasBatch() {
+ return batch_ != null;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ *
+ * @return The batch.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationResultBatch getBatch() {
+ return batch_ == null
+ ? com.google.datastore.v1.AggregationResultBatch.getDefaultInstance()
+ : batch_;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationResultBatchOrBuilder getBatchOrBuilder() {
+ return getBatch();
+ }
+
+ public static final int QUERY_FIELD_NUMBER = 2;
+ private com.google.datastore.v1.AggregationQuery query_;
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ *
+ * @return Whether the query field is set.
+ */
+ @java.lang.Override
+ public boolean hasQuery() {
+ return query_ != null;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ *
+ * @return The query.
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQuery getQuery() {
+ return query_ == null ? com.google.datastore.v1.AggregationQuery.getDefaultInstance() : query_;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ @java.lang.Override
+ public com.google.datastore.v1.AggregationQueryOrBuilder getQueryOrBuilder() {
+ return getQuery();
+ }
+
+ 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 (batch_ != null) {
+ output.writeMessage(1, getBatch());
+ }
+ if (query_ != null) {
+ output.writeMessage(2, getQuery());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (batch_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBatch());
+ }
+ if (query_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuery());
+ }
+ 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.datastore.v1.RunAggregationQueryResponse)) {
+ return super.equals(obj);
+ }
+ com.google.datastore.v1.RunAggregationQueryResponse other =
+ (com.google.datastore.v1.RunAggregationQueryResponse) obj;
+
+ if (hasBatch() != other.hasBatch()) return false;
+ if (hasBatch()) {
+ if (!getBatch().equals(other.getBatch())) return false;
+ }
+ if (hasQuery() != other.hasQuery()) return false;
+ if (hasQuery()) {
+ if (!getQuery().equals(other.getQuery())) 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 (hasBatch()) {
+ hash = (37 * hash) + BATCH_FIELD_NUMBER;
+ hash = (53 * hash) + getBatch().hashCode();
+ }
+ if (hasQuery()) {
+ hash = (37 * hash) + QUERY_FIELD_NUMBER;
+ hash = (53 * hash) + getQuery().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse 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.datastore.v1.RunAggregationQueryResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse 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.datastore.v1.RunAggregationQueryResponse parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse 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.datastore.v1.RunAggregationQueryResponse parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse 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.datastore.v1.RunAggregationQueryResponse 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 response for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. + *+ * + * Protobuf type {@code google.datastore.v1.RunAggregationQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ *
+ * @return Whether the batch field is set.
+ */
+ public boolean hasBatch() {
+ return batchBuilder_ != null || batch_ != null;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ *
+ * @return The batch.
+ */
+ public com.google.datastore.v1.AggregationResultBatch getBatch() {
+ if (batchBuilder_ == null) {
+ return batch_ == null
+ ? com.google.datastore.v1.AggregationResultBatch.getDefaultInstance()
+ : batch_;
+ } else {
+ return batchBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ public Builder setBatch(com.google.datastore.v1.AggregationResultBatch value) {
+ if (batchBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ batch_ = value;
+ onChanged();
+ } else {
+ batchBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ public Builder setBatch(
+ com.google.datastore.v1.AggregationResultBatch.Builder builderForValue) {
+ if (batchBuilder_ == null) {
+ batch_ = builderForValue.build();
+ onChanged();
+ } else {
+ batchBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ public Builder mergeBatch(com.google.datastore.v1.AggregationResultBatch value) {
+ if (batchBuilder_ == null) {
+ if (batch_ != null) {
+ batch_ =
+ com.google.datastore.v1.AggregationResultBatch.newBuilder(batch_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ batch_ = value;
+ }
+ onChanged();
+ } else {
+ batchBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ public Builder clearBatch() {
+ if (batchBuilder_ == null) {
+ batch_ = null;
+ onChanged();
+ } else {
+ batch_ = null;
+ batchBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ public com.google.datastore.v1.AggregationResultBatch.Builder getBatchBuilder() {
+
+ onChanged();
+ return getBatchFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ public com.google.datastore.v1.AggregationResultBatchOrBuilder getBatchOrBuilder() {
+ if (batchBuilder_ != null) {
+ return batchBuilder_.getMessageOrBuilder();
+ } else {
+ return batch_ == null
+ ? com.google.datastore.v1.AggregationResultBatch.getDefaultInstance()
+ : batch_;
+ }
+ }
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationResultBatch,
+ com.google.datastore.v1.AggregationResultBatch.Builder,
+ com.google.datastore.v1.AggregationResultBatchOrBuilder>
+ getBatchFieldBuilder() {
+ if (batchBuilder_ == null) {
+ batchBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationResultBatch,
+ com.google.datastore.v1.AggregationResultBatch.Builder,
+ com.google.datastore.v1.AggregationResultBatchOrBuilder>(
+ getBatch(), getParentForChildren(), isClean());
+ batch_ = null;
+ }
+ return batchBuilder_;
+ }
+
+ private com.google.datastore.v1.AggregationQuery query_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery,
+ com.google.datastore.v1.AggregationQuery.Builder,
+ com.google.datastore.v1.AggregationQueryOrBuilder>
+ queryBuilder_;
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ *
+ * @return Whether the query field is set.
+ */
+ public boolean hasQuery() {
+ return queryBuilder_ != null || query_ != null;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ *
+ * @return The query.
+ */
+ public com.google.datastore.v1.AggregationQuery getQuery() {
+ if (queryBuilder_ == null) {
+ return query_ == null
+ ? com.google.datastore.v1.AggregationQuery.getDefaultInstance()
+ : query_;
+ } else {
+ return queryBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ public Builder setQuery(com.google.datastore.v1.AggregationQuery value) {
+ if (queryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ query_ = value;
+ onChanged();
+ } else {
+ queryBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ public Builder setQuery(com.google.datastore.v1.AggregationQuery.Builder builderForValue) {
+ if (queryBuilder_ == null) {
+ query_ = builderForValue.build();
+ onChanged();
+ } else {
+ queryBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ public Builder mergeQuery(com.google.datastore.v1.AggregationQuery value) {
+ if (queryBuilder_ == null) {
+ if (query_ != null) {
+ query_ =
+ com.google.datastore.v1.AggregationQuery.newBuilder(query_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ query_ = value;
+ }
+ onChanged();
+ } else {
+ queryBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ public Builder clearQuery() {
+ if (queryBuilder_ == null) {
+ query_ = null;
+ onChanged();
+ } else {
+ query_ = null;
+ queryBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ public com.google.datastore.v1.AggregationQuery.Builder getQueryBuilder() {
+
+ onChanged();
+ return getQueryFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ public com.google.datastore.v1.AggregationQueryOrBuilder getQueryOrBuilder() {
+ if (queryBuilder_ != null) {
+ return queryBuilder_.getMessageOrBuilder();
+ } else {
+ return query_ == null
+ ? com.google.datastore.v1.AggregationQuery.getDefaultInstance()
+ : query_;
+ }
+ }
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery,
+ com.google.datastore.v1.AggregationQuery.Builder,
+ com.google.datastore.v1.AggregationQueryOrBuilder>
+ getQueryFieldBuilder() {
+ if (queryBuilder_ == null) {
+ queryBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.datastore.v1.AggregationQuery,
+ com.google.datastore.v1.AggregationQuery.Builder,
+ com.google.datastore.v1.AggregationQueryOrBuilder>(
+ getQuery(), getParentForChildren(), isClean());
+ query_ = null;
+ }
+ return queryBuilder_;
+ }
+
+ @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.datastore.v1.RunAggregationQueryResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.datastore.v1.RunAggregationQueryResponse)
+ private static final com.google.datastore.v1.RunAggregationQueryResponse DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.datastore.v1.RunAggregationQueryResponse();
+ }
+
+ public static com.google.datastore.v1.RunAggregationQueryResponse getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ *
+ * @return Whether the batch field is set.
+ */
+ boolean hasBatch();
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ *
+ * @return The batch.
+ */
+ com.google.datastore.v1.AggregationResultBatch getBatch();
+ /**
+ *
+ *
+ * + * A batch of aggregation results. Always present. + *+ * + *
.google.datastore.v1.AggregationResultBatch batch = 1;
+ */
+ com.google.datastore.v1.AggregationResultBatchOrBuilder getBatchOrBuilder();
+
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ *
+ * @return Whether the query field is set.
+ */
+ boolean hasQuery();
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ *
+ * @return The query.
+ */
+ com.google.datastore.v1.AggregationQuery getQuery();
+ /**
+ *
+ *
+ * + * The parsed form of the `GqlQuery` from the request, if it was set. + *+ * + *
.google.datastore.v1.AggregationQuery query = 2;
+ */
+ com.google.datastore.v1.AggregationQueryOrBuilder getQueryOrBuilder();
+}
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java
index 51999dba5..5b30e3bac 100644
--- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java
@@ -53,121 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
- private RunQueryRequest(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10:
- {
- com.google.datastore.v1.ReadOptions.Builder subBuilder = null;
- if (readOptions_ != null) {
- subBuilder = readOptions_.toBuilder();
- }
- readOptions_ =
- input.readMessage(
- com.google.datastore.v1.ReadOptions.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(readOptions_);
- readOptions_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 18:
- {
- com.google.datastore.v1.PartitionId.Builder subBuilder = null;
- if (partitionId_ != null) {
- subBuilder = partitionId_.toBuilder();
- }
- partitionId_ =
- input.readMessage(
- com.google.datastore.v1.PartitionId.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(partitionId_);
- partitionId_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 26:
- {
- com.google.datastore.v1.Query.Builder subBuilder = null;
- if (queryTypeCase_ == 3) {
- subBuilder = ((com.google.datastore.v1.Query) queryType_).toBuilder();
- }
- queryType_ =
- input.readMessage(com.google.datastore.v1.Query.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.Query) queryType_);
- queryType_ = subBuilder.buildPartial();
- }
- queryTypeCase_ = 3;
- break;
- }
- case 58:
- {
- com.google.datastore.v1.GqlQuery.Builder subBuilder = null;
- if (queryTypeCase_ == 7) {
- subBuilder = ((com.google.datastore.v1.GqlQuery) queryType_).toBuilder();
- }
- queryType_ =
- input.readMessage(com.google.datastore.v1.GqlQuery.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.GqlQuery) queryType_);
- queryType_ = subBuilder.buildPartial();
- }
- queryTypeCase_ = 7;
- break;
- }
- case 66:
- {
- java.lang.String s = input.readStringRequireUtf8();
-
- projectId_ = s;
- break;
- }
- case 74:
- {
- java.lang.String s = input.readStringRequireUtf8();
-
- databaseId_ = s;
- break;
- }
- default:
- {
- if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_RunQueryRequest_descriptor;
@@ -571,7 +456,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_);
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -602,7 +487,7 @@ public int getSerializedSize() {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_);
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -638,7 +523,7 @@ public boolean equals(final java.lang.Object obj) {
case 0:
default:
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -673,7 +558,7 @@ public int hashCode() {
case 0:
default:
}
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -802,17 +687,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
}
// Construct using com.google.datastore.v1.RunQueryRequest.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
@@ -834,6 +712,12 @@ public Builder clear() {
readOptions_ = null;
readOptionsBuilder_ = null;
}
+ if (queryBuilder_ != null) {
+ queryBuilder_.clear();
+ }
+ if (gqlQueryBuilder_ != null) {
+ gqlQueryBuilder_.clear();
+ }
queryTypeCase_ = 0;
queryType_ = null;
return this;
@@ -969,7 +853,7 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryRequest other) {
break;
}
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -984,17 +868,67 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.datastore.v1.RunQueryRequest parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ input.readMessage(getReadOptionsFieldBuilder().getBuilder(), extensionRegistry);
+
+ break;
+ } // case 10
+ case 18:
+ {
+ input.readMessage(getPartitionIdFieldBuilder().getBuilder(), extensionRegistry);
+
+ break;
+ } // case 18
+ case 26:
+ {
+ input.readMessage(getQueryFieldBuilder().getBuilder(), extensionRegistry);
+ queryTypeCase_ = 3;
+ break;
+ } // case 26
+ case 58:
+ {
+ input.readMessage(getGqlQueryFieldBuilder().getBuilder(), extensionRegistry);
+ queryTypeCase_ = 7;
+ break;
+ } // case 58
+ case 66:
+ {
+ projectId_ = input.readStringRequireUtf8();
+
+ break;
+ } // case 66
+ case 74:
+ {
+ databaseId_ = input.readStringRequireUtf8();
+
+ break;
+ } // case 74
+ 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) {
- parsedMessage = (com.google.datastore.v1.RunQueryRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
@@ -2076,7 +2010,18 @@ public RunQueryRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new RunQueryRequest(input, extensionRegistry);
+ 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();
}
};
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java
index cc025af6b..0eb1eb818 100644
--- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java
@@ -50,75 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
- private RunQueryResponse(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10:
- {
- com.google.datastore.v1.QueryResultBatch.Builder subBuilder = null;
- if (batch_ != null) {
- subBuilder = batch_.toBuilder();
- }
- batch_ =
- input.readMessage(
- com.google.datastore.v1.QueryResultBatch.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(batch_);
- batch_ = subBuilder.buildPartial();
- }
-
- break;
- }
- case 18:
- {
- com.google.datastore.v1.Query.Builder subBuilder = null;
- if (query_ != null) {
- subBuilder = query_.toBuilder();
- }
- query_ = input.readMessage(com.google.datastore.v1.Query.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(query_);
- query_ = subBuilder.buildPartial();
- }
-
- break;
- }
- default:
- {
- if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_RunQueryResponse_descriptor;
@@ -246,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (query_ != null) {
output.writeMessage(2, getQuery());
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -261,7 +192,7 @@ public int getSerializedSize() {
if (query_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuery());
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -284,7 +215,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasQuery()) {
if (!getQuery().equals(other.getQuery())) return false;
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -303,7 +234,7 @@ public int hashCode() {
hash = (37 * hash) + QUERY_FIELD_NUMBER;
hash = (53 * hash) + getQuery().hashCode();
}
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -432,17 +363,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
}
// Construct using com.google.datastore.v1.RunQueryResponse.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
@@ -552,7 +476,7 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryResponse other) {
if (other.hasQuery()) {
mergeQuery(other.getQuery());
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -567,17 +491,43 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.datastore.v1.RunQueryResponse parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ input.readMessage(getBatchFieldBuilder().getBuilder(), extensionRegistry);
+
+ break;
+ } // case 10
+ case 18:
+ {
+ input.readMessage(getQueryFieldBuilder().getBuilder(), extensionRegistry);
+
+ 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) {
- parsedMessage = (com.google.datastore.v1.RunQueryResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
@@ -976,7 +926,18 @@ public RunQueryResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new RunQueryResponse(input, extensionRegistry);
+ 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();
}
};
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/TransactionOptions.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/TransactionOptions.java
index 27a3efa73..fc965df9d 100644
--- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/TransactionOptions.java
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/TransactionOptions.java
@@ -53,81 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
- private TransactionOptions(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10:
- {
- com.google.datastore.v1.TransactionOptions.ReadWrite.Builder subBuilder = null;
- if (modeCase_ == 1) {
- subBuilder =
- ((com.google.datastore.v1.TransactionOptions.ReadWrite) mode_).toBuilder();
- }
- mode_ =
- input.readMessage(
- com.google.datastore.v1.TransactionOptions.ReadWrite.parser(),
- extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.TransactionOptions.ReadWrite) mode_);
- mode_ = subBuilder.buildPartial();
- }
- modeCase_ = 1;
- break;
- }
- case 18:
- {
- com.google.datastore.v1.TransactionOptions.ReadOnly.Builder subBuilder = null;
- if (modeCase_ == 2) {
- subBuilder =
- ((com.google.datastore.v1.TransactionOptions.ReadOnly) mode_).toBuilder();
- }
- mode_ =
- input.readMessage(
- com.google.datastore.v1.TransactionOptions.ReadOnly.parser(),
- extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.TransactionOptions.ReadOnly) mode_);
- mode_ = subBuilder.buildPartial();
- }
- modeCase_ = 2;
- break;
- }
- default:
- {
- if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_TransactionOptions_descriptor;
@@ -195,50 +120,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
- private ReadWrite(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10:
- {
- previousTransaction_ = input.readBytes();
- break;
- }
- default:
- {
- if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_TransactionOptions_ReadWrite_descriptor;
@@ -289,7 +170,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!previousTransaction_.isEmpty()) {
output.writeBytes(1, previousTransaction_);
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -301,7 +182,7 @@ public int getSerializedSize() {
if (!previousTransaction_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, previousTransaction_);
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -318,7 +199,7 @@ public boolean equals(final java.lang.Object obj) {
(com.google.datastore.v1.TransactionOptions.ReadWrite) obj;
if (!getPreviousTransaction().equals(other.getPreviousTransaction())) return false;
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -331,7 +212,7 @@ public int hashCode() {
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + PREVIOUS_TRANSACTION_FIELD_NUMBER;
hash = (53 * hash) + getPreviousTransaction().hashCode();
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -463,17 +344,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
}
// Construct using com.google.datastore.v1.TransactionOptions.ReadWrite.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
@@ -564,7 +438,7 @@ public Builder mergeFrom(com.google.datastore.v1.TransactionOptions.ReadWrite ot
if (other.getPreviousTransaction() != com.google.protobuf.ByteString.EMPTY) {
setPreviousTransaction(other.getPreviousTransaction());
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -579,18 +453,37 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.datastore.v1.TransactionOptions.ReadWrite parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ previousTransaction_ = input.readBytes();
+
+ 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) {
- parsedMessage =
- (com.google.datastore.v1.TransactionOptions.ReadWrite) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
@@ -683,7 +576,19 @@ public ReadWrite parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new ReadWrite(input, extensionRegistry);
+ 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();
}
};
@@ -777,60 +682,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
- private ReadOnly(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10:
- {
- com.google.protobuf.Timestamp.Builder subBuilder = null;
- if (readTime_ != null) {
- subBuilder = readTime_.toBuilder();
- }
- readTime_ =
- input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(readTime_);
- readTime_ = subBuilder.buildPartial();
- }
-
- break;
- }
- default:
- {
- if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_TransactionOptions_ReadOnly_descriptor;
@@ -912,7 +763,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (readTime_ != null) {
output.writeMessage(1, getReadTime());
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -924,7 +775,7 @@ public int getSerializedSize() {
if (readTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReadTime());
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -944,7 +795,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasReadTime()) {
if (!getReadTime().equals(other.getReadTime())) return false;
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -959,7 +810,7 @@ public int hashCode() {
hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
hash = (53 * hash) + getReadTime().hashCode();
}
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -1091,17 +942,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
}
// Construct using com.google.datastore.v1.TransactionOptions.ReadOnly.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
@@ -1200,7 +1044,7 @@ public Builder mergeFrom(com.google.datastore.v1.TransactionOptions.ReadOnly oth
if (other.hasReadTime()) {
mergeReadTime(other.getReadTime());
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -1215,18 +1059,37 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.datastore.v1.TransactionOptions.ReadOnly parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ input.readMessage(getReadTimeFieldBuilder().getBuilder(), extensionRegistry);
+
+ 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) {
- parsedMessage =
- (com.google.datastore.v1.TransactionOptions.ReadOnly) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
@@ -1451,7 +1314,19 @@ public ReadOnly parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new ReadOnly(input, extensionRegistry);
+ 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();
}
};
@@ -1639,7 +1514,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (modeCase_ == 2) {
output.writeMessage(2, (com.google.datastore.v1.TransactionOptions.ReadOnly) mode_);
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -1658,7 +1533,7 @@ public int getSerializedSize() {
com.google.protobuf.CodedOutputStream.computeMessageSize(
2, (com.google.datastore.v1.TransactionOptions.ReadOnly) mode_);
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -1685,7 +1560,7 @@ public boolean equals(final java.lang.Object obj) {
case 0:
default:
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -1708,7 +1583,7 @@ public int hashCode() {
case 0:
default:
}
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -1840,22 +1715,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
}
// Construct using com.google.datastore.v1.TransactionOptions.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
+ if (readWriteBuilder_ != null) {
+ readWriteBuilder_.clear();
+ }
+ if (readOnlyBuilder_ != null) {
+ readOnlyBuilder_.clear();
+ }
modeCase_ = 0;
mode_ = null;
return this;
@@ -1965,7 +1839,7 @@ public Builder mergeFrom(com.google.datastore.v1.TransactionOptions other) {
break;
}
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -1980,17 +1854,43 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.datastore.v1.TransactionOptions parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10:
+ {
+ input.readMessage(getReadWriteFieldBuilder().getBuilder(), extensionRegistry);
+ modeCase_ = 1;
+ break;
+ } // case 10
+ case 18:
+ {
+ input.readMessage(getReadOnlyFieldBuilder().getBuilder(), extensionRegistry);
+ modeCase_ = 2;
+ 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) {
- parsedMessage = (com.google.datastore.v1.TransactionOptions) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
@@ -2460,7 +2360,18 @@ public TransactionOptions parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new TransactionOptions(input, extensionRegistry);
+ 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();
}
};
diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Value.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Value.java
index 9c1dc9ae8..e4168166a 100644
--- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Value.java
+++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Value.java
@@ -51,167 +51,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
- private Value(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 8:
- {
- valueType_ = input.readBool();
- valueTypeCase_ = 1;
- break;
- }
- case 16:
- {
- valueType_ = input.readInt64();
- valueTypeCase_ = 2;
- break;
- }
- case 25:
- {
- valueType_ = input.readDouble();
- valueTypeCase_ = 3;
- break;
- }
- case 42:
- {
- com.google.datastore.v1.Key.Builder subBuilder = null;
- if (valueTypeCase_ == 5) {
- subBuilder = ((com.google.datastore.v1.Key) valueType_).toBuilder();
- }
- valueType_ =
- input.readMessage(com.google.datastore.v1.Key.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.Key) valueType_);
- valueType_ = subBuilder.buildPartial();
- }
- valueTypeCase_ = 5;
- break;
- }
- case 50:
- {
- com.google.datastore.v1.Entity.Builder subBuilder = null;
- if (valueTypeCase_ == 6) {
- subBuilder = ((com.google.datastore.v1.Entity) valueType_).toBuilder();
- }
- valueType_ =
- input.readMessage(com.google.datastore.v1.Entity.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.Entity) valueType_);
- valueType_ = subBuilder.buildPartial();
- }
- valueTypeCase_ = 6;
- break;
- }
- case 66:
- {
- com.google.type.LatLng.Builder subBuilder = null;
- if (valueTypeCase_ == 8) {
- subBuilder = ((com.google.type.LatLng) valueType_).toBuilder();
- }
- valueType_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.type.LatLng) valueType_);
- valueType_ = subBuilder.buildPartial();
- }
- valueTypeCase_ = 8;
- break;
- }
- case 74:
- {
- com.google.datastore.v1.ArrayValue.Builder subBuilder = null;
- if (valueTypeCase_ == 9) {
- subBuilder = ((com.google.datastore.v1.ArrayValue) valueType_).toBuilder();
- }
- valueType_ =
- input.readMessage(com.google.datastore.v1.ArrayValue.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.datastore.v1.ArrayValue) valueType_);
- valueType_ = subBuilder.buildPartial();
- }
- valueTypeCase_ = 9;
- break;
- }
- case 82:
- {
- com.google.protobuf.Timestamp.Builder subBuilder = null;
- if (valueTypeCase_ == 10) {
- subBuilder = ((com.google.protobuf.Timestamp) valueType_).toBuilder();
- }
- valueType_ =
- input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom((com.google.protobuf.Timestamp) valueType_);
- valueType_ = subBuilder.buildPartial();
- }
- valueTypeCase_ = 10;
- break;
- }
- case 88:
- {
- int rawValue = input.readEnum();
- valueTypeCase_ = 11;
- valueType_ = rawValue;
- break;
- }
- case 112:
- {
- meaning_ = input.readInt32();
- break;
- }
- case 138:
- {
- java.lang.String s = input.readStringRequireUtf8();
- valueTypeCase_ = 17;
- valueType_ = s;
- break;
- }
- case 146:
- {
- valueType_ = input.readBytes();
- valueTypeCase_ = 18;
- break;
- }
- case 152:
- {
- excludeFromIndexes_ = input.readBool();
- break;
- }
- default:
- {
- if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.EntityProto.internal_static_google_datastore_v1_Value_descriptor;
}
@@ -943,7 +782,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (excludeFromIndexes_ != false) {
output.writeBool(19, excludeFromIndexes_);
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -1011,7 +850,7 @@ public int getSerializedSize() {
if (excludeFromIndexes_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, excludeFromIndexes_);
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -1067,7 +906,7 @@ public boolean equals(final java.lang.Object obj) {
case 0:
default:
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -1133,7 +972,7 @@ public int hashCode() {
case 0:
default:
}
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -1261,22 +1100,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
}
// Construct using com.google.datastore.v1.Value.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
+ if (timestampValueBuilder_ != null) {
+ timestampValueBuilder_.clear();
+ }
+ if (keyValueBuilder_ != null) {
+ keyValueBuilder_.clear();
+ }
+ if (geoPointValueBuilder_ != null) {
+ geoPointValueBuilder_.clear();
+ }
+ if (entityValueBuilder_ != null) {
+ entityValueBuilder_.clear();
+ }
+ if (arrayValueBuilder_ != null) {
+ arrayValueBuilder_.clear();
+ }
meaning_ = 0;
excludeFromIndexes_ = false;
@@ -1483,7 +1330,7 @@ public Builder mergeFrom(com.google.datastore.v1.Value other) {
break;
}
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -1498,17 +1345,111 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.datastore.v1.Value parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8:
+ {
+ valueType_ = input.readBool();
+ valueTypeCase_ = 1;
+ break;
+ } // case 8
+ case 16:
+ {
+ valueType_ = input.readInt64();
+ valueTypeCase_ = 2;
+ break;
+ } // case 16
+ case 25:
+ {
+ valueType_ = input.readDouble();
+ valueTypeCase_ = 3;
+ break;
+ } // case 25
+ case 42:
+ {
+ input.readMessage(getKeyValueFieldBuilder().getBuilder(), extensionRegistry);
+ valueTypeCase_ = 5;
+ break;
+ } // case 42
+ case 50:
+ {
+ input.readMessage(getEntityValueFieldBuilder().getBuilder(), extensionRegistry);
+ valueTypeCase_ = 6;
+ break;
+ } // case 50
+ case 66:
+ {
+ input.readMessage(getGeoPointValueFieldBuilder().getBuilder(), extensionRegistry);
+ valueTypeCase_ = 8;
+ break;
+ } // case 66
+ case 74:
+ {
+ input.readMessage(getArrayValueFieldBuilder().getBuilder(), extensionRegistry);
+ valueTypeCase_ = 9;
+ break;
+ } // case 74
+ case 82:
+ {
+ input.readMessage(getTimestampValueFieldBuilder().getBuilder(), extensionRegistry);
+ valueTypeCase_ = 10;
+ break;
+ } // case 82
+ case 88:
+ {
+ int rawValue = input.readEnum();
+ valueTypeCase_ = 11;
+ valueType_ = rawValue;
+ break;
+ } // case 88
+ case 112:
+ {
+ meaning_ = input.readInt32();
+
+ break;
+ } // case 112
+ case 138:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+ valueTypeCase_ = 17;
+ valueType_ = s;
+ break;
+ } // case 138
+ case 146:
+ {
+ valueType_ = input.readBytes();
+ valueTypeCase_ = 18;
+ break;
+ } // case 146
+ case 152:
+ {
+ excludeFromIndexes_ = input.readBool();
+
+ break;
+ } // case 152
+ 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) {
- parsedMessage = (com.google.datastore.v1.Value) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
@@ -3312,7 +3253,18 @@ public Value parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new Value(input, extensionRegistry);
+ 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();
}
};
diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/aggregation_result.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/aggregation_result.proto
new file mode 100644
index 000000000..e9c1d4940
--- /dev/null
+++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/aggregation_result.proto
@@ -0,0 +1,61 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://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.
+
+syntax = "proto3";
+
+package google.datastore.v1;
+
+import "google/datastore/v1/entity.proto";
+import "google/datastore/v1/query.proto";
+import "google/protobuf/timestamp.proto";
+
+option csharp_namespace = "Google.Cloud.Datastore.V1";
+option go_package = "google.golang.org/genproto/googleapis/datastore/v1;datastore";
+option java_multiple_files = true;
+option java_outer_classname = "AggregationResultProto";
+option java_package = "com.google.datastore.v1";
+option php_namespace = "Google\\Cloud\\Datastore\\V1";
+option ruby_package = "Google::Cloud::Datastore::V1";
+
+// The result of a single bucket from a Datastore aggregation query.
+//
+// The keys of `aggregate_properties` are the same for all results in an
+// aggregation query, unlike entity queries which can have different fields
+// present for each result.
+message AggregationResult {
+ // The result of the aggregation functions, ex: `COUNT(*) AS total_entities`.
+ //
+ // The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias]
+ // assigned to the aggregation function on input and the size of this map
+ // equals the number of aggregation functions in the query.
+ map