diff --git a/pom.xml b/pom.xml index 1111a5f4a..dbbec97fe 100644 --- a/pom.xml +++ b/pom.xml @@ -209,6 +209,7 @@ proto-google-cloud-firestore-admin-v1 proto-google-cloud-firestore-v1 + proto-google-cloud-firestore-bundle-v1 grpc-google-cloud-firestore-admin-v1 grpc-google-cloud-firestore-v1 google-cloud-firestore-admin diff --git a/proto-google-cloud-firestore-bundle-v1/pom.xml b/proto-google-cloud-firestore-bundle-v1/pom.xml new file mode 100644 index 000000000..6c4103c4e --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + proto-google-cloud-firestore-bundle-v1 + 2.0.1-SNAPSHOT + + proto-google-cloud-firestore-bundle-v1 + PROTO library for proto-google-cloud-firestore-bundle-v1 + + com.google.cloud + google-cloud-firestore-parent + 2.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api.grpc + proto-google-cloud-firestore-v1 + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleElement.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleElement.java new file mode 100644 index 000000000..9b3161d30 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleElement.java @@ -0,0 +1,1406 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +/** + * + * + *
+ * A Firestore bundle is a length-prefixed stream of JSON representations of
+ * `BundleElement`.
+ * Only one `BundleMetadata` is expected, and it should be the first element.
+ * The named queries follow after `metadata`. Every `document_metadata` is
+ * immediately followed by a `document`.
+ * 
+ * + * Protobuf type {@code firestore.BundleElement} + */ +public final class BundleElement extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:firestore.BundleElement) + BundleElementOrBuilder { + private static final long serialVersionUID = 0L; + // Use BundleElement.newBuilder() to construct. + private BundleElement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BundleElement() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BundleElement(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BundleElement( + 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.firestore.proto.BundleMetadata.Builder subBuilder = null; + if (elementTypeCase_ == 1) { + subBuilder = ((com.google.firestore.proto.BundleMetadata) elementType_).toBuilder(); + } + elementType_ = + input.readMessage( + com.google.firestore.proto.BundleMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.proto.BundleMetadata) elementType_); + elementType_ = subBuilder.buildPartial(); + } + elementTypeCase_ = 1; + break; + } + case 18: + { + com.google.firestore.proto.NamedQuery.Builder subBuilder = null; + if (elementTypeCase_ == 2) { + subBuilder = ((com.google.firestore.proto.NamedQuery) elementType_).toBuilder(); + } + elementType_ = + input.readMessage( + com.google.firestore.proto.NamedQuery.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.proto.NamedQuery) elementType_); + elementType_ = subBuilder.buildPartial(); + } + elementTypeCase_ = 2; + break; + } + case 26: + { + com.google.firestore.proto.BundledDocumentMetadata.Builder subBuilder = null; + if (elementTypeCase_ == 3) { + subBuilder = + ((com.google.firestore.proto.BundledDocumentMetadata) elementType_).toBuilder(); + } + elementType_ = + input.readMessage( + com.google.firestore.proto.BundledDocumentMetadata.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.proto.BundledDocumentMetadata) elementType_); + elementType_ = subBuilder.buildPartial(); + } + elementTypeCase_ = 3; + break; + } + case 34: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (elementTypeCase_ == 4) { + subBuilder = ((com.google.firestore.v1.Document) elementType_).toBuilder(); + } + elementType_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Document) elementType_); + elementType_ = subBuilder.buildPartial(); + } + elementTypeCase_ = 4; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.firestore.proto.BundleProto + .internal_static_firestore_BundleElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundleElement.class, + com.google.firestore.proto.BundleElement.Builder.class); + } + + private int elementTypeCase_ = 0; + private java.lang.Object elementType_; + + public enum ElementTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + METADATA(1), + NAMED_QUERY(2), + DOCUMENT_METADATA(3), + DOCUMENT(4), + ELEMENTTYPE_NOT_SET(0); + private final int value; + + private ElementTypeCase(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 ElementTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ElementTypeCase forNumber(int value) { + switch (value) { + case 1: + return METADATA; + case 2: + return NAMED_QUERY; + case 3: + return DOCUMENT_METADATA; + case 4: + return DOCUMENT; + case 0: + return ELEMENTTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ElementTypeCase getElementTypeCase() { + return ElementTypeCase.forNumber(elementTypeCase_); + } + + public static final int METADATA_FIELD_NUMBER = 1; + /** + * .firestore.BundleMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return elementTypeCase_ == 1; + } + /** + * .firestore.BundleMetadata metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.firestore.proto.BundleMetadata getMetadata() { + if (elementTypeCase_ == 1) { + return (com.google.firestore.proto.BundleMetadata) elementType_; + } + return com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } + /** .firestore.BundleMetadata metadata = 1; */ + @java.lang.Override + public com.google.firestore.proto.BundleMetadataOrBuilder getMetadataOrBuilder() { + if (elementTypeCase_ == 1) { + return (com.google.firestore.proto.BundleMetadata) elementType_; + } + return com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } + + public static final int NAMED_QUERY_FIELD_NUMBER = 2; + /** + * .firestore.NamedQuery named_query = 2; + * + * @return Whether the namedQuery field is set. + */ + @java.lang.Override + public boolean hasNamedQuery() { + return elementTypeCase_ == 2; + } + /** + * .firestore.NamedQuery named_query = 2; + * + * @return The namedQuery. + */ + @java.lang.Override + public com.google.firestore.proto.NamedQuery getNamedQuery() { + if (elementTypeCase_ == 2) { + return (com.google.firestore.proto.NamedQuery) elementType_; + } + return com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } + /** .firestore.NamedQuery named_query = 2; */ + @java.lang.Override + public com.google.firestore.proto.NamedQueryOrBuilder getNamedQueryOrBuilder() { + if (elementTypeCase_ == 2) { + return (com.google.firestore.proto.NamedQuery) elementType_; + } + return com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } + + public static final int DOCUMENT_METADATA_FIELD_NUMBER = 3; + /** + * .firestore.BundledDocumentMetadata document_metadata = 3; + * + * @return Whether the documentMetadata field is set. + */ + @java.lang.Override + public boolean hasDocumentMetadata() { + return elementTypeCase_ == 3; + } + /** + * .firestore.BundledDocumentMetadata document_metadata = 3; + * + * @return The documentMetadata. + */ + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadata getDocumentMetadata() { + if (elementTypeCase_ == 3) { + return (com.google.firestore.proto.BundledDocumentMetadata) elementType_; + } + return com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadataOrBuilder + getDocumentMetadataOrBuilder() { + if (elementTypeCase_ == 3) { + return (com.google.firestore.proto.BundledDocumentMetadata) elementType_; + } + return com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } + + public static final int DOCUMENT_FIELD_NUMBER = 4; + /** + * .google.firestore.v1.Document document = 4; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return elementTypeCase_ == 4; + } + /** + * .google.firestore.v1.Document document = 4; + * + * @return The document. + */ + @java.lang.Override + public com.google.firestore.v1.Document getDocument() { + if (elementTypeCase_ == 4) { + return (com.google.firestore.v1.Document) elementType_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + /** .google.firestore.v1.Document document = 4; */ + @java.lang.Override + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (elementTypeCase_ == 4) { + return (com.google.firestore.v1.Document) elementType_; + } + return com.google.firestore.v1.Document.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 (elementTypeCase_ == 1) { + output.writeMessage(1, (com.google.firestore.proto.BundleMetadata) elementType_); + } + if (elementTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.proto.NamedQuery) elementType_); + } + if (elementTypeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.proto.BundledDocumentMetadata) elementType_); + } + if (elementTypeCase_ == 4) { + output.writeMessage(4, (com.google.firestore.v1.Document) elementType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (elementTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.firestore.proto.BundleMetadata) elementType_); + } + if (elementTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.proto.NamedQuery) elementType_); + } + if (elementTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.proto.BundledDocumentMetadata) elementType_); + } + if (elementTypeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.firestore.v1.Document) elementType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.proto.BundleElement)) { + return super.equals(obj); + } + com.google.firestore.proto.BundleElement other = (com.google.firestore.proto.BundleElement) obj; + + if (!getElementTypeCase().equals(other.getElementTypeCase())) return false; + switch (elementTypeCase_) { + case 1: + if (!getMetadata().equals(other.getMetadata())) return false; + break; + case 2: + if (!getNamedQuery().equals(other.getNamedQuery())) return false; + break; + case 3: + if (!getDocumentMetadata().equals(other.getDocumentMetadata())) return false; + break; + case 4: + if (!getDocument().equals(other.getDocument())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (elementTypeCase_) { + case 1: + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + break; + case 2: + hash = (37 * hash) + NAMED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getNamedQuery().hashCode(); + break; + case 3: + hash = (37 * hash) + DOCUMENT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentMetadata().hashCode(); + break; + case 4: + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.proto.BundleElement parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundleElement parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundleElement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundleElement 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.firestore.proto.BundleElement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundleElement parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundleElement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundleElement 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.firestore.proto.BundleElement parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundleElement 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.firestore.proto.BundleElement parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundleElement 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.firestore.proto.BundleElement 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 Firestore bundle is a length-prefixed stream of JSON representations of
+   * `BundleElement`.
+   * Only one `BundleMetadata` is expected, and it should be the first element.
+   * The named queries follow after `metadata`. Every `document_metadata` is
+   * immediately followed by a `document`.
+   * 
+ * + * Protobuf type {@code firestore.BundleElement} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:firestore.BundleElement) + com.google.firestore.proto.BundleElementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundleElement.class, + com.google.firestore.proto.BundleElement.Builder.class); + } + + // Construct using com.google.firestore.proto.BundleElement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + elementTypeCase_ = 0; + elementType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleElement_descriptor; + } + + @java.lang.Override + public com.google.firestore.proto.BundleElement getDefaultInstanceForType() { + return com.google.firestore.proto.BundleElement.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.proto.BundleElement build() { + com.google.firestore.proto.BundleElement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.proto.BundleElement buildPartial() { + com.google.firestore.proto.BundleElement result = + new com.google.firestore.proto.BundleElement(this); + if (elementTypeCase_ == 1) { + if (metadataBuilder_ == null) { + result.elementType_ = elementType_; + } else { + result.elementType_ = metadataBuilder_.build(); + } + } + if (elementTypeCase_ == 2) { + if (namedQueryBuilder_ == null) { + result.elementType_ = elementType_; + } else { + result.elementType_ = namedQueryBuilder_.build(); + } + } + if (elementTypeCase_ == 3) { + if (documentMetadataBuilder_ == null) { + result.elementType_ = elementType_; + } else { + result.elementType_ = documentMetadataBuilder_.build(); + } + } + if (elementTypeCase_ == 4) { + if (documentBuilder_ == null) { + result.elementType_ = elementType_; + } else { + result.elementType_ = documentBuilder_.build(); + } + } + result.elementTypeCase_ = elementTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.proto.BundleElement) { + return mergeFrom((com.google.firestore.proto.BundleElement) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.proto.BundleElement other) { + if (other == com.google.firestore.proto.BundleElement.getDefaultInstance()) return this; + switch (other.getElementTypeCase()) { + case METADATA: + { + mergeMetadata(other.getMetadata()); + break; + } + case NAMED_QUERY: + { + mergeNamedQuery(other.getNamedQuery()); + break; + } + case DOCUMENT_METADATA: + { + mergeDocumentMetadata(other.getDocumentMetadata()); + break; + } + case DOCUMENT: + { + mergeDocument(other.getDocument()); + break; + } + case ELEMENTTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.proto.BundleElement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.proto.BundleElement) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int elementTypeCase_ = 0; + private java.lang.Object elementType_; + + public ElementTypeCase getElementTypeCase() { + return ElementTypeCase.forNumber(elementTypeCase_); + } + + public Builder clearElementType() { + elementTypeCase_ = 0; + elementType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundleMetadata, + com.google.firestore.proto.BundleMetadata.Builder, + com.google.firestore.proto.BundleMetadataOrBuilder> + metadataBuilder_; + /** + * .firestore.BundleMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return elementTypeCase_ == 1; + } + /** + * .firestore.BundleMetadata metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.firestore.proto.BundleMetadata getMetadata() { + if (metadataBuilder_ == null) { + if (elementTypeCase_ == 1) { + return (com.google.firestore.proto.BundleMetadata) elementType_; + } + return com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } else { + if (elementTypeCase_ == 1) { + return metadataBuilder_.getMessage(); + } + return com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } + } + /** .firestore.BundleMetadata metadata = 1; */ + public Builder setMetadata(com.google.firestore.proto.BundleMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elementType_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + elementTypeCase_ = 1; + return this; + } + /** .firestore.BundleMetadata metadata = 1; */ + public Builder setMetadata(com.google.firestore.proto.BundleMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + elementType_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + elementTypeCase_ = 1; + return this; + } + /** .firestore.BundleMetadata metadata = 1; */ + public Builder mergeMetadata(com.google.firestore.proto.BundleMetadata value) { + if (metadataBuilder_ == null) { + if (elementTypeCase_ == 1 + && elementType_ != com.google.firestore.proto.BundleMetadata.getDefaultInstance()) { + elementType_ = + com.google.firestore.proto.BundleMetadata.newBuilder( + (com.google.firestore.proto.BundleMetadata) elementType_) + .mergeFrom(value) + .buildPartial(); + } else { + elementType_ = value; + } + onChanged(); + } else { + if (elementTypeCase_ == 1) { + metadataBuilder_.mergeFrom(value); + } + metadataBuilder_.setMessage(value); + } + elementTypeCase_ = 1; + return this; + } + /** .firestore.BundleMetadata metadata = 1; */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + if (elementTypeCase_ == 1) { + elementTypeCase_ = 0; + elementType_ = null; + onChanged(); + } + } else { + if (elementTypeCase_ == 1) { + elementTypeCase_ = 0; + elementType_ = null; + } + metadataBuilder_.clear(); + } + return this; + } + /** .firestore.BundleMetadata metadata = 1; */ + public com.google.firestore.proto.BundleMetadata.Builder getMetadataBuilder() { + return getMetadataFieldBuilder().getBuilder(); + } + /** .firestore.BundleMetadata metadata = 1; */ + @java.lang.Override + public com.google.firestore.proto.BundleMetadataOrBuilder getMetadataOrBuilder() { + if ((elementTypeCase_ == 1) && (metadataBuilder_ != null)) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + if (elementTypeCase_ == 1) { + return (com.google.firestore.proto.BundleMetadata) elementType_; + } + return com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } + } + /** .firestore.BundleMetadata metadata = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundleMetadata, + com.google.firestore.proto.BundleMetadata.Builder, + com.google.firestore.proto.BundleMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + if (!(elementTypeCase_ == 1)) { + elementType_ = com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundleMetadata, + com.google.firestore.proto.BundleMetadata.Builder, + com.google.firestore.proto.BundleMetadataOrBuilder>( + (com.google.firestore.proto.BundleMetadata) elementType_, + getParentForChildren(), + isClean()); + elementType_ = null; + } + elementTypeCase_ = 1; + onChanged(); + ; + return metadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.NamedQuery, + com.google.firestore.proto.NamedQuery.Builder, + com.google.firestore.proto.NamedQueryOrBuilder> + namedQueryBuilder_; + /** + * .firestore.NamedQuery named_query = 2; + * + * @return Whether the namedQuery field is set. + */ + @java.lang.Override + public boolean hasNamedQuery() { + return elementTypeCase_ == 2; + } + /** + * .firestore.NamedQuery named_query = 2; + * + * @return The namedQuery. + */ + @java.lang.Override + public com.google.firestore.proto.NamedQuery getNamedQuery() { + if (namedQueryBuilder_ == null) { + if (elementTypeCase_ == 2) { + return (com.google.firestore.proto.NamedQuery) elementType_; + } + return com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } else { + if (elementTypeCase_ == 2) { + return namedQueryBuilder_.getMessage(); + } + return com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } + } + /** .firestore.NamedQuery named_query = 2; */ + public Builder setNamedQuery(com.google.firestore.proto.NamedQuery value) { + if (namedQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elementType_ = value; + onChanged(); + } else { + namedQueryBuilder_.setMessage(value); + } + elementTypeCase_ = 2; + return this; + } + /** .firestore.NamedQuery named_query = 2; */ + public Builder setNamedQuery(com.google.firestore.proto.NamedQuery.Builder builderForValue) { + if (namedQueryBuilder_ == null) { + elementType_ = builderForValue.build(); + onChanged(); + } else { + namedQueryBuilder_.setMessage(builderForValue.build()); + } + elementTypeCase_ = 2; + return this; + } + /** .firestore.NamedQuery named_query = 2; */ + public Builder mergeNamedQuery(com.google.firestore.proto.NamedQuery value) { + if (namedQueryBuilder_ == null) { + if (elementTypeCase_ == 2 + && elementType_ != com.google.firestore.proto.NamedQuery.getDefaultInstance()) { + elementType_ = + com.google.firestore.proto.NamedQuery.newBuilder( + (com.google.firestore.proto.NamedQuery) elementType_) + .mergeFrom(value) + .buildPartial(); + } else { + elementType_ = value; + } + onChanged(); + } else { + if (elementTypeCase_ == 2) { + namedQueryBuilder_.mergeFrom(value); + } + namedQueryBuilder_.setMessage(value); + } + elementTypeCase_ = 2; + return this; + } + /** .firestore.NamedQuery named_query = 2; */ + public Builder clearNamedQuery() { + if (namedQueryBuilder_ == null) { + if (elementTypeCase_ == 2) { + elementTypeCase_ = 0; + elementType_ = null; + onChanged(); + } + } else { + if (elementTypeCase_ == 2) { + elementTypeCase_ = 0; + elementType_ = null; + } + namedQueryBuilder_.clear(); + } + return this; + } + /** .firestore.NamedQuery named_query = 2; */ + public com.google.firestore.proto.NamedQuery.Builder getNamedQueryBuilder() { + return getNamedQueryFieldBuilder().getBuilder(); + } + /** .firestore.NamedQuery named_query = 2; */ + @java.lang.Override + public com.google.firestore.proto.NamedQueryOrBuilder getNamedQueryOrBuilder() { + if ((elementTypeCase_ == 2) && (namedQueryBuilder_ != null)) { + return namedQueryBuilder_.getMessageOrBuilder(); + } else { + if (elementTypeCase_ == 2) { + return (com.google.firestore.proto.NamedQuery) elementType_; + } + return com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } + } + /** .firestore.NamedQuery named_query = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.NamedQuery, + com.google.firestore.proto.NamedQuery.Builder, + com.google.firestore.proto.NamedQueryOrBuilder> + getNamedQueryFieldBuilder() { + if (namedQueryBuilder_ == null) { + if (!(elementTypeCase_ == 2)) { + elementType_ = com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } + namedQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.NamedQuery, + com.google.firestore.proto.NamedQuery.Builder, + com.google.firestore.proto.NamedQueryOrBuilder>( + (com.google.firestore.proto.NamedQuery) elementType_, + getParentForChildren(), + isClean()); + elementType_ = null; + } + elementTypeCase_ = 2; + onChanged(); + ; + return namedQueryBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundledDocumentMetadata, + com.google.firestore.proto.BundledDocumentMetadata.Builder, + com.google.firestore.proto.BundledDocumentMetadataOrBuilder> + documentMetadataBuilder_; + /** + * .firestore.BundledDocumentMetadata document_metadata = 3; + * + * @return Whether the documentMetadata field is set. + */ + @java.lang.Override + public boolean hasDocumentMetadata() { + return elementTypeCase_ == 3; + } + /** + * .firestore.BundledDocumentMetadata document_metadata = 3; + * + * @return The documentMetadata. + */ + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadata getDocumentMetadata() { + if (documentMetadataBuilder_ == null) { + if (elementTypeCase_ == 3) { + return (com.google.firestore.proto.BundledDocumentMetadata) elementType_; + } + return com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } else { + if (elementTypeCase_ == 3) { + return documentMetadataBuilder_.getMessage(); + } + return com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + public Builder setDocumentMetadata(com.google.firestore.proto.BundledDocumentMetadata value) { + if (documentMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elementType_ = value; + onChanged(); + } else { + documentMetadataBuilder_.setMessage(value); + } + elementTypeCase_ = 3; + return this; + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + public Builder setDocumentMetadata( + com.google.firestore.proto.BundledDocumentMetadata.Builder builderForValue) { + if (documentMetadataBuilder_ == null) { + elementType_ = builderForValue.build(); + onChanged(); + } else { + documentMetadataBuilder_.setMessage(builderForValue.build()); + } + elementTypeCase_ = 3; + return this; + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + public Builder mergeDocumentMetadata(com.google.firestore.proto.BundledDocumentMetadata value) { + if (documentMetadataBuilder_ == null) { + if (elementTypeCase_ == 3 + && elementType_ + != com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance()) { + elementType_ = + com.google.firestore.proto.BundledDocumentMetadata.newBuilder( + (com.google.firestore.proto.BundledDocumentMetadata) elementType_) + .mergeFrom(value) + .buildPartial(); + } else { + elementType_ = value; + } + onChanged(); + } else { + if (elementTypeCase_ == 3) { + documentMetadataBuilder_.mergeFrom(value); + } + documentMetadataBuilder_.setMessage(value); + } + elementTypeCase_ = 3; + return this; + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + public Builder clearDocumentMetadata() { + if (documentMetadataBuilder_ == null) { + if (elementTypeCase_ == 3) { + elementTypeCase_ = 0; + elementType_ = null; + onChanged(); + } + } else { + if (elementTypeCase_ == 3) { + elementTypeCase_ = 0; + elementType_ = null; + } + documentMetadataBuilder_.clear(); + } + return this; + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + public com.google.firestore.proto.BundledDocumentMetadata.Builder getDocumentMetadataBuilder() { + return getDocumentMetadataFieldBuilder().getBuilder(); + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadataOrBuilder + getDocumentMetadataOrBuilder() { + if ((elementTypeCase_ == 3) && (documentMetadataBuilder_ != null)) { + return documentMetadataBuilder_.getMessageOrBuilder(); + } else { + if (elementTypeCase_ == 3) { + return (com.google.firestore.proto.BundledDocumentMetadata) elementType_; + } + return com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } + } + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundledDocumentMetadata, + com.google.firestore.proto.BundledDocumentMetadata.Builder, + com.google.firestore.proto.BundledDocumentMetadataOrBuilder> + getDocumentMetadataFieldBuilder() { + if (documentMetadataBuilder_ == null) { + if (!(elementTypeCase_ == 3)) { + elementType_ = com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } + documentMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundledDocumentMetadata, + com.google.firestore.proto.BundledDocumentMetadata.Builder, + com.google.firestore.proto.BundledDocumentMetadataOrBuilder>( + (com.google.firestore.proto.BundledDocumentMetadata) elementType_, + getParentForChildren(), + isClean()); + elementType_ = null; + } + elementTypeCase_ = 3; + onChanged(); + ; + return documentMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + documentBuilder_; + /** + * .google.firestore.v1.Document document = 4; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return elementTypeCase_ == 4; + } + /** + * .google.firestore.v1.Document document = 4; + * + * @return The document. + */ + @java.lang.Override + public com.google.firestore.v1.Document getDocument() { + if (documentBuilder_ == null) { + if (elementTypeCase_ == 4) { + return (com.google.firestore.v1.Document) elementType_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } else { + if (elementTypeCase_ == 4) { + return documentBuilder_.getMessage(); + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + } + /** .google.firestore.v1.Document document = 4; */ + public Builder setDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elementType_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + elementTypeCase_ = 4; + return this; + } + /** .google.firestore.v1.Document document = 4; */ + public Builder setDocument(com.google.firestore.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + elementType_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + elementTypeCase_ = 4; + return this; + } + /** .google.firestore.v1.Document document = 4; */ + public Builder mergeDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (elementTypeCase_ == 4 + && elementType_ != com.google.firestore.v1.Document.getDefaultInstance()) { + elementType_ = + com.google.firestore.v1.Document.newBuilder( + (com.google.firestore.v1.Document) elementType_) + .mergeFrom(value) + .buildPartial(); + } else { + elementType_ = value; + } + onChanged(); + } else { + if (elementTypeCase_ == 4) { + documentBuilder_.mergeFrom(value); + } + documentBuilder_.setMessage(value); + } + elementTypeCase_ = 4; + return this; + } + /** .google.firestore.v1.Document document = 4; */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + if (elementTypeCase_ == 4) { + elementTypeCase_ = 0; + elementType_ = null; + onChanged(); + } + } else { + if (elementTypeCase_ == 4) { + elementTypeCase_ = 0; + elementType_ = null; + } + documentBuilder_.clear(); + } + return this; + } + /** .google.firestore.v1.Document document = 4; */ + public com.google.firestore.v1.Document.Builder getDocumentBuilder() { + return getDocumentFieldBuilder().getBuilder(); + } + /** .google.firestore.v1.Document document = 4; */ + @java.lang.Override + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + if ((elementTypeCase_ == 4) && (documentBuilder_ != null)) { + return documentBuilder_.getMessageOrBuilder(); + } else { + if (elementTypeCase_ == 4) { + return (com.google.firestore.v1.Document) elementType_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + } + /** .google.firestore.v1.Document document = 4; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + if (!(elementTypeCase_ == 4)) { + elementType_ = com.google.firestore.v1.Document.getDefaultInstance(); + } + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder>( + (com.google.firestore.v1.Document) elementType_, getParentForChildren(), isClean()); + elementType_ = null; + } + elementTypeCase_ = 4; + onChanged(); + ; + return documentBuilder_; + } + + @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:firestore.BundleElement) + } + + // @@protoc_insertion_point(class_scope:firestore.BundleElement) + private static final com.google.firestore.proto.BundleElement DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.proto.BundleElement(); + } + + public static com.google.firestore.proto.BundleElement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundleElement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BundleElement(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.proto.BundleElement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleElementOrBuilder.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleElementOrBuilder.java new file mode 100644 index 000000000..371b34e5f --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleElementOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +public interface BundleElementOrBuilder + extends + // @@protoc_insertion_point(interface_extends:firestore.BundleElement) + com.google.protobuf.MessageOrBuilder { + + /** + * .firestore.BundleMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * .firestore.BundleMetadata metadata = 1; + * + * @return The metadata. + */ + com.google.firestore.proto.BundleMetadata getMetadata(); + /** .firestore.BundleMetadata metadata = 1; */ + com.google.firestore.proto.BundleMetadataOrBuilder getMetadataOrBuilder(); + + /** + * .firestore.NamedQuery named_query = 2; + * + * @return Whether the namedQuery field is set. + */ + boolean hasNamedQuery(); + /** + * .firestore.NamedQuery named_query = 2; + * + * @return The namedQuery. + */ + com.google.firestore.proto.NamedQuery getNamedQuery(); + /** .firestore.NamedQuery named_query = 2; */ + com.google.firestore.proto.NamedQueryOrBuilder getNamedQueryOrBuilder(); + + /** + * .firestore.BundledDocumentMetadata document_metadata = 3; + * + * @return Whether the documentMetadata field is set. + */ + boolean hasDocumentMetadata(); + /** + * .firestore.BundledDocumentMetadata document_metadata = 3; + * + * @return The documentMetadata. + */ + com.google.firestore.proto.BundledDocumentMetadata getDocumentMetadata(); + /** .firestore.BundledDocumentMetadata document_metadata = 3; */ + com.google.firestore.proto.BundledDocumentMetadataOrBuilder getDocumentMetadataOrBuilder(); + + /** + * .google.firestore.v1.Document document = 4; + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * .google.firestore.v1.Document document = 4; + * + * @return The document. + */ + com.google.firestore.v1.Document getDocument(); + /** .google.firestore.v1.Document document = 4; */ + com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder(); + + public com.google.firestore.proto.BundleElement.ElementTypeCase getElementTypeCase(); +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleMetadata.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleMetadata.java new file mode 100644 index 000000000..25463e8c8 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleMetadata.java @@ -0,0 +1,1176 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +/** + * + * + *
+ * Metadata describing the bundle file/stream.
+ * 
+ * + * Protobuf type {@code firestore.BundleMetadata} + */ +public final class BundleMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:firestore.BundleMetadata) + BundleMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BundleMetadata.newBuilder() to construct. + private BundleMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BundleMetadata() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BundleMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BundleMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + version_ = input.readUInt32(); + break; + } + case 32: + { + totalDocuments_ = input.readUInt32(); + break; + } + case 40: + { + totalBytes_ = input.readUInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.firestore.proto.BundleProto + .internal_static_firestore_BundleMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundleMetadata.class, + com.google.firestore.proto.BundleMetadata.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+   * The ID of the bundle.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the bundle.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Time at which the documents snapshot is taken for this bundle.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Time at which the documents snapshot is taken for this bundle.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Time at which the documents snapshot is taken for this bundle.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int VERSION_FIELD_NUMBER = 3; + private int version_; + /** + * + * + *
+   * The schema version of the bundle.
+   * 
+ * + * uint32 version = 3; + * + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + + public static final int TOTAL_DOCUMENTS_FIELD_NUMBER = 4; + private int totalDocuments_; + /** + * + * + *
+   * The number of documents in the bundle.
+   * 
+ * + * uint32 total_documents = 4; + * + * @return The totalDocuments. + */ + @java.lang.Override + public int getTotalDocuments() { + return totalDocuments_; + } + + public static final int TOTAL_BYTES_FIELD_NUMBER = 5; + private long totalBytes_; + /** + * + * + *
+   * The size of the bundle in bytes, excluding this `BundleMetadata`.
+   * 
+ * + * uint64 total_bytes = 5; + * + * @return The totalBytes. + */ + @java.lang.Override + public long getTotalBytes() { + return totalBytes_; + } + + 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (version_ != 0) { + output.writeUInt32(3, version_); + } + if (totalDocuments_ != 0) { + output.writeUInt32(4, totalDocuments_); + } + if (totalBytes_ != 0L) { + output.writeUInt64(5, totalBytes_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (version_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, version_); + } + if (totalDocuments_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, totalDocuments_); + } + if (totalBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(5, totalBytes_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.proto.BundleMetadata)) { + return super.equals(obj); + } + com.google.firestore.proto.BundleMetadata other = + (com.google.firestore.proto.BundleMetadata) obj; + + if (!getId().equals(other.getId())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (getVersion() != other.getVersion()) return false; + if (getTotalDocuments() != other.getTotalDocuments()) return false; + if (getTotalBytes() != other.getTotalBytes()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + hash = (37 * hash) + TOTAL_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getTotalDocuments(); + hash = (37 * hash) + TOTAL_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTotalBytes()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.proto.BundleMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundleMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundleMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundleMetadata 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.firestore.proto.BundleMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundleMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundleMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundleMetadata 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.firestore.proto.BundleMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundleMetadata 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.firestore.proto.BundleMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundleMetadata 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.firestore.proto.BundleMetadata 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; + } + /** + * + * + *
+   * Metadata describing the bundle file/stream.
+   * 
+ * + * Protobuf type {@code firestore.BundleMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:firestore.BundleMetadata) + com.google.firestore.proto.BundleMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundleMetadata.class, + com.google.firestore.proto.BundleMetadata.Builder.class); + } + + // Construct using com.google.firestore.proto.BundleMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + version_ = 0; + + totalDocuments_ = 0; + + totalBytes_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundleMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.proto.BundleMetadata getDefaultInstanceForType() { + return com.google.firestore.proto.BundleMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.proto.BundleMetadata build() { + com.google.firestore.proto.BundleMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.proto.BundleMetadata buildPartial() { + com.google.firestore.proto.BundleMetadata result = + new com.google.firestore.proto.BundleMetadata(this); + result.id_ = id_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.version_ = version_; + result.totalDocuments_ = totalDocuments_; + result.totalBytes_ = totalBytes_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.proto.BundleMetadata) { + return mergeFrom((com.google.firestore.proto.BundleMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.proto.BundleMetadata other) { + if (other == com.google.firestore.proto.BundleMetadata.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.getVersion() != 0) { + setVersion(other.getVersion()); + } + if (other.getTotalDocuments() != 0) { + setTotalDocuments(other.getTotalDocuments()); + } + if (other.getTotalBytes() != 0L) { + setTotalBytes(other.getTotalBytes()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.proto.BundleMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.proto.BundleMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * The ID of the bundle.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the bundle.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the bundle.
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the bundle.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the bundle.
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Time at which the documents snapshot is taken for this bundle.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int version_; + /** + * + * + *
+     * The schema version of the bundle.
+     * 
+ * + * uint32 version = 3; + * + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + /** + * + * + *
+     * The schema version of the bundle.
+     * 
+ * + * uint32 version = 3; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(int value) { + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema version of the bundle.
+     * 
+ * + * uint32 version = 3; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = 0; + onChanged(); + return this; + } + + private int totalDocuments_; + /** + * + * + *
+     * The number of documents in the bundle.
+     * 
+ * + * uint32 total_documents = 4; + * + * @return The totalDocuments. + */ + @java.lang.Override + public int getTotalDocuments() { + return totalDocuments_; + } + /** + * + * + *
+     * The number of documents in the bundle.
+     * 
+ * + * uint32 total_documents = 4; + * + * @param value The totalDocuments to set. + * @return This builder for chaining. + */ + public Builder setTotalDocuments(int value) { + + totalDocuments_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of documents in the bundle.
+     * 
+ * + * uint32 total_documents = 4; + * + * @return This builder for chaining. + */ + public Builder clearTotalDocuments() { + + totalDocuments_ = 0; + onChanged(); + return this; + } + + private long totalBytes_; + /** + * + * + *
+     * The size of the bundle in bytes, excluding this `BundleMetadata`.
+     * 
+ * + * uint64 total_bytes = 5; + * + * @return The totalBytes. + */ + @java.lang.Override + public long getTotalBytes() { + return totalBytes_; + } + /** + * + * + *
+     * The size of the bundle in bytes, excluding this `BundleMetadata`.
+     * 
+ * + * uint64 total_bytes = 5; + * + * @param value The totalBytes to set. + * @return This builder for chaining. + */ + public Builder setTotalBytes(long value) { + + totalBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The size of the bundle in bytes, excluding this `BundleMetadata`.
+     * 
+ * + * uint64 total_bytes = 5; + * + * @return This builder for chaining. + */ + public Builder clearTotalBytes() { + + totalBytes_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:firestore.BundleMetadata) + } + + // @@protoc_insertion_point(class_scope:firestore.BundleMetadata) + private static final com.google.firestore.proto.BundleMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.proto.BundleMetadata(); + } + + public static com.google.firestore.proto.BundleMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundleMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BundleMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.proto.BundleMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleMetadataOrBuilder.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleMetadataOrBuilder.java new file mode 100644 index 000000000..ecc2ba700 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleMetadataOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +public interface BundleMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:firestore.BundleMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the bundle.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * The ID of the bundle.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Time at which the documents snapshot is taken for this bundle.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Time at which the documents snapshot is taken for this bundle.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Time at which the documents snapshot is taken for this bundle.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The schema version of the bundle.
+   * 
+ * + * uint32 version = 3; + * + * @return The version. + */ + int getVersion(); + + /** + * + * + *
+   * The number of documents in the bundle.
+   * 
+ * + * uint32 total_documents = 4; + * + * @return The totalDocuments. + */ + int getTotalDocuments(); + + /** + * + * + *
+   * The size of the bundle in bytes, excluding this `BundleMetadata`.
+   * 
+ * + * uint64 total_bytes = 5; + * + * @return The totalBytes. + */ + long getTotalBytes(); +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleProto.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleProto.java new file mode 100644 index 000000000..8c4a309e1 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundleProto.java @@ -0,0 +1,139 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +public final class BundleProto { + private BundleProto() {} + + 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_firestore_BundledQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_firestore_BundledQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_firestore_NamedQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_firestore_NamedQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_firestore_BundledDocumentMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_firestore_BundledDocumentMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_firestore_BundleMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_firestore_BundleMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_firestore_BundleElement_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_firestore_BundleElement_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\026firestore/bundle.proto\022\tfirestore\032\"goo" + + "gle/firestore/v1/document.proto\032\037google/" + + "firestore/v1/query.proto\032\037google/protobu" + + "f/timestamp.proto\"\307\001\n\014BundledQuery\022\016\n\006pa" + + "rent\030\001 \001(\t\022@\n\020structured_query\030\002 \001(\0132$.g" + + "oogle.firestore.v1.StructuredQueryH\000\0225\n\n" + + "limit_type\030\003 \001(\0162!.firestore.BundledQuer" + + "y.LimitType\" \n\tLimitType\022\t\n\005FIRST\020\000\022\010\n\004L" + + "AST\020\001B\014\n\nquery_type\"y\n\nNamedQuery\022\014\n\004nam" + + "e\030\001 \001(\t\022.\n\rbundled_query\030\002 \001(\0132\027.firesto" + + "re.BundledQuery\022-\n\tread_time\030\003 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\"w\n\027BundledDocumen" + + "tMetadata\022\014\n\004name\030\001 \001(\t\022-\n\tread_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022\016\n\006exists" + + "\030\003 \001(\010\022\017\n\007queries\030\004 \003(\t\"\214\001\n\016BundleMetada" + + "ta\022\n\n\002id\030\001 \001(\t\022/\n\013create_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022\017\n\007version\030\003 \001(\r" + + "\022\027\n\017total_documents\030\004 \001(\r\022\023\n\013total_bytes" + + "\030\005 \001(\004\"\360\001\n\rBundleElement\022-\n\010metadata\030\001 \001" + + "(\0132\031.firestore.BundleMetadataH\000\022,\n\013named" + + "_query\030\002 \001(\0132\025.firestore.NamedQueryH\000\022?\n" + + "\021document_metadata\030\003 \001(\0132\".firestore.Bun" + + "dledDocumentMetadataH\000\0221\n\010document\030\004 \001(\013" + + "2\035.google.firestore.v1.DocumentH\000B\016\n\014ele" + + "ment_typeB\215\001\n\032com.google.firestore.proto" + + "B\013BundleProtoP\001Z4google.golang.org/genpr" + + "oto/firestore/proto;firestore\242\002\005FSTPB\252\002\017" + + "Firestore.Proto\312\002\017Firestore\\Protob\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.firestore.v1.DocumentProto.getDescriptor(), + com.google.firestore.v1.QueryProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_firestore_BundledQuery_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_firestore_BundledQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_firestore_BundledQuery_descriptor, + new java.lang.String[] { + "Parent", "StructuredQuery", "LimitType", "QueryType", + }); + internal_static_firestore_NamedQuery_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_firestore_NamedQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_firestore_NamedQuery_descriptor, + new java.lang.String[] { + "Name", "BundledQuery", "ReadTime", + }); + internal_static_firestore_BundledDocumentMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_firestore_BundledDocumentMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_firestore_BundledDocumentMetadata_descriptor, + new java.lang.String[] { + "Name", "ReadTime", "Exists", "Queries", + }); + internal_static_firestore_BundleMetadata_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_firestore_BundleMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_firestore_BundleMetadata_descriptor, + new java.lang.String[] { + "Id", "CreateTime", "Version", "TotalDocuments", "TotalBytes", + }); + internal_static_firestore_BundleElement_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_firestore_BundleElement_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_firestore_BundleElement_descriptor, + new java.lang.String[] { + "Metadata", "NamedQuery", "DocumentMetadata", "Document", "ElementType", + }); + com.google.firestore.v1.DocumentProto.getDescriptor(); + com.google.firestore.v1.QueryProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledDocumentMetadata.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledDocumentMetadata.java new file mode 100644 index 000000000..d1c6580f3 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledDocumentMetadata.java @@ -0,0 +1,1274 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +/** + * + * + *
+ * Metadata describing a Firestore document saved in the bundle.
+ * 
+ * + * Protobuf type {@code firestore.BundledDocumentMetadata} + */ +public final class BundledDocumentMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:firestore.BundledDocumentMetadata) + BundledDocumentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use BundledDocumentMetadata.newBuilder() to construct. + private BundledDocumentMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BundledDocumentMetadata() { + name_ = ""; + queries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BundledDocumentMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BundledDocumentMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + 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; + } + case 24: + { + exists_ = input.readBool(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + queries_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + queries_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + queries_ = queries_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundledDocumentMetadata.class, + com.google.firestore.proto.BundledDocumentMetadata.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The document key of a bundled document.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The document key of a bundled document.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The snapshot version of the document data bundled.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The snapshot version of the document data bundled.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * The snapshot version of the document data bundled.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int EXISTS_FIELD_NUMBER = 3; + private boolean exists_; + /** + * + * + *
+   * Whether the document exists.
+   * 
+ * + * bool exists = 3; + * + * @return The exists. + */ + @java.lang.Override + public boolean getExists() { + return exists_; + } + + public static final int QUERIES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList queries_; + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @return A list containing the queries. + */ + public com.google.protobuf.ProtocolStringList getQueriesList() { + return queries_; + } + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @return The count of queries. + */ + public int getQueriesCount() { + return queries_.size(); + } + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @param index The index of the element to return. + * @return The queries at the given index. + */ + public java.lang.String getQueries(int index) { + return queries_.get(index); + } + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @param index The index of the value to return. + * @return The bytes of the queries at the given index. + */ + public com.google.protobuf.ByteString getQueriesBytes(int index) { + return queries_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (exists_ != false) { + output.writeBool(3, exists_); + } + for (int i = 0; i < queries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, queries_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (exists_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, exists_); + } + { + int dataSize = 0; + for (int i = 0; i < queries_.size(); i++) { + dataSize += computeStringSizeNoTag(queries_.getRaw(i)); + } + size += dataSize; + size += 1 * getQueriesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.proto.BundledDocumentMetadata)) { + return super.equals(obj); + } + com.google.firestore.proto.BundledDocumentMetadata other = + (com.google.firestore.proto.BundledDocumentMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (getExists() != other.getExists()) return false; + if (!getQueriesList().equals(other.getQueriesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + EXISTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExists()); + if (getQueriesCount() > 0) { + hash = (37 * hash) + QUERIES_FIELD_NUMBER; + hash = (53 * hash) + getQueriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.proto.BundledDocumentMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundledDocumentMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundledDocumentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundledDocumentMetadata 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.firestore.proto.BundledDocumentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundledDocumentMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundledDocumentMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundledDocumentMetadata 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.firestore.proto.BundledDocumentMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundledDocumentMetadata 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.firestore.proto.BundledDocumentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundledDocumentMetadata 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.firestore.proto.BundledDocumentMetadata 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; + } + /** + * + * + *
+   * Metadata describing a Firestore document saved in the bundle.
+   * 
+ * + * Protobuf type {@code firestore.BundledDocumentMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:firestore.BundledDocumentMetadata) + com.google.firestore.proto.BundledDocumentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledDocumentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledDocumentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundledDocumentMetadata.class, + com.google.firestore.proto.BundledDocumentMetadata.Builder.class); + } + + // Construct using com.google.firestore.proto.BundledDocumentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + exists_ = false; + + queries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledDocumentMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadata getDefaultInstanceForType() { + return com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadata build() { + com.google.firestore.proto.BundledDocumentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadata buildPartial() { + com.google.firestore.proto.BundledDocumentMetadata result = + new com.google.firestore.proto.BundledDocumentMetadata(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.exists_ = exists_; + if (((bitField0_ & 0x00000001) != 0)) { + queries_ = queries_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queries_ = queries_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.proto.BundledDocumentMetadata) { + return mergeFrom((com.google.firestore.proto.BundledDocumentMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.proto.BundledDocumentMetadata other) { + if (other == com.google.firestore.proto.BundledDocumentMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.getExists() != false) { + setExists(other.getExists()); + } + if (!other.queries_.isEmpty()) { + if (queries_.isEmpty()) { + queries_ = other.queries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueriesIsMutable(); + queries_.addAll(other.queries_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.proto.BundledDocumentMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.proto.BundledDocumentMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The document key of a bundled document.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The document key of a bundled document.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The document key of a bundled document.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The document key of a bundled document.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The document key of a bundled document.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + 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; + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + 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; + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * The snapshot version of the document data bundled.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + 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_; + } + + private boolean exists_; + /** + * + * + *
+     * Whether the document exists.
+     * 
+ * + * bool exists = 3; + * + * @return The exists. + */ + @java.lang.Override + public boolean getExists() { + return exists_; + } + /** + * + * + *
+     * Whether the document exists.
+     * 
+ * + * bool exists = 3; + * + * @param value The exists to set. + * @return This builder for chaining. + */ + public Builder setExists(boolean value) { + + exists_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the document exists.
+     * 
+ * + * bool exists = 3; + * + * @return This builder for chaining. + */ + public Builder clearExists() { + + exists_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList queries_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureQueriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queries_ = new com.google.protobuf.LazyStringArrayList(queries_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @return A list containing the queries. + */ + public com.google.protobuf.ProtocolStringList getQueriesList() { + return queries_.getUnmodifiableView(); + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @return The count of queries. + */ + public int getQueriesCount() { + return queries_.size(); + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @param index The index of the element to return. + * @return The queries at the given index. + */ + public java.lang.String getQueries(int index) { + return queries_.get(index); + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @param index The index of the value to return. + * @return The bytes of the queries at the given index. + */ + public com.google.protobuf.ByteString getQueriesBytes(int index) { + return queries_.getByteString(index); + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @param index The index to set the value at. + * @param value The queries to set. + * @return This builder for chaining. + */ + public Builder setQueries(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @param value The queries to add. + * @return This builder for chaining. + */ + public Builder addQueries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @param values The queries to add. + * @return This builder for chaining. + */ + public Builder addAllQueries(java.lang.Iterable values) { + ensureQueriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queries_); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @return This builder for chaining. + */ + public Builder clearQueries() { + queries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the queries in this bundle that this document matches to.
+     * 
+ * + * repeated string queries = 4; + * + * @param value The bytes of the queries to add. + * @return This builder for chaining. + */ + public Builder addQueriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureQueriesIsMutable(); + queries_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:firestore.BundledDocumentMetadata) + } + + // @@protoc_insertion_point(class_scope:firestore.BundledDocumentMetadata) + private static final com.google.firestore.proto.BundledDocumentMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.proto.BundledDocumentMetadata(); + } + + public static com.google.firestore.proto.BundledDocumentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundledDocumentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BundledDocumentMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.proto.BundledDocumentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledDocumentMetadataOrBuilder.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledDocumentMetadataOrBuilder.java new file mode 100644 index 000000000..7b41abed6 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledDocumentMetadataOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +public interface BundledDocumentMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:firestore.BundledDocumentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The document key of a bundled document.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The document key of a bundled document.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The snapshot version of the document data bundled.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * The snapshot version of the document data bundled.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The snapshot version of the document data bundled.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Whether the document exists.
+   * 
+ * + * bool exists = 3; + * + * @return The exists. + */ + boolean getExists(); + + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @return A list containing the queries. + */ + java.util.List getQueriesList(); + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @return The count of queries. + */ + int getQueriesCount(); + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @param index The index of the element to return. + * @return The queries at the given index. + */ + java.lang.String getQueries(int index); + /** + * + * + *
+   * The names of the queries in this bundle that this document matches to.
+   * 
+ * + * repeated string queries = 4; + * + * @param index The index of the value to return. + * @return The bytes of the queries at the given index. + */ + com.google.protobuf.ByteString getQueriesBytes(int index); +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledQuery.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledQuery.java new file mode 100644 index 000000000..c22d88322 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledQuery.java @@ -0,0 +1,1225 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +/** + * + * + *
+ * Encodes a query saved in the bundle.
+ * 
+ * + * Protobuf type {@code firestore.BundledQuery} + */ +public final class BundledQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:firestore.BundledQuery) + BundledQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use BundledQuery.newBuilder() to construct. + private BundledQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BundledQuery() { + parent_ = ""; + limitType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BundledQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BundledQuery( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.firestore.v1.StructuredQuery.Builder subBuilder = null; + if (queryTypeCase_ == 2) { + subBuilder = ((com.google.firestore.v1.StructuredQuery) queryType_).toBuilder(); + } + queryType_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.StructuredQuery) queryType_); + queryType_ = subBuilder.buildPartial(); + } + queryTypeCase_ = 2; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + limitType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.firestore.proto.BundleProto.internal_static_firestore_BundledQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundledQuery.class, + com.google.firestore.proto.BundledQuery.Builder.class); + } + + /** + * + * + *
+   * If the query is a limit query, should the limit be applied to the beginning or
+   * the end of results.
+   * 
+ * + * Protobuf enum {@code firestore.BundledQuery.LimitType} + */ + public enum LimitType implements com.google.protobuf.ProtocolMessageEnum { + /** FIRST = 0; */ + FIRST(0), + /** LAST = 1; */ + LAST(1), + UNRECOGNIZED(-1), + ; + + /** FIRST = 0; */ + public static final int FIRST_VALUE = 0; + /** LAST = 1; */ + public static final int LAST_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LimitType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static LimitType forNumber(int value) { + switch (value) { + case 0: + return FIRST; + case 1: + return LAST; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public LimitType findValueByNumber(int number) { + return LimitType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.firestore.proto.BundledQuery.getDescriptor().getEnumTypes().get(0); + } + + private static final LimitType[] VALUES = values(); + + public static LimitType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private LimitType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:firestore.BundledQuery.LimitType) + } + + private int queryTypeCase_ = 0; + private java.lang.Object queryType_; + + public enum QueryTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRUCTURED_QUERY(2), + 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 2: + return STRUCTURED_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 PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The parent resource name.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The parent resource name.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STRUCTURED_QUERY_FIELD_NUMBER = 2; + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + * + * @return Whether the structuredQuery field is set. + */ + @java.lang.Override + public boolean hasStructuredQuery() { + return queryTypeCase_ == 2; + } + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + * + * @return The structuredQuery. + */ + @java.lang.Override + public com.google.firestore.v1.StructuredQuery getStructuredQuery() { + if (queryTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery) queryType_; + } + return com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + @java.lang.Override + public com.google.firestore.v1.StructuredQueryOrBuilder getStructuredQueryOrBuilder() { + if (queryTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery) queryType_; + } + return com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } + + public static final int LIMIT_TYPE_FIELD_NUMBER = 3; + private int limitType_; + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return The enum numeric value on the wire for limitType. + */ + @java.lang.Override + public int getLimitTypeValue() { + return limitType_; + } + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return The limitType. + */ + @java.lang.Override + public com.google.firestore.proto.BundledQuery.LimitType getLimitType() { + @SuppressWarnings("deprecation") + com.google.firestore.proto.BundledQuery.LimitType result = + com.google.firestore.proto.BundledQuery.LimitType.valueOf(limitType_); + return result == null ? com.google.firestore.proto.BundledQuery.LimitType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (queryTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.StructuredQuery) queryType_); + } + if (limitType_ != com.google.firestore.proto.BundledQuery.LimitType.FIRST.getNumber()) { + output.writeEnum(3, limitType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (queryTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.StructuredQuery) queryType_); + } + if (limitType_ != com.google.firestore.proto.BundledQuery.LimitType.FIRST.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, limitType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.proto.BundledQuery)) { + return super.equals(obj); + } + com.google.firestore.proto.BundledQuery other = (com.google.firestore.proto.BundledQuery) obj; + + if (!getParent().equals(other.getParent())) return false; + if (limitType_ != other.limitType_) return false; + if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; + switch (queryTypeCase_) { + case 2: + if (!getStructuredQuery().equals(other.getStructuredQuery())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + LIMIT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + limitType_; + switch (queryTypeCase_) { + case 2: + hash = (37 * hash) + STRUCTURED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getStructuredQuery().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.proto.BundledQuery parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundledQuery parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundledQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundledQuery 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.firestore.proto.BundledQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.BundledQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.BundledQuery parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundledQuery 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.firestore.proto.BundledQuery parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundledQuery 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.firestore.proto.BundledQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.BundledQuery 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.firestore.proto.BundledQuery 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; + } + /** + * + * + *
+   * Encodes a query saved in the bundle.
+   * 
+ * + * Protobuf type {@code firestore.BundledQuery} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:firestore.BundledQuery) + com.google.firestore.proto.BundledQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.BundledQuery.class, + com.google.firestore.proto.BundledQuery.Builder.class); + } + + // Construct using com.google.firestore.proto.BundledQuery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + limitType_ = 0; + + queryTypeCase_ = 0; + queryType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_BundledQuery_descriptor; + } + + @java.lang.Override + public com.google.firestore.proto.BundledQuery getDefaultInstanceForType() { + return com.google.firestore.proto.BundledQuery.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.proto.BundledQuery build() { + com.google.firestore.proto.BundledQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.proto.BundledQuery buildPartial() { + com.google.firestore.proto.BundledQuery result = + new com.google.firestore.proto.BundledQuery(this); + result.parent_ = parent_; + if (queryTypeCase_ == 2) { + if (structuredQueryBuilder_ == null) { + result.queryType_ = queryType_; + } else { + result.queryType_ = structuredQueryBuilder_.build(); + } + } + result.limitType_ = limitType_; + result.queryTypeCase_ = queryTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.proto.BundledQuery) { + return mergeFrom((com.google.firestore.proto.BundledQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.proto.BundledQuery other) { + if (other == com.google.firestore.proto.BundledQuery.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.limitType_ != 0) { + setLimitTypeValue(other.getLimitTypeValue()); + } + switch (other.getQueryTypeCase()) { + case STRUCTURED_QUERY: + { + mergeStructuredQuery(other.getStructuredQuery()); + break; + } + case QUERYTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.proto.BundledQuery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.proto.BundledQuery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int queryTypeCase_ = 0; + private java.lang.Object queryType_; + + public QueryTypeCase getQueryTypeCase() { + return QueryTypeCase.forNumber(queryTypeCase_); + } + + public Builder clearQueryType() { + queryTypeCase_ = 0; + queryType_ = null; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The parent resource name.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The parent resource name.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The parent resource name.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource name.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource name.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery, + com.google.firestore.v1.StructuredQuery.Builder, + com.google.firestore.v1.StructuredQueryOrBuilder> + structuredQueryBuilder_; + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + * + * @return Whether the structuredQuery field is set. + */ + @java.lang.Override + public boolean hasStructuredQuery() { + return queryTypeCase_ == 2; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + * + * @return The structuredQuery. + */ + @java.lang.Override + public com.google.firestore.v1.StructuredQuery getStructuredQuery() { + if (structuredQueryBuilder_ == null) { + if (queryTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery) queryType_; + } + return com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } else { + if (queryTypeCase_ == 2) { + return structuredQueryBuilder_.getMessage(); + } + return com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + public Builder setStructuredQuery(com.google.firestore.v1.StructuredQuery value) { + if (structuredQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryType_ = value; + onChanged(); + } else { + structuredQueryBuilder_.setMessage(value); + } + queryTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + public Builder setStructuredQuery( + com.google.firestore.v1.StructuredQuery.Builder builderForValue) { + if (structuredQueryBuilder_ == null) { + queryType_ = builderForValue.build(); + onChanged(); + } else { + structuredQueryBuilder_.setMessage(builderForValue.build()); + } + queryTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + public Builder mergeStructuredQuery(com.google.firestore.v1.StructuredQuery value) { + if (structuredQueryBuilder_ == null) { + if (queryTypeCase_ == 2 + && queryType_ != com.google.firestore.v1.StructuredQuery.getDefaultInstance()) { + queryType_ = + com.google.firestore.v1.StructuredQuery.newBuilder( + (com.google.firestore.v1.StructuredQuery) queryType_) + .mergeFrom(value) + .buildPartial(); + } else { + queryType_ = value; + } + onChanged(); + } else { + if (queryTypeCase_ == 2) { + structuredQueryBuilder_.mergeFrom(value); + } + structuredQueryBuilder_.setMessage(value); + } + queryTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + public Builder clearStructuredQuery() { + if (structuredQueryBuilder_ == null) { + if (queryTypeCase_ == 2) { + queryTypeCase_ = 0; + queryType_ = null; + onChanged(); + } + } else { + if (queryTypeCase_ == 2) { + queryTypeCase_ = 0; + queryType_ = null; + } + structuredQueryBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + public com.google.firestore.v1.StructuredQuery.Builder getStructuredQueryBuilder() { + return getStructuredQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + @java.lang.Override + public com.google.firestore.v1.StructuredQueryOrBuilder getStructuredQueryOrBuilder() { + if ((queryTypeCase_ == 2) && (structuredQueryBuilder_ != null)) { + return structuredQueryBuilder_.getMessageOrBuilder(); + } else { + if (queryTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery) queryType_; + } + return com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery, + com.google.firestore.v1.StructuredQuery.Builder, + com.google.firestore.v1.StructuredQueryOrBuilder> + getStructuredQueryFieldBuilder() { + if (structuredQueryBuilder_ == null) { + if (!(queryTypeCase_ == 2)) { + queryType_ = com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } + structuredQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery, + com.google.firestore.v1.StructuredQuery.Builder, + com.google.firestore.v1.StructuredQueryOrBuilder>( + (com.google.firestore.v1.StructuredQuery) queryType_, + getParentForChildren(), + isClean()); + queryType_ = null; + } + queryTypeCase_ = 2; + onChanged(); + ; + return structuredQueryBuilder_; + } + + private int limitType_ = 0; + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return The enum numeric value on the wire for limitType. + */ + @java.lang.Override + public int getLimitTypeValue() { + return limitType_; + } + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @param value The enum numeric value on the wire for limitType to set. + * @return This builder for chaining. + */ + public Builder setLimitTypeValue(int value) { + + limitType_ = value; + onChanged(); + return this; + } + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return The limitType. + */ + @java.lang.Override + public com.google.firestore.proto.BundledQuery.LimitType getLimitType() { + @SuppressWarnings("deprecation") + com.google.firestore.proto.BundledQuery.LimitType result = + com.google.firestore.proto.BundledQuery.LimitType.valueOf(limitType_); + return result == null + ? com.google.firestore.proto.BundledQuery.LimitType.UNRECOGNIZED + : result; + } + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @param value The limitType to set. + * @return This builder for chaining. + */ + public Builder setLimitType(com.google.firestore.proto.BundledQuery.LimitType value) { + if (value == null) { + throw new NullPointerException(); + } + + limitType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearLimitType() { + + limitType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:firestore.BundledQuery) + } + + // @@protoc_insertion_point(class_scope:firestore.BundledQuery) + private static final com.google.firestore.proto.BundledQuery DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.proto.BundledQuery(); + } + + public static com.google.firestore.proto.BundledQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundledQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BundledQuery(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.proto.BundledQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledQueryOrBuilder.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledQueryOrBuilder.java new file mode 100644 index 000000000..7fedbfe17 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/BundledQueryOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +public interface BundledQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:firestore.BundledQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent resource name.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The parent resource name.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + * + * @return Whether the structuredQuery field is set. + */ + boolean hasStructuredQuery(); + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + * + * @return The structuredQuery. + */ + com.google.firestore.v1.StructuredQuery getStructuredQuery(); + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + com.google.firestore.v1.StructuredQueryOrBuilder getStructuredQueryOrBuilder(); + + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return The enum numeric value on the wire for limitType. + */ + int getLimitTypeValue(); + /** + * .firestore.BundledQuery.LimitType limit_type = 3; + * + * @return The limitType. + */ + com.google.firestore.proto.BundledQuery.LimitType getLimitType(); + + public com.google.firestore.proto.BundledQuery.QueryTypeCase getQueryTypeCase(); +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/NamedQuery.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/NamedQuery.java new file mode 100644 index 000000000..baca26560 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/NamedQuery.java @@ -0,0 +1,1203 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +/** + * + * + *
+ * A Query associated with a name, created as part of the bundle file, and can be read
+ * by client SDKs once the bundle containing them is loaded.
+ * 
+ * + * Protobuf type {@code firestore.NamedQuery} + */ +public final class NamedQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:firestore.NamedQuery) + NamedQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use NamedQuery.newBuilder() to construct. + private NamedQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NamedQuery() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NamedQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NamedQuery( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.firestore.proto.BundledQuery.Builder subBuilder = null; + if (bundledQuery_ != null) { + subBuilder = bundledQuery_.toBuilder(); + } + bundledQuery_ = + input.readMessage( + com.google.firestore.proto.BundledQuery.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(bundledQuery_); + bundledQuery_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + 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 (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.firestore.proto.BundleProto.internal_static_firestore_NamedQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_NamedQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.NamedQuery.class, + com.google.firestore.proto.NamedQuery.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the query, such that client can use the name to load this query
+   * from bundle, and resume from when the query results are materialized
+   * into this bundle.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the query, such that client can use the name to load this query
+   * from bundle, and resume from when the query results are materialized
+   * into this bundle.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUNDLED_QUERY_FIELD_NUMBER = 2; + private com.google.firestore.proto.BundledQuery bundledQuery_; + /** + * + * + *
+   * The query saved in the bundle.
+   * 
+ * + * .firestore.BundledQuery bundled_query = 2; + * + * @return Whether the bundledQuery field is set. + */ + @java.lang.Override + public boolean hasBundledQuery() { + return bundledQuery_ != null; + } + /** + * + * + *
+   * The query saved in the bundle.
+   * 
+ * + * .firestore.BundledQuery bundled_query = 2; + * + * @return The bundledQuery. + */ + @java.lang.Override + public com.google.firestore.proto.BundledQuery getBundledQuery() { + return bundledQuery_ == null + ? com.google.firestore.proto.BundledQuery.getDefaultInstance() + : bundledQuery_; + } + /** + * + * + *
+   * The query saved in the bundle.
+   * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + @java.lang.Override + public com.google.firestore.proto.BundledQueryOrBuilder getBundledQueryOrBuilder() { + return getBundledQuery(); + } + + public static final int READ_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The read time of the query, when it is used to build the bundle. This is useful to
+   * resume the query from the bundle, once it is loaded by client SDKs.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The read time of the query, when it is used to build the bundle. This is useful to
+   * resume the query from the bundle, once it is loaded by client SDKs.
+   * 
+ * + * .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_; + } + /** + * + * + *
+   * The read time of the query, when it is used to build the bundle. This is useful to
+   * resume the query from the bundle, once it is loaded by client SDKs.
+   * 
+ * + * .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 { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (bundledQuery_ != null) { + output.writeMessage(2, getBundledQuery()); + } + if (readTime_ != null) { + output.writeMessage(3, getReadTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (bundledQuery_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBundledQuery()); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReadTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.proto.NamedQuery)) { + return super.equals(obj); + } + com.google.firestore.proto.NamedQuery other = (com.google.firestore.proto.NamedQuery) obj; + + if (!getName().equals(other.getName())) return false; + if (hasBundledQuery() != other.hasBundledQuery()) return false; + if (hasBundledQuery()) { + if (!getBundledQuery().equals(other.getBundledQuery())) return false; + } + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasBundledQuery()) { + hash = (37 * hash) + BUNDLED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getBundledQuery().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.proto.NamedQuery parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.NamedQuery parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.NamedQuery parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.NamedQuery 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.firestore.proto.NamedQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.proto.NamedQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.proto.NamedQuery parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.NamedQuery 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.firestore.proto.NamedQuery parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.NamedQuery 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.firestore.proto.NamedQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.proto.NamedQuery 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.firestore.proto.NamedQuery 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 Query associated with a name, created as part of the bundle file, and can be read
+   * by client SDKs once the bundle containing them is loaded.
+   * 
+ * + * Protobuf type {@code firestore.NamedQuery} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:firestore.NamedQuery) + com.google.firestore.proto.NamedQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.proto.BundleProto.internal_static_firestore_NamedQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.proto.BundleProto + .internal_static_firestore_NamedQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.proto.NamedQuery.class, + com.google.firestore.proto.NamedQuery.Builder.class); + } + + // Construct using com.google.firestore.proto.NamedQuery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (bundledQueryBuilder_ == null) { + bundledQuery_ = null; + } else { + bundledQuery_ = null; + bundledQueryBuilder_ = null; + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.proto.BundleProto.internal_static_firestore_NamedQuery_descriptor; + } + + @java.lang.Override + public com.google.firestore.proto.NamedQuery getDefaultInstanceForType() { + return com.google.firestore.proto.NamedQuery.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.proto.NamedQuery build() { + com.google.firestore.proto.NamedQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.proto.NamedQuery buildPartial() { + com.google.firestore.proto.NamedQuery result = + new com.google.firestore.proto.NamedQuery(this); + result.name_ = name_; + if (bundledQueryBuilder_ == null) { + result.bundledQuery_ = bundledQuery_; + } else { + result.bundledQuery_ = bundledQueryBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.proto.NamedQuery) { + return mergeFrom((com.google.firestore.proto.NamedQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.proto.NamedQuery other) { + if (other == com.google.firestore.proto.NamedQuery.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasBundledQuery()) { + mergeBundledQuery(other.getBundledQuery()); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.proto.NamedQuery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.proto.NamedQuery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the query, such that client can use the name to load this query
+     * from bundle, and resume from when the query results are materialized
+     * into this bundle.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the query, such that client can use the name to load this query
+     * from bundle, and resume from when the query results are materialized
+     * into this bundle.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the query, such that client can use the name to load this query
+     * from bundle, and resume from when the query results are materialized
+     * into this bundle.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the query, such that client can use the name to load this query
+     * from bundle, and resume from when the query results are materialized
+     * into this bundle.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the query, such that client can use the name to load this query
+     * from bundle, and resume from when the query results are materialized
+     * into this bundle.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.firestore.proto.BundledQuery bundledQuery_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundledQuery, + com.google.firestore.proto.BundledQuery.Builder, + com.google.firestore.proto.BundledQueryOrBuilder> + bundledQueryBuilder_; + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + * + * @return Whether the bundledQuery field is set. + */ + public boolean hasBundledQuery() { + return bundledQueryBuilder_ != null || bundledQuery_ != null; + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + * + * @return The bundledQuery. + */ + public com.google.firestore.proto.BundledQuery getBundledQuery() { + if (bundledQueryBuilder_ == null) { + return bundledQuery_ == null + ? com.google.firestore.proto.BundledQuery.getDefaultInstance() + : bundledQuery_; + } else { + return bundledQueryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + public Builder setBundledQuery(com.google.firestore.proto.BundledQuery value) { + if (bundledQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bundledQuery_ = value; + onChanged(); + } else { + bundledQueryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + public Builder setBundledQuery( + com.google.firestore.proto.BundledQuery.Builder builderForValue) { + if (bundledQueryBuilder_ == null) { + bundledQuery_ = builderForValue.build(); + onChanged(); + } else { + bundledQueryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + public Builder mergeBundledQuery(com.google.firestore.proto.BundledQuery value) { + if (bundledQueryBuilder_ == null) { + if (bundledQuery_ != null) { + bundledQuery_ = + com.google.firestore.proto.BundledQuery.newBuilder(bundledQuery_) + .mergeFrom(value) + .buildPartial(); + } else { + bundledQuery_ = value; + } + onChanged(); + } else { + bundledQueryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + public Builder clearBundledQuery() { + if (bundledQueryBuilder_ == null) { + bundledQuery_ = null; + onChanged(); + } else { + bundledQuery_ = null; + bundledQueryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + public com.google.firestore.proto.BundledQuery.Builder getBundledQueryBuilder() { + + onChanged(); + return getBundledQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + public com.google.firestore.proto.BundledQueryOrBuilder getBundledQueryOrBuilder() { + if (bundledQueryBuilder_ != null) { + return bundledQueryBuilder_.getMessageOrBuilder(); + } else { + return bundledQuery_ == null + ? com.google.firestore.proto.BundledQuery.getDefaultInstance() + : bundledQuery_; + } + } + /** + * + * + *
+     * The query saved in the bundle.
+     * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundledQuery, + com.google.firestore.proto.BundledQuery.Builder, + com.google.firestore.proto.BundledQueryOrBuilder> + getBundledQueryFieldBuilder() { + if (bundledQueryBuilder_ == null) { + bundledQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.proto.BundledQuery, + com.google.firestore.proto.BundledQuery.Builder, + com.google.firestore.proto.BundledQueryOrBuilder>( + getBundledQuery(), getParentForChildren(), isClean()); + bundledQuery_ = null; + } + return bundledQueryBuilder_; + } + + 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_; + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .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(); + } + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .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; + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .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; + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .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; + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .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_; + } + } + /** + * + * + *
+     * The read time of the query, when it is used to build the bundle. This is useful to
+     * resume the query from the bundle, once it is loaded by client SDKs.
+     * 
+ * + * .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:firestore.NamedQuery) + } + + // @@protoc_insertion_point(class_scope:firestore.NamedQuery) + private static final com.google.firestore.proto.NamedQuery DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.proto.NamedQuery(); + } + + public static com.google.firestore.proto.NamedQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NamedQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NamedQuery(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.proto.NamedQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/NamedQueryOrBuilder.java b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/NamedQueryOrBuilder.java new file mode 100644 index 000000000..f131fbac5 --- /dev/null +++ b/proto-google-cloud-firestore-bundle-v1/src/main/java/com/google/firestore/proto/NamedQueryOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 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: firestore/bundle.proto + +package com.google.firestore.proto; + +public interface NamedQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:firestore.NamedQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the query, such that client can use the name to load this query
+   * from bundle, and resume from when the query results are materialized
+   * into this bundle.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the query, such that client can use the name to load this query
+   * from bundle, and resume from when the query results are materialized
+   * into this bundle.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The query saved in the bundle.
+   * 
+ * + * .firestore.BundledQuery bundled_query = 2; + * + * @return Whether the bundledQuery field is set. + */ + boolean hasBundledQuery(); + /** + * + * + *
+   * The query saved in the bundle.
+   * 
+ * + * .firestore.BundledQuery bundled_query = 2; + * + * @return The bundledQuery. + */ + com.google.firestore.proto.BundledQuery getBundledQuery(); + /** + * + * + *
+   * The query saved in the bundle.
+   * 
+ * + * .firestore.BundledQuery bundled_query = 2; + */ + com.google.firestore.proto.BundledQueryOrBuilder getBundledQueryOrBuilder(); + + /** + * + * + *
+   * The read time of the query, when it is used to build the bundle. This is useful to
+   * resume the query from the bundle, once it is loaded by client SDKs.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * The read time of the query, when it is used to build the bundle. This is useful to
+   * resume the query from the bundle, once it is loaded by client SDKs.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The read time of the query, when it is used to build the bundle. This is useful to
+   * resume the query from the bundle, once it is loaded by client SDKs.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/proto/firestore/BUILD.bazel b/proto-google-cloud-firestore-v1/src/main/proto/firestore/BUILD.bazel new file mode 100644 index 000000000..2630288f8 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/proto/firestore/BUILD.bazel @@ -0,0 +1,88 @@ +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +############################################################################## +# Common +############################################################################## +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") + +proto_library( + name = "firestore_bundle_proto", + srcs = [ + "bundle.proto", + ], + deps = [ + "//google/firestore/v1:firestore_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +proto_library_with_info( + name = "firestore_bundle_proto_with_info", + deps = [ + ":firestore_bundle_proto", + "//google/cloud:common_resources_proto", + ], +) + +############################################################################## +# Java +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "java_gapic_assembly_gradle_pkg", + "java_gapic_library", + "java_gapic_test", + "java_grpc_library", + "java_proto_library", +) + +java_proto_library( + name = "firestore_bundle_java_proto", + deps = [":firestore_bundle_proto"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-firestore-bundle-v1-java", + deps = [ + ":firestore_bundle_java_proto", + ":firestore_bundle_proto", + ], +) + +############################################################################## +# Go +############################################################################## +# Put your Go rules here + +############################################################################## +# Python +############################################################################## +# Put your Python rules here + +############################################################################## +# PHP +############################################################################## +# Put your PHP rules here + +############################################################################## +# Node.js +############################################################################## +# Put your Node.js rules here + +############################################################################## +# Ruby +############################################################################## +# Put your Ruby rules here + +############################################################################## +# C# +############################################################################## +# Put your C# rules here + +############################################################################## +# C++ +############################################################################## +# Put your C++ rules here diff --git a/proto-google-cloud-firestore-v1/src/main/proto/firestore/bundle.proto b/proto-google-cloud-firestore-v1/src/main/proto/firestore/bundle.proto new file mode 100644 index 000000000..22bbd8a09 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/proto/firestore/bundle.proto @@ -0,0 +1,120 @@ +// Copyright 2020 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. +// + +// This file defines the format of Firestore bundle file/stream. It is not a part of the +// Firestore API, only a specification used by Server and Client SDK to write and read +// bundles. + +syntax = "proto3"; + +package firestore; + +import "google/firestore/v1/document.proto"; +import "google/firestore/v1/query.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Firestore.Proto"; +option go_package = "google.golang.org/genproto/firestore/proto;firestore"; +option java_multiple_files = true; +option java_outer_classname = "BundleProto"; +option java_package = "com.google.firestore.proto"; +option objc_class_prefix = "FSTPB"; +option php_namespace = "Firestore\\Proto"; + +// Encodes a query saved in the bundle. +message BundledQuery { + // The parent resource name. + string parent = 1; + + // The query to run. + oneof query_type { + // A structured query. + google.firestore.v1.StructuredQuery structured_query = 2; + } + + // If the query is a limit query, should the limit be applied to the beginning or + // the end of results. + enum LimitType { + FIRST = 0; + LAST = 1; + } + LimitType limit_type = 3; +} + +// A Query associated with a name, created as part of the bundle file, and can be read +// by client SDKs once the bundle containing them is loaded. +message NamedQuery { + // Name of the query, such that client can use the name to load this query + // from bundle, and resume from when the query results are materialized + // into this bundle. + string name = 1; + + // The query saved in the bundle. + BundledQuery bundled_query = 2; + + // The read time of the query, when it is used to build the bundle. This is useful to + // resume the query from the bundle, once it is loaded by client SDKs. + google.protobuf.Timestamp read_time = 3; +} + +// Metadata describing a Firestore document saved in the bundle. +message BundledDocumentMetadata { + // The document key of a bundled document. + string name = 1; + + // The snapshot version of the document data bundled. + google.protobuf.Timestamp read_time = 2; + + // Whether the document exists. + bool exists = 3; + + // The names of the queries in this bundle that this document matches to. + repeated string queries = 4; +} + +// Metadata describing the bundle file/stream. +message BundleMetadata { + // The ID of the bundle. + string id = 1; + + // Time at which the documents snapshot is taken for this bundle. + google.protobuf.Timestamp create_time = 2; + + // The schema version of the bundle. + uint32 version = 3; + + // The number of documents in the bundle. + uint32 total_documents = 4; + + // The size of the bundle in bytes, excluding this `BundleMetadata`. + uint64 total_bytes = 5; +} + +// A Firestore bundle is a length-prefixed stream of JSON representations of +// `BundleElement`. +// Only one `BundleMetadata` is expected, and it should be the first element. +// The named queries follow after `metadata`. Every `document_metadata` is +// immediately followed by a `document`. +message BundleElement { + oneof element_type { + BundleMetadata metadata = 1; + + NamedQuery named_query = 2; + + BundledDocumentMetadata document_metadata = 3; + + google.firestore.v1.Document document = 4; + } +} diff --git a/synth.metadata b/synth.metadata index 4f38fc3c2..55fb2f653 100644 --- a/synth.metadata +++ b/synth.metadata @@ -24,6 +24,15 @@ } ], "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "firestore-bundle", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } + }, { "client": { "source": "googleapis", @@ -279,4 +288,4 @@ "samples/snapshot/pom.xml", "samples/snippets/pom.xml" ] -} \ No newline at end of file +} diff --git a/synth.py b/synth.py index edce13e5c..68ed33599 100644 --- a/synth.py +++ b/synth.py @@ -120,6 +120,13 @@ def generate_client(service, version, proto_path=None, bazel_target=None, packag include_gapic=True ) +bundle_v1 = generate_client( + service='firestore-bundle', + version='v1', + proto_path='firestore', + bazel_target='//firestore:google-cloud-firestore-bundle-v1-java', +) + java.common_templates(excludes=[ # firestore uses a different project for its integration tests # due to the default project running datastore diff --git a/update.sh b/update.sh new file mode 100755 index 000000000..f6f294a44 --- /dev/null +++ b/update.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright 2020 Google Inc. +# +# 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. + +# It is an error if a variable is not set. +set -u +IFS=$'\n\t' + +# Variables +SDK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +TEMP_DIR=`mktemp -d` + +# deletes the temp directory on exit +function cleanup { + rm -rf "$TEMP_DIR" + echo "Deleted temp working directory $TEMP_DIR" +} + +# register the cleanup function to be called on the EXIT signal +trap cleanup EXIT + +# Clone googleapis to temp directory. +cd "$TEMP_DIR" +git clone --depth 1 https://github.com/googleapis/googleapis.git + +# Tell synthtool to use the cloned googleapi repo. +export SYNTHTOOL_GOOGLEAPIS="$TEMP_DIR/googleapis" + +# Patch bundle.proto to local googleapi repo. +mkdir "$SYNTHTOOL_GOOGLEAPIS/firestore" +cd "$SDK_DIR" +cp proto-google-cloud-firestore-v1/src/main/proto/firestore/* "$SYNTHTOOL_GOOGLEAPIS/firestore/" + +# Generate code with synthtool. +python3 -m synthtool