From 7fc4b3b2973faa23292b4f92f49ef1445d19934d Mon Sep 17 00:00:00 2001 From: JesseLovelace <43148100+JesseLovelace@users.noreply.github.com> Date: Wed, 30 Jan 2019 13:04:42 -0800 Subject: [PATCH] Generate Firestore API v1 (#4410) --- .../grpc-google-cloud-firestore-v1/pom.xml | 31 + .../google/firestore/v1/FirestoreGrpc.java | 1788 +++ google-api-grpc/pom.xml | 12 + .../proto-google-cloud-firestore-v1/pom.xml | 31 + .../com/google/firestore/v1/AnyPathName.java | 240 + .../com/google/firestore/v1/ArrayValue.java | 916 ++ .../firestore/v1/ArrayValueOrBuilder.java | 61 + .../v1/BatchGetDocumentsRequest.java | 1975 +++ .../v1/BatchGetDocumentsRequestOrBuilder.java | 211 + .../v1/BatchGetDocumentsResponse.java | 1373 ++ .../BatchGetDocumentsResponseOrBuilder.java | 119 + .../firestore/v1/BeginTransactionRequest.java | 883 ++ .../v1/BeginTransactionRequestOrBuilder.java | 67 + .../v1/BeginTransactionResponse.java | 520 + .../v1/BeginTransactionResponseOrBuilder.java | 21 + .../google/firestore/v1/CommitRequest.java | 1194 ++ .../firestore/v1/CommitRequestOrBuilder.java | 100 + .../google/firestore/v1/CommitResponse.java | 1234 ++ .../firestore/v1/CommitResponseOrBuilder.java | 103 + .../com/google/firestore/v1/CommonProto.java | 124 + .../firestore/v1/CreateDocumentRequest.java | 1487 ++ .../v1/CreateDocumentRequestOrBuilder.java | 147 + .../java/com/google/firestore/v1/Cursor.java | 1046 ++ .../google/firestore/v1/CursorOrBuilder.java | 83 + .../google/firestore/v1/DatabaseRootName.java | 180 + .../firestore/v1/DeleteDocumentRequest.java | 883 ++ .../v1/DeleteDocumentRequestOrBuilder.java | 67 + .../com/google/firestore/v1/Document.java | 1722 +++ .../google/firestore/v1/DocumentChange.java | 1156 ++ .../firestore/v1/DocumentChangeOrBuilder.java | 106 + .../google/firestore/v1/DocumentDelete.java | 1096 ++ .../firestore/v1/DocumentDeleteOrBuilder.java | 96 + .../com/google/firestore/v1/DocumentMask.java | 698 + .../firestore/v1/DocumentMaskOrBuilder.java | 55 + .../firestore/v1/DocumentOrBuilder.java | 258 + .../google/firestore/v1/DocumentPathName.java | 213 + .../google/firestore/v1/DocumentProto.java | 163 + .../google/firestore/v1/DocumentRemove.java | 1098 ++ .../firestore/v1/DocumentRemoveOrBuilder.java | 96 + .../google/firestore/v1/DocumentRootName.java | 180 + .../firestore/v1/DocumentTransform.java | 4484 ++++++ .../v1/DocumentTransformOrBuilder.java | 99 + .../google/firestore/v1/ExistenceFilter.java | 603 + .../v1/ExistenceFilterOrBuilder.java | 34 + .../google/firestore/v1/FirestoreProto.java | 597 + .../firestore/v1/GetDocumentRequest.java | 1357 ++ .../v1/GetDocumentRequestOrBuilder.java | 118 + .../v1/ListCollectionIdsRequest.java | 867 ++ .../v1/ListCollectionIdsRequestOrBuilder.java | 71 + .../v1/ListCollectionIdsResponse.java | 846 ++ .../ListCollectionIdsResponseOrBuilder.java | 72 + .../firestore/v1/ListDocumentsRequest.java | 2055 +++ .../v1/ListDocumentsRequestOrBuilder.java | 218 + .../firestore/v1/ListDocumentsResponse.java | 1087 ++ .../v1/ListDocumentsResponseOrBuilder.java | 82 + .../google/firestore/v1/ListenRequest.java | 1370 ++ .../firestore/v1/ListenRequestOrBuilder.java | 131 + .../google/firestore/v1/ListenResponse.java | 2007 +++ .../firestore/v1/ListenResponseOrBuilder.java | 179 + .../com/google/firestore/v1/MapValue.java | 800 ++ .../firestore/v1/MapValueOrBuilder.java | 85 + .../com/google/firestore/v1/Precondition.java | 900 ++ .../firestore/v1/PreconditionOrBuilder.java | 58 + .../com/google/firestore/v1/QueryProto.java | 225 + .../google/firestore/v1/RollbackRequest.java | 686 + .../v1/RollbackRequestOrBuilder.java | 44 + .../google/firestore/v1/RunQueryRequest.java | 1790 +++ .../v1/RunQueryRequestOrBuilder.java | 162 + .../google/firestore/v1/RunQueryResponse.java | 1206 ++ .../v1/RunQueryResponseOrBuilder.java | 116 + .../google/firestore/v1/StructuredQuery.java | 11934 ++++++++++++++++ .../v1/StructuredQueryOrBuilder.java | 353 + .../java/com/google/firestore/v1/Target.java | 3572 +++++ .../com/google/firestore/v1/TargetChange.java | 1730 +++ .../firestore/v1/TargetChangeOrBuilder.java | 173 + .../google/firestore/v1/TargetOrBuilder.java | 149 + .../firestore/v1/TransactionOptions.java | 2480 ++++ .../v1/TransactionOptionsOrBuilder.java | 74 + .../firestore/v1/UpdateDocumentRequest.java | 1599 +++ .../v1/UpdateDocumentRequestOrBuilder.java | 161 + .../java/com/google/firestore/v1/Value.java | 2654 ++++ .../google/firestore/v1/ValueOrBuilder.java | 265 + .../java/com/google/firestore/v1/Write.java | 1949 +++ .../google/firestore/v1/WriteOrBuilder.java | 195 + .../com/google/firestore/v1/WriteProto.java | 195 + .../com/google/firestore/v1/WriteRequest.java | 1802 +++ .../firestore/v1/WriteRequestOrBuilder.java | 205 + .../google/firestore/v1/WriteResponse.java | 1492 ++ .../firestore/v1/WriteResponseOrBuilder.java | 139 + .../com/google/firestore/v1/WriteResult.java | 1244 ++ .../firestore/v1/WriteResultOrBuilder.java | 107 + .../proto/google/firestore/v1/common.proto | 84 + .../proto/google/firestore/v1/document.proto | 151 + .../proto/google/firestore/v1/firestore.proto | 761 + .../proto/google/firestore/v1/query.proto | 236 + .../proto/google/firestore/v1/write.proto | 255 + .../firestore/v1beta1/DocumentTransform.java | 1386 ++ .../google/firestore/v1beta1/WriteProto.java | 59 +- .../google/firestore/v1beta1/common.proto | 3 +- .../google/firestore/v1beta1/document.proto | 3 +- .../google/firestore/v1beta1/firestore.proto | 3 +- .../google/firestore/v1beta1/query.proto | 3 +- .../google/firestore/v1beta1/write.proto | 43 +- google-cloud-bom/pom.xml | 10 + .../google-cloud-firestore/pom.xml | 9 + .../cloud/firestore/v1/FirestoreClient.java | 1286 ++ .../cloud/firestore/v1/FirestoreSettings.java | 334 + .../cloud/firestore/v1/package-info.java | 49 + .../firestore/v1/stub/FirestoreStub.java | 128 + .../v1/stub/FirestoreStubSettings.java | 707 + .../v1/stub/GrpcFirestoreCallableFactory.java | 115 + .../firestore/v1/stub/GrpcFirestoreStub.java | 446 + .../firestore/v1beta1/FirestoreClient.java | 2 +- .../firestore/v1beta1/FirestoreSettings.java | 2 +- .../cloud/firestore/v1beta1/package-info.java | 2 +- .../firestore/v1beta1/stub/FirestoreStub.java | 2 +- .../v1beta1/stub/FirestoreStubSettings.java | 2 +- .../stub/GrpcFirestoreCallableFactory.java | 2 +- .../v1beta1/stub/GrpcFirestoreStub.java | 2 +- .../firestore/v1/FirestoreClientTest.java | 561 + .../cloud/firestore/v1/MockFirestore.java | 57 + .../cloud/firestore/v1/MockFirestoreImpl.java | 303 + .../v1beta1/FirestoreClientTest.java | 2 +- .../firestore/v1beta1/MockFirestore.java | 2 +- .../firestore/v1beta1/MockFirestoreImpl.java | 2 +- .../google-cloud-firestore/synth.py | 47 +- google-cloud-clients/pom.xml | 2 +- 127 files changed, 83656 insertions(+), 59 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-firestore-v1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/AnyPathName.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValue.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValueOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommonProto.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CreateDocumentRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CreateDocumentRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Cursor.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CursorOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DatabaseRootName.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Document.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChange.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChangeOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDelete.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDeleteOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMask.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMaskOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentPathName.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentProto.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemove.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemoveOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRootName.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransform.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransformOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilter.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilterOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/GetDocumentRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/GetDocumentRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValue.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValueOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Precondition.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PreconditionOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProto.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RollbackRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RollbackRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQuery.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQueryOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Target.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChange.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChangeOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptions.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptionsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Value.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ValueOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Write.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteProto.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteRequest.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponse.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResult.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResultOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/common.proto create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/document.proto create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query.proto create mode 100644 google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/write.proto create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreSettings.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/package-info.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStub.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestore.java create mode 100644 google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreImpl.java diff --git a/google-api-grpc/grpc-google-cloud-firestore-v1/pom.xml b/google-api-grpc/grpc-google-cloud-firestore-v1/pom.xml new file mode 100644 index 000000000000..0c42bddddf11 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-firestore-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-firestore-v1 + 0.44.1-SNAPSHOT + grpc-google-cloud-firestore-v1 + GRPC library for grpc-google-cloud-firestore-v1 + + com.google.api.grpc + google-api-grpc + 0.44.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-firestore-v1 + compile + + + \ No newline at end of file diff --git a/google-api-grpc/grpc-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreGrpc.java b/google-api-grpc/grpc-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreGrpc.java new file mode 100644 index 000000000000..cfe117b3af9d --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreGrpc.java @@ -0,0 +1,1788 @@ +package com.google.firestore.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * The Cloud Firestore service.
+ * This service exposes several types of comparable timestamps:
+ * *    `create_time` - The time at which a document was created. Changes only
+ *      when a document is deleted, then re-created. Increases in a strict
+ *       monotonic fashion.
+ * *    `update_time` - The time at which a document was last updated. Changes
+ *      every time a document is modified. Does not change when a write results
+ *      in no modifications. Increases in a strict monotonic fashion.
+ * *    `read_time` - The time at which a particular state was observed. Used
+ *      to denote a consistent snapshot of the database or the time at which a
+ *      Document was observed to not exist.
+ * *    `commit_time` - The time at which the writes in a transaction were
+ *      committed. Any read with an equal or greater `read_time` is guaranteed
+ *      to see the effects of the transaction.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/firestore/v1/firestore.proto") +public final class FirestoreGrpc { + + private FirestoreGrpc() {} + + public static final String SERVICE_NAME = "google.firestore.v1.Firestore"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetDocumentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.GetDocumentRequest, com.google.firestore.v1.Document> + METHOD_GET_DOCUMENT = getGetDocumentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.GetDocumentRequest, com.google.firestore.v1.Document> + getGetDocumentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.GetDocumentRequest, com.google.firestore.v1.Document> + getGetDocumentMethod() { + return getGetDocumentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.GetDocumentRequest, com.google.firestore.v1.Document> + getGetDocumentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.GetDocumentRequest, com.google.firestore.v1.Document> + getGetDocumentMethod; + if ((getGetDocumentMethod = FirestoreGrpc.getGetDocumentMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getGetDocumentMethod = FirestoreGrpc.getGetDocumentMethod) == null) { + FirestoreGrpc.getGetDocumentMethod = + getGetDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "GetDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.GetDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.Document.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("GetDocument")) + .build(); + } + } + } + return getGetDocumentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListDocumentsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.ListDocumentsRequest, + com.google.firestore.v1.ListDocumentsResponse> + METHOD_LIST_DOCUMENTS = getListDocumentsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.ListDocumentsRequest, + com.google.firestore.v1.ListDocumentsResponse> + getListDocumentsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.ListDocumentsRequest, + com.google.firestore.v1.ListDocumentsResponse> + getListDocumentsMethod() { + return getListDocumentsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.ListDocumentsRequest, + com.google.firestore.v1.ListDocumentsResponse> + getListDocumentsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.ListDocumentsRequest, + com.google.firestore.v1.ListDocumentsResponse> + getListDocumentsMethod; + if ((getListDocumentsMethod = FirestoreGrpc.getListDocumentsMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getListDocumentsMethod = FirestoreGrpc.getListDocumentsMethod) == null) { + FirestoreGrpc.getListDocumentsMethod = + getListDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "ListDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.ListDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.ListDocumentsResponse.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("ListDocuments")) + .build(); + } + } + } + return getListDocumentsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateDocumentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.CreateDocumentRequest, com.google.firestore.v1.Document> + METHOD_CREATE_DOCUMENT = getCreateDocumentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.CreateDocumentRequest, com.google.firestore.v1.Document> + getCreateDocumentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.CreateDocumentRequest, com.google.firestore.v1.Document> + getCreateDocumentMethod() { + return getCreateDocumentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.CreateDocumentRequest, com.google.firestore.v1.Document> + getCreateDocumentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.CreateDocumentRequest, com.google.firestore.v1.Document> + getCreateDocumentMethod; + if ((getCreateDocumentMethod = FirestoreGrpc.getCreateDocumentMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getCreateDocumentMethod = FirestoreGrpc.getCreateDocumentMethod) == null) { + FirestoreGrpc.getCreateDocumentMethod = + getCreateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "CreateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.CreateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.Document.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("CreateDocument")) + .build(); + } + } + } + return getCreateDocumentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateDocumentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.UpdateDocumentRequest, com.google.firestore.v1.Document> + METHOD_UPDATE_DOCUMENT = getUpdateDocumentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.UpdateDocumentRequest, com.google.firestore.v1.Document> + getUpdateDocumentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.UpdateDocumentRequest, com.google.firestore.v1.Document> + getUpdateDocumentMethod() { + return getUpdateDocumentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.UpdateDocumentRequest, com.google.firestore.v1.Document> + getUpdateDocumentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.UpdateDocumentRequest, com.google.firestore.v1.Document> + getUpdateDocumentMethod; + if ((getUpdateDocumentMethod = FirestoreGrpc.getUpdateDocumentMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getUpdateDocumentMethod = FirestoreGrpc.getUpdateDocumentMethod) == null) { + FirestoreGrpc.getUpdateDocumentMethod = + getUpdateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "UpdateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.UpdateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.Document.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("UpdateDocument")) + .build(); + } + } + } + return getUpdateDocumentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteDocumentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + METHOD_DELETE_DOCUMENT = getDeleteDocumentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod() { + return getDeleteDocumentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod; + if ((getDeleteDocumentMethod = FirestoreGrpc.getDeleteDocumentMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getDeleteDocumentMethod = FirestoreGrpc.getDeleteDocumentMethod) == null) { + FirestoreGrpc.getDeleteDocumentMethod = + getDeleteDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "DeleteDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.DeleteDocumentRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("DeleteDocument")) + .build(); + } + } + } + return getDeleteDocumentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getBatchGetDocumentsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.BatchGetDocumentsRequest, + com.google.firestore.v1.BatchGetDocumentsResponse> + METHOD_BATCH_GET_DOCUMENTS = getBatchGetDocumentsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.BatchGetDocumentsRequest, + com.google.firestore.v1.BatchGetDocumentsResponse> + getBatchGetDocumentsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.BatchGetDocumentsRequest, + com.google.firestore.v1.BatchGetDocumentsResponse> + getBatchGetDocumentsMethod() { + return getBatchGetDocumentsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.BatchGetDocumentsRequest, + com.google.firestore.v1.BatchGetDocumentsResponse> + getBatchGetDocumentsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.BatchGetDocumentsRequest, + com.google.firestore.v1.BatchGetDocumentsResponse> + getBatchGetDocumentsMethod; + if ((getBatchGetDocumentsMethod = FirestoreGrpc.getBatchGetDocumentsMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getBatchGetDocumentsMethod = FirestoreGrpc.getBatchGetDocumentsMethod) == null) { + FirestoreGrpc.getBatchGetDocumentsMethod = + getBatchGetDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName( + "google.firestore.v1.Firestore", "BatchGetDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.BatchGetDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.BatchGetDocumentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreMethodDescriptorSupplier("BatchGetDocuments")) + .build(); + } + } + } + return getBatchGetDocumentsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getBeginTransactionMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.BeginTransactionRequest, + com.google.firestore.v1.BeginTransactionResponse> + METHOD_BEGIN_TRANSACTION = getBeginTransactionMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.BeginTransactionRequest, + com.google.firestore.v1.BeginTransactionResponse> + getBeginTransactionMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.BeginTransactionRequest, + com.google.firestore.v1.BeginTransactionResponse> + getBeginTransactionMethod() { + return getBeginTransactionMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.BeginTransactionRequest, + com.google.firestore.v1.BeginTransactionResponse> + getBeginTransactionMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.BeginTransactionRequest, + com.google.firestore.v1.BeginTransactionResponse> + getBeginTransactionMethod; + if ((getBeginTransactionMethod = FirestoreGrpc.getBeginTransactionMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getBeginTransactionMethod = FirestoreGrpc.getBeginTransactionMethod) == null) { + FirestoreGrpc.getBeginTransactionMethod = + getBeginTransactionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.v1.Firestore", "BeginTransaction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.BeginTransactionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.BeginTransactionResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreMethodDescriptorSupplier("BeginTransaction")) + .build(); + } + } + } + return getBeginTransactionMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCommitMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.CommitRequest, com.google.firestore.v1.CommitResponse> + METHOD_COMMIT = getCommitMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.CommitRequest, com.google.firestore.v1.CommitResponse> + getCommitMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.CommitRequest, com.google.firestore.v1.CommitResponse> + getCommitMethod() { + return getCommitMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.CommitRequest, com.google.firestore.v1.CommitResponse> + getCommitMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.CommitRequest, com.google.firestore.v1.CommitResponse> + getCommitMethod; + if ((getCommitMethod = FirestoreGrpc.getCommitMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getCommitMethod = FirestoreGrpc.getCommitMethod) == null) { + FirestoreGrpc.getCommitMethod = + getCommitMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "Commit")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.CommitRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.CommitResponse.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("Commit")) + .build(); + } + } + } + return getCommitMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRollbackMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.RollbackRequest, com.google.protobuf.Empty> + METHOD_ROLLBACK = getRollbackMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.RollbackRequest, com.google.protobuf.Empty> + getRollbackMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.RollbackRequest, com.google.protobuf.Empty> + getRollbackMethod() { + return getRollbackMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.RollbackRequest, com.google.protobuf.Empty> + getRollbackMethodHelper() { + io.grpc.MethodDescriptor + getRollbackMethod; + if ((getRollbackMethod = FirestoreGrpc.getRollbackMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getRollbackMethod = FirestoreGrpc.getRollbackMethod) == null) { + FirestoreGrpc.getRollbackMethod = + getRollbackMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "Rollback")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.RollbackRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("Rollback")) + .build(); + } + } + } + return getRollbackMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRunQueryMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.RunQueryRequest, com.google.firestore.v1.RunQueryResponse> + METHOD_RUN_QUERY = getRunQueryMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.RunQueryRequest, com.google.firestore.v1.RunQueryResponse> + getRunQueryMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.RunQueryRequest, com.google.firestore.v1.RunQueryResponse> + getRunQueryMethod() { + return getRunQueryMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.RunQueryRequest, com.google.firestore.v1.RunQueryResponse> + getRunQueryMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.RunQueryRequest, com.google.firestore.v1.RunQueryResponse> + getRunQueryMethod; + if ((getRunQueryMethod = FirestoreGrpc.getRunQueryMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getRunQueryMethod = FirestoreGrpc.getRunQueryMethod) == null) { + FirestoreGrpc.getRunQueryMethod = + getRunQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "RunQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.RunQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.RunQueryResponse.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("RunQuery")) + .build(); + } + } + } + return getRunQueryMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getWriteMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.WriteRequest, com.google.firestore.v1.WriteResponse> + METHOD_WRITE = getWriteMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.WriteRequest, com.google.firestore.v1.WriteResponse> + getWriteMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.WriteRequest, com.google.firestore.v1.WriteResponse> + getWriteMethod() { + return getWriteMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.WriteRequest, com.google.firestore.v1.WriteResponse> + getWriteMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.WriteRequest, com.google.firestore.v1.WriteResponse> + getWriteMethod; + if ((getWriteMethod = FirestoreGrpc.getWriteMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getWriteMethod = FirestoreGrpc.getWriteMethod) == null) { + FirestoreGrpc.getWriteMethod = + getWriteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "Write")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.WriteRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.WriteResponse.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("Write")) + .build(); + } + } + } + return getWriteMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListenMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.ListenRequest, com.google.firestore.v1.ListenResponse> + METHOD_LISTEN = getListenMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.ListenRequest, com.google.firestore.v1.ListenResponse> + getListenMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.ListenRequest, com.google.firestore.v1.ListenResponse> + getListenMethod() { + return getListenMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.ListenRequest, com.google.firestore.v1.ListenResponse> + getListenMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.ListenRequest, com.google.firestore.v1.ListenResponse> + getListenMethod; + if ((getListenMethod = FirestoreGrpc.getListenMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getListenMethod = FirestoreGrpc.getListenMethod) == null) { + FirestoreGrpc.getListenMethod = + getListenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName("google.firestore.v1.Firestore", "Listen")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.ListenRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.ListenResponse.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreMethodDescriptorSupplier("Listen")) + .build(); + } + } + } + return getListenMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListCollectionIdsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.v1.ListCollectionIdsRequest, + com.google.firestore.v1.ListCollectionIdsResponse> + METHOD_LIST_COLLECTION_IDS = getListCollectionIdsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.v1.ListCollectionIdsRequest, + com.google.firestore.v1.ListCollectionIdsResponse> + getListCollectionIdsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.v1.ListCollectionIdsRequest, + com.google.firestore.v1.ListCollectionIdsResponse> + getListCollectionIdsMethod() { + return getListCollectionIdsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.v1.ListCollectionIdsRequest, + com.google.firestore.v1.ListCollectionIdsResponse> + getListCollectionIdsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.v1.ListCollectionIdsRequest, + com.google.firestore.v1.ListCollectionIdsResponse> + getListCollectionIdsMethod; + if ((getListCollectionIdsMethod = FirestoreGrpc.getListCollectionIdsMethod) == null) { + synchronized (FirestoreGrpc.class) { + if ((getListCollectionIdsMethod = FirestoreGrpc.getListCollectionIdsMethod) == null) { + FirestoreGrpc.getListCollectionIdsMethod = + getListCollectionIdsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.v1.Firestore", "ListCollectionIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.ListCollectionIdsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.v1.ListCollectionIdsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreMethodDescriptorSupplier("ListCollectionIds")) + .build(); + } + } + } + return getListCollectionIdsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FirestoreStub newStub(io.grpc.Channel channel) { + return new FirestoreStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FirestoreBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new FirestoreBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FirestoreFutureStub newFutureStub(io.grpc.Channel channel) { + return new FirestoreFutureStub(channel); + } + + /** + * + * + *
+   * The Cloud Firestore service.
+   * This service exposes several types of comparable timestamps:
+   * *    `create_time` - The time at which a document was created. Changes only
+   *      when a document is deleted, then re-created. Increases in a strict
+   *       monotonic fashion.
+   * *    `update_time` - The time at which a document was last updated. Changes
+   *      every time a document is modified. Does not change when a write results
+   *      in no modifications. Increases in a strict monotonic fashion.
+   * *    `read_time` - The time at which a particular state was observed. Used
+   *      to denote a consistent snapshot of the database or the time at which a
+   *      Document was observed to not exist.
+   * *    `commit_time` - The time at which the writes in a transaction were
+   *      committed. Any read with an equal or greater `read_time` is guaranteed
+   *      to see the effects of the transaction.
+   * 
+ */ + public abstract static class FirestoreImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Gets a single document.
+     * 
+ */ + public void getDocument( + com.google.firestore.v1.GetDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetDocumentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists documents.
+     * 
+ */ + public void listDocuments( + com.google.firestore.v1.ListDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListDocumentsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a new document.
+     * 
+ */ + public void createDocument( + com.google.firestore.v1.CreateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateDocumentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates or inserts a document.
+     * 
+ */ + public void updateDocument( + com.google.firestore.v1.UpdateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateDocumentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a document.
+     * 
+ */ + public void deleteDocument( + com.google.firestore.v1.DeleteDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteDocumentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets multiple documents.
+     * Documents returned by this method are not guaranteed to be returned in the
+     * same order that they were requested.
+     * 
+ */ + public void batchGetDocuments( + com.google.firestore.v1.BatchGetDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getBatchGetDocumentsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Starts a new transaction.
+     * 
+ */ + public void beginTransaction( + com.google.firestore.v1.BeginTransactionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getBeginTransactionMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Commits a transaction, while optionally updating documents.
+     * 
+ */ + public void commit( + com.google.firestore.v1.CommitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCommitMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Rolls back a transaction.
+     * 
+ */ + public void rollback( + com.google.firestore.v1.RollbackRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRollbackMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Runs a query.
+     * 
+ */ + public void runQuery( + com.google.firestore.v1.RunQueryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRunQueryMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Streams batches of document updates and deletes, in order.
+     * 
+ */ + public io.grpc.stub.StreamObserver write( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getWriteMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Listens to changes.
+     * 
+ */ + public io.grpc.stub.StreamObserver listen( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getListenMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists all the collection IDs underneath a document.
+     * 
+ */ + public void listCollectionIds( + com.google.firestore.v1.ListCollectionIdsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListCollectionIdsMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetDocumentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.GetDocumentRequest, com.google.firestore.v1.Document>( + this, METHODID_GET_DOCUMENT))) + .addMethod( + getListDocumentsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.ListDocumentsRequest, + com.google.firestore.v1.ListDocumentsResponse>( + this, METHODID_LIST_DOCUMENTS))) + .addMethod( + getCreateDocumentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.CreateDocumentRequest, + com.google.firestore.v1.Document>(this, METHODID_CREATE_DOCUMENT))) + .addMethod( + getUpdateDocumentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.UpdateDocumentRequest, + com.google.firestore.v1.Document>(this, METHODID_UPDATE_DOCUMENT))) + .addMethod( + getDeleteDocumentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.DeleteDocumentRequest, com.google.protobuf.Empty>( + this, METHODID_DELETE_DOCUMENT))) + .addMethod( + getBatchGetDocumentsMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.google.firestore.v1.BatchGetDocumentsRequest, + com.google.firestore.v1.BatchGetDocumentsResponse>( + this, METHODID_BATCH_GET_DOCUMENTS))) + .addMethod( + getBeginTransactionMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.BeginTransactionRequest, + com.google.firestore.v1.BeginTransactionResponse>( + this, METHODID_BEGIN_TRANSACTION))) + .addMethod( + getCommitMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.CommitRequest, + com.google.firestore.v1.CommitResponse>(this, METHODID_COMMIT))) + .addMethod( + getRollbackMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.RollbackRequest, com.google.protobuf.Empty>( + this, METHODID_ROLLBACK))) + .addMethod( + getRunQueryMethodHelper(), + asyncServerStreamingCall( + new MethodHandlers< + com.google.firestore.v1.RunQueryRequest, + com.google.firestore.v1.RunQueryResponse>(this, METHODID_RUN_QUERY))) + .addMethod( + getWriteMethodHelper(), + asyncBidiStreamingCall( + new MethodHandlers< + com.google.firestore.v1.WriteRequest, com.google.firestore.v1.WriteResponse>( + this, METHODID_WRITE))) + .addMethod( + getListenMethodHelper(), + asyncBidiStreamingCall( + new MethodHandlers< + com.google.firestore.v1.ListenRequest, + com.google.firestore.v1.ListenResponse>(this, METHODID_LISTEN))) + .addMethod( + getListCollectionIdsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.v1.ListCollectionIdsRequest, + com.google.firestore.v1.ListCollectionIdsResponse>( + this, METHODID_LIST_COLLECTION_IDS))) + .build(); + } + } + + /** + * + * + *
+   * The Cloud Firestore service.
+   * This service exposes several types of comparable timestamps:
+   * *    `create_time` - The time at which a document was created. Changes only
+   *      when a document is deleted, then re-created. Increases in a strict
+   *       monotonic fashion.
+   * *    `update_time` - The time at which a document was last updated. Changes
+   *      every time a document is modified. Does not change when a write results
+   *      in no modifications. Increases in a strict monotonic fashion.
+   * *    `read_time` - The time at which a particular state was observed. Used
+   *      to denote a consistent snapshot of the database or the time at which a
+   *      Document was observed to not exist.
+   * *    `commit_time` - The time at which the writes in a transaction were
+   *      committed. Any read with an equal or greater `read_time` is guaranteed
+   *      to see the effects of the transaction.
+   * 
+ */ + public static final class FirestoreStub extends io.grpc.stub.AbstractStub { + private FirestoreStub(io.grpc.Channel channel) { + super(channel); + } + + private FirestoreStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FirestoreStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FirestoreStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single document.
+     * 
+ */ + public void getDocument( + com.google.firestore.v1.GetDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetDocumentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists documents.
+     * 
+ */ + public void listDocuments( + com.google.firestore.v1.ListDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListDocumentsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new document.
+     * 
+ */ + public void createDocument( + com.google.firestore.v1.CreateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateDocumentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates or inserts a document.
+     * 
+ */ + public void updateDocument( + com.google.firestore.v1.UpdateDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateDocumentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a document.
+     * 
+ */ + public void deleteDocument( + com.google.firestore.v1.DeleteDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteDocumentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets multiple documents.
+     * Documents returned by this method are not guaranteed to be returned in the
+     * same order that they were requested.
+     * 
+ */ + public void batchGetDocuments( + com.google.firestore.v1.BatchGetDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getBatchGetDocumentsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts a new transaction.
+     * 
+ */ + public void beginTransaction( + com.google.firestore.v1.BeginTransactionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBeginTransactionMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Commits a transaction, while optionally updating documents.
+     * 
+ */ + public void commit( + com.google.firestore.v1.CommitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCommitMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rolls back a transaction.
+     * 
+ */ + public void rollback( + com.google.firestore.v1.RollbackRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRollbackMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Runs a query.
+     * 
+ */ + public void runQuery( + com.google.firestore.v1.RunQueryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getRunQueryMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Streams batches of document updates and deletes, in order.
+     * 
+ */ + public io.grpc.stub.StreamObserver write( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getWriteMethodHelper(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * Listens to changes.
+     * 
+ */ + public io.grpc.stub.StreamObserver listen( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getListenMethodHelper(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * Lists all the collection IDs underneath a document.
+     * 
+ */ + public void listCollectionIds( + com.google.firestore.v1.ListCollectionIdsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListCollectionIdsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The Cloud Firestore service.
+   * This service exposes several types of comparable timestamps:
+   * *    `create_time` - The time at which a document was created. Changes only
+   *      when a document is deleted, then re-created. Increases in a strict
+   *       monotonic fashion.
+   * *    `update_time` - The time at which a document was last updated. Changes
+   *      every time a document is modified. Does not change when a write results
+   *      in no modifications. Increases in a strict monotonic fashion.
+   * *    `read_time` - The time at which a particular state was observed. Used
+   *      to denote a consistent snapshot of the database or the time at which a
+   *      Document was observed to not exist.
+   * *    `commit_time` - The time at which the writes in a transaction were
+   *      committed. Any read with an equal or greater `read_time` is guaranteed
+   *      to see the effects of the transaction.
+   * 
+ */ + public static final class FirestoreBlockingStub + extends io.grpc.stub.AbstractStub { + private FirestoreBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private FirestoreBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FirestoreBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FirestoreBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single document.
+     * 
+ */ + public com.google.firestore.v1.Document getDocument( + com.google.firestore.v1.GetDocumentRequest request) { + return blockingUnaryCall( + getChannel(), getGetDocumentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists documents.
+     * 
+ */ + public com.google.firestore.v1.ListDocumentsResponse listDocuments( + com.google.firestore.v1.ListDocumentsRequest request) { + return blockingUnaryCall( + getChannel(), getListDocumentsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new document.
+     * 
+ */ + public com.google.firestore.v1.Document createDocument( + com.google.firestore.v1.CreateDocumentRequest request) { + return blockingUnaryCall( + getChannel(), getCreateDocumentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates or inserts a document.
+     * 
+ */ + public com.google.firestore.v1.Document updateDocument( + com.google.firestore.v1.UpdateDocumentRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateDocumentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a document.
+     * 
+ */ + public com.google.protobuf.Empty deleteDocument( + com.google.firestore.v1.DeleteDocumentRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteDocumentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets multiple documents.
+     * Documents returned by this method are not guaranteed to be returned in the
+     * same order that they were requested.
+     * 
+ */ + public java.util.Iterator batchGetDocuments( + com.google.firestore.v1.BatchGetDocumentsRequest request) { + return blockingServerStreamingCall( + getChannel(), getBatchGetDocumentsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts a new transaction.
+     * 
+ */ + public com.google.firestore.v1.BeginTransactionResponse beginTransaction( + com.google.firestore.v1.BeginTransactionRequest request) { + return blockingUnaryCall( + getChannel(), getBeginTransactionMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Commits a transaction, while optionally updating documents.
+     * 
+ */ + public com.google.firestore.v1.CommitResponse commit( + com.google.firestore.v1.CommitRequest request) { + return blockingUnaryCall(getChannel(), getCommitMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rolls back a transaction.
+     * 
+ */ + public com.google.protobuf.Empty rollback(com.google.firestore.v1.RollbackRequest request) { + return blockingUnaryCall(getChannel(), getRollbackMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Runs a query.
+     * 
+ */ + public java.util.Iterator runQuery( + com.google.firestore.v1.RunQueryRequest request) { + return blockingServerStreamingCall( + getChannel(), getRunQueryMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the collection IDs underneath a document.
+     * 
+ */ + public com.google.firestore.v1.ListCollectionIdsResponse listCollectionIds( + com.google.firestore.v1.ListCollectionIdsRequest request) { + return blockingUnaryCall( + getChannel(), getListCollectionIdsMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The Cloud Firestore service.
+   * This service exposes several types of comparable timestamps:
+   * *    `create_time` - The time at which a document was created. Changes only
+   *      when a document is deleted, then re-created. Increases in a strict
+   *       monotonic fashion.
+   * *    `update_time` - The time at which a document was last updated. Changes
+   *      every time a document is modified. Does not change when a write results
+   *      in no modifications. Increases in a strict monotonic fashion.
+   * *    `read_time` - The time at which a particular state was observed. Used
+   *      to denote a consistent snapshot of the database or the time at which a
+   *      Document was observed to not exist.
+   * *    `commit_time` - The time at which the writes in a transaction were
+   *      committed. Any read with an equal or greater `read_time` is guaranteed
+   *      to see the effects of the transaction.
+   * 
+ */ + public static final class FirestoreFutureStub + extends io.grpc.stub.AbstractStub { + private FirestoreFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private FirestoreFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FirestoreFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FirestoreFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getDocument(com.google.firestore.v1.GetDocumentRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetDocumentMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists documents.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.v1.ListDocumentsResponse> + listDocuments(com.google.firestore.v1.ListDocumentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListDocumentsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createDocument(com.google.firestore.v1.CreateDocumentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateDocumentMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates or inserts a document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateDocument(com.google.firestore.v1.UpdateDocumentRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateDocumentMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDocument(com.google.firestore.v1.DeleteDocumentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteDocumentMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts a new transaction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.v1.BeginTransactionResponse> + beginTransaction(com.google.firestore.v1.BeginTransactionRequest request) { + return futureUnaryCall( + getChannel().newCall(getBeginTransactionMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Commits a transaction, while optionally updating documents.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.v1.CommitResponse> + commit(com.google.firestore.v1.CommitRequest request) { + return futureUnaryCall( + getChannel().newCall(getCommitMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rolls back a transaction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture rollback( + com.google.firestore.v1.RollbackRequest request) { + return futureUnaryCall( + getChannel().newCall(getRollbackMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the collection IDs underneath a document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.v1.ListCollectionIdsResponse> + listCollectionIds(com.google.firestore.v1.ListCollectionIdsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListCollectionIdsMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_DOCUMENT = 0; + private static final int METHODID_LIST_DOCUMENTS = 1; + private static final int METHODID_CREATE_DOCUMENT = 2; + private static final int METHODID_UPDATE_DOCUMENT = 3; + private static final int METHODID_DELETE_DOCUMENT = 4; + private static final int METHODID_BATCH_GET_DOCUMENTS = 5; + private static final int METHODID_BEGIN_TRANSACTION = 6; + private static final int METHODID_COMMIT = 7; + private static final int METHODID_ROLLBACK = 8; + private static final int METHODID_RUN_QUERY = 9; + private static final int METHODID_LIST_COLLECTION_IDS = 10; + private static final int METHODID_WRITE = 11; + private static final int METHODID_LISTEN = 12; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final FirestoreImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FirestoreImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_DOCUMENT: + serviceImpl.getDocument( + (com.google.firestore.v1.GetDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_DOCUMENTS: + serviceImpl.listDocuments( + (com.google.firestore.v1.ListDocumentsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_DOCUMENT: + serviceImpl.createDocument( + (com.google.firestore.v1.CreateDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_DOCUMENT: + serviceImpl.updateDocument( + (com.google.firestore.v1.UpdateDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_DOCUMENT: + serviceImpl.deleteDocument( + (com.google.firestore.v1.DeleteDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_GET_DOCUMENTS: + serviceImpl.batchGetDocuments( + (com.google.firestore.v1.BatchGetDocumentsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_BEGIN_TRANSACTION: + serviceImpl.beginTransaction( + (com.google.firestore.v1.BeginTransactionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COMMIT: + serviceImpl.commit( + (com.google.firestore.v1.CommitRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ROLLBACK: + serviceImpl.rollback( + (com.google.firestore.v1.RollbackRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RUN_QUERY: + serviceImpl.runQuery( + (com.google.firestore.v1.RunQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_COLLECTION_IDS: + serviceImpl.listCollectionIds( + (com.google.firestore.v1.ListCollectionIdsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_WRITE: + return (io.grpc.stub.StreamObserver) + serviceImpl.write( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_LISTEN: + return (io.grpc.stub.StreamObserver) + serviceImpl.listen( + (io.grpc.stub.StreamObserver) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + private abstract static class FirestoreBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FirestoreBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.firestore.v1.FirestoreProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Firestore"); + } + } + + private static final class FirestoreFileDescriptorSupplier + extends FirestoreBaseDescriptorSupplier { + FirestoreFileDescriptorSupplier() {} + } + + private static final class FirestoreMethodDescriptorSupplier + extends FirestoreBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FirestoreMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (FirestoreGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FirestoreFileDescriptorSupplier()) + .addMethod(getGetDocumentMethodHelper()) + .addMethod(getListDocumentsMethodHelper()) + .addMethod(getCreateDocumentMethodHelper()) + .addMethod(getUpdateDocumentMethodHelper()) + .addMethod(getDeleteDocumentMethodHelper()) + .addMethod(getBatchGetDocumentsMethodHelper()) + .addMethod(getBeginTransactionMethodHelper()) + .addMethod(getCommitMethodHelper()) + .addMethod(getRollbackMethodHelper()) + .addMethod(getRunQueryMethodHelper()) + .addMethod(getWriteMethodHelper()) + .addMethod(getListenMethodHelper()) + .addMethod(getListCollectionIdsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 5b3f680e89f4..9860e5ceb745 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -284,11 +284,21 @@ grpc-google-cloud-error-reporting-v1beta1 0.44.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-firestore-v1 + 0.44.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-firestore-v1beta1 0.44.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-firestore-v1 + 0.44.1-SNAPSHOT + com.google.api.grpc grpc-google-cloud-firestore-v1beta1 @@ -662,6 +672,7 @@ grpc-google-cloud-dialogflow-v2beta1 grpc-google-cloud-dlp-v2 grpc-google-cloud-error-reporting-v1beta1 + grpc-google-cloud-firestore-v1 grpc-google-cloud-firestore-v1beta1 grpc-google-cloud-iamcredentials-v1 grpc-google-cloud-iot-v1 @@ -714,6 +725,7 @@ proto-google-cloud-dialogflow-v2beta1 proto-google-cloud-dlp-v2 proto-google-cloud-error-reporting-v1beta1 + proto-google-cloud-firestore-v1 proto-google-cloud-firestore-v1beta1 proto-google-cloud-iamcredentials-v1 proto-google-cloud-iot-v1 diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/pom.xml b/google-api-grpc/proto-google-cloud-firestore-v1/pom.xml new file mode 100644 index 000000000000..f043f884679a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-firestore-v1 + 0.44.1-SNAPSHOT + proto-google-cloud-firestore-v1 + PROTO library for proto-google-cloud-firestore-v1 + + com.google.api.grpc + google-api-grpc + 0.44.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + \ No newline at end of file diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/AnyPathName.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/AnyPathName.java new file mode 100644 index 000000000000..9bd9d56a3cc4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/AnyPathName.java @@ -0,0 +1,240 @@ +/* + * Copyright 2018 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. + */ + +package com.google.firestore.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AnyPathName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/documents/{document}/{any_path=**}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + private final String document; + private final String anyPath; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getDocument() { + return document; + } + + public String getAnyPath() { + return anyPath; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AnyPathName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + document = Preconditions.checkNotNull(builder.getDocument()); + anyPath = Preconditions.checkNotNull(builder.getAnyPath()); + } + + public static AnyPathName of(String project, String database, String document, String anyPath) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setDocument(document) + .setAnyPath(anyPath) + .build(); + } + + public static String format(String project, String database, String document, String anyPath) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setDocument(document) + .setAnyPath(anyPath) + .build() + .toString(); + } + + public static AnyPathName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AnyPathName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("database"), + matchMap.get("document"), + matchMap.get("any_path")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (AnyPathName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldMapBuilder.put("document", document); + fieldMapBuilder.put("anyPath", anyPath); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "database", database, "document", document, "any_path", anyPath); + } + + /** Builder for AnyPathName. */ + public static class Builder { + + private String project; + private String database; + private String document; + private String anyPath; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getDocument() { + return document; + } + + public String getAnyPath() { + return anyPath; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setDocument(String document) { + this.document = document; + return this; + } + + public Builder setAnyPath(String anyPath) { + this.anyPath = anyPath; + return this; + } + + private Builder() {} + + private Builder(AnyPathName anyPathName) { + project = anyPathName.project; + database = anyPathName.database; + document = anyPathName.document; + anyPath = anyPathName.anyPath; + } + + public AnyPathName build() { + return new AnyPathName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AnyPathName) { + AnyPathName that = (AnyPathName) o; + return (this.project.equals(that.project)) + && (this.database.equals(that.database)) + && (this.document.equals(that.document)) + && (this.anyPath.equals(that.anyPath)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + h *= 1000003; + h ^= document.hashCode(); + h *= 1000003; + h ^= anyPath.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValue.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValue.java new file mode 100644 index 000000000000..e543995933e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValue.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * An array value.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ArrayValue} + */ +public final class ArrayValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ArrayValue) + ArrayValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use ArrayValue.newBuilder() to construct. + private ArrayValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ArrayValue() { + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ArrayValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + values_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + values_.add( + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + values_ = java.util.Collections.unmodifiableList(values_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_ArrayValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_ArrayValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ArrayValue.class, + com.google.firestore.v1.ArrayValue.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + private java.util.List values_; + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.ValueOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ArrayValue)) { + return super.equals(obj); + } + com.google.firestore.v1.ArrayValue other = (com.google.firestore.v1.ArrayValue) obj; + + boolean result = true; + result = result && getValuesList().equals(other.getValuesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ArrayValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ArrayValue 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.v1.ArrayValue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ArrayValue 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.v1.ArrayValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ArrayValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ArrayValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ArrayValue 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.v1.ArrayValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ArrayValue 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.v1.ArrayValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ArrayValue 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.v1.ArrayValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An array value.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ArrayValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ArrayValue) + com.google.firestore.v1.ArrayValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_ArrayValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_ArrayValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ArrayValue.class, + com.google.firestore.v1.ArrayValue.Builder.class); + } + + // Construct using com.google.firestore.v1.ArrayValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + valuesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_ArrayValue_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ArrayValue getDefaultInstanceForType() { + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ArrayValue build() { + com.google.firestore.v1.ArrayValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ArrayValue buildPartial() { + com.google.firestore.v1.ArrayValue result = new com.google.firestore.v1.ArrayValue(this); + int from_bitField0_ = bitField0_; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ArrayValue) { + return mergeFrom((com.google.firestore.v1.ArrayValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ArrayValue other) { + if (other == com.google.firestore.v1.ArrayValue.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + 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.v1.ArrayValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ArrayValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder setValues(int index, com.google.firestore.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder setValues(int index, com.google.firestore.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(com.google.firestore.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(int index, com.google.firestore.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(com.google.firestore.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(int index, com.google.firestore.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value.Builder getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.ValueOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder(com.google.firestore.v1.Value.getDefaultInstance()); + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value.Builder addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder(index, com.google.firestore.v1.Value.getDefaultInstance()); + } + /** + * + * + *
+     * Values in the array.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + values_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + values_ = null; + } + return valuesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ArrayValue) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ArrayValue) + private static final com.google.firestore.v1.ArrayValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ArrayValue(); + } + + public static com.google.firestore.v1.ArrayValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArrayValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ArrayValue(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.v1.ArrayValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValueOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValueOrBuilder.java new file mode 100644 index 000000000000..87b209185bdb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ArrayValueOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +public interface ArrayValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ArrayValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + java.util.List getValuesList(); + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + com.google.firestore.v1.Value getValues(int index); + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + int getValuesCount(); + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + java.util.List getValuesOrBuilderList(); + /** + * + * + *
+   * Values in the array.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + com.google.firestore.v1.ValueOrBuilder getValuesOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequest.java new file mode 100644 index 000000000000..80ede040eaa6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequest.java @@ -0,0 +1,1975 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.BatchGetDocumentsRequest} + */ +public final class BatchGetDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.BatchGetDocumentsRequest) + BatchGetDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchGetDocumentsRequest.newBuilder() to construct. + private BatchGetDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchGetDocumentsRequest() { + database_ = ""; + documents_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchGetDocumentsRequest( + 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(); + + database_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + documents_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + documents_.add(s); + break; + } + case 26: + { + com.google.firestore.v1.DocumentMask.Builder subBuilder = null; + if (mask_ != null) { + subBuilder = mask_.toBuilder(); + } + mask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mask_); + mask_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + consistencySelectorCase_ = 4; + consistencySelector_ = input.readBytes(); + break; + } + case 42: + { + com.google.firestore.v1.TransactionOptions.Builder subBuilder = null; + if (consistencySelectorCase_ == 5) { + subBuilder = + ((com.google.firestore.v1.TransactionOptions) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage( + com.google.firestore.v1.TransactionOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.v1.TransactionOptions) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 5; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (consistencySelectorCase_ == 7) { + subBuilder = ((com.google.protobuf.Timestamp) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 7; + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + documents_ = documents_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BatchGetDocumentsRequest.class, + com.google.firestore.v1.BatchGetDocumentsRequest.Builder.class); + } + + private int bitField0_; + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public enum ConsistencySelectorCase implements com.google.protobuf.Internal.EnumLite { + TRANSACTION(4), + NEW_TRANSACTION(5), + READ_TIME(7), + CONSISTENCYSELECTOR_NOT_SET(0); + private final int value; + + private ConsistencySelectorCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ConsistencySelectorCase valueOf(int value) { + return forNumber(value); + } + + public static ConsistencySelectorCase forNumber(int value) { + switch (value) { + case 4: + return TRANSACTION; + case 5: + return NEW_TRANSACTION; + case 7: + return READ_TIME; + case 0: + return CONSISTENCYSELECTOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + 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(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENTS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList documents_; + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ProtocolStringList getDocumentsList() { + return documents_; + } + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + public java.lang.String getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ByteString getDocumentsBytes(int index) { + return documents_.getByteString(index); + } + + public static final int MASK_FIELD_NUMBER = 3; + private com.google.firestore.v1.DocumentMask mask_; + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field will
+   * not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public boolean hasMask() { + return mask_ != null; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field will
+   * not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMask getMask() { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field will
+   * not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + return getMask(); + } + + public static final int TRANSACTION_FIELD_NUMBER = 4; + /** + * + * + *
+   * Reads documents in a transaction.
+   * 
+ * + * bytes transaction = 4; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 4) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int NEW_TRANSACTION_FIELD_NUMBER = 5; + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public boolean hasNewTransaction() { + return consistencySelectorCase_ == 5; + } + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public com.google.firestore.v1.TransactionOptions getNewTransaction() { + if (consistencySelectorCase_ == 5) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public com.google.firestore.v1.TransactionOptionsOrBuilder getNewTransactionOrBuilder() { + if (consistencySelectorCase_ == 5) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + + public static final int READ_TIME_FIELD_NUMBER = 7; + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 7; + } + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.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 (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + for (int i = 0; i < documents_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, documents_.getRaw(i)); + } + if (mask_ != null) { + output.writeMessage(3, getMask()); + } + if (consistencySelectorCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 5) { + output.writeMessage(5, (com.google.firestore.v1.TransactionOptions) consistencySelector_); + } + if (consistencySelectorCase_ == 7) { + output.writeMessage(7, (com.google.protobuf.Timestamp) consistencySelector_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + { + int dataSize = 0; + for (int i = 0; i < documents_.size(); i++) { + dataSize += computeStringSizeNoTag(documents_.getRaw(i)); + } + size += dataSize; + size += 1 * getDocumentsList().size(); + } + if (mask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMask()); + } + if (consistencySelectorCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.firestore.v1.TransactionOptions) consistencySelector_); + } + if (consistencySelectorCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.protobuf.Timestamp) consistencySelector_); + } + 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.v1.BatchGetDocumentsRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.BatchGetDocumentsRequest other = + (com.google.firestore.v1.BatchGetDocumentsRequest) obj; + + boolean result = true; + result = result && getDatabase().equals(other.getDatabase()); + result = result && getDocumentsList().equals(other.getDocumentsList()); + result = result && (hasMask() == other.hasMask()); + if (hasMask()) { + result = result && getMask().equals(other.getMask()); + } + result = result && getConsistencySelectorCase().equals(other.getConsistencySelectorCase()); + if (!result) return false; + switch (consistencySelectorCase_) { + case 4: + result = result && getTransaction().equals(other.getTransaction()); + break; + case 5: + result = result && getNewTransaction().equals(other.getNewTransaction()); + break; + case 7: + result = result && getReadTime().equals(other.getReadTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + if (getDocumentsCount() > 0) { + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentsList().hashCode(); + } + if (hasMask()) { + hash = (37 * hash) + MASK_FIELD_NUMBER; + hash = (53 * hash) + getMask().hashCode(); + } + switch (consistencySelectorCase_) { + case 4: + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + break; + case 5: + hash = (37 * hash) + NEW_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getNewTransaction().hashCode(); + break; + case 7: + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest 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.v1.BatchGetDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest 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.v1.BatchGetDocumentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest 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.v1.BatchGetDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest 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.v1.BatchGetDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest 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.v1.BatchGetDocumentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.BatchGetDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.BatchGetDocumentsRequest) + com.google.firestore.v1.BatchGetDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BatchGetDocumentsRequest.class, + com.google.firestore.v1.BatchGetDocumentsRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.BatchGetDocumentsRequest.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(); + database_ = ""; + + documents_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (maskBuilder_ == null) { + mask_ = null; + } else { + mask_ = null; + maskBuilder_ = null; + } + consistencySelectorCase_ = 0; + consistencySelector_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.BatchGetDocumentsRequest getDefaultInstanceForType() { + return com.google.firestore.v1.BatchGetDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.BatchGetDocumentsRequest build() { + com.google.firestore.v1.BatchGetDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.BatchGetDocumentsRequest buildPartial() { + com.google.firestore.v1.BatchGetDocumentsRequest result = + new com.google.firestore.v1.BatchGetDocumentsRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.database_ = database_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + documents_ = documents_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.documents_ = documents_; + if (maskBuilder_ == null) { + result.mask_ = mask_; + } else { + result.mask_ = maskBuilder_.build(); + } + if (consistencySelectorCase_ == 4) { + result.consistencySelector_ = consistencySelector_; + } + if (consistencySelectorCase_ == 5) { + if (newTransactionBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = newTransactionBuilder_.build(); + } + } + if (consistencySelectorCase_ == 7) { + if (readTimeBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = readTimeBuilder_.build(); + } + } + result.bitField0_ = to_bitField0_; + result.consistencySelectorCase_ = consistencySelectorCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.BatchGetDocumentsRequest) { + return mergeFrom((com.google.firestore.v1.BatchGetDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.BatchGetDocumentsRequest other) { + if (other == com.google.firestore.v1.BatchGetDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (!other.documents_.isEmpty()) { + if (documents_.isEmpty()) { + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDocumentsIsMutable(); + documents_.addAll(other.documents_); + } + onChanged(); + } + if (other.hasMask()) { + mergeMask(other.getMask()); + } + switch (other.getConsistencySelectorCase()) { + case TRANSACTION: + { + setTransaction(other.getTransaction()); + break; + } + case NEW_TRANSACTION: + { + mergeNewTransaction(other.getNewTransaction()); + break; + } + case READ_TIME: + { + mergeReadTime(other.getReadTime()); + break; + } + case CONSISTENCYSELECTOR_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.v1.BatchGetDocumentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.BatchGetDocumentsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public Builder clearConsistencySelector() { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList documents_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDocumentsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + documents_ = new com.google.protobuf.LazyStringArrayList(documents_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ProtocolStringList getDocumentsList() { + return documents_.getUnmodifiableView(); + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public java.lang.String getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ByteString getDocumentsBytes(int index) { + return documents_.getByteString(index); + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public Builder setDocuments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public Builder addDocuments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public Builder addAllDocuments(java.lang.Iterable values) { + ensureDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documents_); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public Builder clearDocuments() { + documents_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of the
+     * given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public Builder addDocumentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + return this; + } + + private com.google.firestore.v1.DocumentMask mask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + maskBuilder_; + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public boolean hasMask() { + return maskBuilder_ != null || mask_ != null; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMask getMask() { + if (maskBuilder_ == null) { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } else { + return maskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mask_ = value; + onChanged(); + } else { + maskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (maskBuilder_ == null) { + mask_ = builderForValue.build(); + onChanged(); + } else { + maskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder mergeMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (mask_ != null) { + mask_ = + com.google.firestore.v1.DocumentMask.newBuilder(mask_) + .mergeFrom(value) + .buildPartial(); + } else { + mask_ = value; + } + onChanged(); + } else { + maskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder clearMask() { + if (maskBuilder_ == null) { + mask_ = null; + onChanged(); + } else { + mask_ = null; + maskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMask.Builder getMaskBuilder() { + + onChanged(); + return getMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + if (maskBuilder_ != null) { + return maskBuilder_.getMessageOrBuilder(); + } else { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field will
+     * not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getMaskFieldBuilder() { + if (maskBuilder_ == null) { + maskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getMask(), getParentForChildren(), isClean()); + mask_ = null; + } + return maskBuilder_; + } + + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 4; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 4) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 4; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelectorCase_ = 4; + consistencySelector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 4; + */ + public Builder clearTransaction() { + if (consistencySelectorCase_ == 4) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder> + newTransactionBuilder_; + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public boolean hasNewTransaction() { + return consistencySelectorCase_ == 5; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public com.google.firestore.v1.TransactionOptions getNewTransaction() { + if (newTransactionBuilder_ == null) { + if (consistencySelectorCase_ == 5) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 5) { + return newTransactionBuilder_.getMessage(); + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public Builder setNewTransaction(com.google.firestore.v1.TransactionOptions value) { + if (newTransactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + newTransactionBuilder_.setMessage(value); + } + consistencySelectorCase_ = 5; + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public Builder setNewTransaction( + com.google.firestore.v1.TransactionOptions.Builder builderForValue) { + if (newTransactionBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + newTransactionBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 5; + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public Builder mergeNewTransaction(com.google.firestore.v1.TransactionOptions value) { + if (newTransactionBuilder_ == null) { + if (consistencySelectorCase_ == 5 + && consistencySelector_ + != com.google.firestore.v1.TransactionOptions.getDefaultInstance()) { + consistencySelector_ = + com.google.firestore.v1.TransactionOptions.newBuilder( + (com.google.firestore.v1.TransactionOptions) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 5) { + newTransactionBuilder_.mergeFrom(value); + } + newTransactionBuilder_.setMessage(value); + } + consistencySelectorCase_ = 5; + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public Builder clearNewTransaction() { + if (newTransactionBuilder_ == null) { + if (consistencySelectorCase_ == 5) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 5) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + newTransactionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public com.google.firestore.v1.TransactionOptions.Builder getNewTransactionBuilder() { + return getNewTransactionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + public com.google.firestore.v1.TransactionOptionsOrBuilder getNewTransactionOrBuilder() { + if ((consistencySelectorCase_ == 5) && (newTransactionBuilder_ != null)) { + return newTransactionBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 5) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder> + getNewTransactionFieldBuilder() { + if (newTransactionBuilder_ == null) { + if (!(consistencySelectorCase_ == 5)) { + consistencySelector_ = com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + newTransactionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder>( + (com.google.firestore.v1.TransactionOptions) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 5; + onChanged(); + ; + return newTransactionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 7; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 7) { + return readTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 7; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 7; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 7 + && consistencySelector_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + consistencySelector_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 7) { + readTimeBuilder_.mergeFrom(value); + } + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 7; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 7) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 7) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + readTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if ((consistencySelectorCase_ == 7) && (readTimeBuilder_ != null)) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + if (!(consistencySelectorCase_ == 7)) { + consistencySelector_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 7; + onChanged(); + ; + return readTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.BatchGetDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.BatchGetDocumentsRequest) + private static final com.google.firestore.v1.BatchGetDocumentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.BatchGetDocumentsRequest(); + } + + public static com.google.firestore.v1.BatchGetDocumentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchGetDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchGetDocumentsRequest(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.v1.BatchGetDocumentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..4b0b3e16732f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsRequestOrBuilder.java @@ -0,0 +1,211 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface BatchGetDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.BatchGetDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + java.util.List getDocumentsList(); + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + int getDocumentsCount(); + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + java.lang.String getDocuments(int index); + /** + * + * + *
+   * The names of the documents to retrieve. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * The request will fail if any of the document is not a child resource of the
+   * given `database`. Duplicate names will be elided.
+   * 
+ * + * repeated string documents = 2; + */ + com.google.protobuf.ByteString getDocumentsBytes(int index); + + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field will
+   * not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + boolean hasMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field will
+   * not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + com.google.firestore.v1.DocumentMask getMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field will
+   * not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder(); + + /** + * + * + *
+   * Reads documents in a transaction.
+   * 
+ * + * bytes transaction = 4; + */ + com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + boolean hasNewTransaction(); + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + com.google.firestore.v1.TransactionOptions getNewTransaction(); + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 5; + */ + com.google.firestore.v1.TransactionOptionsOrBuilder getNewTransactionOrBuilder(); + + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + public com.google.firestore.v1.BatchGetDocumentsRequest.ConsistencySelectorCase + getConsistencySelectorCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponse.java new file mode 100644 index 000000000000..641fae961f7d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponse.java @@ -0,0 +1,1373 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.BatchGetDocumentsResponse} + */ +public final class BatchGetDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.BatchGetDocumentsResponse) + BatchGetDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchGetDocumentsResponse.newBuilder() to construct. + private BatchGetDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchGetDocumentsResponse() { + transaction_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchGetDocumentsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (resultCase_ == 1) { + subBuilder = ((com.google.firestore.v1.Document) result_).toBuilder(); + } + result_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Document) result_); + result_ = subBuilder.buildPartial(); + } + resultCase_ = 1; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + resultCase_ = 2; + result_ = s; + break; + } + case 26: + { + transaction_ = input.readBytes(); + break; + } + case 34: + { + 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 (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BatchGetDocumentsResponse.class, + com.google.firestore.v1.BatchGetDocumentsResponse.Builder.class); + } + + private int resultCase_ = 0; + private java.lang.Object result_; + + public enum ResultCase implements com.google.protobuf.Internal.EnumLite { + FOUND(1), + MISSING(2), + RESULT_NOT_SET(0); + private final int value; + + private ResultCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ResultCase valueOf(int value) { + return forNumber(value); + } + + public static ResultCase forNumber(int value) { + switch (value) { + case 1: + return FOUND; + case 2: + return MISSING; + case 0: + return RESULT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResultCase getResultCase() { + return ResultCase.forNumber(resultCase_); + } + + public static final int FOUND_FIELD_NUMBER = 1; + /** + * + * + *
+   * A document that was requested.
+   * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public boolean hasFound() { + return resultCase_ == 1; + } + /** + * + * + *
+   * A document that was requested.
+   * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public com.google.firestore.v1.Document getFound() { + if (resultCase_ == 1) { + return (com.google.firestore.v1.Document) result_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + /** + * + * + *
+   * A document that was requested.
+   * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getFoundOrBuilder() { + if (resultCase_ == 1) { + return (com.google.firestore.v1.Document) result_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + + public static final int MISSING_FIELD_NUMBER = 2; + /** + * + * + *
+   * A document name that was requested but does not exist. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string missing = 2; + */ + public java.lang.String getMissing() { + java.lang.Object ref = ""; + if (resultCase_ == 2) { + ref = result_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (resultCase_ == 2) { + result_ = s; + } + return s; + } + } + /** + * + * + *
+   * A document name that was requested but does not exist. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string missing = 2; + */ + public com.google.protobuf.ByteString getMissingBytes() { + java.lang.Object ref = ""; + if (resultCase_ == 2) { + ref = result_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (resultCase_ == 2) { + result_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSACTION_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString transaction_; + /** + * + * + *
+   * The transaction that was started as part of this request.
+   * Will only be set in the first response, and only if
+   * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request.
+   * 
+ * + * bytes transaction = 3; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The time at which the document was read.
+   * This may be monotically increasing, in this case the previous documents in
+   * the result stream are guaranteed not to have changed between their
+   * read_time and this one.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The time at which the document was read.
+   * This may be monotically increasing, in this case the previous documents in
+   * the result stream are guaranteed not to have changed between their
+   * read_time and this one.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * The time at which the document was read.
+   * This may be monotically increasing, in this case the previous documents in
+   * the result stream are guaranteed not to have changed between their
+   * read_time and this one.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 (resultCase_ == 1) { + output.writeMessage(1, (com.google.firestore.v1.Document) result_); + } + if (resultCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, result_); + } + if (!transaction_.isEmpty()) { + output.writeBytes(3, transaction_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resultCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.firestore.v1.Document) result_); + } + if (resultCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, result_); + } + if (!transaction_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, transaction_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, 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.v1.BatchGetDocumentsResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.BatchGetDocumentsResponse other = + (com.google.firestore.v1.BatchGetDocumentsResponse) obj; + + boolean result = true; + result = result && getTransaction().equals(other.getTransaction()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && getResultCase().equals(other.getResultCase()); + if (!result) return false; + switch (resultCase_) { + case 1: + result = result && getFound().equals(other.getFound()); + break; + case 2: + result = result && getMissing().equals(other.getMissing()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + switch (resultCase_) { + case 1: + hash = (37 * hash) + FOUND_FIELD_NUMBER; + hash = (53 * hash) + getFound().hashCode(); + break; + case 2: + hash = (37 * hash) + MISSING_FIELD_NUMBER; + hash = (53 * hash) + getMissing().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse 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.v1.BatchGetDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse 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.v1.BatchGetDocumentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse 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.v1.BatchGetDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse 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.v1.BatchGetDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse 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.v1.BatchGetDocumentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.BatchGetDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.BatchGetDocumentsResponse) + com.google.firestore.v1.BatchGetDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BatchGetDocumentsResponse.class, + com.google.firestore.v1.BatchGetDocumentsResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.BatchGetDocumentsResponse.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(); + transaction_ = com.google.protobuf.ByteString.EMPTY; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + resultCase_ = 0; + result_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BatchGetDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.BatchGetDocumentsResponse getDefaultInstanceForType() { + return com.google.firestore.v1.BatchGetDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.BatchGetDocumentsResponse build() { + com.google.firestore.v1.BatchGetDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.BatchGetDocumentsResponse buildPartial() { + com.google.firestore.v1.BatchGetDocumentsResponse result = + new com.google.firestore.v1.BatchGetDocumentsResponse(this); + if (resultCase_ == 1) { + if (foundBuilder_ == null) { + result.result_ = result_; + } else { + result.result_ = foundBuilder_.build(); + } + } + if (resultCase_ == 2) { + result.result_ = result_; + } + result.transaction_ = transaction_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.resultCase_ = resultCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.BatchGetDocumentsResponse) { + return mergeFrom((com.google.firestore.v1.BatchGetDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.BatchGetDocumentsResponse other) { + if (other == com.google.firestore.v1.BatchGetDocumentsResponse.getDefaultInstance()) + return this; + if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { + setTransaction(other.getTransaction()); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + switch (other.getResultCase()) { + case FOUND: + { + mergeFound(other.getFound()); + break; + } + case MISSING: + { + resultCase_ = 2; + result_ = other.result_; + onChanged(); + break; + } + case RESULT_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.v1.BatchGetDocumentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.BatchGetDocumentsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int resultCase_ = 0; + private java.lang.Object result_; + + public ResultCase getResultCase() { + return ResultCase.forNumber(resultCase_); + } + + public Builder clearResult() { + resultCase_ = 0; + result_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + foundBuilder_; + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public boolean hasFound() { + return resultCase_ == 1; + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public com.google.firestore.v1.Document getFound() { + if (foundBuilder_ == null) { + if (resultCase_ == 1) { + return (com.google.firestore.v1.Document) result_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } else { + if (resultCase_ == 1) { + return foundBuilder_.getMessage(); + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public Builder setFound(com.google.firestore.v1.Document value) { + if (foundBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + result_ = value; + onChanged(); + } else { + foundBuilder_.setMessage(value); + } + resultCase_ = 1; + return this; + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public Builder setFound(com.google.firestore.v1.Document.Builder builderForValue) { + if (foundBuilder_ == null) { + result_ = builderForValue.build(); + onChanged(); + } else { + foundBuilder_.setMessage(builderForValue.build()); + } + resultCase_ = 1; + return this; + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public Builder mergeFound(com.google.firestore.v1.Document value) { + if (foundBuilder_ == null) { + if (resultCase_ == 1 && result_ != com.google.firestore.v1.Document.getDefaultInstance()) { + result_ = + com.google.firestore.v1.Document.newBuilder( + (com.google.firestore.v1.Document) result_) + .mergeFrom(value) + .buildPartial(); + } else { + result_ = value; + } + onChanged(); + } else { + if (resultCase_ == 1) { + foundBuilder_.mergeFrom(value); + } + foundBuilder_.setMessage(value); + } + resultCase_ = 1; + return this; + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public Builder clearFound() { + if (foundBuilder_ == null) { + if (resultCase_ == 1) { + resultCase_ = 0; + result_ = null; + onChanged(); + } + } else { + if (resultCase_ == 1) { + resultCase_ = 0; + result_ = null; + } + foundBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public com.google.firestore.v1.Document.Builder getFoundBuilder() { + return getFoundFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getFoundOrBuilder() { + if ((resultCase_ == 1) && (foundBuilder_ != null)) { + return foundBuilder_.getMessageOrBuilder(); + } else { + if (resultCase_ == 1) { + return (com.google.firestore.v1.Document) result_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * A document that was requested.
+     * 
+ * + * .google.firestore.v1.Document found = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + getFoundFieldBuilder() { + if (foundBuilder_ == null) { + if (!(resultCase_ == 1)) { + result_ = com.google.firestore.v1.Document.getDefaultInstance(); + } + foundBuilder_ = + 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) result_, getParentForChildren(), isClean()); + result_ = null; + } + resultCase_ = 1; + onChanged(); + ; + return foundBuilder_; + } + + /** + * + * + *
+     * A document name that was requested but does not exist. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string missing = 2; + */ + public java.lang.String getMissing() { + java.lang.Object ref = ""; + if (resultCase_ == 2) { + ref = result_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (resultCase_ == 2) { + result_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A document name that was requested but does not exist. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string missing = 2; + */ + public com.google.protobuf.ByteString getMissingBytes() { + java.lang.Object ref = ""; + if (resultCase_ == 2) { + ref = result_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (resultCase_ == 2) { + result_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A document name that was requested but does not exist. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string missing = 2; + */ + public Builder setMissing(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resultCase_ = 2; + result_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A document name that was requested but does not exist. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string missing = 2; + */ + public Builder clearMissing() { + if (resultCase_ == 2) { + resultCase_ = 0; + result_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A document name that was requested but does not exist. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string missing = 2; + */ + public Builder setMissingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resultCase_ = 2; + result_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString transaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The transaction that was started as part of this request.
+     * Will only be set in the first response, and only if
+     * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request.
+     * 
+ * + * bytes transaction = 3; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + /** + * + * + *
+     * The transaction that was started as part of this request.
+     * Will only be set in the first response, and only if
+     * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request.
+     * 
+ * + * bytes transaction = 3; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + transaction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction that was started as part of this request.
+     * Will only be set in the first response, and only if
+     * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request.
+     * 
+ * + * bytes transaction = 3; + */ + public Builder clearTransaction() { + + transaction_ = getDefaultInstance().getTransaction(); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * The time at which the document was read.
+     * This may be monotically increasing, in this case the previous documents in
+     * the result stream are guaranteed not to have changed between their
+     * read_time and this one.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.BatchGetDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.BatchGetDocumentsResponse) + private static final com.google.firestore.v1.BatchGetDocumentsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.BatchGetDocumentsResponse(); + } + + public static com.google.firestore.v1.BatchGetDocumentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchGetDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchGetDocumentsResponse(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.v1.BatchGetDocumentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..7757fe305814 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BatchGetDocumentsResponseOrBuilder.java @@ -0,0 +1,119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface BatchGetDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.BatchGetDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A document that was requested.
+   * 
+ * + * .google.firestore.v1.Document found = 1; + */ + boolean hasFound(); + /** + * + * + *
+   * A document that was requested.
+   * 
+ * + * .google.firestore.v1.Document found = 1; + */ + com.google.firestore.v1.Document getFound(); + /** + * + * + *
+   * A document that was requested.
+   * 
+ * + * .google.firestore.v1.Document found = 1; + */ + com.google.firestore.v1.DocumentOrBuilder getFoundOrBuilder(); + + /** + * + * + *
+   * A document name that was requested but does not exist. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string missing = 2; + */ + java.lang.String getMissing(); + /** + * + * + *
+   * A document name that was requested but does not exist. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string missing = 2; + */ + com.google.protobuf.ByteString getMissingBytes(); + + /** + * + * + *
+   * The transaction that was started as part of this request.
+   * Will only be set in the first response, and only if
+   * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request.
+   * 
+ * + * bytes transaction = 3; + */ + com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * The time at which the document was read.
+   * This may be monotically increasing, in this case the previous documents in
+   * the result stream are guaranteed not to have changed between their
+   * read_time and this one.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + boolean hasReadTime(); + /** + * + * + *
+   * The time at which the document was read.
+   * This may be monotically increasing, in this case the previous documents in
+   * the result stream are guaranteed not to have changed between their
+   * read_time and this one.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The time at which the document was read.
+   * This may be monotically increasing, in this case the previous documents in
+   * the result stream are guaranteed not to have changed between their
+   * read_time and this one.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + public com.google.firestore.v1.BatchGetDocumentsResponse.ResultCase getResultCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequest.java new file mode 100644 index 000000000000..af42d2e00f96 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequest.java @@ -0,0 +1,883 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.BeginTransactionRequest} + */ +public final class BeginTransactionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.BeginTransactionRequest) + BeginTransactionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BeginTransactionRequest.newBuilder() to construct. + private BeginTransactionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BeginTransactionRequest() { + database_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BeginTransactionRequest( + 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(); + + database_ = s; + break; + } + case 18: + { + com.google.firestore.v1.TransactionOptions.Builder subBuilder = null; + if (options_ != null) { + subBuilder = options_.toBuilder(); + } + options_ = + input.readMessage( + com.google.firestore.v1.TransactionOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(options_); + options_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BeginTransactionRequest.class, + com.google.firestore.v1.BeginTransactionRequest.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + 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(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPTIONS_FIELD_NUMBER = 2; + private com.google.firestore.v1.TransactionOptions options_; + /** + * + * + *
+   * The options for the transaction.
+   * Defaults to a read-write transaction.
+   * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public boolean hasOptions() { + return options_ != null; + } + /** + * + * + *
+   * The options for the transaction.
+   * Defaults to a read-write transaction.
+   * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public com.google.firestore.v1.TransactionOptions getOptions() { + return options_ == null + ? com.google.firestore.v1.TransactionOptions.getDefaultInstance() + : options_; + } + /** + * + * + *
+   * The options for the transaction.
+   * Defaults to a read-write transaction.
+   * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public com.google.firestore.v1.TransactionOptionsOrBuilder getOptionsOrBuilder() { + return getOptions(); + } + + 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 (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + if (options_ != null) { + output.writeMessage(2, getOptions()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + if (options_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOptions()); + } + 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.v1.BeginTransactionRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.BeginTransactionRequest other = + (com.google.firestore.v1.BeginTransactionRequest) obj; + + boolean result = true; + result = result && getDatabase().equals(other.getDatabase()); + result = result && (hasOptions() == other.hasOptions()); + if (hasOptions()) { + result = result && getOptions().equals(other.getOptions()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + if (hasOptions()) { + hash = (37 * hash) + OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptions().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.BeginTransactionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BeginTransactionRequest 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.v1.BeginTransactionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BeginTransactionRequest 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.v1.BeginTransactionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BeginTransactionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.BeginTransactionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BeginTransactionRequest 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.v1.BeginTransactionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BeginTransactionRequest 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.v1.BeginTransactionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BeginTransactionRequest 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.v1.BeginTransactionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.BeginTransactionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.BeginTransactionRequest) + com.google.firestore.v1.BeginTransactionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BeginTransactionRequest.class, + com.google.firestore.v1.BeginTransactionRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.BeginTransactionRequest.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(); + database_ = ""; + + if (optionsBuilder_ == null) { + options_ = null; + } else { + options_ = null; + optionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.BeginTransactionRequest getDefaultInstanceForType() { + return com.google.firestore.v1.BeginTransactionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.BeginTransactionRequest build() { + com.google.firestore.v1.BeginTransactionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.BeginTransactionRequest buildPartial() { + com.google.firestore.v1.BeginTransactionRequest result = + new com.google.firestore.v1.BeginTransactionRequest(this); + result.database_ = database_; + if (optionsBuilder_ == null) { + result.options_ = options_; + } else { + result.options_ = optionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.BeginTransactionRequest) { + return mergeFrom((com.google.firestore.v1.BeginTransactionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.BeginTransactionRequest other) { + if (other == com.google.firestore.v1.BeginTransactionRequest.getDefaultInstance()) + return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (other.hasOptions()) { + mergeOptions(other.getOptions()); + } + 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.v1.BeginTransactionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.BeginTransactionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private com.google.firestore.v1.TransactionOptions options_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder> + optionsBuilder_; + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public boolean hasOptions() { + return optionsBuilder_ != null || options_ != null; + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public com.google.firestore.v1.TransactionOptions getOptions() { + if (optionsBuilder_ == null) { + return options_ == null + ? com.google.firestore.v1.TransactionOptions.getDefaultInstance() + : options_; + } else { + return optionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public Builder setOptions(com.google.firestore.v1.TransactionOptions value) { + if (optionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + options_ = value; + onChanged(); + } else { + optionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public Builder setOptions(com.google.firestore.v1.TransactionOptions.Builder builderForValue) { + if (optionsBuilder_ == null) { + options_ = builderForValue.build(); + onChanged(); + } else { + optionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public Builder mergeOptions(com.google.firestore.v1.TransactionOptions value) { + if (optionsBuilder_ == null) { + if (options_ != null) { + options_ = + com.google.firestore.v1.TransactionOptions.newBuilder(options_) + .mergeFrom(value) + .buildPartial(); + } else { + options_ = value; + } + onChanged(); + } else { + optionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public Builder clearOptions() { + if (optionsBuilder_ == null) { + options_ = null; + onChanged(); + } else { + options_ = null; + optionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public com.google.firestore.v1.TransactionOptions.Builder getOptionsBuilder() { + + onChanged(); + return getOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + public com.google.firestore.v1.TransactionOptionsOrBuilder getOptionsOrBuilder() { + if (optionsBuilder_ != null) { + return optionsBuilder_.getMessageOrBuilder(); + } else { + return options_ == null + ? com.google.firestore.v1.TransactionOptions.getDefaultInstance() + : options_; + } + } + /** + * + * + *
+     * The options for the transaction.
+     * Defaults to a read-write transaction.
+     * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder> + getOptionsFieldBuilder() { + if (optionsBuilder_ == null) { + optionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder>( + getOptions(), getParentForChildren(), isClean()); + options_ = null; + } + return optionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.BeginTransactionRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.BeginTransactionRequest) + private static final com.google.firestore.v1.BeginTransactionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.BeginTransactionRequest(); + } + + public static com.google.firestore.v1.BeginTransactionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BeginTransactionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BeginTransactionRequest(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.v1.BeginTransactionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequestOrBuilder.java new file mode 100644 index 000000000000..229deba4fdb3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionRequestOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface BeginTransactionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.BeginTransactionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The options for the transaction.
+   * Defaults to a read-write transaction.
+   * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + boolean hasOptions(); + /** + * + * + *
+   * The options for the transaction.
+   * Defaults to a read-write transaction.
+   * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + com.google.firestore.v1.TransactionOptions getOptions(); + /** + * + * + *
+   * The options for the transaction.
+   * Defaults to a read-write transaction.
+   * 
+ * + * .google.firestore.v1.TransactionOptions options = 2; + */ + com.google.firestore.v1.TransactionOptionsOrBuilder getOptionsOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponse.java new file mode 100644 index 000000000000..e6e333802284 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponse.java @@ -0,0 +1,520 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.BeginTransactionResponse} + */ +public final class BeginTransactionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.BeginTransactionResponse) + BeginTransactionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BeginTransactionResponse.newBuilder() to construct. + private BeginTransactionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BeginTransactionResponse() { + transaction_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BeginTransactionResponse( + 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: + { + transaction_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BeginTransactionResponse.class, + com.google.firestore.v1.BeginTransactionResponse.Builder.class); + } + + public static final int TRANSACTION_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString transaction_; + /** + * + * + *
+   * The transaction that was started.
+   * 
+ * + * bytes transaction = 1; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + + 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 (!transaction_.isEmpty()) { + output.writeBytes(1, transaction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!transaction_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, transaction_); + } + 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.v1.BeginTransactionResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.BeginTransactionResponse other = + (com.google.firestore.v1.BeginTransactionResponse) obj; + + boolean result = true; + result = result && getTransaction().equals(other.getTransaction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.BeginTransactionResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BeginTransactionResponse 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.v1.BeginTransactionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BeginTransactionResponse 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.v1.BeginTransactionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.BeginTransactionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.BeginTransactionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BeginTransactionResponse 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.v1.BeginTransactionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BeginTransactionResponse 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.v1.BeginTransactionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.BeginTransactionResponse 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.v1.BeginTransactionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.BeginTransactionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.BeginTransactionResponse) + com.google.firestore.v1.BeginTransactionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.BeginTransactionResponse.class, + com.google.firestore.v1.BeginTransactionResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.BeginTransactionResponse.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(); + transaction_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_BeginTransactionResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.BeginTransactionResponse getDefaultInstanceForType() { + return com.google.firestore.v1.BeginTransactionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.BeginTransactionResponse build() { + com.google.firestore.v1.BeginTransactionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.BeginTransactionResponse buildPartial() { + com.google.firestore.v1.BeginTransactionResponse result = + new com.google.firestore.v1.BeginTransactionResponse(this); + result.transaction_ = transaction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.BeginTransactionResponse) { + return mergeFrom((com.google.firestore.v1.BeginTransactionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.BeginTransactionResponse other) { + if (other == com.google.firestore.v1.BeginTransactionResponse.getDefaultInstance()) + return this; + if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { + setTransaction(other.getTransaction()); + } + 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.v1.BeginTransactionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.BeginTransactionResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString transaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The transaction that was started.
+     * 
+ * + * bytes transaction = 1; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + /** + * + * + *
+     * The transaction that was started.
+     * 
+ * + * bytes transaction = 1; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + transaction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction that was started.
+     * 
+ * + * bytes transaction = 1; + */ + public Builder clearTransaction() { + + transaction_ = getDefaultInstance().getTransaction(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.BeginTransactionResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.BeginTransactionResponse) + private static final com.google.firestore.v1.BeginTransactionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.BeginTransactionResponse(); + } + + public static com.google.firestore.v1.BeginTransactionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BeginTransactionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BeginTransactionResponse(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.v1.BeginTransactionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponseOrBuilder.java new file mode 100644 index 000000000000..62333e98506d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/BeginTransactionResponseOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface BeginTransactionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.BeginTransactionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The transaction that was started.
+   * 
+ * + * bytes transaction = 1; + */ + com.google.protobuf.ByteString getTransaction(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequest.java new file mode 100644 index 000000000000..a098bdc6f5df --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequest.java @@ -0,0 +1,1194 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.CommitRequest} + */ +public final class CommitRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.CommitRequest) + CommitRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitRequest.newBuilder() to construct. + private CommitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommitRequest() { + database_ = ""; + writes_ = java.util.Collections.emptyList(); + transaction_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CommitRequest( + 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(); + + database_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + writes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + writes_.add( + input.readMessage(com.google.firestore.v1.Write.parser(), extensionRegistry)); + break; + } + case 26: + { + transaction_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + writes_ = java.util.Collections.unmodifiableList(writes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.CommitRequest.class, + com.google.firestore.v1.CommitRequest.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_FIELD_NUMBER = 1; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + 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(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITES_FIELD_NUMBER = 2; + private java.util.List writes_; + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public java.util.List getWritesList() { + return writes_; + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public java.util.List getWritesOrBuilderList() { + return writes_; + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public int getWritesCount() { + return writes_.size(); + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.Write getWrites(int index) { + return writes_.get(index); + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.WriteOrBuilder getWritesOrBuilder(int index) { + return writes_.get(index); + } + + public static final int TRANSACTION_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString transaction_; + /** + * + * + *
+   * If set, applies all writes in this transaction, and commits it.
+   * 
+ * + * bytes transaction = 3; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + + 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 (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + for (int i = 0; i < writes_.size(); i++) { + output.writeMessage(2, writes_.get(i)); + } + if (!transaction_.isEmpty()) { + output.writeBytes(3, transaction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + for (int i = 0; i < writes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, writes_.get(i)); + } + if (!transaction_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, transaction_); + } + 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.v1.CommitRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.CommitRequest other = (com.google.firestore.v1.CommitRequest) obj; + + boolean result = true; + result = result && getDatabase().equals(other.getDatabase()); + result = result && getWritesList().equals(other.getWritesList()); + result = result && getTransaction().equals(other.getTransaction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + if (getWritesCount() > 0) { + hash = (37 * hash) + WRITES_FIELD_NUMBER; + hash = (53 * hash) + getWritesList().hashCode(); + } + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.CommitRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CommitRequest 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.v1.CommitRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CommitRequest 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.v1.CommitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CommitRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.CommitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CommitRequest 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.v1.CommitRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CommitRequest 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.v1.CommitRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CommitRequest 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.v1.CommitRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.CommitRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.CommitRequest) + com.google.firestore.v1.CommitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.CommitRequest.class, + com.google.firestore.v1.CommitRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.CommitRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWritesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + database_ = ""; + + if (writesBuilder_ == null) { + writes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + writesBuilder_.clear(); + } + transaction_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.CommitRequest getDefaultInstanceForType() { + return com.google.firestore.v1.CommitRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.CommitRequest build() { + com.google.firestore.v1.CommitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.CommitRequest buildPartial() { + com.google.firestore.v1.CommitRequest result = + new com.google.firestore.v1.CommitRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.database_ = database_; + if (writesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + writes_ = java.util.Collections.unmodifiableList(writes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.writes_ = writes_; + } else { + result.writes_ = writesBuilder_.build(); + } + result.transaction_ = transaction_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.CommitRequest) { + return mergeFrom((com.google.firestore.v1.CommitRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.CommitRequest other) { + if (other == com.google.firestore.v1.CommitRequest.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (writesBuilder_ == null) { + if (!other.writes_.isEmpty()) { + if (writes_.isEmpty()) { + writes_ = other.writes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureWritesIsMutable(); + writes_.addAll(other.writes_); + } + onChanged(); + } + } else { + if (!other.writes_.isEmpty()) { + if (writesBuilder_.isEmpty()) { + writesBuilder_.dispose(); + writesBuilder_ = null; + writes_ = other.writes_; + bitField0_ = (bitField0_ & ~0x00000002); + writesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWritesFieldBuilder() + : null; + } else { + writesBuilder_.addAllMessages(other.writes_); + } + } + } + if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { + setTransaction(other.getTransaction()); + } + 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.v1.CommitRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.CommitRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private java.util.List writes_ = + java.util.Collections.emptyList(); + + private void ensureWritesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + writes_ = new java.util.ArrayList(writes_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Write, + com.google.firestore.v1.Write.Builder, + com.google.firestore.v1.WriteOrBuilder> + writesBuilder_; + + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public java.util.List getWritesList() { + if (writesBuilder_ == null) { + return java.util.Collections.unmodifiableList(writes_); + } else { + return writesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public int getWritesCount() { + if (writesBuilder_ == null) { + return writes_.size(); + } else { + return writesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.Write getWrites(int index) { + if (writesBuilder_ == null) { + return writes_.get(index); + } else { + return writesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder setWrites(int index, com.google.firestore.v1.Write value) { + if (writesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWritesIsMutable(); + writes_.set(index, value); + onChanged(); + } else { + writesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder setWrites(int index, com.google.firestore.v1.Write.Builder builderForValue) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.set(index, builderForValue.build()); + onChanged(); + } else { + writesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder addWrites(com.google.firestore.v1.Write value) { + if (writesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWritesIsMutable(); + writes_.add(value); + onChanged(); + } else { + writesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder addWrites(int index, com.google.firestore.v1.Write value) { + if (writesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWritesIsMutable(); + writes_.add(index, value); + onChanged(); + } else { + writesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder addWrites(com.google.firestore.v1.Write.Builder builderForValue) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.add(builderForValue.build()); + onChanged(); + } else { + writesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder addWrites(int index, com.google.firestore.v1.Write.Builder builderForValue) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.add(index, builderForValue.build()); + onChanged(); + } else { + writesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder addAllWrites( + java.lang.Iterable values) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, writes_); + onChanged(); + } else { + writesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder clearWrites() { + if (writesBuilder_ == null) { + writes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + writesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public Builder removeWrites(int index) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.remove(index); + onChanged(); + } else { + writesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.Write.Builder getWritesBuilder(int index) { + return getWritesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.WriteOrBuilder getWritesOrBuilder(int index) { + if (writesBuilder_ == null) { + return writes_.get(index); + } else { + return writesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public java.util.List + getWritesOrBuilderList() { + if (writesBuilder_ != null) { + return writesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(writes_); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.Write.Builder addWritesBuilder() { + return getWritesFieldBuilder().addBuilder(com.google.firestore.v1.Write.getDefaultInstance()); + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public com.google.firestore.v1.Write.Builder addWritesBuilder(int index) { + return getWritesFieldBuilder() + .addBuilder(index, com.google.firestore.v1.Write.getDefaultInstance()); + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + public java.util.List getWritesBuilderList() { + return getWritesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Write, + com.google.firestore.v1.Write.Builder, + com.google.firestore.v1.WriteOrBuilder> + getWritesFieldBuilder() { + if (writesBuilder_ == null) { + writesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Write, + com.google.firestore.v1.Write.Builder, + com.google.firestore.v1.WriteOrBuilder>( + writes_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + writes_ = null; + } + return writesBuilder_; + } + + private com.google.protobuf.ByteString transaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * If set, applies all writes in this transaction, and commits it.
+     * 
+ * + * bytes transaction = 3; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + /** + * + * + *
+     * If set, applies all writes in this transaction, and commits it.
+     * 
+ * + * bytes transaction = 3; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + transaction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, applies all writes in this transaction, and commits it.
+     * 
+ * + * bytes transaction = 3; + */ + public Builder clearTransaction() { + + transaction_ = getDefaultInstance().getTransaction(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.CommitRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.CommitRequest) + private static final com.google.firestore.v1.CommitRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.CommitRequest(); + } + + public static com.google.firestore.v1.CommitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommitRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitRequest(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.v1.CommitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequestOrBuilder.java new file mode 100644 index 000000000000..a3149c3bf144 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitRequestOrBuilder.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface CommitRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.CommitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + java.util.List getWritesList(); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + com.google.firestore.v1.Write getWrites(int index); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + int getWritesCount(); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + java.util.List getWritesOrBuilderList(); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 2; + */ + com.google.firestore.v1.WriteOrBuilder getWritesOrBuilder(int index); + + /** + * + * + *
+   * If set, applies all writes in this transaction, and commits it.
+   * 
+ * + * bytes transaction = 3; + */ + com.google.protobuf.ByteString getTransaction(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponse.java new file mode 100644 index 000000000000..3afba5cac924 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponse.java @@ -0,0 +1,1234 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.CommitResponse} + */ +public final class CommitResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.CommitResponse) + CommitResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitResponse.newBuilder() to construct. + private CommitResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommitResponse() { + writeResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CommitResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + writeResults_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + writeResults_.add( + input.readMessage( + com.google.firestore.v1.WriteResult.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (commitTime_ != null) { + subBuilder = commitTime_.toBuilder(); + } + commitTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commitTime_); + commitTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + writeResults_ = java.util.Collections.unmodifiableList(writeResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.CommitResponse.class, + com.google.firestore.v1.CommitResponse.Builder.class); + } + + private int bitField0_; + public static final int WRITE_RESULTS_FIELD_NUMBER = 1; + private java.util.List writeResults_; + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public java.util.List getWriteResultsList() { + return writeResults_; + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public java.util.List + getWriteResultsOrBuilderList() { + return writeResults_; + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public int getWriteResultsCount() { + return writeResults_.size(); + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResult getWriteResults(int index) { + return writeResults_.get(index); + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResultOrBuilder getWriteResultsOrBuilder(int index) { + return writeResults_.get(index); + } + + public static final int COMMIT_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp commitTime_; + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public boolean hasCommitTime() { + return commitTime_ != null; + } + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public com.google.protobuf.Timestamp getCommitTime() { + return commitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : commitTime_; + } + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder() { + return getCommitTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < writeResults_.size(); i++) { + output.writeMessage(1, writeResults_.get(i)); + } + if (commitTime_ != null) { + output.writeMessage(2, getCommitTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < writeResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, writeResults_.get(i)); + } + if (commitTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCommitTime()); + } + 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.v1.CommitResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.CommitResponse other = (com.google.firestore.v1.CommitResponse) obj; + + boolean result = true; + result = result && getWriteResultsList().equals(other.getWriteResultsList()); + result = result && (hasCommitTime() == other.hasCommitTime()); + if (hasCommitTime()) { + result = result && getCommitTime().equals(other.getCommitTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWriteResultsCount() > 0) { + hash = (37 * hash) + WRITE_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getWriteResultsList().hashCode(); + } + if (hasCommitTime()) { + hash = (37 * hash) + COMMIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCommitTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.CommitResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CommitResponse 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.v1.CommitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CommitResponse 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.v1.CommitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CommitResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.CommitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CommitResponse 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.v1.CommitResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CommitResponse 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.v1.CommitResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CommitResponse 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.v1.CommitResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.CommitResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.CommitResponse) + com.google.firestore.v1.CommitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.CommitResponse.class, + com.google.firestore.v1.CommitResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.CommitResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWriteResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (writeResultsBuilder_ == null) { + writeResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + writeResultsBuilder_.clear(); + } + if (commitTimeBuilder_ == null) { + commitTime_ = null; + } else { + commitTime_ = null; + commitTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CommitResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.CommitResponse getDefaultInstanceForType() { + return com.google.firestore.v1.CommitResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.CommitResponse build() { + com.google.firestore.v1.CommitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.CommitResponse buildPartial() { + com.google.firestore.v1.CommitResponse result = + new com.google.firestore.v1.CommitResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (writeResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + writeResults_ = java.util.Collections.unmodifiableList(writeResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.writeResults_ = writeResults_; + } else { + result.writeResults_ = writeResultsBuilder_.build(); + } + if (commitTimeBuilder_ == null) { + result.commitTime_ = commitTime_; + } else { + result.commitTime_ = commitTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.CommitResponse) { + return mergeFrom((com.google.firestore.v1.CommitResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.CommitResponse other) { + if (other == com.google.firestore.v1.CommitResponse.getDefaultInstance()) return this; + if (writeResultsBuilder_ == null) { + if (!other.writeResults_.isEmpty()) { + if (writeResults_.isEmpty()) { + writeResults_ = other.writeResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWriteResultsIsMutable(); + writeResults_.addAll(other.writeResults_); + } + onChanged(); + } + } else { + if (!other.writeResults_.isEmpty()) { + if (writeResultsBuilder_.isEmpty()) { + writeResultsBuilder_.dispose(); + writeResultsBuilder_ = null; + writeResults_ = other.writeResults_; + bitField0_ = (bitField0_ & ~0x00000001); + writeResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWriteResultsFieldBuilder() + : null; + } else { + writeResultsBuilder_.addAllMessages(other.writeResults_); + } + } + } + if (other.hasCommitTime()) { + mergeCommitTime(other.getCommitTime()); + } + 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.v1.CommitResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.CommitResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List writeResults_ = + java.util.Collections.emptyList(); + + private void ensureWriteResultsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + writeResults_ = new java.util.ArrayList(writeResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.WriteResult, + com.google.firestore.v1.WriteResult.Builder, + com.google.firestore.v1.WriteResultOrBuilder> + writeResultsBuilder_; + + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public java.util.List getWriteResultsList() { + if (writeResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(writeResults_); + } else { + return writeResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public int getWriteResultsCount() { + if (writeResultsBuilder_ == null) { + return writeResults_.size(); + } else { + return writeResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResult getWriteResults(int index) { + if (writeResultsBuilder_ == null) { + return writeResults_.get(index); + } else { + return writeResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder setWriteResults(int index, com.google.firestore.v1.WriteResult value) { + if (writeResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWriteResultsIsMutable(); + writeResults_.set(index, value); + onChanged(); + } else { + writeResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder setWriteResults( + int index, com.google.firestore.v1.WriteResult.Builder builderForValue) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.set(index, builderForValue.build()); + onChanged(); + } else { + writeResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder addWriteResults(com.google.firestore.v1.WriteResult value) { + if (writeResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWriteResultsIsMutable(); + writeResults_.add(value); + onChanged(); + } else { + writeResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder addWriteResults(int index, com.google.firestore.v1.WriteResult value) { + if (writeResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWriteResultsIsMutable(); + writeResults_.add(index, value); + onChanged(); + } else { + writeResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder addWriteResults(com.google.firestore.v1.WriteResult.Builder builderForValue) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.add(builderForValue.build()); + onChanged(); + } else { + writeResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder addWriteResults( + int index, com.google.firestore.v1.WriteResult.Builder builderForValue) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.add(index, builderForValue.build()); + onChanged(); + } else { + writeResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder addAllWriteResults( + java.lang.Iterable values) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, writeResults_); + onChanged(); + } else { + writeResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder clearWriteResults() { + if (writeResultsBuilder_ == null) { + writeResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + writeResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public Builder removeWriteResults(int index) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.remove(index); + onChanged(); + } else { + writeResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResult.Builder getWriteResultsBuilder(int index) { + return getWriteResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResultOrBuilder getWriteResultsOrBuilder(int index) { + if (writeResultsBuilder_ == null) { + return writeResults_.get(index); + } else { + return writeResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public java.util.List + getWriteResultsOrBuilderList() { + if (writeResultsBuilder_ != null) { + return writeResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(writeResults_); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResult.Builder addWriteResultsBuilder() { + return getWriteResultsFieldBuilder() + .addBuilder(com.google.firestore.v1.WriteResult.getDefaultInstance()); + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public com.google.firestore.v1.WriteResult.Builder addWriteResultsBuilder(int index) { + return getWriteResultsFieldBuilder() + .addBuilder(index, com.google.firestore.v1.WriteResult.getDefaultInstance()); + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + public java.util.List + getWriteResultsBuilderList() { + return getWriteResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.WriteResult, + com.google.firestore.v1.WriteResult.Builder, + com.google.firestore.v1.WriteResultOrBuilder> + getWriteResultsFieldBuilder() { + if (writeResultsBuilder_ == null) { + writeResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.WriteResult, + com.google.firestore.v1.WriteResult.Builder, + com.google.firestore.v1.WriteResultOrBuilder>( + writeResults_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + writeResults_ = null; + } + return writeResultsBuilder_; + } + + private com.google.protobuf.Timestamp commitTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitTimeBuilder_; + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public boolean hasCommitTime() { + return commitTimeBuilder_ != null || commitTime_ != null; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public com.google.protobuf.Timestamp getCommitTime() { + if (commitTimeBuilder_ == null) { + return commitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTime_; + } else { + return commitTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public Builder setCommitTime(com.google.protobuf.Timestamp value) { + if (commitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitTime_ = value; + onChanged(); + } else { + commitTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public Builder setCommitTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitTimeBuilder_ == null) { + commitTime_ = builderForValue.build(); + onChanged(); + } else { + commitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public Builder mergeCommitTime(com.google.protobuf.Timestamp value) { + if (commitTimeBuilder_ == null) { + if (commitTime_ != null) { + commitTime_ = + com.google.protobuf.Timestamp.newBuilder(commitTime_).mergeFrom(value).buildPartial(); + } else { + commitTime_ = value; + } + onChanged(); + } else { + commitTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public Builder clearCommitTime() { + if (commitTimeBuilder_ == null) { + commitTime_ = null; + onChanged(); + } else { + commitTime_ = null; + commitTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCommitTimeBuilder() { + + onChanged(); + return getCommitTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder() { + if (commitTimeBuilder_ != null) { + return commitTimeBuilder_.getMessageOrBuilder(); + } else { + return commitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTime_; + } + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitTimeFieldBuilder() { + if (commitTimeBuilder_ == null) { + commitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitTime(), getParentForChildren(), isClean()); + commitTime_ = null; + } + return commitTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.CommitResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.CommitResponse) + private static final com.google.firestore.v1.CommitResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.CommitResponse(); + } + + public static com.google.firestore.v1.CommitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommitResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitResponse(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.v1.CommitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponseOrBuilder.java new file mode 100644 index 000000000000..6fda2567d2fe --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommitResponseOrBuilder.java @@ -0,0 +1,103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface CommitResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.CommitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + java.util.List getWriteResultsList(); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + com.google.firestore.v1.WriteResult getWriteResults(int index); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + int getWriteResultsCount(); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + java.util.List + getWriteResultsOrBuilderList(); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 1; + */ + com.google.firestore.v1.WriteResultOrBuilder getWriteResultsOrBuilder(int index); + + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + boolean hasCommitTime(); + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + com.google.protobuf.Timestamp getCommitTime(); + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommonProto.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommonProto.java new file mode 100644 index 000000000000..84047cf6c4ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CommonProto.java @@ -0,0 +1,124 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +public final class CommonProto { + private CommonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DocumentMask_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DocumentMask_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Precondition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Precondition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_TransactionOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_TransactionOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_TransactionOptions_ReadWrite_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_TransactionOptions_ReadWrite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_TransactionOptions_ReadOnly_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_TransactionOptions_ReadOnly_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n google/firestore/v1/common.proto\022\023goog" + + "le.firestore.v1\032\034google/api/annotations." + + "proto\032\037google/protobuf/timestamp.proto\"#" + + "\n\014DocumentMask\022\023\n\013field_paths\030\001 \003(\t\"e\n\014P" + + "recondition\022\020\n\006exists\030\001 \001(\010H\000\0221\n\013update_" + + "time\030\002 \001(\0132\032.google.protobuf.TimestampH\000" + + "B\020\n\016condition_type\"\251\002\n\022TransactionOption" + + "s\022E\n\tread_only\030\002 \001(\01320.google.firestore." + + "v1.TransactionOptions.ReadOnlyH\000\022G\n\nread" + + "_write\030\003 \001(\01321.google.firestore.v1.Trans" + + "actionOptions.ReadWriteH\000\032&\n\tReadWrite\022\031" + + "\n\021retry_transaction\030\001 \001(\014\032S\n\010ReadOnly\022/\n" + + "\tread_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tampH\000B\026\n\024consistency_selectorB\006\n\004modeB\245" + + "\001\n\027com.google.firestore.v1B\013CommonProtoP" + + "\001Z + * The request for [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument]. + * + * + * Protobuf type {@code google.firestore.v1.CreateDocumentRequest} + */ +public final class CreateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.CreateDocumentRequest) + CreateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentRequest.newBuilder() to construct. + private CreateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentRequest() { + parent_ = ""; + collectionId_ = ""; + documentId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateDocumentRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + collectionId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + documentId_ = s; + break; + } + case 34: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (document_ != null) { + subBuilder = document_.toBuilder(); + } + document_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(document_); + document_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.firestore.v1.DocumentMask.Builder subBuilder = null; + if (mask_ != null) { + subBuilder = mask_.toBuilder(); + } + mask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mask_); + mask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CreateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.CreateDocumentRequest.class, + com.google.firestore.v1.CreateDocumentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The parent resource. For example:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+   * 
+ * + * string parent = 1; + */ + 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. For example:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+   * 
+ * + * string parent = 1; + */ + 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 COLLECTION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object collectionId_; + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+   * 
+ * + * string collection_id = 2; + */ + public java.lang.String getCollectionId() { + java.lang.Object ref = collectionId_; + 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(); + collectionId_ = s; + return s; + } + } + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+   * 
+ * + * string collection_id = 2; + */ + public com.google.protobuf.ByteString getCollectionIdBytes() { + java.lang.Object ref = collectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object documentId_; + /** + * + * + *
+   * The client-assigned document ID to use for this document.
+   * Optional. If not specified, an ID will be assigned by the service.
+   * 
+ * + * string document_id = 3; + */ + public java.lang.String getDocumentId() { + java.lang.Object ref = documentId_; + 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(); + documentId_ = s; + return s; + } + } + /** + * + * + *
+   * The client-assigned document ID to use for this document.
+   * Optional. If not specified, an ID will be assigned by the service.
+   * 
+ * + * string document_id = 3; + */ + public com.google.protobuf.ByteString getDocumentIdBytes() { + java.lang.Object ref = documentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENT_FIELD_NUMBER = 4; + private com.google.firestore.v1.Document document_; + /** + * + * + *
+   * The document to create. `name` must not be set.
+   * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * The document to create. `name` must not be set.
+   * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public com.google.firestore.v1.Document getDocument() { + return document_ == null ? com.google.firestore.v1.Document.getDefaultInstance() : document_; + } + /** + * + * + *
+   * The document to create. `name` must not be set.
+   * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int MASK_FIELD_NUMBER = 5; + private com.google.firestore.v1.DocumentMask mask_; + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public boolean hasMask() { + return mask_ != null; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public com.google.firestore.v1.DocumentMask getMask() { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + return getMask(); + } + + 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 (!getCollectionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectionId_); + } + if (!getDocumentIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, documentId_); + } + if (document_ != null) { + output.writeMessage(4, getDocument()); + } + if (mask_ != null) { + output.writeMessage(5, getMask()); + } + 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 (!getCollectionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, collectionId_); + } + if (!getDocumentIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, documentId_); + } + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocument()); + } + if (mask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getMask()); + } + 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.v1.CreateDocumentRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.CreateDocumentRequest other = + (com.google.firestore.v1.CreateDocumentRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getCollectionId().equals(other.getCollectionId()); + result = result && getDocumentId().equals(other.getDocumentId()); + result = result && (hasDocument() == other.hasDocument()); + if (hasDocument()) { + result = result && getDocument().equals(other.getDocument()); + } + result = result && (hasMask() == other.hasMask()); + if (hasMask()) { + result = result && getMask().equals(other.getMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + COLLECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getCollectionId().hashCode(); + hash = (37 * hash) + DOCUMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getDocumentId().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasMask()) { + hash = (37 * hash) + MASK_FIELD_NUMBER; + hash = (53 * hash) + getMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.CreateDocumentRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CreateDocumentRequest 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.v1.CreateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CreateDocumentRequest 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.v1.CreateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.CreateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.CreateDocumentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CreateDocumentRequest 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.v1.CreateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CreateDocumentRequest 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.v1.CreateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.CreateDocumentRequest 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.v1.CreateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.CreateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.CreateDocumentRequest) + com.google.firestore.v1.CreateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CreateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.CreateDocumentRequest.class, + com.google.firestore.v1.CreateDocumentRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.CreateDocumentRequest.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_ = ""; + + collectionId_ = ""; + + documentId_ = ""; + + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (maskBuilder_ == null) { + mask_ = null; + } else { + mask_ = null; + maskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.CreateDocumentRequest getDefaultInstanceForType() { + return com.google.firestore.v1.CreateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.CreateDocumentRequest build() { + com.google.firestore.v1.CreateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.CreateDocumentRequest buildPartial() { + com.google.firestore.v1.CreateDocumentRequest result = + new com.google.firestore.v1.CreateDocumentRequest(this); + result.parent_ = parent_; + result.collectionId_ = collectionId_; + result.documentId_ = documentId_; + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (maskBuilder_ == null) { + result.mask_ = mask_; + } else { + result.mask_ = maskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.CreateDocumentRequest) { + return mergeFrom((com.google.firestore.v1.CreateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.CreateDocumentRequest other) { + if (other == com.google.firestore.v1.CreateDocumentRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getCollectionId().isEmpty()) { + collectionId_ = other.collectionId_; + onChanged(); + } + if (!other.getDocumentId().isEmpty()) { + documentId_ = other.documentId_; + onChanged(); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasMask()) { + mergeMask(other.getMask()); + } + 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.v1.CreateDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.CreateDocumentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The parent resource. For example:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+     * 
+ * + * string parent = 1; + */ + 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. For example:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+     * 
+ * + * string parent = 1; + */ + 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. For example:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource. For example:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource. For example:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object collectionId_ = ""; + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+     * 
+ * + * string collection_id = 2; + */ + public java.lang.String getCollectionId() { + java.lang.Object ref = collectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+     * 
+ * + * string collection_id = 2; + */ + public com.google.protobuf.ByteString getCollectionIdBytes() { + java.lang.Object ref = collectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+     * 
+ * + * string collection_id = 2; + */ + public Builder setCollectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + collectionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+     * 
+ * + * string collection_id = 2; + */ + public Builder clearCollectionId() { + + collectionId_ = getDefaultInstance().getCollectionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+     * 
+ * + * string collection_id = 2; + */ + public Builder setCollectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + collectionId_ = value; + onChanged(); + return this; + } + + private java.lang.Object documentId_ = ""; + /** + * + * + *
+     * The client-assigned document ID to use for this document.
+     * Optional. If not specified, an ID will be assigned by the service.
+     * 
+ * + * string document_id = 3; + */ + public java.lang.String getDocumentId() { + java.lang.Object ref = documentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The client-assigned document ID to use for this document.
+     * Optional. If not specified, an ID will be assigned by the service.
+     * 
+ * + * string document_id = 3; + */ + public com.google.protobuf.ByteString getDocumentIdBytes() { + java.lang.Object ref = documentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The client-assigned document ID to use for this document.
+     * Optional. If not specified, an ID will be assigned by the service.
+     * 
+ * + * string document_id = 3; + */ + public Builder setDocumentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + documentId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The client-assigned document ID to use for this document.
+     * Optional. If not specified, an ID will be assigned by the service.
+     * 
+ * + * string document_id = 3; + */ + public Builder clearDocumentId() { + + documentId_ = getDefaultInstance().getDocumentId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The client-assigned document ID to use for this document.
+     * Optional. If not specified, an ID will be assigned by the service.
+     * 
+ * + * string document_id = 3; + */ + public Builder setDocumentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + documentId_ = value; + onChanged(); + return this; + } + + private com.google.firestore.v1.Document document_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public com.google.firestore.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public Builder setDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public Builder setDocument(com.google.firestore.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public Builder mergeDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.firestore.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public com.google.firestore.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .google.firestore.v1.Document document = 4; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * The document to create. `name` must not be set.
+     * 
+ * + * .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) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.firestore.v1.DocumentMask mask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + maskBuilder_; + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public boolean hasMask() { + return maskBuilder_ != null || mask_ != null; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public com.google.firestore.v1.DocumentMask getMask() { + if (maskBuilder_ == null) { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } else { + return maskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mask_ = value; + onChanged(); + } else { + maskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (maskBuilder_ == null) { + mask_ = builderForValue.build(); + onChanged(); + } else { + maskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public Builder mergeMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (mask_ != null) { + mask_ = + com.google.firestore.v1.DocumentMask.newBuilder(mask_) + .mergeFrom(value) + .buildPartial(); + } else { + mask_ = value; + } + onChanged(); + } else { + maskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public Builder clearMask() { + if (maskBuilder_ == null) { + mask_ = null; + onChanged(); + } else { + mask_ = null; + maskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public com.google.firestore.v1.DocumentMask.Builder getMaskBuilder() { + + onChanged(); + return getMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + if (maskBuilder_ != null) { + return maskBuilder_.getMessageOrBuilder(); + } else { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getMaskFieldBuilder() { + if (maskBuilder_ == null) { + maskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getMask(), getParentForChildren(), isClean()); + mask_ = null; + } + return maskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.CreateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.CreateDocumentRequest) + private static final com.google.firestore.v1.CreateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.CreateDocumentRequest(); + } + + public static com.google.firestore.v1.CreateDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateDocumentRequest(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.v1.CreateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CreateDocumentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CreateDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..f2fad7c4837e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CreateDocumentRequestOrBuilder.java @@ -0,0 +1,147 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface CreateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.CreateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent resource. For example:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The parent resource. For example:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+   * 
+ * + * string collection_id = 2; + */ + java.lang.String getCollectionId(); + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`.
+   * 
+ * + * string collection_id = 2; + */ + com.google.protobuf.ByteString getCollectionIdBytes(); + + /** + * + * + *
+   * The client-assigned document ID to use for this document.
+   * Optional. If not specified, an ID will be assigned by the service.
+   * 
+ * + * string document_id = 3; + */ + java.lang.String getDocumentId(); + /** + * + * + *
+   * The client-assigned document ID to use for this document.
+   * Optional. If not specified, an ID will be assigned by the service.
+   * 
+ * + * string document_id = 3; + */ + com.google.protobuf.ByteString getDocumentIdBytes(); + + /** + * + * + *
+   * The document to create. `name` must not be set.
+   * 
+ * + * .google.firestore.v1.Document document = 4; + */ + boolean hasDocument(); + /** + * + * + *
+   * The document to create. `name` must not be set.
+   * 
+ * + * .google.firestore.v1.Document document = 4; + */ + com.google.firestore.v1.Document getDocument(); + /** + * + * + *
+   * The document to create. `name` must not be set.
+   * 
+ * + * .google.firestore.v1.Document document = 4; + */ + com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + boolean hasMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + com.google.firestore.v1.DocumentMask getMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 5; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Cursor.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Cursor.java new file mode 100644 index 000000000000..7a9982bc9aed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Cursor.java @@ -0,0 +1,1046 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A position in a query result set.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.Cursor} + */ +public final class Cursor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Cursor) + CursorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Cursor.newBuilder() to construct. + private Cursor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Cursor() { + values_ = java.util.Collections.emptyList(); + before_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Cursor( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + values_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + values_.add( + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry)); + break; + } + case 16: + { + before_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + values_ = java.util.Collections.unmodifiableList(values_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto.internal_static_google_firestore_v1_Cursor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_Cursor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Cursor.class, com.google.firestore.v1.Cursor.Builder.class); + } + + private int bitField0_; + public static final int VALUES_FIELD_NUMBER = 1; + private java.util.List values_; + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.ValueOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + public static final int BEFORE_FIELD_NUMBER = 2; + private boolean before_; + /** + * + * + *
+   * If the position is just before or just after the given values, relative
+   * to the sort order defined by the query.
+   * 
+ * + * bool before = 2; + */ + public boolean getBefore() { + return before_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + if (before_ != false) { + output.writeBool(2, before_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + if (before_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, before_); + } + 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.v1.Cursor)) { + return super.equals(obj); + } + com.google.firestore.v1.Cursor other = (com.google.firestore.v1.Cursor) obj; + + boolean result = true; + result = result && getValuesList().equals(other.getValuesList()); + result = result && (getBefore() == other.getBefore()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (37 * hash) + BEFORE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBefore()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Cursor parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Cursor 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.v1.Cursor parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Cursor 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.v1.Cursor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Cursor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Cursor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Cursor 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.v1.Cursor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Cursor 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.v1.Cursor parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Cursor 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.v1.Cursor 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 position in a query result set.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Cursor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Cursor) + com.google.firestore.v1.CursorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_Cursor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_Cursor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Cursor.class, com.google.firestore.v1.Cursor.Builder.class); + } + + // Construct using com.google.firestore.v1.Cursor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + valuesBuilder_.clear(); + } + before_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_Cursor_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Cursor getDefaultInstanceForType() { + return com.google.firestore.v1.Cursor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Cursor build() { + com.google.firestore.v1.Cursor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Cursor buildPartial() { + com.google.firestore.v1.Cursor result = new com.google.firestore.v1.Cursor(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + result.before_ = before_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Cursor) { + return mergeFrom((com.google.firestore.v1.Cursor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Cursor other) { + if (other == com.google.firestore.v1.Cursor.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + if (other.getBefore() != false) { + setBefore(other.getBefore()); + } + 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.v1.Cursor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Cursor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder setValues(int index, com.google.firestore.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder setValues(int index, com.google.firestore.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(com.google.firestore.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(int index, com.google.firestore.v1.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(com.google.firestore.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addValues(int index, com.google.firestore.v1.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value.Builder getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.ValueOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder(com.google.firestore.v1.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public com.google.firestore.v1.Value.Builder addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder(index, com.google.firestore.v1.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The values that represent a position, in the order they appear in
+     * the order by clause of a query.
+     * Can contain fewer values than specified in the order by clause.
+     * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + public java.util.List getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + values_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + values_ = null; + } + return valuesBuilder_; + } + + private boolean before_; + /** + * + * + *
+     * If the position is just before or just after the given values, relative
+     * to the sort order defined by the query.
+     * 
+ * + * bool before = 2; + */ + public boolean getBefore() { + return before_; + } + /** + * + * + *
+     * If the position is just before or just after the given values, relative
+     * to the sort order defined by the query.
+     * 
+ * + * bool before = 2; + */ + public Builder setBefore(boolean value) { + + before_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If the position is just before or just after the given values, relative
+     * to the sort order defined by the query.
+     * 
+ * + * bool before = 2; + */ + public Builder clearBefore() { + + before_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Cursor) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Cursor) + private static final com.google.firestore.v1.Cursor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Cursor(); + } + + public static com.google.firestore.v1.Cursor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cursor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Cursor(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.v1.Cursor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CursorOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CursorOrBuilder.java new file mode 100644 index 000000000000..fada6f7f8410 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/CursorOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query.proto + +package com.google.firestore.v1; + +public interface CursorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Cursor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + java.util.List getValuesList(); + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + com.google.firestore.v1.Value getValues(int index); + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + int getValuesCount(); + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + java.util.List getValuesOrBuilderList(); + /** + * + * + *
+   * The values that represent a position, in the order they appear in
+   * the order by clause of a query.
+   * Can contain fewer values than specified in the order by clause.
+   * 
+ * + * repeated .google.firestore.v1.Value values = 1; + */ + com.google.firestore.v1.ValueOrBuilder getValuesOrBuilder(int index); + + /** + * + * + *
+   * If the position is just before or just after the given values, relative
+   * to the sort order defined by the query.
+   * 
+ * + * bool before = 2; + */ + boolean getBefore(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DatabaseRootName.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DatabaseRootName.java new file mode 100644 index 000000000000..3acfa897f7ba --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DatabaseRootName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 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. + */ + +package com.google.firestore.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class DatabaseRootName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/databases/{database}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DatabaseRootName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + } + + public static DatabaseRootName of(String project, String database) { + return newBuilder().setProject(project).setDatabase(database).build(); + } + + public static String format(String project, String database) { + return newBuilder().setProject(project).setDatabase(database).build().toString(); + } + + public static DatabaseRootName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "DatabaseRootName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("database")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (DatabaseRootName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "database", database); + } + + /** Builder for DatabaseRootName. */ + public static class Builder { + + private String project; + private String database; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + private Builder() {} + + private Builder(DatabaseRootName databaseRootName) { + project = databaseRootName.project; + database = databaseRootName.database; + } + + public DatabaseRootName build() { + return new DatabaseRootName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DatabaseRootName) { + DatabaseRootName that = (DatabaseRootName) o; + return (this.project.equals(that.project)) && (this.database.equals(that.database)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequest.java new file mode 100644 index 000000000000..a6d7daf36d7d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequest.java @@ -0,0 +1,883 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.DeleteDocumentRequest} + */ +public final class DeleteDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DeleteDocumentRequest) + DeleteDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDocumentRequest.newBuilder() to construct. + private DeleteDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteDocumentRequest( + 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.firestore.v1.Precondition.Builder subBuilder = null; + if (currentDocument_ != null) { + subBuilder = currentDocument_.toBuilder(); + } + currentDocument_ = + input.readMessage( + com.google.firestore.v1.Precondition.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(currentDocument_); + currentDocument_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_DeleteDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DeleteDocumentRequest.class, + com.google.firestore.v1.DeleteDocumentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the Document to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + 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 resource name of the Document to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + 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 CURRENT_DOCUMENT_FIELD_NUMBER = 2; + private com.google.firestore.v1.Precondition currentDocument_; + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public boolean hasCurrentDocument() { + return currentDocument_ != null; + } + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public com.google.firestore.v1.Precondition getCurrentDocument() { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { + return getCurrentDocument(); + } + + 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 (currentDocument_ != null) { + output.writeMessage(2, getCurrentDocument()); + } + 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 (currentDocument_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCurrentDocument()); + } + 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.v1.DeleteDocumentRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.DeleteDocumentRequest other = + (com.google.firestore.v1.DeleteDocumentRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && (hasCurrentDocument() == other.hasCurrentDocument()); + if (hasCurrentDocument()) { + result = result && getCurrentDocument().equals(other.getCurrentDocument()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (hasCurrentDocument()) { + hash = (37 * hash) + CURRENT_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getCurrentDocument().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.DeleteDocumentRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DeleteDocumentRequest 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.v1.DeleteDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DeleteDocumentRequest 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.v1.DeleteDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DeleteDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DeleteDocumentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DeleteDocumentRequest 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.v1.DeleteDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DeleteDocumentRequest 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.v1.DeleteDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DeleteDocumentRequest 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.v1.DeleteDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DeleteDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DeleteDocumentRequest) + com.google.firestore.v1.DeleteDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_DeleteDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DeleteDocumentRequest.class, + com.google.firestore.v1.DeleteDocumentRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.DeleteDocumentRequest.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 (currentDocumentBuilder_ == null) { + currentDocument_ = null; + } else { + currentDocument_ = null; + currentDocumentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DeleteDocumentRequest getDefaultInstanceForType() { + return com.google.firestore.v1.DeleteDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DeleteDocumentRequest build() { + com.google.firestore.v1.DeleteDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DeleteDocumentRequest buildPartial() { + com.google.firestore.v1.DeleteDocumentRequest result = + new com.google.firestore.v1.DeleteDocumentRequest(this); + result.name_ = name_; + if (currentDocumentBuilder_ == null) { + result.currentDocument_ = currentDocument_; + } else { + result.currentDocument_ = currentDocumentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DeleteDocumentRequest) { + return mergeFrom((com.google.firestore.v1.DeleteDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DeleteDocumentRequest other) { + if (other == com.google.firestore.v1.DeleteDocumentRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCurrentDocument()) { + mergeCurrentDocument(other.getCurrentDocument()); + } + 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.v1.DeleteDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.DeleteDocumentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the Document to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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 resource name of the Document to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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 resource name of the Document to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Document to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Document to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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.v1.Precondition currentDocument_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder> + currentDocumentBuilder_; + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public boolean hasCurrentDocument() { + return currentDocumentBuilder_ != null || currentDocument_ != null; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public com.google.firestore.v1.Precondition getCurrentDocument() { + if (currentDocumentBuilder_ == null) { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } else { + return currentDocumentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public Builder setCurrentDocument(com.google.firestore.v1.Precondition value) { + if (currentDocumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentDocument_ = value; + onChanged(); + } else { + currentDocumentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public Builder setCurrentDocument( + com.google.firestore.v1.Precondition.Builder builderForValue) { + if (currentDocumentBuilder_ == null) { + currentDocument_ = builderForValue.build(); + onChanged(); + } else { + currentDocumentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public Builder mergeCurrentDocument(com.google.firestore.v1.Precondition value) { + if (currentDocumentBuilder_ == null) { + if (currentDocument_ != null) { + currentDocument_ = + com.google.firestore.v1.Precondition.newBuilder(currentDocument_) + .mergeFrom(value) + .buildPartial(); + } else { + currentDocument_ = value; + } + onChanged(); + } else { + currentDocumentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public Builder clearCurrentDocument() { + if (currentDocumentBuilder_ == null) { + currentDocument_ = null; + onChanged(); + } else { + currentDocument_ = null; + currentDocumentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public com.google.firestore.v1.Precondition.Builder getCurrentDocumentBuilder() { + + onChanged(); + return getCurrentDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + public com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { + if (currentDocumentBuilder_ != null) { + return currentDocumentBuilder_.getMessageOrBuilder(); + } else { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder> + getCurrentDocumentFieldBuilder() { + if (currentDocumentBuilder_ == null) { + currentDocumentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder>( + getCurrentDocument(), getParentForChildren(), isClean()); + currentDocument_ = null; + } + return currentDocumentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DeleteDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DeleteDocumentRequest) + private static final com.google.firestore.v1.DeleteDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DeleteDocumentRequest(); + } + + public static com.google.firestore.v1.DeleteDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteDocumentRequest(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.v1.DeleteDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..9c689205be95 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DeleteDocumentRequestOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface DeleteDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DeleteDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the Document to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the Document to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + boolean hasCurrentDocument(); + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + com.google.firestore.v1.Precondition getCurrentDocument(); + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 2; + */ + com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Document.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Document.java new file mode 100644 index 000000000000..da198de868b2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Document.java @@ -0,0 +1,1722 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A Firestore document.
+ * Must not exceed 1 MiB - 4 bytes.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.Document} + */ +public final class Document extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Document) + DocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Document.newBuilder() to construct. + private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Document() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Document( + 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: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + fields_ = + com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + fields__ = + input.readMessage( + FieldsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + fields_.getMutableMap().put(fields__.getKey(), fields__.getValue()); + break; + } + case 26: + { + 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 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.DocumentProto + .internal_static_google_firestore_v1_Document_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Document.class, com.google.firestore.v1.Document.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the document, for example
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + 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 resource name of the document, for example
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + 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 FIELDS_FIELD_NUMBER = 2; + + private static final class FieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Document_FieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.firestore.v1.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField fields_; + + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField(FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public boolean containsFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetFields().getMap().containsKey(key); + } + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public java.util.Map getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public com.google.firestore.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.firestore.v1.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public com.google.firestore.v1.Value getFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time at which the document was created.
+   * This value increases monotonically when a document is deleted then
+   * recreated. It can also be compared to values from other documents and
+   * the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which the document was created.
+   * This value increases monotonically when a document is deleted then
+   * recreated. It can also be compared to values from other documents and
+   * the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time at which the document was created.
+   * This value increases monotonically when a document is deleted then
+   * recreated. It can also be compared to values from other documents and
+   * the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time at which the document was last changed.
+   * This value is initially set to the `create_time` then increases
+   * monotonically with each change to the document. It can also be
+   * compared to values from other documents and the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which the document was last changed.
+   * This value is initially set to the `create_time` then increases
+   * monotonically with each change to the document. It can also be
+   * compared to values from other documents and the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The time at which the document was last changed.
+   * This value is initially set to the `create_time` then increases
+   * monotonically with each change to the document. It can also be
+   * compared to values from other documents and the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetFields(), FieldsDefaultEntryHolder.defaultEntry, 2); + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + 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_); + } + for (java.util.Map.Entry entry : + internalGetFields().getMap().entrySet()) { + com.google.protobuf.MapEntry fields__ = + FieldsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, fields__); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + 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.v1.Document)) { + return super.equals(obj); + } + com.google.firestore.v1.Document other = (com.google.firestore.v1.Document) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && internalGetFields().equals(other.internalGetFields()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime().equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime().equals(other.getUpdateTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (!internalGetFields().getMap().isEmpty()) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetFields().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Document parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Document 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.v1.Document parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Document 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.v1.Document parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Document parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Document parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Document 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.v1.Document parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Document 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.v1.Document parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Document 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.v1.Document 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 document.
+   * Must not exceed 1 MiB - 4 bytes.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Document} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Document) + com.google.firestore.v1.DocumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Document_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Document.class, + com.google.firestore.v1.Document.Builder.class); + } + + // Construct using com.google.firestore.v1.Document.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_ = ""; + + internalGetMutableFields().clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Document_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Document getDefaultInstanceForType() { + return com.google.firestore.v1.Document.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Document build() { + com.google.firestore.v1.Document result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Document buildPartial() { + com.google.firestore.v1.Document result = new com.google.firestore.v1.Document(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.fields_ = internalGetFields(); + result.fields_.makeImmutable(); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Document) { + return mergeFrom((com.google.firestore.v1.Document) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Document other) { + if (other == com.google.firestore.v1.Document.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableFields().mergeFrom(other.internalGetFields()); + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.v1.Document parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Document) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the document, for example
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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 resource name of the document, for example
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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 resource name of the document, for example
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the document, for example
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the document, for example
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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.MapField fields_; + + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField(FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + + private com.google.protobuf.MapField + internalGetMutableFields() { + onChanged(); + ; + if (fields_ == null) { + fields_ = com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry); + } + if (!fields_.isMutable()) { + fields_ = fields_.copy(); + } + return fields_; + } + + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public boolean containsFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetFields().getMap().containsKey(key); + } + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public java.util.Map getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public com.google.firestore.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.firestore.v1.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public com.google.firestore.v1.Value getFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFields() { + internalGetMutableFields().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public Builder removeFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableFields().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableFields() { + return internalGetMutableFields().getMutableMap(); + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public Builder putFields(java.lang.String key, com.google.firestore.v1.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableFields().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The document's fields.
+     * The map keys represent field names.
+     * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+     * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+     * `foo_bar_17`.
+     * Field names matching the regular expression `__.*__` are reserved. Reserved
+     * field names are forbidden except in certain documented contexts. The map
+     * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+     * empty.
+     * Field paths may be used in other contexts to refer to structured fields
+     * defined here. For `map_value`, the field path is represented by the simple
+     * or quoted field names of the containing fields, delimited by `.`. For
+     * example, the structured field
+     * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+     * represented by the field path `foo.x&y`.
+     * Within a field path, a quoted field name starts and ends with `` ` `` and
+     * may contain any character. Some characters, including `` ` ``, must be
+     * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+     * `` `bak\`tik` `` represents `` bak`tik ``.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + public Builder putAllFields( + java.util.Map values) { + internalGetMutableFields().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time at which the document was created.
+     * This value increases monotonically when a document is deleted then
+     * recreated. It can also be compared to values from other documents and
+     * the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The time at which the document was last changed.
+     * This value is initially set to the `create_time` then increases
+     * monotonically with each change to the document. It can also be
+     * compared to values from other documents and the `read_time` of a query.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Document) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Document) + private static final com.google.firestore.v1.Document DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Document(); + } + + public static com.google.firestore.v1.Document getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Document parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Document(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.v1.Document getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChange.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChange.java new file mode 100644 index 000000000000..088e1847cf33 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChange.java @@ -0,0 +1,1156 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A [Document][google.firestore.v1.Document] has changed.
+ * May be the result of multiple [writes][google.firestore.v1.Write], including deletes, that
+ * ultimately resulted in a new value for the [Document][google.firestore.v1.Document].
+ * Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical
+ * change, if multiple targets are affected.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentChange} + */ +public final class DocumentChange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DocumentChange) + DocumentChangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentChange.newBuilder() to construct. + private DocumentChange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentChange() { + targetIds_ = java.util.Collections.emptyList(); + removedTargetIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentChange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (document_ != null) { + subBuilder = document_.toBuilder(); + } + document_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(document_); + document_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + targetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + targetIds_.add(input.readInt32()); + break; + } + case 42: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) + && input.getBytesUntilLimit() > 0) { + targetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + targetIds_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 48: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + removedTargetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + removedTargetIds_.add(input.readInt32()); + break; + } + case 50: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) + && input.getBytesUntilLimit() > 0) { + removedTargetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + while (input.getBytesUntilLimit() > 0) { + removedTargetIds_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + targetIds_ = java.util.Collections.unmodifiableList(targetIds_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + removedTargetIds_ = java.util.Collections.unmodifiableList(removedTargetIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentChange.class, + com.google.firestore.v1.DocumentChange.Builder.class); + } + + private int bitField0_; + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.firestore.v1.Document document_; + /** + * + * + *
+   * The new state of the [Document][google.firestore.v1.Document].
+   * If `mask` is set, contains only fields that were updated or added.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * The new state of the [Document][google.firestore.v1.Document].
+   * If `mask` is set, contains only fields that were updated or added.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document getDocument() { + return document_ == null ? com.google.firestore.v1.Document.getDefaultInstance() : document_; + } + /** + * + * + *
+   * The new state of the [Document][google.firestore.v1.Document].
+   * If `mask` is set, contains only fields that were updated or added.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int TARGET_IDS_FIELD_NUMBER = 5; + private java.util.List targetIds_; + /** + * + * + *
+   * A set of target IDs of targets that match this document.
+   * 
+ * + * repeated int32 target_ids = 5; + */ + public java.util.List getTargetIdsList() { + return targetIds_; + } + /** + * + * + *
+   * A set of target IDs of targets that match this document.
+   * 
+ * + * repeated int32 target_ids = 5; + */ + public int getTargetIdsCount() { + return targetIds_.size(); + } + /** + * + * + *
+   * A set of target IDs of targets that match this document.
+   * 
+ * + * repeated int32 target_ids = 5; + */ + public int getTargetIds(int index) { + return targetIds_.get(index); + } + + private int targetIdsMemoizedSerializedSize = -1; + + public static final int REMOVED_TARGET_IDS_FIELD_NUMBER = 6; + private java.util.List removedTargetIds_; + /** + * + * + *
+   * A set of target IDs for targets that no longer match this document.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public java.util.List getRemovedTargetIdsList() { + return removedTargetIds_; + } + /** + * + * + *
+   * A set of target IDs for targets that no longer match this document.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIdsCount() { + return removedTargetIds_.size(); + } + /** + * + * + *
+   * A set of target IDs for targets that no longer match this document.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIds(int index) { + return removedTargetIds_.get(index); + } + + private int removedTargetIdsMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (getTargetIdsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(targetIdsMemoizedSerializedSize); + } + for (int i = 0; i < targetIds_.size(); i++) { + output.writeInt32NoTag(targetIds_.get(i)); + } + if (getRemovedTargetIdsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(removedTargetIdsMemoizedSerializedSize); + } + for (int i = 0; i < removedTargetIds_.size(); i++) { + output.writeInt32NoTag(removedTargetIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + { + int dataSize = 0; + for (int i = 0; i < targetIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(targetIds_.get(i)); + } + size += dataSize; + if (!getTargetIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + targetIdsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < removedTargetIds_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(removedTargetIds_.get(i)); + } + size += dataSize; + if (!getRemovedTargetIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + removedTargetIdsMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.DocumentChange)) { + return super.equals(obj); + } + com.google.firestore.v1.DocumentChange other = (com.google.firestore.v1.DocumentChange) obj; + + boolean result = true; + result = result && (hasDocument() == other.hasDocument()); + if (hasDocument()) { + result = result && getDocument().equals(other.getDocument()); + } + result = result && getTargetIdsList().equals(other.getTargetIdsList()); + result = result && getRemovedTargetIdsList().equals(other.getRemovedTargetIdsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (getTargetIdsCount() > 0) { + hash = (37 * hash) + TARGET_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTargetIdsList().hashCode(); + } + if (getRemovedTargetIdsCount() > 0) { + hash = (37 * hash) + REMOVED_TARGET_IDS_FIELD_NUMBER; + hash = (53 * hash) + getRemovedTargetIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.DocumentChange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentChange 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.v1.DocumentChange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentChange 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.v1.DocumentChange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentChange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DocumentChange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentChange 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.v1.DocumentChange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentChange 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.v1.DocumentChange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentChange 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.v1.DocumentChange 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 [Document][google.firestore.v1.Document] has changed.
+   * May be the result of multiple [writes][google.firestore.v1.Write], including deletes, that
+   * ultimately resulted in a new value for the [Document][google.firestore.v1.Document].
+   * Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical
+   * change, if multiple targets are affected.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentChange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DocumentChange) + com.google.firestore.v1.DocumentChangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentChange.class, + com.google.firestore.v1.DocumentChange.Builder.class); + } + + // Construct using com.google.firestore.v1.DocumentChange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + targetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + removedTargetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentChange_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentChange getDefaultInstanceForType() { + return com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DocumentChange build() { + com.google.firestore.v1.DocumentChange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentChange buildPartial() { + com.google.firestore.v1.DocumentChange result = + new com.google.firestore.v1.DocumentChange(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + targetIds_ = java.util.Collections.unmodifiableList(targetIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.targetIds_ = targetIds_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + removedTargetIds_ = java.util.Collections.unmodifiableList(removedTargetIds_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.removedTargetIds_ = removedTargetIds_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DocumentChange) { + return mergeFrom((com.google.firestore.v1.DocumentChange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DocumentChange other) { + if (other == com.google.firestore.v1.DocumentChange.getDefaultInstance()) return this; + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (!other.targetIds_.isEmpty()) { + if (targetIds_.isEmpty()) { + targetIds_ = other.targetIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTargetIdsIsMutable(); + targetIds_.addAll(other.targetIds_); + } + onChanged(); + } + if (!other.removedTargetIds_.isEmpty()) { + if (removedTargetIds_.isEmpty()) { + removedTargetIds_ = other.removedTargetIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.addAll(other.removedTargetIds_); + } + 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.v1.DocumentChange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.DocumentChange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.firestore.v1.Document document_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder setDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder setDocument(com.google.firestore.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder mergeDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.firestore.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * The new state of the [Document][google.firestore.v1.Document].
+     * If `mask` is set, contains only fields that were updated or added.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + 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) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private java.util.List targetIds_ = java.util.Collections.emptyList(); + + private void ensureTargetIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + targetIds_ = new java.util.ArrayList(targetIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public java.util.List getTargetIdsList() { + return java.util.Collections.unmodifiableList(targetIds_); + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public int getTargetIdsCount() { + return targetIds_.size(); + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public int getTargetIds(int index) { + return targetIds_.get(index); + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public Builder setTargetIds(int index, int value) { + ensureTargetIdsIsMutable(); + targetIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public Builder addTargetIds(int value) { + ensureTargetIdsIsMutable(); + targetIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public Builder addAllTargetIds(java.lang.Iterable values) { + ensureTargetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs of targets that match this document.
+     * 
+ * + * repeated int32 target_ids = 5; + */ + public Builder clearTargetIds() { + targetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private java.util.List removedTargetIds_ = java.util.Collections.emptyList(); + + private void ensureRemovedTargetIdsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + removedTargetIds_ = new java.util.ArrayList(removedTargetIds_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public java.util.List getRemovedTargetIdsList() { + return java.util.Collections.unmodifiableList(removedTargetIds_); + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIdsCount() { + return removedTargetIds_.size(); + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIds(int index) { + return removedTargetIds_.get(index); + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder setRemovedTargetIds(int index, int value) { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder addRemovedTargetIds(int value) { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder addAllRemovedTargetIds(java.lang.Iterable values) { + ensureRemovedTargetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, removedTargetIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that no longer match this document.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder clearRemovedTargetIds() { + removedTargetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DocumentChange) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DocumentChange) + private static final com.google.firestore.v1.DocumentChange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DocumentChange(); + } + + public static com.google.firestore.v1.DocumentChange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentChange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentChange(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.v1.DocumentChange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChangeOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChangeOrBuilder.java new file mode 100644 index 000000000000..38363b63c83b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentChangeOrBuilder.java @@ -0,0 +1,106 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface DocumentChangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DocumentChange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The new state of the [Document][google.firestore.v1.Document].
+   * If `mask` is set, contains only fields that were updated or added.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + boolean hasDocument(); + /** + * + * + *
+   * The new state of the [Document][google.firestore.v1.Document].
+   * If `mask` is set, contains only fields that were updated or added.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + com.google.firestore.v1.Document getDocument(); + /** + * + * + *
+   * The new state of the [Document][google.firestore.v1.Document].
+   * If `mask` is set, contains only fields that were updated or added.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * A set of target IDs of targets that match this document.
+   * 
+ * + * repeated int32 target_ids = 5; + */ + java.util.List getTargetIdsList(); + /** + * + * + *
+   * A set of target IDs of targets that match this document.
+   * 
+ * + * repeated int32 target_ids = 5; + */ + int getTargetIdsCount(); + /** + * + * + *
+   * A set of target IDs of targets that match this document.
+   * 
+ * + * repeated int32 target_ids = 5; + */ + int getTargetIds(int index); + + /** + * + * + *
+   * A set of target IDs for targets that no longer match this document.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + java.util.List getRemovedTargetIdsList(); + /** + * + * + *
+   * A set of target IDs for targets that no longer match this document.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + int getRemovedTargetIdsCount(); + /** + * + * + *
+   * A set of target IDs for targets that no longer match this document.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + int getRemovedTargetIds(int index); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDelete.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDelete.java new file mode 100644 index 000000000000..c0a83d86a3ae --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDelete.java @@ -0,0 +1,1096 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A [Document][google.firestore.v1.Document] has been deleted.
+ * May be the result of multiple [writes][google.firestore.v1.Write], including updates, the
+ * last of which deleted the [Document][google.firestore.v1.Document].
+ * Multiple [DocumentDelete][google.firestore.v1.DocumentDelete] messages may be returned for the same logical
+ * delete, if multiple targets are affected.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentDelete} + */ +public final class DocumentDelete extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DocumentDelete) + DocumentDeleteOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentDelete.newBuilder() to construct. + private DocumentDelete(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentDelete() { + document_ = ""; + removedTargetIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentDelete( + 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(); + + document_ = s; + break; + } + case 34: + { + 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 48: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + removedTargetIds_.add(input.readInt32()); + break; + } + case 50: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) + && input.getBytesUntilLimit() > 0) { + removedTargetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + removedTargetIds_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = java.util.Collections.unmodifiableList(removedTargetIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentDelete_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentDelete_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentDelete.class, + com.google.firestore.v1.DocumentDelete.Builder.class); + } + + private int bitField0_; + public static final int DOCUMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object document_; + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+   * 
+ * + * string document = 1; + */ + public java.lang.String getDocument() { + java.lang.Object ref = document_; + 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(); + document_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+   * 
+ * + * string document = 1; + */ + public com.google.protobuf.ByteString getDocumentBytes() { + java.lang.Object ref = document_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + document_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMOVED_TARGET_IDS_FIELD_NUMBER = 6; + private java.util.List removedTargetIds_; + /** + * + * + *
+   * A set of target IDs for targets that previously matched this entity.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public java.util.List getRemovedTargetIdsList() { + return removedTargetIds_; + } + /** + * + * + *
+   * A set of target IDs for targets that previously matched this entity.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIdsCount() { + return removedTargetIds_.size(); + } + /** + * + * + *
+   * A set of target IDs for targets that previously matched this entity.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIds(int index) { + return removedTargetIds_.get(index); + } + + private int removedTargetIdsMemoizedSerializedSize = -1; + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The read timestamp at which the delete was observed.
+   * Greater or equal to the `commit_time` of the delete.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The read timestamp at which the delete was observed.
+   * Greater or equal to the `commit_time` of the delete.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * The read timestamp at which the delete was observed.
+   * Greater or equal to the `commit_time` of the delete.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 { + getSerializedSize(); + if (!getDocumentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, document_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (getRemovedTargetIdsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(removedTargetIdsMemoizedSerializedSize); + } + for (int i = 0; i < removedTargetIds_.size(); i++) { + output.writeInt32NoTag(removedTargetIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDocumentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, document_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + { + int dataSize = 0; + for (int i = 0; i < removedTargetIds_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(removedTargetIds_.get(i)); + } + size += dataSize; + if (!getRemovedTargetIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + removedTargetIdsMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.DocumentDelete)) { + return super.equals(obj); + } + com.google.firestore.v1.DocumentDelete other = (com.google.firestore.v1.DocumentDelete) obj; + + boolean result = true; + result = result && getDocument().equals(other.getDocument()); + result = result && getRemovedTargetIdsList().equals(other.getRemovedTargetIdsList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + if (getRemovedTargetIdsCount() > 0) { + hash = (37 * hash) + REMOVED_TARGET_IDS_FIELD_NUMBER; + hash = (53 * hash) + getRemovedTargetIdsList().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.v1.DocumentDelete parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentDelete 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.v1.DocumentDelete parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentDelete 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.v1.DocumentDelete parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentDelete parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DocumentDelete parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentDelete 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.v1.DocumentDelete parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentDelete 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.v1.DocumentDelete parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentDelete 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.v1.DocumentDelete 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 [Document][google.firestore.v1.Document] has been deleted.
+   * May be the result of multiple [writes][google.firestore.v1.Write], including updates, the
+   * last of which deleted the [Document][google.firestore.v1.Document].
+   * Multiple [DocumentDelete][google.firestore.v1.DocumentDelete] messages may be returned for the same logical
+   * delete, if multiple targets are affected.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentDelete} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DocumentDelete) + com.google.firestore.v1.DocumentDeleteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentDelete_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentDelete_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentDelete.class, + com.google.firestore.v1.DocumentDelete.Builder.class); + } + + // Construct using com.google.firestore.v1.DocumentDelete.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(); + document_ = ""; + + removedTargetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + 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.v1.WriteProto + .internal_static_google_firestore_v1_DocumentDelete_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentDelete getDefaultInstanceForType() { + return com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DocumentDelete build() { + com.google.firestore.v1.DocumentDelete result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentDelete buildPartial() { + com.google.firestore.v1.DocumentDelete result = + new com.google.firestore.v1.DocumentDelete(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.document_ = document_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = java.util.Collections.unmodifiableList(removedTargetIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.removedTargetIds_ = removedTargetIds_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DocumentDelete) { + return mergeFrom((com.google.firestore.v1.DocumentDelete) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DocumentDelete other) { + if (other == com.google.firestore.v1.DocumentDelete.getDefaultInstance()) return this; + if (!other.getDocument().isEmpty()) { + document_ = other.document_; + onChanged(); + } + if (!other.removedTargetIds_.isEmpty()) { + if (removedTargetIds_.isEmpty()) { + removedTargetIds_ = other.removedTargetIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.addAll(other.removedTargetIds_); + } + onChanged(); + } + 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.v1.DocumentDelete parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.DocumentDelete) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object document_ = ""; + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+     * 
+ * + * string document = 1; + */ + public java.lang.String getDocument() { + java.lang.Object ref = document_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + document_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+     * 
+ * + * string document = 1; + */ + public com.google.protobuf.ByteString getDocumentBytes() { + java.lang.Object ref = document_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + document_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+     * 
+ * + * string document = 1; + */ + public Builder setDocument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + document_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+     * 
+ * + * string document = 1; + */ + public Builder clearDocument() { + + document_ = getDefaultInstance().getDocument(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+     * 
+ * + * string document = 1; + */ + public Builder setDocumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + document_ = value; + onChanged(); + return this; + } + + private java.util.List removedTargetIds_ = java.util.Collections.emptyList(); + + private void ensureRemovedTargetIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = new java.util.ArrayList(removedTargetIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public java.util.List getRemovedTargetIdsList() { + return java.util.Collections.unmodifiableList(removedTargetIds_); + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIdsCount() { + return removedTargetIds_.size(); + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public int getRemovedTargetIds(int index) { + return removedTargetIds_.get(index); + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder setRemovedTargetIds(int index, int value) { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder addRemovedTargetIds(int value) { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder addAllRemovedTargetIds(java.lang.Iterable values) { + ensureRemovedTargetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, removedTargetIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this entity.
+     * 
+ * + * repeated int32 removed_target_ids = 6; + */ + public Builder clearRemovedTargetIds() { + removedTargetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * The read timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The read timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The read timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The read timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The read timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * The read timestamp at which the delete was observed.
+     * Greater or equal to the `commit_time` of the delete.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DocumentDelete) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DocumentDelete) + private static final com.google.firestore.v1.DocumentDelete DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DocumentDelete(); + } + + public static com.google.firestore.v1.DocumentDelete getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentDelete parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentDelete(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.v1.DocumentDelete getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDeleteOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDeleteOrBuilder.java new file mode 100644 index 000000000000..a4644be12f4b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentDeleteOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface DocumentDeleteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DocumentDelete) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+   * 
+ * + * string document = 1; + */ + java.lang.String getDocument(); + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
+   * 
+ * + * string document = 1; + */ + com.google.protobuf.ByteString getDocumentBytes(); + + /** + * + * + *
+   * A set of target IDs for targets that previously matched this entity.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + java.util.List getRemovedTargetIdsList(); + /** + * + * + *
+   * A set of target IDs for targets that previously matched this entity.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + int getRemovedTargetIdsCount(); + /** + * + * + *
+   * A set of target IDs for targets that previously matched this entity.
+   * 
+ * + * repeated int32 removed_target_ids = 6; + */ + int getRemovedTargetIds(int index); + + /** + * + * + *
+   * The read timestamp at which the delete was observed.
+   * Greater or equal to the `commit_time` of the delete.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + boolean hasReadTime(); + /** + * + * + *
+   * The read timestamp at which the delete was observed.
+   * Greater or equal to the `commit_time` of the delete.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The read timestamp at which the delete was observed.
+   * Greater or equal to the `commit_time` of the delete.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMask.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMask.java new file mode 100644 index 000000000000..eac18de912d5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMask.java @@ -0,0 +1,698 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A set of field paths on a document.
+ * Used to restrict a get or update operation on a document to a subset of its
+ * fields.
+ * This is different from standard field masks, as this is always scoped to a
+ * [Document][google.firestore.v1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1.Value].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentMask} + */ +public final class DocumentMask extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DocumentMask) + DocumentMaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentMask.newBuilder() to construct. + private DocumentMask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentMask() { + fieldPaths_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentMask( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + fieldPaths_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fieldPaths_.add(s); + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + fieldPaths_ = fieldPaths_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_DocumentMask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_DocumentMask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentMask.class, + com.google.firestore.v1.DocumentMask.Builder.class); + } + + public static final int FIELD_PATHS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList fieldPaths_; + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + public com.google.protobuf.ProtocolStringList getFieldPathsList() { + return fieldPaths_; + } + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + public int getFieldPathsCount() { + return fieldPaths_.size(); + } + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + public java.lang.String getFieldPaths(int index) { + return fieldPaths_.get(index); + } + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + public com.google.protobuf.ByteString getFieldPathsBytes(int index) { + return fieldPaths_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < fieldPaths_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPaths_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < fieldPaths_.size(); i++) { + dataSize += computeStringSizeNoTag(fieldPaths_.getRaw(i)); + } + size += dataSize; + size += 1 * getFieldPathsList().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.v1.DocumentMask)) { + return super.equals(obj); + } + com.google.firestore.v1.DocumentMask other = (com.google.firestore.v1.DocumentMask) obj; + + boolean result = true; + result = result && getFieldPathsList().equals(other.getFieldPathsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldPathsCount() > 0) { + hash = (37 * hash) + FIELD_PATHS_FIELD_NUMBER; + hash = (53 * hash) + getFieldPathsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.DocumentMask parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentMask 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.v1.DocumentMask parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentMask 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.v1.DocumentMask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentMask parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DocumentMask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentMask 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.v1.DocumentMask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentMask 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.v1.DocumentMask parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentMask 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.v1.DocumentMask 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 set of field paths on a document.
+   * Used to restrict a get or update operation on a document to a subset of its
+   * fields.
+   * This is different from standard field masks, as this is always scoped to a
+   * [Document][google.firestore.v1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1.Value].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentMask} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DocumentMask) + com.google.firestore.v1.DocumentMaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_DocumentMask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_DocumentMask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentMask.class, + com.google.firestore.v1.DocumentMask.Builder.class); + } + + // Construct using com.google.firestore.v1.DocumentMask.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(); + fieldPaths_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_DocumentMask_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentMask getDefaultInstanceForType() { + return com.google.firestore.v1.DocumentMask.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DocumentMask build() { + com.google.firestore.v1.DocumentMask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentMask buildPartial() { + com.google.firestore.v1.DocumentMask result = new com.google.firestore.v1.DocumentMask(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + fieldPaths_ = fieldPaths_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fieldPaths_ = fieldPaths_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DocumentMask) { + return mergeFrom((com.google.firestore.v1.DocumentMask) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DocumentMask other) { + if (other == com.google.firestore.v1.DocumentMask.getDefaultInstance()) return this; + if (!other.fieldPaths_.isEmpty()) { + if (fieldPaths_.isEmpty()) { + fieldPaths_ = other.fieldPaths_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldPathsIsMutable(); + fieldPaths_.addAll(other.fieldPaths_); + } + 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.v1.DocumentMask parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.DocumentMask) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList fieldPaths_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFieldPathsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + fieldPaths_ = new com.google.protobuf.LazyStringArrayList(fieldPaths_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public com.google.protobuf.ProtocolStringList getFieldPathsList() { + return fieldPaths_.getUnmodifiableView(); + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public int getFieldPathsCount() { + return fieldPaths_.size(); + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public java.lang.String getFieldPaths(int index) { + return fieldPaths_.get(index); + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public com.google.protobuf.ByteString getFieldPathsBytes(int index) { + return fieldPaths_.getByteString(index); + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public Builder setFieldPaths(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldPathsIsMutable(); + fieldPaths_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public Builder addFieldPaths(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldPathsIsMutable(); + fieldPaths_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public Builder addAllFieldPaths(java.lang.Iterable values) { + ensureFieldPathsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fieldPaths_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public Builder clearFieldPaths() { + fieldPaths_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+     * path syntax reference.
+     * 
+ * + * repeated string field_paths = 1; + */ + public Builder addFieldPathsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFieldPathsIsMutable(); + fieldPaths_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DocumentMask) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DocumentMask) + private static final com.google.firestore.v1.DocumentMask DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DocumentMask(); + } + + public static com.google.firestore.v1.DocumentMask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentMask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentMask(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.v1.DocumentMask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMaskOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMaskOrBuilder.java new file mode 100644 index 000000000000..11476e48406b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentMaskOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +public interface DocumentMaskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DocumentMask) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + java.util.List getFieldPathsList(); + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + int getFieldPathsCount(); + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + java.lang.String getFieldPaths(int index); + /** + * + * + *
+   * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
+   * path syntax reference.
+   * 
+ * + * repeated string field_paths = 1; + */ + com.google.protobuf.ByteString getFieldPathsBytes(int index); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentOrBuilder.java new file mode 100644 index 000000000000..831405256159 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentOrBuilder.java @@ -0,0 +1,258 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +public interface DocumentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Document) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the document, for example
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the document, for example
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + int getFieldsCount(); + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + boolean containsFields(java.lang.String key); + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getFields(); + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + java.util.Map getFieldsMap(); + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + com.google.firestore.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.firestore.v1.Value defaultValue); + /** + * + * + *
+   * The document's fields.
+   * The map keys represent field names.
+   * A simple field name contains only characters `a` to `z`, `A` to `Z`,
+   * `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
+   * `foo_bar_17`.
+   * Field names matching the regular expression `__.*__` are reserved. Reserved
+   * field names are forbidden except in certain documented contexts. The map
+   * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
+   * empty.
+   * Field paths may be used in other contexts to refer to structured fields
+   * defined here. For `map_value`, the field path is represented by the simple
+   * or quoted field names of the containing fields, delimited by `.`. For
+   * example, the structured field
+   * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
+   * represented by the field path `foo.x&y`.
+   * Within a field path, a quoted field name starts and ends with `` ` `` and
+   * may contain any character. Some characters, including `` ` ``, must be
+   * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
+   * `` `bak\`tik` `` represents `` bak`tik ``.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 2; + */ + com.google.firestore.v1.Value getFieldsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The time at which the document was created.
+   * This value increases monotonically when a document is deleted then
+   * recreated. It can also be compared to values from other documents and
+   * the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time at which the document was created.
+   * This value increases monotonically when a document is deleted then
+   * recreated. It can also be compared to values from other documents and
+   * the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time at which the document was created.
+   * This value increases monotonically when a document is deleted then
+   * recreated. It can also be compared to values from other documents and
+   * the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the document was last changed.
+   * This value is initially set to the `create_time` then increases
+   * monotonically with each change to the document. It can also be
+   * compared to values from other documents and the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the document was last changed.
+   * This value is initially set to the `create_time` then increases
+   * monotonically with each change to the document. It can also be
+   * compared to values from other documents and the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time at which the document was last changed.
+   * This value is initially set to the `create_time` then increases
+   * monotonically with each change to the document. It can also be
+   * compared to values from other documents and the `read_time` of a query.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentPathName.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentPathName.java new file mode 100644 index 000000000000..ce5f8a5fce51 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentPathName.java @@ -0,0 +1,213 @@ +/* + * Copyright 2018 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. + */ + +package com.google.firestore.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class DocumentPathName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/documents/{document_path=**}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + private final String documentPath; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getDocumentPath() { + return documentPath; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DocumentPathName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + documentPath = Preconditions.checkNotNull(builder.getDocumentPath()); + } + + public static DocumentPathName of(String project, String database, String documentPath) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setDocumentPath(documentPath) + .build(); + } + + public static String format(String project, String database, String documentPath) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setDocumentPath(documentPath) + .build() + .toString(); + } + + public static DocumentPathName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "DocumentPathName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("database"), matchMap.get("document_path")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (DocumentPathName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldMapBuilder.put("documentPath", documentPath); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "database", database, "document_path", documentPath); + } + + /** Builder for DocumentPathName. */ + public static class Builder { + + private String project; + private String database; + private String documentPath; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getDocumentPath() { + return documentPath; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setDocumentPath(String documentPath) { + this.documentPath = documentPath; + return this; + } + + private Builder() {} + + private Builder(DocumentPathName documentPathName) { + project = documentPathName.project; + database = documentPathName.database; + documentPath = documentPathName.documentPath; + } + + public DocumentPathName build() { + return new DocumentPathName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DocumentPathName) { + DocumentPathName that = (DocumentPathName) o; + return (this.project.equals(that.project)) + && (this.database.equals(that.database)) + && (this.documentPath.equals(that.documentPath)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + h *= 1000003; + h ^= documentPath.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentProto.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentProto.java new file mode 100644 index 000000000000..de16046a0533 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentProto.java @@ -0,0 +1,163 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +public final class DocumentProto { + private DocumentProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Document_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Document_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Document_FieldsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Document_FieldsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Value_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Value_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ArrayValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ArrayValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_MapValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_MapValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_MapValue_FieldsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_MapValue_FieldsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\"google/firestore/v1/document.proto\022\023go" + + "ogle.firestore.v1\032\034google/api/annotation" + + "s.proto\032\034google/protobuf/struct.proto\032\037g" + + "oogle/protobuf/timestamp.proto\032\030google/t" + + "ype/latlng.proto\"\200\002\n\010Document\022\014\n\004name\030\001 " + + "\001(\t\0229\n\006fields\030\002 \003(\0132).google.firestore.v" + + "1.Document.FieldsEntry\022/\n\013create_time\030\003 " + + "\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat" + + "e_time\030\004 \001(\0132\032.google.protobuf.Timestamp" + + "\032I\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 " + + "\001(\0132\032.google.firestore.v1.Value:\0028\001\"\256\003\n\005" + + "Value\0220\n\nnull_value\030\013 \001(\0162\032.google.proto" + + "buf.NullValueH\000\022\027\n\rboolean_value\030\001 \001(\010H\000" + + "\022\027\n\rinteger_value\030\002 \001(\003H\000\022\026\n\014double_valu" + + "e\030\003 \001(\001H\000\0225\n\017timestamp_value\030\n \001(\0132\032.goo" + + "gle.protobuf.TimestampH\000\022\026\n\014string_value" + + "\030\021 \001(\tH\000\022\025\n\013bytes_value\030\022 \001(\014H\000\022\031\n\017refer" + + "ence_value\030\005 \001(\tH\000\022.\n\017geo_point_value\030\010 " + + "\001(\0132\023.google.type.LatLngH\000\0226\n\013array_valu" + + "e\030\t \001(\0132\037.google.firestore.v1.ArrayValue" + + "H\000\0222\n\tmap_value\030\006 \001(\0132\035.google.firestore" + + ".v1.MapValueH\000B\014\n\nvalue_type\"8\n\nArrayVal" + + "ue\022*\n\006values\030\001 \003(\0132\032.google.firestore.v1" + + ".Value\"\220\001\n\010MapValue\0229\n\006fields\030\001 \003(\0132).go" + + "ogle.firestore.v1.MapValue.FieldsEntry\032I" + + "\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(" + + "\0132\032.google.firestore.v1.Value:\0028\001B\247\001\n\027co" + + "m.google.firestore.v1B\rDocumentProtoP\001Z<" + + "google.golang.org/genproto/googleapis/fi" + + "restore/v1;firestore\242\002\004GCFS\252\002\031Google.Clo" + + "ud.Firestore.V1\312\002\031Google\\Cloud\\Firestore" + + "\\V1b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.LatLngProto.getDescriptor(), + }, + assigner); + internal_static_google_firestore_v1_Document_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_v1_Document_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_Document_descriptor, + new java.lang.String[] { + "Name", "Fields", "CreateTime", "UpdateTime", + }); + internal_static_google_firestore_v1_Document_FieldsEntry_descriptor = + internal_static_google_firestore_v1_Document_descriptor.getNestedTypes().get(0); + internal_static_google_firestore_v1_Document_FieldsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_Document_FieldsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_firestore_v1_Value_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_v1_Value_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_Value_descriptor, + new java.lang.String[] { + "NullValue", + "BooleanValue", + "IntegerValue", + "DoubleValue", + "TimestampValue", + "StringValue", + "BytesValue", + "ReferenceValue", + "GeoPointValue", + "ArrayValue", + "MapValue", + "ValueType", + }); + internal_static_google_firestore_v1_ArrayValue_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_firestore_v1_ArrayValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ArrayValue_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_firestore_v1_MapValue_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_firestore_v1_MapValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_MapValue_descriptor, + new java.lang.String[] { + "Fields", + }); + internal_static_google_firestore_v1_MapValue_FieldsEntry_descriptor = + internal_static_google_firestore_v1_MapValue_descriptor.getNestedTypes().get(0); + internal_static_google_firestore_v1_MapValue_FieldsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_MapValue_FieldsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.LatLngProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemove.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemove.java new file mode 100644 index 000000000000..f8c8714e7a2a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemove.java @@ -0,0 +1,1098 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A [Document][google.firestore.v1.Document] has been removed from the view of the targets.
+ * Sent if the document is no longer relevant to a target and is out of view.
+ * Can be sent instead of a DocumentDelete or a DocumentChange if the server
+ * can not send the new value of the document.
+ * Multiple [DocumentRemove][google.firestore.v1.DocumentRemove] messages may be returned for the same logical
+ * write or delete, if multiple targets are affected.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentRemove} + */ +public final class DocumentRemove extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DocumentRemove) + DocumentRemoveOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentRemove.newBuilder() to construct. + private DocumentRemove(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentRemove() { + document_ = ""; + removedTargetIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentRemove( + 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(); + + document_ = s; + break; + } + case 16: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + removedTargetIds_.add(input.readInt32()); + break; + } + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) + && input.getBytesUntilLimit() > 0) { + removedTargetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + removedTargetIds_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 34: + { + 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 (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = java.util.Collections.unmodifiableList(removedTargetIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentRemove_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentRemove_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentRemove.class, + com.google.firestore.v1.DocumentRemove.Builder.class); + } + + private int bitField0_; + public static final int DOCUMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object document_; + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+   * 
+ * + * string document = 1; + */ + public java.lang.String getDocument() { + java.lang.Object ref = document_; + 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(); + document_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+   * 
+ * + * string document = 1; + */ + public com.google.protobuf.ByteString getDocumentBytes() { + java.lang.Object ref = document_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + document_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMOVED_TARGET_IDS_FIELD_NUMBER = 2; + private java.util.List removedTargetIds_; + /** + * + * + *
+   * A set of target IDs for targets that previously matched this document.
+   * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public java.util.List getRemovedTargetIdsList() { + return removedTargetIds_; + } + /** + * + * + *
+   * A set of target IDs for targets that previously matched this document.
+   * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public int getRemovedTargetIdsCount() { + return removedTargetIds_.size(); + } + /** + * + * + *
+   * A set of target IDs for targets that previously matched this document.
+   * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public int getRemovedTargetIds(int index) { + return removedTargetIds_.get(index); + } + + private int removedTargetIdsMemoizedSerializedSize = -1; + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The read timestamp at which the remove was observed.
+   * Greater or equal to the `commit_time` of the change/delete/remove.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The read timestamp at which the remove was observed.
+   * Greater or equal to the `commit_time` of the change/delete/remove.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * The read timestamp at which the remove was observed.
+   * Greater or equal to the `commit_time` of the change/delete/remove.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 { + getSerializedSize(); + if (!getDocumentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, document_); + } + if (getRemovedTargetIdsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(removedTargetIdsMemoizedSerializedSize); + } + for (int i = 0; i < removedTargetIds_.size(); i++) { + output.writeInt32NoTag(removedTargetIds_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDocumentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, document_); + } + { + int dataSize = 0; + for (int i = 0; i < removedTargetIds_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(removedTargetIds_.get(i)); + } + size += dataSize; + if (!getRemovedTargetIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + removedTargetIdsMemoizedSerializedSize = dataSize; + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, 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.v1.DocumentRemove)) { + return super.equals(obj); + } + com.google.firestore.v1.DocumentRemove other = (com.google.firestore.v1.DocumentRemove) obj; + + boolean result = true; + result = result && getDocument().equals(other.getDocument()); + result = result && getRemovedTargetIdsList().equals(other.getRemovedTargetIdsList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + if (getRemovedTargetIdsCount() > 0) { + hash = (37 * hash) + REMOVED_TARGET_IDS_FIELD_NUMBER; + hash = (53 * hash) + getRemovedTargetIdsList().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.v1.DocumentRemove parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentRemove 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.v1.DocumentRemove parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentRemove 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.v1.DocumentRemove parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentRemove parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DocumentRemove parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentRemove 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.v1.DocumentRemove parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentRemove 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.v1.DocumentRemove parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentRemove 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.v1.DocumentRemove 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 [Document][google.firestore.v1.Document] has been removed from the view of the targets.
+   * Sent if the document is no longer relevant to a target and is out of view.
+   * Can be sent instead of a DocumentDelete or a DocumentChange if the server
+   * can not send the new value of the document.
+   * Multiple [DocumentRemove][google.firestore.v1.DocumentRemove] messages may be returned for the same logical
+   * write or delete, if multiple targets are affected.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentRemove} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DocumentRemove) + com.google.firestore.v1.DocumentRemoveOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentRemove_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentRemove_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentRemove.class, + com.google.firestore.v1.DocumentRemove.Builder.class); + } + + // Construct using com.google.firestore.v1.DocumentRemove.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(); + document_ = ""; + + removedTargetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + 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.v1.WriteProto + .internal_static_google_firestore_v1_DocumentRemove_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentRemove getDefaultInstanceForType() { + return com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DocumentRemove build() { + com.google.firestore.v1.DocumentRemove result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentRemove buildPartial() { + com.google.firestore.v1.DocumentRemove result = + new com.google.firestore.v1.DocumentRemove(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.document_ = document_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = java.util.Collections.unmodifiableList(removedTargetIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.removedTargetIds_ = removedTargetIds_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DocumentRemove) { + return mergeFrom((com.google.firestore.v1.DocumentRemove) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DocumentRemove other) { + if (other == com.google.firestore.v1.DocumentRemove.getDefaultInstance()) return this; + if (!other.getDocument().isEmpty()) { + document_ = other.document_; + onChanged(); + } + if (!other.removedTargetIds_.isEmpty()) { + if (removedTargetIds_.isEmpty()) { + removedTargetIds_ = other.removedTargetIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.addAll(other.removedTargetIds_); + } + onChanged(); + } + 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.v1.DocumentRemove parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.DocumentRemove) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object document_ = ""; + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+     * 
+ * + * string document = 1; + */ + public java.lang.String getDocument() { + java.lang.Object ref = document_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + document_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+     * 
+ * + * string document = 1; + */ + public com.google.protobuf.ByteString getDocumentBytes() { + java.lang.Object ref = document_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + document_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+     * 
+ * + * string document = 1; + */ + public Builder setDocument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + document_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+     * 
+ * + * string document = 1; + */ + public Builder clearDocument() { + + document_ = getDefaultInstance().getDocument(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+     * 
+ * + * string document = 1; + */ + public Builder setDocumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + document_ = value; + onChanged(); + return this; + } + + private java.util.List removedTargetIds_ = java.util.Collections.emptyList(); + + private void ensureRemovedTargetIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + removedTargetIds_ = new java.util.ArrayList(removedTargetIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public java.util.List getRemovedTargetIdsList() { + return java.util.Collections.unmodifiableList(removedTargetIds_); + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public int getRemovedTargetIdsCount() { + return removedTargetIds_.size(); + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public int getRemovedTargetIds(int index) { + return removedTargetIds_.get(index); + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public Builder setRemovedTargetIds(int index, int value) { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public Builder addRemovedTargetIds(int value) { + ensureRemovedTargetIdsIsMutable(); + removedTargetIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public Builder addAllRemovedTargetIds(java.lang.Iterable values) { + ensureRemovedTargetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, removedTargetIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * A set of target IDs for targets that previously matched this document.
+     * 
+ * + * repeated int32 removed_target_ids = 2; + */ + public Builder clearRemovedTargetIds() { + removedTargetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * The read timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The read timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The read timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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 timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The read timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The read timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * The read timestamp at which the remove was observed.
+     * Greater or equal to the `commit_time` of the change/delete/remove.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DocumentRemove) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DocumentRemove) + private static final com.google.firestore.v1.DocumentRemove DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DocumentRemove(); + } + + public static com.google.firestore.v1.DocumentRemove getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentRemove parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentRemove(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.v1.DocumentRemove getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemoveOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemoveOrBuilder.java new file mode 100644 index 000000000000..55e07d9aecff --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRemoveOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface DocumentRemoveOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DocumentRemove) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+   * 
+ * + * string document = 1; + */ + java.lang.String getDocument(); + /** + * + * + *
+   * The resource name of the [Document][google.firestore.v1.Document] that has gone out of view.
+   * 
+ * + * string document = 1; + */ + com.google.protobuf.ByteString getDocumentBytes(); + + /** + * + * + *
+   * A set of target IDs for targets that previously matched this document.
+   * 
+ * + * repeated int32 removed_target_ids = 2; + */ + java.util.List getRemovedTargetIdsList(); + /** + * + * + *
+   * A set of target IDs for targets that previously matched this document.
+   * 
+ * + * repeated int32 removed_target_ids = 2; + */ + int getRemovedTargetIdsCount(); + /** + * + * + *
+   * A set of target IDs for targets that previously matched this document.
+   * 
+ * + * repeated int32 removed_target_ids = 2; + */ + int getRemovedTargetIds(int index); + + /** + * + * + *
+   * The read timestamp at which the remove was observed.
+   * Greater or equal to the `commit_time` of the change/delete/remove.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + boolean hasReadTime(); + /** + * + * + *
+   * The read timestamp at which the remove was observed.
+   * Greater or equal to the `commit_time` of the change/delete/remove.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The read timestamp at which the remove was observed.
+   * Greater or equal to the `commit_time` of the change/delete/remove.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRootName.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRootName.java new file mode 100644 index 000000000000..2c407f4521f3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentRootName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 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. + */ + +package com.google.firestore.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class DocumentRootName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/databases/{database}/documents"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DocumentRootName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + } + + public static DocumentRootName of(String project, String database) { + return newBuilder().setProject(project).setDatabase(database).build(); + } + + public static String format(String project, String database) { + return newBuilder().setProject(project).setDatabase(database).build().toString(); + } + + public static DocumentRootName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "DocumentRootName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("database")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (DocumentRootName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "database", database); + } + + /** Builder for DocumentRootName. */ + public static class Builder { + + private String project; + private String database; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + private Builder() {} + + private Builder(DocumentRootName documentRootName) { + project = documentRootName.project; + database = documentRootName.database; + } + + public DocumentRootName build() { + return new DocumentRootName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DocumentRootName) { + DocumentRootName that = (DocumentRootName) o; + return (this.project.equals(that.project)) && (this.database.equals(that.database)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransform.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransform.java new file mode 100644 index 000000000000..16b9eb8cdeb7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransform.java @@ -0,0 +1,4484 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A transformation of a document.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentTransform} + */ +public final class DocumentTransform extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DocumentTransform) + DocumentTransformOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentTransform.newBuilder() to construct. + private DocumentTransform(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentTransform() { + document_ = ""; + fieldTransforms_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentTransform( + 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(); + + document_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + fieldTransforms_ = + new java.util.ArrayList< + com.google.firestore.v1.DocumentTransform.FieldTransform>(); + mutable_bitField0_ |= 0x00000002; + } + fieldTransforms_.add( + input.readMessage( + com.google.firestore.v1.DocumentTransform.FieldTransform.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + fieldTransforms_ = java.util.Collections.unmodifiableList(fieldTransforms_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentTransform.class, + com.google.firestore.v1.DocumentTransform.Builder.class); + } + + public interface FieldTransformOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DocumentTransform.FieldTransform) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+     * reference.
+     * 
+ * + * string field_path = 1; + */ + java.lang.String getFieldPath(); + /** + * + * + *
+     * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+     * reference.
+     * 
+ * + * string field_path = 1; + */ + com.google.protobuf.ByteString getFieldPathBytes(); + + /** + * + * + *
+     * Sets the field to the given server value.
+     * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + int getSetToServerValueValue(); + /** + * + * + *
+     * Sets the field to the given server value.
+     * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue getSetToServerValue(); + + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + boolean hasIncrement(); + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + com.google.firestore.v1.Value getIncrement(); + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + com.google.firestore.v1.ValueOrBuilder getIncrementOrBuilder(); + + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + boolean hasMaximum(); + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + com.google.firestore.v1.Value getMaximum(); + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + com.google.firestore.v1.ValueOrBuilder getMaximumOrBuilder(); + + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + boolean hasMinimum(); + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + com.google.firestore.v1.Value getMinimum(); + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + com.google.firestore.v1.ValueOrBuilder getMinimumOrBuilder(); + + /** + * + * + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + boolean hasAppendMissingElements(); + /** + * + * + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + com.google.firestore.v1.ArrayValue getAppendMissingElements(); + /** + * + * + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + com.google.firestore.v1.ArrayValueOrBuilder getAppendMissingElementsOrBuilder(); + + /** + * + * + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + boolean hasRemoveAllFromArray(); + /** + * + * + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + com.google.firestore.v1.ArrayValue getRemoveAllFromArray(); + /** + * + * + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + com.google.firestore.v1.ArrayValueOrBuilder getRemoveAllFromArrayOrBuilder(); + + public com.google.firestore.v1.DocumentTransform.FieldTransform.TransformTypeCase + getTransformTypeCase(); + } + /** + * + * + *
+   * A transformation of a field of the document.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentTransform.FieldTransform} + */ + public static final class FieldTransform extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.DocumentTransform.FieldTransform) + FieldTransformOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldTransform.newBuilder() to construct. + private FieldTransform(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldTransform() { + fieldPath_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FieldTransform( + 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(); + + fieldPath_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + transformTypeCase_ = 2; + transformType_ = rawValue; + break; + } + case 26: + { + com.google.firestore.v1.Value.Builder subBuilder = null; + if (transformTypeCase_ == 3) { + subBuilder = ((com.google.firestore.v1.Value) transformType_).toBuilder(); + } + transformType_ = + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Value) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 3; + break; + } + case 34: + { + com.google.firestore.v1.Value.Builder subBuilder = null; + if (transformTypeCase_ == 4) { + subBuilder = ((com.google.firestore.v1.Value) transformType_).toBuilder(); + } + transformType_ = + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Value) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 4; + break; + } + case 42: + { + com.google.firestore.v1.Value.Builder subBuilder = null; + if (transformTypeCase_ == 5) { + subBuilder = ((com.google.firestore.v1.Value) transformType_).toBuilder(); + } + transformType_ = + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Value) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 5; + break; + } + case 50: + { + com.google.firestore.v1.ArrayValue.Builder subBuilder = null; + if (transformTypeCase_ == 6) { + subBuilder = ((com.google.firestore.v1.ArrayValue) transformType_).toBuilder(); + } + transformType_ = + input.readMessage( + com.google.firestore.v1.ArrayValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.ArrayValue) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 6; + break; + } + case 58: + { + com.google.firestore.v1.ArrayValue.Builder subBuilder = null; + if (transformTypeCase_ == 7) { + subBuilder = ((com.google.firestore.v1.ArrayValue) transformType_).toBuilder(); + } + transformType_ = + input.readMessage( + com.google.firestore.v1.ArrayValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.ArrayValue) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 7; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_FieldTransform_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_FieldTransform_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentTransform.FieldTransform.class, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder.class); + } + + /** + * + * + *
+     * A value that is calculated by the server.
+     * 
+ * + * Protobuf enum {@code google.firestore.v1.DocumentTransform.FieldTransform.ServerValue} + */ + public enum ServerValue implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * SERVER_VALUE_UNSPECIFIED = 0; + */ + SERVER_VALUE_UNSPECIFIED(0), + /** + * + * + *
+       * The time at which the server processed the request, with millisecond
+       * precision.
+       * 
+ * + * REQUEST_TIME = 1; + */ + REQUEST_TIME(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * SERVER_VALUE_UNSPECIFIED = 0; + */ + public static final int SERVER_VALUE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The time at which the server processed the request, with millisecond
+       * precision.
+       * 
+ * + * REQUEST_TIME = 1; + */ + public static final int REQUEST_TIME_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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ServerValue valueOf(int value) { + return forNumber(value); + } + + public static ServerValue forNumber(int value) { + switch (value) { + case 0: + return SERVER_VALUE_UNSPECIFIED; + case 1: + return REQUEST_TIME; + 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 ServerValue findValueByNumber(int number) { + return ServerValue.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.DocumentTransform.FieldTransform.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ServerValue[] VALUES = values(); + + public static ServerValue 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 ServerValue(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.DocumentTransform.FieldTransform.ServerValue) + } + + private int transformTypeCase_ = 0; + private java.lang.Object transformType_; + + public enum TransformTypeCase implements com.google.protobuf.Internal.EnumLite { + SET_TO_SERVER_VALUE(2), + INCREMENT(3), + MAXIMUM(4), + MINIMUM(5), + APPEND_MISSING_ELEMENTS(6), + REMOVE_ALL_FROM_ARRAY(7), + TRANSFORMTYPE_NOT_SET(0); + private final int value; + + private TransformTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TransformTypeCase valueOf(int value) { + return forNumber(value); + } + + public static TransformTypeCase forNumber(int value) { + switch (value) { + case 2: + return SET_TO_SERVER_VALUE; + case 3: + return INCREMENT; + case 4: + return MAXIMUM; + case 5: + return MINIMUM; + case 6: + return APPEND_MISSING_ELEMENTS; + case 7: + return REMOVE_ALL_FROM_ARRAY; + case 0: + return TRANSFORMTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TransformTypeCase getTransformTypeCase() { + return TransformTypeCase.forNumber(transformTypeCase_); + } + + public static final int FIELD_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object fieldPath_; + /** + * + * + *
+     * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+     * reference.
+     * 
+ * + * string field_path = 1; + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + 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(); + fieldPath_ = s; + return s; + } + } + /** + * + * + *
+     * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+     * reference.
+     * 
+ * + * string field_path = 1; + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SET_TO_SERVER_VALUE_FIELD_NUMBER = 2; + /** + * + * + *
+     * Sets the field to the given server value.
+     * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public int getSetToServerValueValue() { + if (transformTypeCase_ == 2) { + return (java.lang.Integer) transformType_; + } + return 0; + } + /** + * + * + *
+     * Sets the field to the given server value.
+     * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue + getSetToServerValue() { + if (transformTypeCase_ == 2) { + @SuppressWarnings("deprecation") + com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue result = + com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue.valueOf( + (java.lang.Integer) transformType_); + return result == null + ? com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue.UNRECOGNIZED + : result; + } + return com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue + .SERVER_VALUE_UNSPECIFIED; + } + + public static final int INCREMENT_FIELD_NUMBER = 3; + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public boolean hasIncrement() { + return transformTypeCase_ == 3; + } + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public com.google.firestore.v1.Value getIncrement() { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public com.google.firestore.v1.ValueOrBuilder getIncrementOrBuilder() { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + + public static final int MAXIMUM_FIELD_NUMBER = 4; + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public boolean hasMaximum() { + return transformTypeCase_ == 4; + } + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public com.google.firestore.v1.Value getMaximum() { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public com.google.firestore.v1.ValueOrBuilder getMaximumOrBuilder() { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + + public static final int MINIMUM_FIELD_NUMBER = 5; + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public boolean hasMinimum() { + return transformTypeCase_ == 5; + } + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public com.google.firestore.v1.Value getMinimum() { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public com.google.firestore.v1.ValueOrBuilder getMinimumOrBuilder() { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + + public static final int APPEND_MISSING_ELEMENTS_FIELD_NUMBER = 6; + /** + * + * + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public boolean hasAppendMissingElements() { + return transformTypeCase_ == 6; + } + /** + * + * + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1.ArrayValue getAppendMissingElements() { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + /** + * + * + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1.ArrayValueOrBuilder getAppendMissingElementsOrBuilder() { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + + public static final int REMOVE_ALL_FROM_ARRAY_FIELD_NUMBER = 7; + /** + * + * + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public boolean hasRemoveAllFromArray() { + return transformTypeCase_ == 7; + } + /** + * + * + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1.ArrayValue getRemoveAllFromArray() { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + /** + * + * + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1.ArrayValueOrBuilder getRemoveAllFromArrayOrBuilder() { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.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 (!getFieldPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_); + } + if (transformTypeCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) transformType_)); + } + if (transformTypeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.v1.Value) transformType_); + } + if (transformTypeCase_ == 4) { + output.writeMessage(4, (com.google.firestore.v1.Value) transformType_); + } + if (transformTypeCase_ == 5) { + output.writeMessage(5, (com.google.firestore.v1.Value) transformType_); + } + if (transformTypeCase_ == 6) { + output.writeMessage(6, (com.google.firestore.v1.ArrayValue) transformType_); + } + if (transformTypeCase_ == 7) { + output.writeMessage(7, (com.google.firestore.v1.ArrayValue) transformType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFieldPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_); + } + if (transformTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 2, ((java.lang.Integer) transformType_)); + } + if (transformTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.v1.Value) transformType_); + } + if (transformTypeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.firestore.v1.Value) transformType_); + } + if (transformTypeCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.firestore.v1.Value) transformType_); + } + if (transformTypeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.firestore.v1.ArrayValue) transformType_); + } + if (transformTypeCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.firestore.v1.ArrayValue) transformType_); + } + 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.v1.DocumentTransform.FieldTransform)) { + return super.equals(obj); + } + com.google.firestore.v1.DocumentTransform.FieldTransform other = + (com.google.firestore.v1.DocumentTransform.FieldTransform) obj; + + boolean result = true; + result = result && getFieldPath().equals(other.getFieldPath()); + result = result && getTransformTypeCase().equals(other.getTransformTypeCase()); + if (!result) return false; + switch (transformTypeCase_) { + case 2: + result = result && getSetToServerValueValue() == other.getSetToServerValueValue(); + break; + case 3: + result = result && getIncrement().equals(other.getIncrement()); + break; + case 4: + result = result && getMaximum().equals(other.getMaximum()); + break; + case 5: + result = result && getMinimum().equals(other.getMinimum()); + break; + case 6: + result = result && getAppendMissingElements().equals(other.getAppendMissingElements()); + break; + case 7: + result = result && getRemoveAllFromArray().equals(other.getRemoveAllFromArray()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + switch (transformTypeCase_) { + case 2: + hash = (37 * hash) + SET_TO_SERVER_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getSetToServerValueValue(); + break; + case 3: + hash = (37 * hash) + INCREMENT_FIELD_NUMBER; + hash = (53 * hash) + getIncrement().hashCode(); + break; + case 4: + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = (53 * hash) + getMaximum().hashCode(); + break; + case 5: + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = (53 * hash) + getMinimum().hashCode(); + break; + case 6: + hash = (37 * hash) + APPEND_MISSING_ELEMENTS_FIELD_NUMBER; + hash = (53 * hash) + getAppendMissingElements().hashCode(); + break; + case 7: + hash = (37 * hash) + REMOVE_ALL_FROM_ARRAY_FIELD_NUMBER; + hash = (53 * hash) + getRemoveAllFromArray().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform 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.v1.DocumentTransform.FieldTransform parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform 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.v1.DocumentTransform.FieldTransform parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform 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.v1.DocumentTransform.FieldTransform parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform 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.v1.DocumentTransform.FieldTransform parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform 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.v1.DocumentTransform.FieldTransform 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 transformation of a field of the document.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentTransform.FieldTransform} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DocumentTransform.FieldTransform) + com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_FieldTransform_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_FieldTransform_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentTransform.FieldTransform.class, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder.class); + } + + // Construct using com.google.firestore.v1.DocumentTransform.FieldTransform.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(); + fieldPath_ = ""; + + transformTypeCase_ = 0; + transformType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_FieldTransform_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentTransform.FieldTransform getDefaultInstanceForType() { + return com.google.firestore.v1.DocumentTransform.FieldTransform.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DocumentTransform.FieldTransform build() { + com.google.firestore.v1.DocumentTransform.FieldTransform result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentTransform.FieldTransform buildPartial() { + com.google.firestore.v1.DocumentTransform.FieldTransform result = + new com.google.firestore.v1.DocumentTransform.FieldTransform(this); + result.fieldPath_ = fieldPath_; + if (transformTypeCase_ == 2) { + result.transformType_ = transformType_; + } + if (transformTypeCase_ == 3) { + if (incrementBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = incrementBuilder_.build(); + } + } + if (transformTypeCase_ == 4) { + if (maximumBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = maximumBuilder_.build(); + } + } + if (transformTypeCase_ == 5) { + if (minimumBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = minimumBuilder_.build(); + } + } + if (transformTypeCase_ == 6) { + if (appendMissingElementsBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = appendMissingElementsBuilder_.build(); + } + } + if (transformTypeCase_ == 7) { + if (removeAllFromArrayBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = removeAllFromArrayBuilder_.build(); + } + } + result.transformTypeCase_ = transformTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DocumentTransform.FieldTransform) { + return mergeFrom((com.google.firestore.v1.DocumentTransform.FieldTransform) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DocumentTransform.FieldTransform other) { + if (other == com.google.firestore.v1.DocumentTransform.FieldTransform.getDefaultInstance()) + return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + onChanged(); + } + switch (other.getTransformTypeCase()) { + case SET_TO_SERVER_VALUE: + { + setSetToServerValueValue(other.getSetToServerValueValue()); + break; + } + case INCREMENT: + { + mergeIncrement(other.getIncrement()); + break; + } + case MAXIMUM: + { + mergeMaximum(other.getMaximum()); + break; + } + case MINIMUM: + { + mergeMinimum(other.getMinimum()); + break; + } + case APPEND_MISSING_ELEMENTS: + { + mergeAppendMissingElements(other.getAppendMissingElements()); + break; + } + case REMOVE_ALL_FROM_ARRAY: + { + mergeRemoveAllFromArray(other.getRemoveAllFromArray()); + break; + } + case TRANSFORMTYPE_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.v1.DocumentTransform.FieldTransform parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.DocumentTransform.FieldTransform) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int transformTypeCase_ = 0; + private java.lang.Object transformType_; + + public TransformTypeCase getTransformTypeCase() { + return TransformTypeCase.forNumber(transformTypeCase_); + } + + public Builder clearTransformType() { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + return this; + } + + private java.lang.Object fieldPath_ = ""; + /** + * + * + *
+       * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+       * reference.
+       * 
+ * + * string field_path = 1; + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+       * reference.
+       * 
+ * + * string field_path = 1; + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+       * reference.
+       * 
+ * + * string field_path = 1; + */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fieldPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+       * reference.
+       * 
+ * + * string field_path = 1; + */ + public Builder clearFieldPath() { + + fieldPath_ = getDefaultInstance().getFieldPath(); + onChanged(); + return this; + } + /** + * + * + *
+       * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax
+       * reference.
+       * 
+ * + * string field_path = 1; + */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fieldPath_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Sets the field to the given server value.
+       * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public int getSetToServerValueValue() { + if (transformTypeCase_ == 2) { + return ((java.lang.Integer) transformType_).intValue(); + } + return 0; + } + /** + * + * + *
+       * Sets the field to the given server value.
+       * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public Builder setSetToServerValueValue(int value) { + transformTypeCase_ = 2; + transformType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Sets the field to the given server value.
+       * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue + getSetToServerValue() { + if (transformTypeCase_ == 2) { + @SuppressWarnings("deprecation") + com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue result = + com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue.valueOf( + (java.lang.Integer) transformType_); + return result == null + ? com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue.UNRECOGNIZED + : result; + } + return com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue + .SERVER_VALUE_UNSPECIFIED; + } + /** + * + * + *
+       * Sets the field to the given server value.
+       * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public Builder setSetToServerValue( + com.google.firestore.v1.DocumentTransform.FieldTransform.ServerValue value) { + if (value == null) { + throw new NullPointerException(); + } + transformTypeCase_ = 2; + transformType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Sets the field to the given server value.
+       * 
+ * + * + * .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * + */ + public Builder clearSetToServerValue() { + if (transformTypeCase_ == 2) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + incrementBuilder_; + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public boolean hasIncrement() { + return transformTypeCase_ == 3; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public com.google.firestore.v1.Value getIncrement() { + if (incrementBuilder_ == null) { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } else { + if (transformTypeCase_ == 3) { + return incrementBuilder_.getMessage(); + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public Builder setIncrement(com.google.firestore.v1.Value value) { + if (incrementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + incrementBuilder_.setMessage(value); + } + transformTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public Builder setIncrement(com.google.firestore.v1.Value.Builder builderForValue) { + if (incrementBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + incrementBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public Builder mergeIncrement(com.google.firestore.v1.Value value) { + if (incrementBuilder_ == null) { + if (transformTypeCase_ == 3 + && transformType_ != com.google.firestore.v1.Value.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1.Value.newBuilder( + (com.google.firestore.v1.Value) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 3) { + incrementBuilder_.mergeFrom(value); + } + incrementBuilder_.setMessage(value); + } + transformTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public Builder clearIncrement() { + if (incrementBuilder_ == null) { + if (transformTypeCase_ == 3) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 3) { + transformTypeCase_ = 0; + transformType_ = null; + } + incrementBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public com.google.firestore.v1.Value.Builder getIncrementBuilder() { + return getIncrementFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + public com.google.firestore.v1.ValueOrBuilder getIncrementOrBuilder() { + if ((transformTypeCase_ == 3) && (incrementBuilder_ != null)) { + return incrementBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1.Value increment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getIncrementFieldBuilder() { + if (incrementBuilder_ == null) { + if (!(transformTypeCase_ == 3)) { + transformType_ = com.google.firestore.v1.Value.getDefaultInstance(); + } + incrementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + (com.google.firestore.v1.Value) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 3; + onChanged(); + ; + return incrementBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + maximumBuilder_; + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public boolean hasMaximum() { + return transformTypeCase_ == 4; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public com.google.firestore.v1.Value getMaximum() { + if (maximumBuilder_ == null) { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } else { + if (transformTypeCase_ == 4) { + return maximumBuilder_.getMessage(); + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public Builder setMaximum(com.google.firestore.v1.Value value) { + if (maximumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + maximumBuilder_.setMessage(value); + } + transformTypeCase_ = 4; + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public Builder setMaximum(com.google.firestore.v1.Value.Builder builderForValue) { + if (maximumBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + maximumBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 4; + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public Builder mergeMaximum(com.google.firestore.v1.Value value) { + if (maximumBuilder_ == null) { + if (transformTypeCase_ == 4 + && transformType_ != com.google.firestore.v1.Value.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1.Value.newBuilder( + (com.google.firestore.v1.Value) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 4) { + maximumBuilder_.mergeFrom(value); + } + maximumBuilder_.setMessage(value); + } + transformTypeCase_ = 4; + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public Builder clearMaximum() { + if (maximumBuilder_ == null) { + if (transformTypeCase_ == 4) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 4) { + transformTypeCase_ = 0; + transformType_ = null; + } + maximumBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public com.google.firestore.v1.Value.Builder getMaximumBuilder() { + return getMaximumFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + public com.google.firestore.v1.ValueOrBuilder getMaximumOrBuilder() { + if ((transformTypeCase_ == 4) && (maximumBuilder_ != null)) { + return maximumBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value maximum = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getMaximumFieldBuilder() { + if (maximumBuilder_ == null) { + if (!(transformTypeCase_ == 4)) { + transformType_ = com.google.firestore.v1.Value.getDefaultInstance(); + } + maximumBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + (com.google.firestore.v1.Value) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 4; + onChanged(); + ; + return maximumBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + minimumBuilder_; + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public boolean hasMinimum() { + return transformTypeCase_ == 5; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public com.google.firestore.v1.Value getMinimum() { + if (minimumBuilder_ == null) { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } else { + if (transformTypeCase_ == 5) { + return minimumBuilder_.getMessage(); + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public Builder setMinimum(com.google.firestore.v1.Value value) { + if (minimumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + minimumBuilder_.setMessage(value); + } + transformTypeCase_ = 5; + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public Builder setMinimum(com.google.firestore.v1.Value.Builder builderForValue) { + if (minimumBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + minimumBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 5; + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public Builder mergeMinimum(com.google.firestore.v1.Value value) { + if (minimumBuilder_ == null) { + if (transformTypeCase_ == 5 + && transformType_ != com.google.firestore.v1.Value.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1.Value.newBuilder( + (com.google.firestore.v1.Value) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 5) { + minimumBuilder_.mergeFrom(value); + } + minimumBuilder_.setMessage(value); + } + transformTypeCase_ = 5; + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public Builder clearMinimum() { + if (minimumBuilder_ == null) { + if (transformTypeCase_ == 5) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 5) { + transformTypeCase_ = 0; + transformType_ = null; + } + minimumBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public com.google.firestore.v1.Value.Builder getMinimumBuilder() { + return getMinimumFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + public com.google.firestore.v1.ValueOrBuilder getMinimumOrBuilder() { + if ((transformTypeCase_ == 5) && (minimumBuilder_ != null)) { + return minimumBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1.Value) transformType_; + } + return com.google.firestore.v1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1.Value minimum = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getMinimumFieldBuilder() { + if (minimumBuilder_ == null) { + if (!(transformTypeCase_ == 5)) { + transformType_ = com.google.firestore.v1.Value.getDefaultInstance(); + } + minimumBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + (com.google.firestore.v1.Value) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 5; + onChanged(); + ; + return minimumBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder> + appendMissingElementsBuilder_; + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public boolean hasAppendMissingElements() { + return transformTypeCase_ == 6; + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1.ArrayValue getAppendMissingElements() { + if (appendMissingElementsBuilder_ == null) { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } else { + if (transformTypeCase_ == 6) { + return appendMissingElementsBuilder_.getMessage(); + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public Builder setAppendMissingElements(com.google.firestore.v1.ArrayValue value) { + if (appendMissingElementsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + appendMissingElementsBuilder_.setMessage(value); + } + transformTypeCase_ = 6; + return this; + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public Builder setAppendMissingElements( + com.google.firestore.v1.ArrayValue.Builder builderForValue) { + if (appendMissingElementsBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + appendMissingElementsBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 6; + return this; + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public Builder mergeAppendMissingElements(com.google.firestore.v1.ArrayValue value) { + if (appendMissingElementsBuilder_ == null) { + if (transformTypeCase_ == 6 + && transformType_ != com.google.firestore.v1.ArrayValue.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1.ArrayValue.newBuilder( + (com.google.firestore.v1.ArrayValue) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 6) { + appendMissingElementsBuilder_.mergeFrom(value); + } + appendMissingElementsBuilder_.setMessage(value); + } + transformTypeCase_ = 6; + return this; + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public Builder clearAppendMissingElements() { + if (appendMissingElementsBuilder_ == null) { + if (transformTypeCase_ == 6) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 6) { + transformTypeCase_ = 0; + transformType_ = null; + } + appendMissingElementsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1.ArrayValue.Builder getAppendMissingElementsBuilder() { + return getAppendMissingElementsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1.ArrayValueOrBuilder getAppendMissingElementsOrBuilder() { + if ((transformTypeCase_ == 6) && (appendMissingElementsBuilder_ != null)) { + return appendMissingElementsBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + } + /** + * + * + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue append_missing_elements = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder> + getAppendMissingElementsFieldBuilder() { + if (appendMissingElementsBuilder_ == null) { + if (!(transformTypeCase_ == 6)) { + transformType_ = com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + appendMissingElementsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder>( + (com.google.firestore.v1.ArrayValue) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 6; + onChanged(); + ; + return appendMissingElementsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder> + removeAllFromArrayBuilder_; + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public boolean hasRemoveAllFromArray() { + return transformTypeCase_ == 7; + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1.ArrayValue getRemoveAllFromArray() { + if (removeAllFromArrayBuilder_ == null) { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } else { + if (transformTypeCase_ == 7) { + return removeAllFromArrayBuilder_.getMessage(); + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public Builder setRemoveAllFromArray(com.google.firestore.v1.ArrayValue value) { + if (removeAllFromArrayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + removeAllFromArrayBuilder_.setMessage(value); + } + transformTypeCase_ = 7; + return this; + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public Builder setRemoveAllFromArray( + com.google.firestore.v1.ArrayValue.Builder builderForValue) { + if (removeAllFromArrayBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + removeAllFromArrayBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 7; + return this; + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public Builder mergeRemoveAllFromArray(com.google.firestore.v1.ArrayValue value) { + if (removeAllFromArrayBuilder_ == null) { + if (transformTypeCase_ == 7 + && transformType_ != com.google.firestore.v1.ArrayValue.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1.ArrayValue.newBuilder( + (com.google.firestore.v1.ArrayValue) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 7) { + removeAllFromArrayBuilder_.mergeFrom(value); + } + removeAllFromArrayBuilder_.setMessage(value); + } + transformTypeCase_ = 7; + return this; + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public Builder clearRemoveAllFromArray() { + if (removeAllFromArrayBuilder_ == null) { + if (transformTypeCase_ == 7) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 7) { + transformTypeCase_ = 0; + transformType_ = null; + } + removeAllFromArrayBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1.ArrayValue.Builder getRemoveAllFromArrayBuilder() { + return getRemoveAllFromArrayFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1.ArrayValueOrBuilder getRemoveAllFromArrayOrBuilder() { + if ((transformTypeCase_ == 7) && (removeAllFromArrayBuilder_ != null)) { + return removeAllFromArrayBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1.ArrayValue) transformType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + } + /** + * + * + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1.ArrayValue remove_all_from_array = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder> + getRemoveAllFromArrayFieldBuilder() { + if (removeAllFromArrayBuilder_ == null) { + if (!(transformTypeCase_ == 7)) { + transformType_ = com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + removeAllFromArrayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder>( + (com.google.firestore.v1.ArrayValue) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 7; + onChanged(); + ; + return removeAllFromArrayBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DocumentTransform.FieldTransform) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DocumentTransform.FieldTransform) + private static final com.google.firestore.v1.DocumentTransform.FieldTransform DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DocumentTransform.FieldTransform(); + } + + public static com.google.firestore.v1.DocumentTransform.FieldTransform getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldTransform parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FieldTransform(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.v1.DocumentTransform.FieldTransform getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int DOCUMENT_FIELD_NUMBER = 1; + private volatile java.lang.Object document_; + /** + * + * + *
+   * The name of the document to transform.
+   * 
+ * + * string document = 1; + */ + public java.lang.String getDocument() { + java.lang.Object ref = document_; + 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(); + document_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the document to transform.
+   * 
+ * + * string document = 1; + */ + public com.google.protobuf.ByteString getDocumentBytes() { + java.lang.Object ref = document_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + document_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELD_TRANSFORMS_FIELD_NUMBER = 2; + private java.util.List fieldTransforms_; + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public java.util.List + getFieldTransformsList() { + return fieldTransforms_; + } + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public java.util.List + getFieldTransformsOrBuilderList() { + return fieldTransforms_; + } + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public int getFieldTransformsCount() { + return fieldTransforms_.size(); + } + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform getFieldTransforms(int index) { + return fieldTransforms_.get(index); + } + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder + getFieldTransformsOrBuilder(int index) { + return fieldTransforms_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDocumentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, document_); + } + for (int i = 0; i < fieldTransforms_.size(); i++) { + output.writeMessage(2, fieldTransforms_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDocumentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, document_); + } + for (int i = 0; i < fieldTransforms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, fieldTransforms_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.DocumentTransform)) { + return super.equals(obj); + } + com.google.firestore.v1.DocumentTransform other = + (com.google.firestore.v1.DocumentTransform) obj; + + boolean result = true; + result = result && getDocument().equals(other.getDocument()); + result = result && getFieldTransformsList().equals(other.getFieldTransformsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + if (getFieldTransformsCount() > 0) { + hash = (37 * hash) + FIELD_TRANSFORMS_FIELD_NUMBER; + hash = (53 * hash) + getFieldTransformsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.DocumentTransform parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentTransform 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.v1.DocumentTransform parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentTransform 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.v1.DocumentTransform parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.DocumentTransform parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.DocumentTransform parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentTransform 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.v1.DocumentTransform parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentTransform 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.v1.DocumentTransform parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.DocumentTransform 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.v1.DocumentTransform 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 transformation of a document.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.DocumentTransform} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.DocumentTransform) + com.google.firestore.v1.DocumentTransformOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.DocumentTransform.class, + com.google.firestore.v1.DocumentTransform.Builder.class); + } + + // Construct using com.google.firestore.v1.DocumentTransform.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFieldTransformsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + document_ = ""; + + if (fieldTransformsBuilder_ == null) { + fieldTransforms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + fieldTransformsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_DocumentTransform_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentTransform getDefaultInstanceForType() { + return com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.DocumentTransform build() { + com.google.firestore.v1.DocumentTransform result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.DocumentTransform buildPartial() { + com.google.firestore.v1.DocumentTransform result = + new com.google.firestore.v1.DocumentTransform(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.document_ = document_; + if (fieldTransformsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + fieldTransforms_ = java.util.Collections.unmodifiableList(fieldTransforms_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.fieldTransforms_ = fieldTransforms_; + } else { + result.fieldTransforms_ = fieldTransformsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.DocumentTransform) { + return mergeFrom((com.google.firestore.v1.DocumentTransform) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.DocumentTransform other) { + if (other == com.google.firestore.v1.DocumentTransform.getDefaultInstance()) return this; + if (!other.getDocument().isEmpty()) { + document_ = other.document_; + onChanged(); + } + if (fieldTransformsBuilder_ == null) { + if (!other.fieldTransforms_.isEmpty()) { + if (fieldTransforms_.isEmpty()) { + fieldTransforms_ = other.fieldTransforms_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFieldTransformsIsMutable(); + fieldTransforms_.addAll(other.fieldTransforms_); + } + onChanged(); + } + } else { + if (!other.fieldTransforms_.isEmpty()) { + if (fieldTransformsBuilder_.isEmpty()) { + fieldTransformsBuilder_.dispose(); + fieldTransformsBuilder_ = null; + fieldTransforms_ = other.fieldTransforms_; + bitField0_ = (bitField0_ & ~0x00000002); + fieldTransformsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldTransformsFieldBuilder() + : null; + } else { + fieldTransformsBuilder_.addAllMessages(other.fieldTransforms_); + } + } + } + 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.v1.DocumentTransform parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.DocumentTransform) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object document_ = ""; + /** + * + * + *
+     * The name of the document to transform.
+     * 
+ * + * string document = 1; + */ + public java.lang.String getDocument() { + java.lang.Object ref = document_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + document_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the document to transform.
+     * 
+ * + * string document = 1; + */ + public com.google.protobuf.ByteString getDocumentBytes() { + java.lang.Object ref = document_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + document_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the document to transform.
+     * 
+ * + * string document = 1; + */ + public Builder setDocument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + document_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the document to transform.
+     * 
+ * + * string document = 1; + */ + public Builder clearDocument() { + + document_ = getDefaultInstance().getDocument(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the document to transform.
+     * 
+ * + * string document = 1; + */ + public Builder setDocumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + document_ = value; + onChanged(); + return this; + } + + private java.util.List + fieldTransforms_ = java.util.Collections.emptyList(); + + private void ensureFieldTransformsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + fieldTransforms_ = + new java.util.ArrayList( + fieldTransforms_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.DocumentTransform.FieldTransform, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder, + com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder> + fieldTransformsBuilder_; + + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public java.util.List + getFieldTransformsList() { + if (fieldTransformsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fieldTransforms_); + } else { + return fieldTransformsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public int getFieldTransformsCount() { + if (fieldTransformsBuilder_ == null) { + return fieldTransforms_.size(); + } else { + return fieldTransformsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform getFieldTransforms(int index) { + if (fieldTransformsBuilder_ == null) { + return fieldTransforms_.get(index); + } else { + return fieldTransformsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder setFieldTransforms( + int index, com.google.firestore.v1.DocumentTransform.FieldTransform value) { + if (fieldTransformsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldTransformsIsMutable(); + fieldTransforms_.set(index, value); + onChanged(); + } else { + fieldTransformsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder setFieldTransforms( + int index, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder builderForValue) { + if (fieldTransformsBuilder_ == null) { + ensureFieldTransformsIsMutable(); + fieldTransforms_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldTransformsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder addFieldTransforms( + com.google.firestore.v1.DocumentTransform.FieldTransform value) { + if (fieldTransformsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldTransformsIsMutable(); + fieldTransforms_.add(value); + onChanged(); + } else { + fieldTransformsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder addFieldTransforms( + int index, com.google.firestore.v1.DocumentTransform.FieldTransform value) { + if (fieldTransformsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldTransformsIsMutable(); + fieldTransforms_.add(index, value); + onChanged(); + } else { + fieldTransformsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder addFieldTransforms( + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder builderForValue) { + if (fieldTransformsBuilder_ == null) { + ensureFieldTransformsIsMutable(); + fieldTransforms_.add(builderForValue.build()); + onChanged(); + } else { + fieldTransformsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder addFieldTransforms( + int index, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder builderForValue) { + if (fieldTransformsBuilder_ == null) { + ensureFieldTransformsIsMutable(); + fieldTransforms_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldTransformsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder addAllFieldTransforms( + java.lang.Iterable + values) { + if (fieldTransformsBuilder_ == null) { + ensureFieldTransformsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fieldTransforms_); + onChanged(); + } else { + fieldTransformsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder clearFieldTransforms() { + if (fieldTransformsBuilder_ == null) { + fieldTransforms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + fieldTransformsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public Builder removeFieldTransforms(int index) { + if (fieldTransformsBuilder_ == null) { + ensureFieldTransformsIsMutable(); + fieldTransforms_.remove(index); + onChanged(); + } else { + fieldTransformsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform.Builder + getFieldTransformsBuilder(int index) { + return getFieldTransformsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder + getFieldTransformsOrBuilder(int index) { + if (fieldTransformsBuilder_ == null) { + return fieldTransforms_.get(index); + } else { + return fieldTransformsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public java.util.List< + ? extends com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder> + getFieldTransformsOrBuilderList() { + if (fieldTransformsBuilder_ != null) { + return fieldTransformsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fieldTransforms_); + } + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform.Builder + addFieldTransformsBuilder() { + return getFieldTransformsFieldBuilder() + .addBuilder( + com.google.firestore.v1.DocumentTransform.FieldTransform.getDefaultInstance()); + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public com.google.firestore.v1.DocumentTransform.FieldTransform.Builder + addFieldTransformsBuilder(int index) { + return getFieldTransformsFieldBuilder() + .addBuilder( + index, com.google.firestore.v1.DocumentTransform.FieldTransform.getDefaultInstance()); + } + /** + * + * + *
+     * The list of transformations to apply to the fields of the document, in
+     * order.
+     * This must not be empty.
+     * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + public java.util.List + getFieldTransformsBuilderList() { + return getFieldTransformsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.DocumentTransform.FieldTransform, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder, + com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder> + getFieldTransformsFieldBuilder() { + if (fieldTransformsBuilder_ == null) { + fieldTransformsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.DocumentTransform.FieldTransform, + com.google.firestore.v1.DocumentTransform.FieldTransform.Builder, + com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder>( + fieldTransforms_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + fieldTransforms_ = null; + } + return fieldTransformsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.DocumentTransform) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.DocumentTransform) + private static final com.google.firestore.v1.DocumentTransform DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.DocumentTransform(); + } + + public static com.google.firestore.v1.DocumentTransform getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentTransform parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentTransform(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.v1.DocumentTransform getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransformOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransformOrBuilder.java new file mode 100644 index 000000000000..6562d9e7621b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/DocumentTransformOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface DocumentTransformOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.DocumentTransform) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the document to transform.
+   * 
+ * + * string document = 1; + */ + java.lang.String getDocument(); + /** + * + * + *
+   * The name of the document to transform.
+   * 
+ * + * string document = 1; + */ + com.google.protobuf.ByteString getDocumentBytes(); + + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + java.util.List getFieldTransformsList(); + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + com.google.firestore.v1.DocumentTransform.FieldTransform getFieldTransforms(int index); + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + int getFieldTransformsCount(); + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + java.util.List + getFieldTransformsOrBuilderList(); + /** + * + * + *
+   * The list of transformations to apply to the fields of the document, in
+   * order.
+   * This must not be empty.
+   * 
+ * + * repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * + */ + com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder getFieldTransformsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilter.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilter.java new file mode 100644 index 000000000000..b0e253af275d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilter.java @@ -0,0 +1,603 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A digest of all the documents that match a given target.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExistenceFilter} + */ +public final class ExistenceFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExistenceFilter) + ExistenceFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExistenceFilter.newBuilder() to construct. + private ExistenceFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExistenceFilter() { + targetId_ = 0; + count_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExistenceFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + targetId_ = input.readInt32(); + break; + } + case 16: + { + count_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.WriteProto + .internal_static_google_firestore_v1_ExistenceFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_ExistenceFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExistenceFilter.class, + com.google.firestore.v1.ExistenceFilter.Builder.class); + } + + public static final int TARGET_ID_FIELD_NUMBER = 1; + private int targetId_; + /** + * + * + *
+   * The target ID to which this filter applies.
+   * 
+ * + * int32 target_id = 1; + */ + public int getTargetId() { + return targetId_; + } + + public static final int COUNT_FIELD_NUMBER = 2; + private int count_; + /** + * + * + *
+   * The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id].
+   * If different from the count of documents in the client that match, the
+   * client must manually determine which documents no longer match the target.
+   * 
+ * + * int32 count = 2; + */ + public int getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (targetId_ != 0) { + output.writeInt32(1, targetId_); + } + if (count_ != 0) { + output.writeInt32(2, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetId_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, targetId_); + } + if (count_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, count_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ExistenceFilter)) { + return super.equals(obj); + } + com.google.firestore.v1.ExistenceFilter other = (com.google.firestore.v1.ExistenceFilter) obj; + + boolean result = true; + result = result && (getTargetId() == other.getTargetId()); + result = result && (getCount() == other.getCount()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TARGET_ID_FIELD_NUMBER; + hash = (53 * hash) + getTargetId(); + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExistenceFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExistenceFilter 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.v1.ExistenceFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExistenceFilter 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.v1.ExistenceFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExistenceFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExistenceFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExistenceFilter 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.v1.ExistenceFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExistenceFilter 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.v1.ExistenceFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExistenceFilter 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.v1.ExistenceFilter 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 digest of all the documents that match a given target.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExistenceFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExistenceFilter) + com.google.firestore.v1.ExistenceFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_ExistenceFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_ExistenceFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExistenceFilter.class, + com.google.firestore.v1.ExistenceFilter.Builder.class); + } + + // Construct using com.google.firestore.v1.ExistenceFilter.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(); + targetId_ = 0; + + count_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_ExistenceFilter_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExistenceFilter getDefaultInstanceForType() { + return com.google.firestore.v1.ExistenceFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExistenceFilter build() { + com.google.firestore.v1.ExistenceFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExistenceFilter buildPartial() { + com.google.firestore.v1.ExistenceFilter result = + new com.google.firestore.v1.ExistenceFilter(this); + result.targetId_ = targetId_; + result.count_ = count_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ExistenceFilter) { + return mergeFrom((com.google.firestore.v1.ExistenceFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExistenceFilter other) { + if (other == com.google.firestore.v1.ExistenceFilter.getDefaultInstance()) return this; + if (other.getTargetId() != 0) { + setTargetId(other.getTargetId()); + } + if (other.getCount() != 0) { + setCount(other.getCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.v1.ExistenceFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ExistenceFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int targetId_; + /** + * + * + *
+     * The target ID to which this filter applies.
+     * 
+ * + * int32 target_id = 1; + */ + public int getTargetId() { + return targetId_; + } + /** + * + * + *
+     * The target ID to which this filter applies.
+     * 
+ * + * int32 target_id = 1; + */ + public Builder setTargetId(int value) { + + targetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target ID to which this filter applies.
+     * 
+ * + * int32 target_id = 1; + */ + public Builder clearTargetId() { + + targetId_ = 0; + onChanged(); + return this; + } + + private int count_; + /** + * + * + *
+     * The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id].
+     * If different from the count of documents in the client that match, the
+     * client must manually determine which documents no longer match the target.
+     * 
+ * + * int32 count = 2; + */ + public int getCount() { + return count_; + } + /** + * + * + *
+     * The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id].
+     * If different from the count of documents in the client that match, the
+     * client must manually determine which documents no longer match the target.
+     * 
+ * + * int32 count = 2; + */ + public Builder setCount(int value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id].
+     * If different from the count of documents in the client that match, the
+     * client must manually determine which documents no longer match the target.
+     * 
+ * + * int32 count = 2; + */ + public Builder clearCount() { + + count_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ExistenceFilter) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExistenceFilter) + private static final com.google.firestore.v1.ExistenceFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExistenceFilter(); + } + + public static com.google.firestore.v1.ExistenceFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExistenceFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExistenceFilter(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.v1.ExistenceFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilterOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilterOrBuilder.java new file mode 100644 index 000000000000..044aec9816a7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExistenceFilterOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface ExistenceFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExistenceFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The target ID to which this filter applies.
+   * 
+ * + * int32 target_id = 1; + */ + int getTargetId(); + + /** + * + * + *
+   * The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id].
+   * If different from the count of documents in the client that match, the
+   * client must manually determine which documents no longer match the target.
+   * 
+ * + * int32 count = 2; + */ + int getCount(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java new file mode 100644 index 000000000000..5d3bede23a76 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java @@ -0,0 +1,597 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public final class FirestoreProto { + private FirestoreProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_GetDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_GetDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_CreateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_CreateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_UpdateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_UpdateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DeleteDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DeleteDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_BatchGetDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_BatchGetDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_BatchGetDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_BatchGetDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_BeginTransactionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_BeginTransactionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_BeginTransactionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_BeginTransactionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_CommitRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_CommitRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_CommitResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_CommitResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_RollbackRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_RollbackRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_RunQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_RunQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_RunQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_RunQueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_WriteRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_WriteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_WriteRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_WriteRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_WriteResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_WriteResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListenRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListenRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListenResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Target_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Target_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Target_DocumentsTarget_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Target_DocumentsTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Target_QueryTarget_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Target_QueryTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_TargetChange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_TargetChange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListCollectionIdsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListCollectionIdsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ListCollectionIdsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ListCollectionIdsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n#google/firestore/v1/firestore.proto\022\023g" + + "oogle.firestore.v1\032\034google/api/annotatio" + + "ns.proto\032 google/firestore/v1/common.pro" + + "to\032\"google/firestore/v1/document.proto\032\037" + + "google/firestore/v1/query.proto\032\037google/" + + "firestore/v1/write.proto\032\033google/protobu" + + "f/empty.proto\032\037google/protobuf/timestamp" + + ".proto\032\027google/rpc/status.proto\"\263\001\n\022GetD" + + "ocumentRequest\022\014\n\004name\030\001 \001(\t\022/\n\004mask\030\002 \001" + + "(\0132!.google.firestore.v1.DocumentMask\022\025\n" + + "\013transaction\030\003 \001(\014H\000\022/\n\tread_time\030\005 \001(\0132" + + "\032.google.protobuf.TimestampH\000B\026\n\024consist" + + "ency_selector\"\235\002\n\024ListDocumentsRequest\022\016" + + "\n\006parent\030\001 \001(\t\022\025\n\rcollection_id\030\002 \001(\t\022\021\n" + + "\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\022\020\n\010" + + "order_by\030\006 \001(\t\022/\n\004mask\030\007 \001(\0132!.google.fi" + + "restore.v1.DocumentMask\022\025\n\013transaction\030\010" + + " \001(\014H\000\022/\n\tread_time\030\n \001(\0132\032.google.proto" + + "buf.TimestampH\000\022\024\n\014show_missing\030\014 \001(\010B\026\n" + + "\024consistency_selector\"b\n\025ListDocumentsRe" + + "sponse\0220\n\tdocuments\030\001 \003(\0132\035.google.fires" + + "tore.v1.Document\022\027\n\017next_page_token\030\002 \001(" + + "\t\"\265\001\n\025CreateDocumentRequest\022\016\n\006parent\030\001 " + + "\001(\t\022\025\n\rcollection_id\030\002 \001(\t\022\023\n\013document_i" + + "d\030\003 \001(\t\022/\n\010document\030\004 \001(\0132\035.google.fires" + + "tore.v1.Document\022/\n\004mask\030\005 \001(\0132!.google." + + "firestore.v1.DocumentMask\"\356\001\n\025UpdateDocu" + + "mentRequest\022/\n\010document\030\001 \001(\0132\035.google.f" + + "irestore.v1.Document\0226\n\013update_mask\030\002 \001(" + + "\0132!.google.firestore.v1.DocumentMask\022/\n\004" + + "mask\030\003 \001(\0132!.google.firestore.v1.Documen" + + "tMask\022;\n\020current_document\030\004 \001(\0132!.google" + + ".firestore.v1.Precondition\"b\n\025DeleteDocu" + + "mentRequest\022\014\n\004name\030\001 \001(\t\022;\n\020current_doc" + + "ument\030\002 \001(\0132!.google.firestore.v1.Precon" + + "dition\"\224\002\n\030BatchGetDocumentsRequest\022\020\n\010d" + + "atabase\030\001 \001(\t\022\021\n\tdocuments\030\002 \003(\t\022/\n\004mask" + + "\030\003 \001(\0132!.google.firestore.v1.DocumentMas" + + "k\022\025\n\013transaction\030\004 \001(\014H\000\022B\n\017new_transact" + + "ion\030\005 \001(\0132\'.google.firestore.v1.Transact" + + "ionOptionsH\000\022/\n\tread_time\030\007 \001(\0132\032.google" + + ".protobuf.TimestampH\000B\026\n\024consistency_sel" + + "ector\"\254\001\n\031BatchGetDocumentsResponse\022.\n\005f" + + "ound\030\001 \001(\0132\035.google.firestore.v1.Documen" + + "tH\000\022\021\n\007missing\030\002 \001(\tH\000\022\023\n\013transaction\030\003 " + + "\001(\014\022-\n\tread_time\030\004 \001(\0132\032.google.protobuf" + + ".TimestampB\010\n\006result\"e\n\027BeginTransaction" + + "Request\022\020\n\010database\030\001 \001(\t\0228\n\007options\030\002 \001" + + "(\0132\'.google.firestore.v1.TransactionOpti" + + "ons\"/\n\030BeginTransactionResponse\022\023\n\013trans" + + "action\030\001 \001(\014\"b\n\rCommitRequest\022\020\n\010databas" + + "e\030\001 \001(\t\022*\n\006writes\030\002 \003(\0132\032.google.firesto" + + "re.v1.Write\022\023\n\013transaction\030\003 \001(\014\"z\n\016Comm" + + "itResponse\0227\n\rwrite_results\030\001 \003(\0132 .goog" + + "le.firestore.v1.WriteResult\022/\n\013commit_ti" + + "me\030\002 \001(\0132\032.google.protobuf.Timestamp\"8\n\017" + + "RollbackRequest\022\020\n\010database\030\001 \001(\t\022\023\n\013tra" + + "nsaction\030\002 \001(\014\"\225\002\n\017RunQueryRequest\022\016\n\006pa" + + "rent\030\001 \001(\t\022@\n\020structured_query\030\002 \001(\0132$.g" + + "oogle.firestore.v1.StructuredQueryH\000\022\025\n\013" + + "transaction\030\005 \001(\014H\001\022B\n\017new_transaction\030\006" + + " \001(\0132\'.google.firestore.v1.TransactionOp" + + "tionsH\001\022/\n\tread_time\030\007 \001(\0132\032.google.prot" + + "obuf.TimestampH\001B\014\n\nquery_typeB\026\n\024consis" + + "tency_selector\"\240\001\n\020RunQueryResponse\022\023\n\013t" + + "ransaction\030\002 \001(\014\022/\n\010document\030\001 \001(\0132\035.goo" + + "gle.firestore.v1.Document\022-\n\tread_time\030\003" + + " \001(\0132\032.google.protobuf.Timestamp\022\027\n\017skip" + + "ped_results\030\004 \001(\005\"\343\001\n\014WriteRequest\022\020\n\010da" + + "tabase\030\001 \001(\t\022\021\n\tstream_id\030\002 \001(\t\022*\n\006write" + + "s\030\003 \003(\0132\032.google.firestore.v1.Write\022\024\n\014s" + + "tream_token\030\004 \001(\014\022=\n\006labels\030\005 \003(\0132-.goog" + + "le.firestore.v1.WriteRequest.LabelsEntry" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\"\242\001\n\rWriteResponse\022\021\n\tstream_id\030\001" + + " \001(\t\022\024\n\014stream_token\030\002 \001(\014\0227\n\rwrite_resu" + + "lts\030\003 \003(\0132 .google.firestore.v1.WriteRes" + + "ult\022/\n\013commit_time\030\004 \001(\0132\032.google.protob" + + "uf.Timestamp\"\355\001\n\rListenRequest\022\020\n\010databa" + + "se\030\001 \001(\t\0221\n\nadd_target\030\002 \001(\0132\033.google.fi" + + "restore.v1.TargetH\000\022\027\n\rremove_target\030\003 \001" + + "(\005H\000\022>\n\006labels\030\004 \003(\0132..google.firestore." + + "v1.ListenRequest.LabelsEntry\032-\n\013LabelsEn" + + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\017\n\rt" + + "arget_change\"\325\002\n\016ListenResponse\022:\n\rtarge" + + "t_change\030\002 \001(\0132!.google.firestore.v1.Tar" + + "getChangeH\000\022>\n\017document_change\030\003 \001(\0132#.g" + + "oogle.firestore.v1.DocumentChangeH\000\022>\n\017d" + + "ocument_delete\030\004 \001(\0132#.google.firestore." + + "v1.DocumentDeleteH\000\022>\n\017document_remove\030\006" + + " \001(\0132#.google.firestore.v1.DocumentRemov" + + "eH\000\0226\n\006filter\030\005 \001(\0132$.google.firestore.v" + + "1.ExistenceFilterH\000B\017\n\rresponse_type\"\241\003\n" + + "\006Target\0228\n\005query\030\002 \001(\0132\'.google.firestor" + + "e.v1.Target.QueryTargetH\000\022@\n\tdocuments\030\003" + + " \001(\0132+.google.firestore.v1.Target.Docume" + + "ntsTargetH\000\022\026\n\014resume_token\030\004 \001(\014H\001\022/\n\tr" + + "ead_time\030\013 \001(\0132\032.google.protobuf.Timesta" + + "mpH\001\022\021\n\ttarget_id\030\005 \001(\005\022\014\n\004once\030\006 \001(\010\032$\n" + + "\017DocumentsTarget\022\021\n\tdocuments\030\002 \003(\t\032m\n\013Q" + + "ueryTarget\022\016\n\006parent\030\001 \001(\t\022@\n\020structured" + + "_query\030\002 \001(\0132$.google.firestore.v1.Struc" + + "turedQueryH\000B\014\n\nquery_typeB\r\n\013target_typ" + + "eB\r\n\013resume_type\"\252\002\n\014TargetChange\022N\n\022tar" + + "get_change_type\030\001 \001(\01622.google.firestore" + + ".v1.TargetChange.TargetChangeType\022\022\n\ntar" + + "get_ids\030\002 \003(\005\022!\n\005cause\030\003 \001(\0132\022.google.rp" + + "c.Status\022\024\n\014resume_token\030\004 \001(\014\022-\n\tread_t" + + "ime\030\006 \001(\0132\032.google.protobuf.Timestamp\"N\n" + + "\020TargetChangeType\022\r\n\tNO_CHANGE\020\000\022\007\n\003ADD\020" + + "\001\022\n\n\006REMOVE\020\002\022\013\n\007CURRENT\020\003\022\t\n\005RESET\020\004\"Q\n" + + "\030ListCollectionIdsRequest\022\016\n\006parent\030\001 \001(" + + "\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + + "\"L\n\031ListCollectionIdsResponse\022\026\n\016collect" + + "ion_ids\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\204" + + "\022\n\tFirestore\022\217\001\n\013GetDocument\022\'.google.fi" + + "restore.v1.GetDocumentRequest\032\035.google.f" + + "irestore.v1.Document\"8\202\323\344\223\0022\0220/v1/{name=" + + "projects/*/databases/*/documents/*/**}\022\262" + + "\001\n\rListDocuments\022).google.firestore.v1.L" + + "istDocumentsRequest\032*.google.firestore.v" + + "1.ListDocumentsResponse\"J\202\323\344\223\002D\022B/v1/{pa" + + "rent=projects/*/databases/*/documents/*/" + + "**}/{collection_id}\022\257\001\n\016CreateDocument\022*" + + ".google.firestore.v1.CreateDocumentReque" + + "st\032\035.google.firestore.v1.Document\"R\202\323\344\223\002" + + "L\"@/v1/{parent=projects/*/databases/*/do" + + "cuments/**}/{collection_id}:\010document\022\250\001" + + "\n\016UpdateDocument\022*.google.firestore.v1.U" + + "pdateDocumentRequest\032\035.google.firestore." + + "v1.Document\"K\202\323\344\223\002E29/v1/{document.name=" + + "projects/*/databases/*/documents/*/**}:\010" + + "document\022\216\001\n\016DeleteDocument\022*.google.fir" + + "estore.v1.DeleteDocumentRequest\032\026.google" + + ".protobuf.Empty\"8\202\323\344\223\0022*0/v1/{name=proje" + + "cts/*/databases/*/documents/*/**}\022\271\001\n\021Ba" + + "tchGetDocuments\022-.google.firestore.v1.Ba" + + "tchGetDocumentsRequest\032..google.firestor" + + "e.v1.BatchGetDocumentsResponse\"C\202\323\344\223\002=\"8" + + "/v1/{database=projects/*/databases/*}/do" + + "cuments:batchGet:\001*0\001\022\274\001\n\020BeginTransacti" + + "on\022,.google.firestore.v1.BeginTransactio" + + "nRequest\032-.google.firestore.v1.BeginTran" + + "sactionResponse\"K\202\323\344\223\002E\"@/v1/{database=p" + + "rojects/*/databases/*}/documents:beginTr" + + "ansaction:\001*\022\224\001\n\006Commit\022\".google.firesto" + + "re.v1.CommitRequest\032#.google.firestore.v" + + "1.CommitResponse\"A\202\323\344\223\002;\"6/v1/{database=" + + "projects/*/databases/*}/documents:commit" + + ":\001*\022\215\001\n\010Rollback\022$.google.firestore.v1.R" + + "ollbackRequest\032\026.google.protobuf.Empty\"C" + + "\202\323\344\223\002=\"8/v1/{database=projects/*/databas" + + "es/*}/documents:rollback:\001*\022\337\001\n\010RunQuery" + + "\022$.google.firestore.v1.RunQueryRequest\032%" + + ".google.firestore.v1.RunQueryResponse\"\203\001" + + "\202\323\344\223\002}\"6/v1/{parent=projects/*/databases" + + "/*/documents}:runQuery:\001*Z@\";/v1/{parent" + + "=projects/*/databases/*/documents/*/**}:" + + "runQuery:\001*0\001\022\224\001\n\005Write\022!.google.firesto" + + "re.v1.WriteRequest\032\".google.firestore.v1" + + ".WriteResponse\"@\202\323\344\223\002:\"5/v1/{database=pr" + + "ojects/*/databases/*}/documents:write:\001*" + + "(\0010\001\022\230\001\n\006Listen\022\".google.firestore.v1.Li" + + "stenRequest\032#.google.firestore.v1.Listen" + + "Response\"A\202\323\344\223\002;\"6/v1/{database=projects" + + "/*/databases/*}/documents:listen:\001*(\0010\001\022" + + "\213\002\n\021ListCollectionIds\022-.google.firestore" + + ".v1.ListCollectionIdsRequest\032..google.fi" + + "restore.v1.ListCollectionIdsResponse\"\226\001\202" + + "\323\344\223\002\217\001\"?/v1/{parent=projects/*/databases" + + "/*/documents}:listCollectionIds:\001*ZI\"D/v" + + "1/{parent=projects/*/databases/*/documen" + + "ts/*/**}:listCollectionIds:\001*B\250\001\n\027com.go" + + "ogle.firestore.v1B\016FirestoreProtoP\001Z + * The request for [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument]. + * + * + * Protobuf type {@code google.firestore.v1.GetDocumentRequest} + */ +public final class GetDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.GetDocumentRequest) + GetDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDocumentRequest.newBuilder() to construct. + private GetDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDocumentRequest( + 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.firestore.v1.DocumentMask.Builder subBuilder = null; + if (mask_ != null) { + subBuilder = mask_.toBuilder(); + } + mask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mask_); + mask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + consistencySelectorCase_ = 3; + consistencySelector_ = input.readBytes(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (consistencySelectorCase_ == 5) { + subBuilder = ((com.google.protobuf.Timestamp) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 5; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_GetDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_GetDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.GetDocumentRequest.class, + com.google.firestore.v1.GetDocumentRequest.Builder.class); + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public enum ConsistencySelectorCase implements com.google.protobuf.Internal.EnumLite { + TRANSACTION(3), + READ_TIME(5), + CONSISTENCYSELECTOR_NOT_SET(0); + private final int value; + + private ConsistencySelectorCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ConsistencySelectorCase valueOf(int value) { + return forNumber(value); + } + + public static ConsistencySelectorCase forNumber(int value) { + switch (value) { + case 3: + return TRANSACTION; + case 5: + return READ_TIME; + case 0: + return CONSISTENCYSELECTOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the Document to get. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + 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 resource name of the Document to get. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + 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 MASK_FIELD_NUMBER = 2; + private com.google.firestore.v1.DocumentMask mask_; + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public boolean hasMask() { + return mask_ != null; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public com.google.firestore.v1.DocumentMask getMask() { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + return getMask(); + } + + public static final int TRANSACTION_FIELD_NUMBER = 3; + /** + * + * + *
+   * Reads the document in a transaction.
+   * 
+ * + * bytes transaction = 3; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 3) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int READ_TIME_FIELD_NUMBER = 5; + /** + * + * + *
+   * Reads the version of the document at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 5; + } + /** + * + * + *
+   * Reads the version of the document at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (consistencySelectorCase_ == 5) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Reads the version of the document at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (consistencySelectorCase_ == 5) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (mask_ != null) { + output.writeMessage(2, getMask()); + } + if (consistencySelectorCase_ == 3) { + output.writeBytes(3, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 5) { + output.writeMessage(5, (com.google.protobuf.Timestamp) consistencySelector_); + } + 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 (mask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMask()); + } + if (consistencySelectorCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 3, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.protobuf.Timestamp) consistencySelector_); + } + 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.v1.GetDocumentRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.GetDocumentRequest other = + (com.google.firestore.v1.GetDocumentRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && (hasMask() == other.hasMask()); + if (hasMask()) { + result = result && getMask().equals(other.getMask()); + } + result = result && getConsistencySelectorCase().equals(other.getConsistencySelectorCase()); + if (!result) return false; + switch (consistencySelectorCase_) { + case 3: + result = result && getTransaction().equals(other.getTransaction()); + break; + case 5: + result = result && getReadTime().equals(other.getReadTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 (hasMask()) { + hash = (37 * hash) + MASK_FIELD_NUMBER; + hash = (53 * hash) + getMask().hashCode(); + } + switch (consistencySelectorCase_) { + case 3: + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + break; + case 5: + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.GetDocumentRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.GetDocumentRequest 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.v1.GetDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.GetDocumentRequest 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.v1.GetDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.GetDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.GetDocumentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.GetDocumentRequest 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.v1.GetDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.GetDocumentRequest 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.v1.GetDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.GetDocumentRequest 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.v1.GetDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.GetDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.GetDocumentRequest) + com.google.firestore.v1.GetDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_GetDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_GetDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.GetDocumentRequest.class, + com.google.firestore.v1.GetDocumentRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.GetDocumentRequest.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 (maskBuilder_ == null) { + mask_ = null; + } else { + mask_ = null; + maskBuilder_ = null; + } + consistencySelectorCase_ = 0; + consistencySelector_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_GetDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.GetDocumentRequest getDefaultInstanceForType() { + return com.google.firestore.v1.GetDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.GetDocumentRequest build() { + com.google.firestore.v1.GetDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.GetDocumentRequest buildPartial() { + com.google.firestore.v1.GetDocumentRequest result = + new com.google.firestore.v1.GetDocumentRequest(this); + result.name_ = name_; + if (maskBuilder_ == null) { + result.mask_ = mask_; + } else { + result.mask_ = maskBuilder_.build(); + } + if (consistencySelectorCase_ == 3) { + result.consistencySelector_ = consistencySelector_; + } + if (consistencySelectorCase_ == 5) { + if (readTimeBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = readTimeBuilder_.build(); + } + } + result.consistencySelectorCase_ = consistencySelectorCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.GetDocumentRequest) { + return mergeFrom((com.google.firestore.v1.GetDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.GetDocumentRequest other) { + if (other == com.google.firestore.v1.GetDocumentRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasMask()) { + mergeMask(other.getMask()); + } + switch (other.getConsistencySelectorCase()) { + case TRANSACTION: + { + setTransaction(other.getTransaction()); + break; + } + case READ_TIME: + { + mergeReadTime(other.getReadTime()); + break; + } + case CONSISTENCYSELECTOR_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.v1.GetDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.GetDocumentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public Builder clearConsistencySelector() { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the Document to get. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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 resource name of the Document to get. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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 resource name of the Document to get. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Document to get. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Document to get. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string name = 1; + */ + 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.v1.DocumentMask mask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + maskBuilder_; + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public boolean hasMask() { + return maskBuilder_ != null || mask_ != null; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public com.google.firestore.v1.DocumentMask getMask() { + if (maskBuilder_ == null) { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } else { + return maskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mask_ = value; + onChanged(); + } else { + maskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (maskBuilder_ == null) { + mask_ = builderForValue.build(); + onChanged(); + } else { + maskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public Builder mergeMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (mask_ != null) { + mask_ = + com.google.firestore.v1.DocumentMask.newBuilder(mask_) + .mergeFrom(value) + .buildPartial(); + } else { + mask_ = value; + } + onChanged(); + } else { + maskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public Builder clearMask() { + if (maskBuilder_ == null) { + mask_ = null; + onChanged(); + } else { + mask_ = null; + maskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public com.google.firestore.v1.DocumentMask.Builder getMaskBuilder() { + + onChanged(); + return getMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + if (maskBuilder_ != null) { + return maskBuilder_.getMessageOrBuilder(); + } else { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getMaskFieldBuilder() { + if (maskBuilder_ == null) { + maskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getMask(), getParentForChildren(), isClean()); + mask_ = null; + } + return maskBuilder_; + } + + /** + * + * + *
+     * Reads the document in a transaction.
+     * 
+ * + * bytes transaction = 3; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 3) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Reads the document in a transaction.
+     * 
+ * + * bytes transaction = 3; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelectorCase_ = 3; + consistencySelector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Reads the document in a transaction.
+     * 
+ * + * bytes transaction = 3; + */ + public Builder clearTransaction() { + if (consistencySelectorCase_ == 3) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 5; + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 5) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 5) { + return readTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 5; + return this; + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 5; + return this; + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 5 + && consistencySelector_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + consistencySelector_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 5) { + readTimeBuilder_.mergeFrom(value); + } + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 5; + return this; + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 5) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 5) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + readTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if ((consistencySelectorCase_ == 5) && (readTimeBuilder_ != null)) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 5) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads the version of the document at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + if (!(consistencySelectorCase_ == 5)) { + consistencySelector_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 5; + onChanged(); + ; + return readTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.GetDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.GetDocumentRequest) + private static final com.google.firestore.v1.GetDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.GetDocumentRequest(); + } + + public static com.google.firestore.v1.GetDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDocumentRequest(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.v1.GetDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/GetDocumentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/GetDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..5aec4869cedf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/GetDocumentRequestOrBuilder.java @@ -0,0 +1,118 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface GetDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.GetDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the Document to get. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the Document to get. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + boolean hasMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + com.google.firestore.v1.DocumentMask getMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 2; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder(); + + /** + * + * + *
+   * Reads the document in a transaction.
+   * 
+ * + * bytes transaction = 3; + */ + com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Reads the version of the document at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Reads the version of the document at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Reads the version of the document at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + public com.google.firestore.v1.GetDocumentRequest.ConsistencySelectorCase + getConsistencySelectorCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequest.java new file mode 100644 index 000000000000..45304820307f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequest.java @@ -0,0 +1,867 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ListCollectionIdsRequest} + */ +public final class ListCollectionIdsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ListCollectionIdsRequest) + ListCollectionIdsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCollectionIdsRequest.newBuilder() to construct. + private ListCollectionIdsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCollectionIdsRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCollectionIdsRequest( + 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(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListCollectionIdsRequest.class, + com.google.firestore.v1.ListCollectionIdsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The parent document. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + 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 document. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token. Must be a value from
+   * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token. Must be a value from
+   * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ListCollectionIdsRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.ListCollectionIdsRequest other = + (com.google.firestore.v1.ListCollectionIdsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && (getPageSize() == other.getPageSize()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ListCollectionIdsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest 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.v1.ListCollectionIdsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest 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.v1.ListCollectionIdsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest 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.v1.ListCollectionIdsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest 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.v1.ListCollectionIdsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest 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.v1.ListCollectionIdsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ListCollectionIdsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ListCollectionIdsRequest) + com.google.firestore.v1.ListCollectionIdsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListCollectionIdsRequest.class, + com.google.firestore.v1.ListCollectionIdsRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.ListCollectionIdsRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ListCollectionIdsRequest getDefaultInstanceForType() { + return com.google.firestore.v1.ListCollectionIdsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ListCollectionIdsRequest build() { + com.google.firestore.v1.ListCollectionIdsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ListCollectionIdsRequest buildPartial() { + com.google.firestore.v1.ListCollectionIdsRequest result = + new com.google.firestore.v1.ListCollectionIdsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ListCollectionIdsRequest) { + return mergeFrom((com.google.firestore.v1.ListCollectionIdsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ListCollectionIdsRequest other) { + if (other == com.google.firestore.v1.ListCollectionIdsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.firestore.v1.ListCollectionIdsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ListCollectionIdsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The parent document. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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 document. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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 document. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent document. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent document. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token. Must be a value from
+     * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token. Must be a value from
+     * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token. Must be a value from
+     * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token. Must be a value from
+     * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token. Must be a value from
+     * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ListCollectionIdsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ListCollectionIdsRequest) + private static final com.google.firestore.v1.ListCollectionIdsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ListCollectionIdsRequest(); + } + + public static com.google.firestore.v1.ListCollectionIdsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCollectionIdsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCollectionIdsRequest(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.v1.ListCollectionIdsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequestOrBuilder.java new file mode 100644 index 000000000000..4aabf3846c51 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsRequestOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface ListCollectionIdsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ListCollectionIdsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent document. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The parent document. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of results to return.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + * + * + *
+   * A page token. Must be a value from
+   * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token. Must be a value from
+   * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponse.java new file mode 100644 index 000000000000..4d1d95ed771b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponse.java @@ -0,0 +1,846 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response from [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ListCollectionIdsResponse} + */ +public final class ListCollectionIdsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ListCollectionIdsResponse) + ListCollectionIdsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCollectionIdsResponse.newBuilder() to construct. + private ListCollectionIdsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCollectionIdsResponse() { + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCollectionIdsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + collectionIds_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListCollectionIdsResponse.class, + com.google.firestore.v1.ListCollectionIdsResponse.Builder.class); + } + + private int bitField0_; + public static final int COLLECTION_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList collectionIds_; + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_; + } + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A page token that may be used to continue the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token that may be used to continue the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < collectionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, collectionIds_.getRaw(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < collectionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionIdsList().size(); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.v1.ListCollectionIdsResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.ListCollectionIdsResponse other = + (com.google.firestore.v1.ListCollectionIdsResponse) obj; + + boolean result = true; + result = result && getCollectionIdsList().equals(other.getCollectionIdsList()); + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCollectionIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionIdsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ListCollectionIdsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse 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.v1.ListCollectionIdsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse 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.v1.ListCollectionIdsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse 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.v1.ListCollectionIdsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse 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.v1.ListCollectionIdsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse 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.v1.ListCollectionIdsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response from [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ListCollectionIdsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ListCollectionIdsResponse) + com.google.firestore.v1.ListCollectionIdsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListCollectionIdsResponse.class, + com.google.firestore.v1.ListCollectionIdsResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.ListCollectionIdsResponse.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(); + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListCollectionIdsResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ListCollectionIdsResponse getDefaultInstanceForType() { + return com.google.firestore.v1.ListCollectionIdsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ListCollectionIdsResponse build() { + com.google.firestore.v1.ListCollectionIdsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ListCollectionIdsResponse buildPartial() { + com.google.firestore.v1.ListCollectionIdsResponse result = + new com.google.firestore.v1.ListCollectionIdsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.collectionIds_ = collectionIds_; + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ListCollectionIdsResponse) { + return mergeFrom((com.google.firestore.v1.ListCollectionIdsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ListCollectionIdsResponse other) { + if (other == com.google.firestore.v1.ListCollectionIdsResponse.getDefaultInstance()) + return this; + if (!other.collectionIds_.isEmpty()) { + if (collectionIds_.isEmpty()) { + collectionIds_ = other.collectionIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCollectionIdsIsMutable(); + collectionIds_.addAll(other.collectionIds_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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.v1.ListCollectionIdsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.ListCollectionIdsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList collectionIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionIdsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(collectionIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public Builder setCollectionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public Builder addCollectionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public Builder addAllCollectionIds(java.lang.Iterable values) { + ensureCollectionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public Builder clearCollectionIds() { + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ids.
+     * 
+ * + * repeated string collection_ids = 1; + */ + public Builder addCollectionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token that may be used to continue the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token that may be used to continue the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token that may be used to continue the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that may be used to continue the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that may be used to continue the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ListCollectionIdsResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ListCollectionIdsResponse) + private static final com.google.firestore.v1.ListCollectionIdsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ListCollectionIdsResponse(); + } + + public static com.google.firestore.v1.ListCollectionIdsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCollectionIdsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCollectionIdsResponse(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.v1.ListCollectionIdsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponseOrBuilder.java new file mode 100644 index 000000000000..c250c4a917d0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListCollectionIdsResponseOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface ListCollectionIdsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ListCollectionIdsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + java.util.List getCollectionIdsList(); + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + int getCollectionIdsCount(); + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + java.lang.String getCollectionIds(int index); + /** + * + * + *
+   * The collection ids.
+   * 
+ * + * repeated string collection_ids = 1; + */ + com.google.protobuf.ByteString getCollectionIdsBytes(int index); + + /** + * + * + *
+   * A page token that may be used to continue the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token that may be used to continue the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequest.java new file mode 100644 index 000000000000..5df0e959d496 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequest.java @@ -0,0 +1,2055 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ListDocumentsRequest} + */ +public final class ListDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ListDocumentsRequest) + ListDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDocumentsRequest.newBuilder() to construct. + private ListDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDocumentsRequest() { + parent_ = ""; + collectionId_ = ""; + pageSize_ = 0; + pageToken_ = ""; + orderBy_ = ""; + showMissing_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDocumentsRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + collectionId_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 58: + { + com.google.firestore.v1.DocumentMask.Builder subBuilder = null; + if (mask_ != null) { + subBuilder = mask_.toBuilder(); + } + mask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mask_); + mask_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + consistencySelectorCase_ = 8; + consistencySelector_ = input.readBytes(); + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (consistencySelectorCase_ == 10) { + subBuilder = ((com.google.protobuf.Timestamp) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 10; + break; + } + case 96: + { + showMissing_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListDocumentsRequest.class, + com.google.firestore.v1.ListDocumentsRequest.Builder.class); + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public enum ConsistencySelectorCase implements com.google.protobuf.Internal.EnumLite { + TRANSACTION(8), + READ_TIME(10), + CONSISTENCYSELECTOR_NOT_SET(0); + private final int value; + + private ConsistencySelectorCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ConsistencySelectorCase valueOf(int value) { + return forNumber(value); + } + + public static ConsistencySelectorCase forNumber(int value) { + switch (value) { + case 8: + return TRANSACTION; + case 10: + return READ_TIME; + case 0: + return CONSISTENCYSELECTOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The parent resource name. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + 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. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + 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 COLLECTION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object collectionId_; + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+   * or `messages`.
+   * 
+ * + * string collection_id = 2; + */ + public java.lang.String getCollectionId() { + java.lang.Object ref = collectionId_; + 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(); + collectionId_ = s; + return s; + } + } + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+   * or `messages`.
+   * 
+ * + * string collection_id = 2; + */ + public com.google.protobuf.ByteString getCollectionIdBytes() { + java.lang.Object ref = collectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of documents to return.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The `next_page_token` value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The `next_page_token` value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 6; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The order to sort results by. For example: `priority desc, name`.
+   * 
+ * + * string order_by = 6; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order to sort results by. For example: `priority desc, name`.
+   * 
+ * + * string order_by = 6; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MASK_FIELD_NUMBER = 7; + private com.google.firestore.v1.DocumentMask mask_; + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public boolean hasMask() { + return mask_ != null; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public com.google.firestore.v1.DocumentMask getMask() { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + return getMask(); + } + + public static final int TRANSACTION_FIELD_NUMBER = 8; + /** + * + * + *
+   * Reads documents in a transaction.
+   * 
+ * + * bytes transaction = 8; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 8) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int READ_TIME_FIELD_NUMBER = 10; + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 10; + } + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (consistencySelectorCase_ == 10) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (consistencySelectorCase_ == 10) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int SHOW_MISSING_FIELD_NUMBER = 12; + private boolean showMissing_; + /** + * + * + *
+   * If the list should show missing documents. A missing document is a
+   * document that does not exist but has sub-documents. These documents will
+   * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time],
+   * or [Document.update_time][google.firestore.v1.Document.update_time] set.
+   * Requests with `show_missing` may not specify `where` or
+   * `order_by`.
+   * 
+ * + * bool show_missing = 12; + */ + public boolean getShowMissing() { + return showMissing_; + } + + 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 (!getCollectionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectionId_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, orderBy_); + } + if (mask_ != null) { + output.writeMessage(7, getMask()); + } + if (consistencySelectorCase_ == 8) { + output.writeBytes(8, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 10) { + output.writeMessage(10, (com.google.protobuf.Timestamp) consistencySelector_); + } + if (showMissing_ != false) { + output.writeBool(12, showMissing_); + } + 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 (!getCollectionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, collectionId_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, orderBy_); + } + if (mask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getMask()); + } + if (consistencySelectorCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 8, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.protobuf.Timestamp) consistencySelector_); + } + if (showMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, showMissing_); + } + 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.v1.ListDocumentsRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.ListDocumentsRequest other = + (com.google.firestore.v1.ListDocumentsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getCollectionId().equals(other.getCollectionId()); + result = result && (getPageSize() == other.getPageSize()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && getOrderBy().equals(other.getOrderBy()); + result = result && (hasMask() == other.hasMask()); + if (hasMask()) { + result = result && getMask().equals(other.getMask()); + } + result = result && (getShowMissing() == other.getShowMissing()); + result = result && getConsistencySelectorCase().equals(other.getConsistencySelectorCase()); + if (!result) return false; + switch (consistencySelectorCase_) { + case 8: + result = result && getTransaction().equals(other.getTransaction()); + break; + case 10: + result = result && getReadTime().equals(other.getReadTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + COLLECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getCollectionId().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasMask()) { + hash = (37 * hash) + MASK_FIELD_NUMBER; + hash = (53 * hash) + getMask().hashCode(); + } + hash = (37 * hash) + SHOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getShowMissing()); + switch (consistencySelectorCase_) { + case 8: + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + break; + case 10: + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ListDocumentsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListDocumentsRequest 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.v1.ListDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListDocumentsRequest 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.v1.ListDocumentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ListDocumentsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListDocumentsRequest 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.v1.ListDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListDocumentsRequest 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.v1.ListDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListDocumentsRequest 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.v1.ListDocumentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ListDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ListDocumentsRequest) + com.google.firestore.v1.ListDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListDocumentsRequest.class, + com.google.firestore.v1.ListDocumentsRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.ListDocumentsRequest.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_ = ""; + + collectionId_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + orderBy_ = ""; + + if (maskBuilder_ == null) { + mask_ = null; + } else { + mask_ = null; + maskBuilder_ = null; + } + showMissing_ = false; + + consistencySelectorCase_ = 0; + consistencySelector_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ListDocumentsRequest getDefaultInstanceForType() { + return com.google.firestore.v1.ListDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ListDocumentsRequest build() { + com.google.firestore.v1.ListDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ListDocumentsRequest buildPartial() { + com.google.firestore.v1.ListDocumentsRequest result = + new com.google.firestore.v1.ListDocumentsRequest(this); + result.parent_ = parent_; + result.collectionId_ = collectionId_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.orderBy_ = orderBy_; + if (maskBuilder_ == null) { + result.mask_ = mask_; + } else { + result.mask_ = maskBuilder_.build(); + } + if (consistencySelectorCase_ == 8) { + result.consistencySelector_ = consistencySelector_; + } + if (consistencySelectorCase_ == 10) { + if (readTimeBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = readTimeBuilder_.build(); + } + } + result.showMissing_ = showMissing_; + result.consistencySelectorCase_ = consistencySelectorCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ListDocumentsRequest) { + return mergeFrom((com.google.firestore.v1.ListDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ListDocumentsRequest other) { + if (other == com.google.firestore.v1.ListDocumentsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getCollectionId().isEmpty()) { + collectionId_ = other.collectionId_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.hasMask()) { + mergeMask(other.getMask()); + } + if (other.getShowMissing() != false) { + setShowMissing(other.getShowMissing()); + } + switch (other.getConsistencySelectorCase()) { + case TRANSACTION: + { + setTransaction(other.getTransaction()); + break; + } + case READ_TIME: + { + mergeReadTime(other.getReadTime()); + break; + } + case CONSISTENCYSELECTOR_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.v1.ListDocumentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ListDocumentsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public Builder clearConsistencySelector() { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object collectionId_ = ""; + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+     * or `messages`.
+     * 
+ * + * string collection_id = 2; + */ + public java.lang.String getCollectionId() { + java.lang.Object ref = collectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+     * or `messages`.
+     * 
+ * + * string collection_id = 2; + */ + public com.google.protobuf.ByteString getCollectionIdBytes() { + java.lang.Object ref = collectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+     * or `messages`.
+     * 
+ * + * string collection_id = 2; + */ + public Builder setCollectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + collectionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+     * or `messages`.
+     * 
+ * + * string collection_id = 2; + */ + public Builder clearCollectionId() { + + collectionId_ = getDefaultInstance().getCollectionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+     * or `messages`.
+     * 
+ * + * string collection_id = 2; + */ + public Builder setCollectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + collectionId_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of documents to return.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of documents to return.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of documents to return.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The `next_page_token` value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order to sort results by. For example: `priority desc, name`.
+     * 
+ * + * string order_by = 6; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The order to sort results by. For example: `priority desc, name`.
+     * 
+ * + * string order_by = 6; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The order to sort results by. For example: `priority desc, name`.
+     * 
+ * + * string order_by = 6; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The order to sort results by. For example: `priority desc, name`.
+     * 
+ * + * string order_by = 6; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The order to sort results by. For example: `priority desc, name`.
+     * 
+ * + * string order_by = 6; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private com.google.firestore.v1.DocumentMask mask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + maskBuilder_; + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public boolean hasMask() { + return maskBuilder_ != null || mask_ != null; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public com.google.firestore.v1.DocumentMask getMask() { + if (maskBuilder_ == null) { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } else { + return maskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mask_ = value; + onChanged(); + } else { + maskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (maskBuilder_ == null) { + mask_ = builderForValue.build(); + onChanged(); + } else { + maskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public Builder mergeMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (mask_ != null) { + mask_ = + com.google.firestore.v1.DocumentMask.newBuilder(mask_) + .mergeFrom(value) + .buildPartial(); + } else { + mask_ = value; + } + onChanged(); + } else { + maskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public Builder clearMask() { + if (maskBuilder_ == null) { + mask_ = null; + onChanged(); + } else { + mask_ = null; + maskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public com.google.firestore.v1.DocumentMask.Builder getMaskBuilder() { + + onChanged(); + return getMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + if (maskBuilder_ != null) { + return maskBuilder_.getMessageOrBuilder(); + } else { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If a document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getMaskFieldBuilder() { + if (maskBuilder_ == null) { + maskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getMask(), getParentForChildren(), isClean()); + mask_ = null; + } + return maskBuilder_; + } + + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 8; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 8) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 8; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelectorCase_ = 8; + consistencySelector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 8; + */ + public Builder clearTransaction() { + if (consistencySelectorCase_ == 8) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 10; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 10) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 10) { + return readTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 10; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 10; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 10 + && consistencySelector_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + consistencySelector_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 10) { + readTimeBuilder_.mergeFrom(value); + } + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 10; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 10) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 10) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + readTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if ((consistencySelectorCase_ == 10) && (readTimeBuilder_ != null)) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 10) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + if (!(consistencySelectorCase_ == 10)) { + consistencySelector_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 10; + onChanged(); + ; + return readTimeBuilder_; + } + + private boolean showMissing_; + /** + * + * + *
+     * If the list should show missing documents. A missing document is a
+     * document that does not exist but has sub-documents. These documents will
+     * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time],
+     * or [Document.update_time][google.firestore.v1.Document.update_time] set.
+     * Requests with `show_missing` may not specify `where` or
+     * `order_by`.
+     * 
+ * + * bool show_missing = 12; + */ + public boolean getShowMissing() { + return showMissing_; + } + /** + * + * + *
+     * If the list should show missing documents. A missing document is a
+     * document that does not exist but has sub-documents. These documents will
+     * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time],
+     * or [Document.update_time][google.firestore.v1.Document.update_time] set.
+     * Requests with `show_missing` may not specify `where` or
+     * `order_by`.
+     * 
+ * + * bool show_missing = 12; + */ + public Builder setShowMissing(boolean value) { + + showMissing_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If the list should show missing documents. A missing document is a
+     * document that does not exist but has sub-documents. These documents will
+     * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time],
+     * or [Document.update_time][google.firestore.v1.Document.update_time] set.
+     * Requests with `show_missing` may not specify `where` or
+     * `order_by`.
+     * 
+ * + * bool show_missing = 12; + */ + public Builder clearShowMissing() { + + showMissing_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ListDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ListDocumentsRequest) + private static final com.google.firestore.v1.ListDocumentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ListDocumentsRequest(); + } + + public static com.google.firestore.v1.ListDocumentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDocumentsRequest(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.v1.ListDocumentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..7b2561ae5eb4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsRequestOrBuilder.java @@ -0,0 +1,218 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface ListDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ListDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent resource name. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The parent resource name. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+   * or `messages`.
+   * 
+ * + * string collection_id = 2; + */ + java.lang.String getCollectionId(); + /** + * + * + *
+   * The collection ID, relative to `parent`, to list. For example: `chatrooms`
+   * or `messages`.
+   * 
+ * + * string collection_id = 2; + */ + com.google.protobuf.ByteString getCollectionIdBytes(); + + /** + * + * + *
+   * The maximum number of documents to return.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + * + * + *
+   * The `next_page_token` value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The `next_page_token` value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The order to sort results by. For example: `priority desc, name`.
+   * 
+ * + * string order_by = 6; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order to sort results by. For example: `priority desc, name`.
+   * 
+ * + * string order_by = 6; + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + boolean hasMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + com.google.firestore.v1.DocumentMask getMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If a document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 7; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder(); + + /** + * + * + *
+   * Reads documents in a transaction.
+   * 
+ * + * bytes transaction = 8; + */ + com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * If the list should show missing documents. A missing document is a
+   * document that does not exist but has sub-documents. These documents will
+   * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time],
+   * or [Document.update_time][google.firestore.v1.Document.update_time] set.
+   * Requests with `show_missing` may not specify `where` or
+   * `order_by`.
+   * 
+ * + * bool show_missing = 12; + */ + boolean getShowMissing(); + + public com.google.firestore.v1.ListDocumentsRequest.ConsistencySelectorCase + getConsistencySelectorCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponse.java new file mode 100644 index 000000000000..e4383afceac1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponse.java @@ -0,0 +1,1087 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ListDocumentsResponse} + */ +public final class ListDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ListDocumentsResponse) + ListDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDocumentsResponse.newBuilder() to construct. + private ListDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDocumentsResponse() { + documents_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDocumentsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + documents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + documents_.add( + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + documents_ = java.util.Collections.unmodifiableList(documents_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListDocumentsResponse.class, + com.google.firestore.v1.ListDocumentsResponse.Builder.class); + } + + private int bitField0_; + public static final int DOCUMENTS_FIELD_NUMBER = 1; + private java.util.List documents_; + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public java.util.List getDocumentsList() { + return documents_; + } + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public java.util.List + getDocumentsOrBuilderList() { + return documents_; + } + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.Document getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentsOrBuilder(int index) { + return documents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < documents_.size(); i++) { + output.writeMessage(1, documents_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documents_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.v1.ListDocumentsResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.ListDocumentsResponse other = + (com.google.firestore.v1.ListDocumentsResponse) obj; + + boolean result = true; + result = result && getDocumentsList().equals(other.getDocumentsList()); + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentsCount() > 0) { + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ListDocumentsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListDocumentsResponse 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.v1.ListDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListDocumentsResponse 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.v1.ListDocumentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ListDocumentsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListDocumentsResponse 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.v1.ListDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListDocumentsResponse 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.v1.ListDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListDocumentsResponse 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.v1.ListDocumentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ListDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ListDocumentsResponse) + com.google.firestore.v1.ListDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListDocumentsResponse.class, + com.google.firestore.v1.ListDocumentsResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.ListDocumentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDocumentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + documentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ListDocumentsResponse getDefaultInstanceForType() { + return com.google.firestore.v1.ListDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ListDocumentsResponse build() { + com.google.firestore.v1.ListDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ListDocumentsResponse buildPartial() { + com.google.firestore.v1.ListDocumentsResponse result = + new com.google.firestore.v1.ListDocumentsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (documentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + documents_ = java.util.Collections.unmodifiableList(documents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documents_ = documents_; + } else { + result.documents_ = documentsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ListDocumentsResponse) { + return mergeFrom((com.google.firestore.v1.ListDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ListDocumentsResponse other) { + if (other == com.google.firestore.v1.ListDocumentsResponse.getDefaultInstance()) return this; + if (documentsBuilder_ == null) { + if (!other.documents_.isEmpty()) { + if (documents_.isEmpty()) { + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentsIsMutable(); + documents_.addAll(other.documents_); + } + onChanged(); + } + } else { + if (!other.documents_.isEmpty()) { + if (documentsBuilder_.isEmpty()) { + documentsBuilder_.dispose(); + documentsBuilder_ = null; + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + documentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentsFieldBuilder() + : null; + } else { + documentsBuilder_.addAllMessages(other.documents_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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.v1.ListDocumentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ListDocumentsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List documents_ = + java.util.Collections.emptyList(); + + private void ensureDocumentsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + documents_ = new java.util.ArrayList(documents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + documentsBuilder_; + + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public java.util.List getDocumentsList() { + if (documentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(documents_); + } else { + return documentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public int getDocumentsCount() { + if (documentsBuilder_ == null) { + return documents_.size(); + } else { + return documentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.Document getDocuments(int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder setDocuments(int index, com.google.firestore.v1.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.set(index, value); + onChanged(); + } else { + documentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder setDocuments( + int index, com.google.firestore.v1.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.set(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder addDocuments(com.google.firestore.v1.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + } else { + documentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder addDocuments(int index, com.google.firestore.v1.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(index, value); + onChanged(); + } else { + documentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder addDocuments(com.google.firestore.v1.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder addDocuments( + int index, com.google.firestore.v1.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder addAllDocuments( + java.lang.Iterable values) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documents_); + onChanged(); + } else { + documentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder clearDocuments() { + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public Builder removeDocuments(int index) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.remove(index); + onChanged(); + } else { + documentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.Document.Builder getDocumentsBuilder(int index) { + return getDocumentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentsOrBuilder(int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public java.util.List + getDocumentsOrBuilderList() { + if (documentsBuilder_ != null) { + return documentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documents_); + } + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.Document.Builder addDocumentsBuilder() { + return getDocumentsFieldBuilder() + .addBuilder(com.google.firestore.v1.Document.getDefaultInstance()); + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public com.google.firestore.v1.Document.Builder addDocumentsBuilder(int index) { + return getDocumentsFieldBuilder() + .addBuilder(index, com.google.firestore.v1.Document.getDefaultInstance()); + } + /** + * + * + *
+     * The Documents found.
+     * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + public java.util.List getDocumentsBuilderList() { + return getDocumentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + getDocumentsFieldBuilder() { + if (documentsBuilder_ == null) { + documentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder>( + documents_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + documents_ = null; + } + return documentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ListDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ListDocumentsResponse) + private static final com.google.firestore.v1.ListDocumentsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ListDocumentsResponse(); + } + + public static com.google.firestore.v1.ListDocumentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDocumentsResponse(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.v1.ListDocumentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..62e11f7cbab2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListDocumentsResponseOrBuilder.java @@ -0,0 +1,82 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface ListDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ListDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + java.util.List getDocumentsList(); + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + com.google.firestore.v1.Document getDocuments(int index); + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + int getDocumentsCount(); + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + java.util.List getDocumentsOrBuilderList(); + /** + * + * + *
+   * The Documents found.
+   * 
+ * + * repeated .google.firestore.v1.Document documents = 1; + */ + com.google.firestore.v1.DocumentOrBuilder getDocumentsOrBuilder(int index); + + /** + * + * + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next page token.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequest.java new file mode 100644 index 000000000000..bfac1ff6546f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequest.java @@ -0,0 +1,1370 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A request for [Firestore.Listen][google.firestore.v1.Firestore.Listen]
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ListenRequest} + */ +public final class ListenRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ListenRequest) + ListenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListenRequest.newBuilder() to construct. + private ListenRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListenRequest() { + database_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListenRequest( + 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(); + + database_ = s; + break; + } + case 18: + { + com.google.firestore.v1.Target.Builder subBuilder = null; + if (targetChangeCase_ == 2) { + subBuilder = ((com.google.firestore.v1.Target) targetChange_).toBuilder(); + } + targetChange_ = + input.readMessage(com.google.firestore.v1.Target.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Target) targetChange_); + targetChange_ = subBuilder.buildPartial(); + } + targetChangeCase_ = 2; + break; + } + case 24: + { + targetChangeCase_ = 3; + targetChange_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListenRequest.class, + com.google.firestore.v1.ListenRequest.Builder.class); + } + + private int bitField0_; + private int targetChangeCase_ = 0; + private java.lang.Object targetChange_; + + public enum TargetChangeCase implements com.google.protobuf.Internal.EnumLite { + ADD_TARGET(2), + REMOVE_TARGET(3), + TARGETCHANGE_NOT_SET(0); + private final int value; + + private TargetChangeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TargetChangeCase valueOf(int value) { + return forNumber(value); + } + + public static TargetChangeCase forNumber(int value) { + switch (value) { + case 2: + return ADD_TARGET; + case 3: + return REMOVE_TARGET; + case 0: + return TARGETCHANGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetChangeCase getTargetChangeCase() { + return TargetChangeCase.forNumber(targetChangeCase_); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + 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(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADD_TARGET_FIELD_NUMBER = 2; + /** + * + * + *
+   * A target to add to this stream.
+   * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public boolean hasAddTarget() { + return targetChangeCase_ == 2; + } + /** + * + * + *
+   * A target to add to this stream.
+   * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public com.google.firestore.v1.Target getAddTarget() { + if (targetChangeCase_ == 2) { + return (com.google.firestore.v1.Target) targetChange_; + } + return com.google.firestore.v1.Target.getDefaultInstance(); + } + /** + * + * + *
+   * A target to add to this stream.
+   * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public com.google.firestore.v1.TargetOrBuilder getAddTargetOrBuilder() { + if (targetChangeCase_ == 2) { + return (com.google.firestore.v1.Target) targetChange_; + } + return com.google.firestore.v1.Target.getDefaultInstance(); + } + + public static final int REMOVE_TARGET_FIELD_NUMBER = 3; + /** + * + * + *
+   * The ID of a target to remove from this stream.
+   * 
+ * + * int32 remove_target = 3; + */ + public int getRemoveTarget() { + if (targetChangeCase_ == 3) { + return (java.lang.Integer) targetChange_; + } + return 0; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + if (targetChangeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.Target) targetChange_); + } + if (targetChangeCase_ == 3) { + output.writeInt32(3, (int) ((java.lang.Integer) targetChange_)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + if (targetChangeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.Target) targetChange_); + } + if (targetChangeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 3, (int) ((java.lang.Integer) targetChange_)); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + 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.v1.ListenRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.ListenRequest other = (com.google.firestore.v1.ListenRequest) obj; + + boolean result = true; + result = result && getDatabase().equals(other.getDatabase()); + result = result && internalGetLabels().equals(other.internalGetLabels()); + result = result && getTargetChangeCase().equals(other.getTargetChangeCase()); + if (!result) return false; + switch (targetChangeCase_) { + case 2: + result = result && getAddTarget().equals(other.getAddTarget()); + break; + case 3: + result = result && (getRemoveTarget() == other.getRemoveTarget()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (targetChangeCase_) { + case 2: + hash = (37 * hash) + ADD_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getAddTarget().hashCode(); + break; + case 3: + hash = (37 * hash) + REMOVE_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getRemoveTarget(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ListenRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListenRequest 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.v1.ListenRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListenRequest 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.v1.ListenRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ListenRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListenRequest 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.v1.ListenRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListenRequest 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.v1.ListenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListenRequest 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.v1.ListenRequest 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 request for [Firestore.Listen][google.firestore.v1.Firestore.Listen]
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ListenRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ListenRequest) + com.google.firestore.v1.ListenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListenRequest.class, + com.google.firestore.v1.ListenRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.ListenRequest.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(); + database_ = ""; + + internalGetMutableLabels().clear(); + targetChangeCase_ = 0; + targetChange_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ListenRequest getDefaultInstanceForType() { + return com.google.firestore.v1.ListenRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ListenRequest build() { + com.google.firestore.v1.ListenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ListenRequest buildPartial() { + com.google.firestore.v1.ListenRequest result = + new com.google.firestore.v1.ListenRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.database_ = database_; + if (targetChangeCase_ == 2) { + if (addTargetBuilder_ == null) { + result.targetChange_ = targetChange_; + } else { + result.targetChange_ = addTargetBuilder_.build(); + } + } + if (targetChangeCase_ == 3) { + result.targetChange_ = targetChange_; + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.bitField0_ = to_bitField0_; + result.targetChangeCase_ = targetChangeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ListenRequest) { + return mergeFrom((com.google.firestore.v1.ListenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ListenRequest other) { + if (other == com.google.firestore.v1.ListenRequest.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + switch (other.getTargetChangeCase()) { + case ADD_TARGET: + { + mergeAddTarget(other.getAddTarget()); + break; + } + case REMOVE_TARGET: + { + setRemoveTarget(other.getRemoveTarget()); + break; + } + case TARGETCHANGE_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.v1.ListenRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ListenRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int targetChangeCase_ = 0; + private java.lang.Object targetChange_; + + public TargetChangeCase getTargetChangeCase() { + return TargetChangeCase.forNumber(targetChangeCase_); + } + + public Builder clearTargetChange() { + targetChangeCase_ = 0; + targetChange_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target, + com.google.firestore.v1.Target.Builder, + com.google.firestore.v1.TargetOrBuilder> + addTargetBuilder_; + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public boolean hasAddTarget() { + return targetChangeCase_ == 2; + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public com.google.firestore.v1.Target getAddTarget() { + if (addTargetBuilder_ == null) { + if (targetChangeCase_ == 2) { + return (com.google.firestore.v1.Target) targetChange_; + } + return com.google.firestore.v1.Target.getDefaultInstance(); + } else { + if (targetChangeCase_ == 2) { + return addTargetBuilder_.getMessage(); + } + return com.google.firestore.v1.Target.getDefaultInstance(); + } + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public Builder setAddTarget(com.google.firestore.v1.Target value) { + if (addTargetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetChange_ = value; + onChanged(); + } else { + addTargetBuilder_.setMessage(value); + } + targetChangeCase_ = 2; + return this; + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public Builder setAddTarget(com.google.firestore.v1.Target.Builder builderForValue) { + if (addTargetBuilder_ == null) { + targetChange_ = builderForValue.build(); + onChanged(); + } else { + addTargetBuilder_.setMessage(builderForValue.build()); + } + targetChangeCase_ = 2; + return this; + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public Builder mergeAddTarget(com.google.firestore.v1.Target value) { + if (addTargetBuilder_ == null) { + if (targetChangeCase_ == 2 + && targetChange_ != com.google.firestore.v1.Target.getDefaultInstance()) { + targetChange_ = + com.google.firestore.v1.Target.newBuilder( + (com.google.firestore.v1.Target) targetChange_) + .mergeFrom(value) + .buildPartial(); + } else { + targetChange_ = value; + } + onChanged(); + } else { + if (targetChangeCase_ == 2) { + addTargetBuilder_.mergeFrom(value); + } + addTargetBuilder_.setMessage(value); + } + targetChangeCase_ = 2; + return this; + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public Builder clearAddTarget() { + if (addTargetBuilder_ == null) { + if (targetChangeCase_ == 2) { + targetChangeCase_ = 0; + targetChange_ = null; + onChanged(); + } + } else { + if (targetChangeCase_ == 2) { + targetChangeCase_ = 0; + targetChange_ = null; + } + addTargetBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public com.google.firestore.v1.Target.Builder getAddTargetBuilder() { + return getAddTargetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + public com.google.firestore.v1.TargetOrBuilder getAddTargetOrBuilder() { + if ((targetChangeCase_ == 2) && (addTargetBuilder_ != null)) { + return addTargetBuilder_.getMessageOrBuilder(); + } else { + if (targetChangeCase_ == 2) { + return (com.google.firestore.v1.Target) targetChange_; + } + return com.google.firestore.v1.Target.getDefaultInstance(); + } + } + /** + * + * + *
+     * A target to add to this stream.
+     * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target, + com.google.firestore.v1.Target.Builder, + com.google.firestore.v1.TargetOrBuilder> + getAddTargetFieldBuilder() { + if (addTargetBuilder_ == null) { + if (!(targetChangeCase_ == 2)) { + targetChange_ = com.google.firestore.v1.Target.getDefaultInstance(); + } + addTargetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target, + com.google.firestore.v1.Target.Builder, + com.google.firestore.v1.TargetOrBuilder>( + (com.google.firestore.v1.Target) targetChange_, getParentForChildren(), isClean()); + targetChange_ = null; + } + targetChangeCase_ = 2; + onChanged(); + ; + return addTargetBuilder_; + } + + /** + * + * + *
+     * The ID of a target to remove from this stream.
+     * 
+ * + * int32 remove_target = 3; + */ + public int getRemoveTarget() { + if (targetChangeCase_ == 3) { + return (java.lang.Integer) targetChange_; + } + return 0; + } + /** + * + * + *
+     * The ID of a target to remove from this stream.
+     * 
+ * + * int32 remove_target = 3; + */ + public Builder setRemoveTarget(int value) { + targetChangeCase_ = 3; + targetChange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of a target to remove from this stream.
+     * 
+ * + * int32 remove_target = 3; + */ + public Builder clearRemoveTarget() { + if (targetChangeCase_ == 3) { + targetChangeCase_ = 0; + targetChange_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this target change.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ListenRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ListenRequest) + private static final com.google.firestore.v1.ListenRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ListenRequest(); + } + + public static com.google.firestore.v1.ListenRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListenRequest(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.v1.ListenRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequestOrBuilder.java new file mode 100644 index 000000000000..041493e140eb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenRequestOrBuilder.java @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface ListenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ListenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * A target to add to this stream.
+   * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + boolean hasAddTarget(); + /** + * + * + *
+   * A target to add to this stream.
+   * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + com.google.firestore.v1.Target getAddTarget(); + /** + * + * + *
+   * A target to add to this stream.
+   * 
+ * + * .google.firestore.v1.Target add_target = 2; + */ + com.google.firestore.v1.TargetOrBuilder getAddTargetOrBuilder(); + + /** + * + * + *
+   * The ID of a target to remove from this stream.
+   * 
+ * + * int32 remove_target = 3; + */ + int getRemoveTarget(); + + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this target change.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + public com.google.firestore.v1.ListenRequest.TargetChangeCase getTargetChangeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponse.java new file mode 100644 index 000000000000..a5270da5b2aa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponse.java @@ -0,0 +1,2007 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response for [Firestore.Listen][google.firestore.v1.Firestore.Listen].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ListenResponse} + */ +public final class ListenResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ListenResponse) + ListenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListenResponse.newBuilder() to construct. + private ListenResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListenResponse() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListenResponse( + 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 18: + { + com.google.firestore.v1.TargetChange.Builder subBuilder = null; + if (responseTypeCase_ == 2) { + subBuilder = ((com.google.firestore.v1.TargetChange) responseType_).toBuilder(); + } + responseType_ = + input.readMessage( + com.google.firestore.v1.TargetChange.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.TargetChange) responseType_); + responseType_ = subBuilder.buildPartial(); + } + responseTypeCase_ = 2; + break; + } + case 26: + { + com.google.firestore.v1.DocumentChange.Builder subBuilder = null; + if (responseTypeCase_ == 3) { + subBuilder = ((com.google.firestore.v1.DocumentChange) responseType_).toBuilder(); + } + responseType_ = + input.readMessage( + com.google.firestore.v1.DocumentChange.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.DocumentChange) responseType_); + responseType_ = subBuilder.buildPartial(); + } + responseTypeCase_ = 3; + break; + } + case 34: + { + com.google.firestore.v1.DocumentDelete.Builder subBuilder = null; + if (responseTypeCase_ == 4) { + subBuilder = ((com.google.firestore.v1.DocumentDelete) responseType_).toBuilder(); + } + responseType_ = + input.readMessage( + com.google.firestore.v1.DocumentDelete.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.DocumentDelete) responseType_); + responseType_ = subBuilder.buildPartial(); + } + responseTypeCase_ = 4; + break; + } + case 42: + { + com.google.firestore.v1.ExistenceFilter.Builder subBuilder = null; + if (responseTypeCase_ == 5) { + subBuilder = ((com.google.firestore.v1.ExistenceFilter) responseType_).toBuilder(); + } + responseType_ = + input.readMessage( + com.google.firestore.v1.ExistenceFilter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.ExistenceFilter) responseType_); + responseType_ = subBuilder.buildPartial(); + } + responseTypeCase_ = 5; + break; + } + case 50: + { + com.google.firestore.v1.DocumentRemove.Builder subBuilder = null; + if (responseTypeCase_ == 6) { + subBuilder = ((com.google.firestore.v1.DocumentRemove) responseType_).toBuilder(); + } + responseType_ = + input.readMessage( + com.google.firestore.v1.DocumentRemove.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.DocumentRemove) responseType_); + responseType_ = subBuilder.buildPartial(); + } + responseTypeCase_ = 6; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListenResponse.class, + com.google.firestore.v1.ListenResponse.Builder.class); + } + + private int responseTypeCase_ = 0; + private java.lang.Object responseType_; + + public enum ResponseTypeCase implements com.google.protobuf.Internal.EnumLite { + TARGET_CHANGE(2), + DOCUMENT_CHANGE(3), + DOCUMENT_DELETE(4), + DOCUMENT_REMOVE(6), + FILTER(5), + RESPONSETYPE_NOT_SET(0); + private final int value; + + private ResponseTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ResponseTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseTypeCase forNumber(int value) { + switch (value) { + case 2: + return TARGET_CHANGE; + case 3: + return DOCUMENT_CHANGE; + case 4: + return DOCUMENT_DELETE; + case 6: + return DOCUMENT_REMOVE; + case 5: + return FILTER; + case 0: + return RESPONSETYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseTypeCase getResponseTypeCase() { + return ResponseTypeCase.forNumber(responseTypeCase_); + } + + public static final int TARGET_CHANGE_FIELD_NUMBER = 2; + /** + * + * + *
+   * Targets have changed.
+   * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public boolean hasTargetChange() { + return responseTypeCase_ == 2; + } + /** + * + * + *
+   * Targets have changed.
+   * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public com.google.firestore.v1.TargetChange getTargetChange() { + if (responseTypeCase_ == 2) { + return (com.google.firestore.v1.TargetChange) responseType_; + } + return com.google.firestore.v1.TargetChange.getDefaultInstance(); + } + /** + * + * + *
+   * Targets have changed.
+   * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public com.google.firestore.v1.TargetChangeOrBuilder getTargetChangeOrBuilder() { + if (responseTypeCase_ == 2) { + return (com.google.firestore.v1.TargetChange) responseType_; + } + return com.google.firestore.v1.TargetChange.getDefaultInstance(); + } + + public static final int DOCUMENT_CHANGE_FIELD_NUMBER = 3; + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has changed.
+   * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public boolean hasDocumentChange() { + return responseTypeCase_ == 3; + } + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has changed.
+   * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public com.google.firestore.v1.DocumentChange getDocumentChange() { + if (responseTypeCase_ == 3) { + return (com.google.firestore.v1.DocumentChange) responseType_; + } + return com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has changed.
+   * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public com.google.firestore.v1.DocumentChangeOrBuilder getDocumentChangeOrBuilder() { + if (responseTypeCase_ == 3) { + return (com.google.firestore.v1.DocumentChange) responseType_; + } + return com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } + + public static final int DOCUMENT_DELETE_FIELD_NUMBER = 4; + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been deleted.
+   * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public boolean hasDocumentDelete() { + return responseTypeCase_ == 4; + } + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been deleted.
+   * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public com.google.firestore.v1.DocumentDelete getDocumentDelete() { + if (responseTypeCase_ == 4) { + return (com.google.firestore.v1.DocumentDelete) responseType_; + } + return com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been deleted.
+   * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public com.google.firestore.v1.DocumentDeleteOrBuilder getDocumentDeleteOrBuilder() { + if (responseTypeCase_ == 4) { + return (com.google.firestore.v1.DocumentDelete) responseType_; + } + return com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } + + public static final int DOCUMENT_REMOVE_FIELD_NUMBER = 6; + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+   * relevant to that target).
+   * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public boolean hasDocumentRemove() { + return responseTypeCase_ == 6; + } + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+   * relevant to that target).
+   * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public com.google.firestore.v1.DocumentRemove getDocumentRemove() { + if (responseTypeCase_ == 6) { + return (com.google.firestore.v1.DocumentRemove) responseType_; + } + return com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+   * relevant to that target).
+   * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public com.google.firestore.v1.DocumentRemoveOrBuilder getDocumentRemoveOrBuilder() { + if (responseTypeCase_ == 6) { + return (com.google.firestore.v1.DocumentRemove) responseType_; + } + return com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } + + public static final int FILTER_FIELD_NUMBER = 5; + /** + * + * + *
+   * A filter to apply to the set of documents previously returned for the
+   * given target.
+   * Returned when documents may have been removed from the given target, but
+   * the exact documents are unknown.
+   * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public boolean hasFilter() { + return responseTypeCase_ == 5; + } + /** + * + * + *
+   * A filter to apply to the set of documents previously returned for the
+   * given target.
+   * Returned when documents may have been removed from the given target, but
+   * the exact documents are unknown.
+   * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public com.google.firestore.v1.ExistenceFilter getFilter() { + if (responseTypeCase_ == 5) { + return (com.google.firestore.v1.ExistenceFilter) responseType_; + } + return com.google.firestore.v1.ExistenceFilter.getDefaultInstance(); + } + /** + * + * + *
+   * A filter to apply to the set of documents previously returned for the
+   * given target.
+   * Returned when documents may have been removed from the given target, but
+   * the exact documents are unknown.
+   * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public com.google.firestore.v1.ExistenceFilterOrBuilder getFilterOrBuilder() { + if (responseTypeCase_ == 5) { + return (com.google.firestore.v1.ExistenceFilter) responseType_; + } + return com.google.firestore.v1.ExistenceFilter.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 (responseTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.TargetChange) responseType_); + } + if (responseTypeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.v1.DocumentChange) responseType_); + } + if (responseTypeCase_ == 4) { + output.writeMessage(4, (com.google.firestore.v1.DocumentDelete) responseType_); + } + if (responseTypeCase_ == 5) { + output.writeMessage(5, (com.google.firestore.v1.ExistenceFilter) responseType_); + } + if (responseTypeCase_ == 6) { + output.writeMessage(6, (com.google.firestore.v1.DocumentRemove) responseType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.TargetChange) responseType_); + } + if (responseTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.v1.DocumentChange) responseType_); + } + if (responseTypeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.firestore.v1.DocumentDelete) responseType_); + } + if (responseTypeCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.firestore.v1.ExistenceFilter) responseType_); + } + if (responseTypeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.firestore.v1.DocumentRemove) responseType_); + } + 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.v1.ListenResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.ListenResponse other = (com.google.firestore.v1.ListenResponse) obj; + + boolean result = true; + result = result && getResponseTypeCase().equals(other.getResponseTypeCase()); + if (!result) return false; + switch (responseTypeCase_) { + case 2: + result = result && getTargetChange().equals(other.getTargetChange()); + break; + case 3: + result = result && getDocumentChange().equals(other.getDocumentChange()); + break; + case 4: + result = result && getDocumentDelete().equals(other.getDocumentDelete()); + break; + case 6: + result = result && getDocumentRemove().equals(other.getDocumentRemove()); + break; + case 5: + result = result && getFilter().equals(other.getFilter()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (responseTypeCase_) { + case 2: + hash = (37 * hash) + TARGET_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + getTargetChange().hashCode(); + break; + case 3: + hash = (37 * hash) + DOCUMENT_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + getDocumentChange().hashCode(); + break; + case 4: + hash = (37 * hash) + DOCUMENT_DELETE_FIELD_NUMBER; + hash = (53 * hash) + getDocumentDelete().hashCode(); + break; + case 6: + hash = (37 * hash) + DOCUMENT_REMOVE_FIELD_NUMBER; + hash = (53 * hash) + getDocumentRemove().hashCode(); + break; + case 5: + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ListenResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListenResponse 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.v1.ListenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListenResponse 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.v1.ListenResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ListenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ListenResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListenResponse 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.v1.ListenResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListenResponse 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.v1.ListenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ListenResponse 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.v1.ListenResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [Firestore.Listen][google.firestore.v1.Firestore.Listen].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ListenResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ListenResponse) + com.google.firestore.v1.ListenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ListenResponse.class, + com.google.firestore.v1.ListenResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.ListenResponse.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(); + responseTypeCase_ = 0; + responseType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_ListenResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ListenResponse getDefaultInstanceForType() { + return com.google.firestore.v1.ListenResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ListenResponse build() { + com.google.firestore.v1.ListenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ListenResponse buildPartial() { + com.google.firestore.v1.ListenResponse result = + new com.google.firestore.v1.ListenResponse(this); + if (responseTypeCase_ == 2) { + if (targetChangeBuilder_ == null) { + result.responseType_ = responseType_; + } else { + result.responseType_ = targetChangeBuilder_.build(); + } + } + if (responseTypeCase_ == 3) { + if (documentChangeBuilder_ == null) { + result.responseType_ = responseType_; + } else { + result.responseType_ = documentChangeBuilder_.build(); + } + } + if (responseTypeCase_ == 4) { + if (documentDeleteBuilder_ == null) { + result.responseType_ = responseType_; + } else { + result.responseType_ = documentDeleteBuilder_.build(); + } + } + if (responseTypeCase_ == 6) { + if (documentRemoveBuilder_ == null) { + result.responseType_ = responseType_; + } else { + result.responseType_ = documentRemoveBuilder_.build(); + } + } + if (responseTypeCase_ == 5) { + if (filterBuilder_ == null) { + result.responseType_ = responseType_; + } else { + result.responseType_ = filterBuilder_.build(); + } + } + result.responseTypeCase_ = responseTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ListenResponse) { + return mergeFrom((com.google.firestore.v1.ListenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ListenResponse other) { + if (other == com.google.firestore.v1.ListenResponse.getDefaultInstance()) return this; + switch (other.getResponseTypeCase()) { + case TARGET_CHANGE: + { + mergeTargetChange(other.getTargetChange()); + break; + } + case DOCUMENT_CHANGE: + { + mergeDocumentChange(other.getDocumentChange()); + break; + } + case DOCUMENT_DELETE: + { + mergeDocumentDelete(other.getDocumentDelete()); + break; + } + case DOCUMENT_REMOVE: + { + mergeDocumentRemove(other.getDocumentRemove()); + break; + } + case FILTER: + { + mergeFilter(other.getFilter()); + break; + } + case RESPONSETYPE_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.v1.ListenResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.ListenResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int responseTypeCase_ = 0; + private java.lang.Object responseType_; + + public ResponseTypeCase getResponseTypeCase() { + return ResponseTypeCase.forNumber(responseTypeCase_); + } + + public Builder clearResponseType() { + responseTypeCase_ = 0; + responseType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TargetChange, + com.google.firestore.v1.TargetChange.Builder, + com.google.firestore.v1.TargetChangeOrBuilder> + targetChangeBuilder_; + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public boolean hasTargetChange() { + return responseTypeCase_ == 2; + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public com.google.firestore.v1.TargetChange getTargetChange() { + if (targetChangeBuilder_ == null) { + if (responseTypeCase_ == 2) { + return (com.google.firestore.v1.TargetChange) responseType_; + } + return com.google.firestore.v1.TargetChange.getDefaultInstance(); + } else { + if (responseTypeCase_ == 2) { + return targetChangeBuilder_.getMessage(); + } + return com.google.firestore.v1.TargetChange.getDefaultInstance(); + } + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public Builder setTargetChange(com.google.firestore.v1.TargetChange value) { + if (targetChangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseType_ = value; + onChanged(); + } else { + targetChangeBuilder_.setMessage(value); + } + responseTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public Builder setTargetChange(com.google.firestore.v1.TargetChange.Builder builderForValue) { + if (targetChangeBuilder_ == null) { + responseType_ = builderForValue.build(); + onChanged(); + } else { + targetChangeBuilder_.setMessage(builderForValue.build()); + } + responseTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public Builder mergeTargetChange(com.google.firestore.v1.TargetChange value) { + if (targetChangeBuilder_ == null) { + if (responseTypeCase_ == 2 + && responseType_ != com.google.firestore.v1.TargetChange.getDefaultInstance()) { + responseType_ = + com.google.firestore.v1.TargetChange.newBuilder( + (com.google.firestore.v1.TargetChange) responseType_) + .mergeFrom(value) + .buildPartial(); + } else { + responseType_ = value; + } + onChanged(); + } else { + if (responseTypeCase_ == 2) { + targetChangeBuilder_.mergeFrom(value); + } + targetChangeBuilder_.setMessage(value); + } + responseTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public Builder clearTargetChange() { + if (targetChangeBuilder_ == null) { + if (responseTypeCase_ == 2) { + responseTypeCase_ = 0; + responseType_ = null; + onChanged(); + } + } else { + if (responseTypeCase_ == 2) { + responseTypeCase_ = 0; + responseType_ = null; + } + targetChangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public com.google.firestore.v1.TargetChange.Builder getTargetChangeBuilder() { + return getTargetChangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + public com.google.firestore.v1.TargetChangeOrBuilder getTargetChangeOrBuilder() { + if ((responseTypeCase_ == 2) && (targetChangeBuilder_ != null)) { + return targetChangeBuilder_.getMessageOrBuilder(); + } else { + if (responseTypeCase_ == 2) { + return (com.google.firestore.v1.TargetChange) responseType_; + } + return com.google.firestore.v1.TargetChange.getDefaultInstance(); + } + } + /** + * + * + *
+     * Targets have changed.
+     * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TargetChange, + com.google.firestore.v1.TargetChange.Builder, + com.google.firestore.v1.TargetChangeOrBuilder> + getTargetChangeFieldBuilder() { + if (targetChangeBuilder_ == null) { + if (!(responseTypeCase_ == 2)) { + responseType_ = com.google.firestore.v1.TargetChange.getDefaultInstance(); + } + targetChangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TargetChange, + com.google.firestore.v1.TargetChange.Builder, + com.google.firestore.v1.TargetChangeOrBuilder>( + (com.google.firestore.v1.TargetChange) responseType_, + getParentForChildren(), + isClean()); + responseType_ = null; + } + responseTypeCase_ = 2; + onChanged(); + ; + return targetChangeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentChange, + com.google.firestore.v1.DocumentChange.Builder, + com.google.firestore.v1.DocumentChangeOrBuilder> + documentChangeBuilder_; + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public boolean hasDocumentChange() { + return responseTypeCase_ == 3; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public com.google.firestore.v1.DocumentChange getDocumentChange() { + if (documentChangeBuilder_ == null) { + if (responseTypeCase_ == 3) { + return (com.google.firestore.v1.DocumentChange) responseType_; + } + return com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } else { + if (responseTypeCase_ == 3) { + return documentChangeBuilder_.getMessage(); + } + return com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public Builder setDocumentChange(com.google.firestore.v1.DocumentChange value) { + if (documentChangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseType_ = value; + onChanged(); + } else { + documentChangeBuilder_.setMessage(value); + } + responseTypeCase_ = 3; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public Builder setDocumentChange( + com.google.firestore.v1.DocumentChange.Builder builderForValue) { + if (documentChangeBuilder_ == null) { + responseType_ = builderForValue.build(); + onChanged(); + } else { + documentChangeBuilder_.setMessage(builderForValue.build()); + } + responseTypeCase_ = 3; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public Builder mergeDocumentChange(com.google.firestore.v1.DocumentChange value) { + if (documentChangeBuilder_ == null) { + if (responseTypeCase_ == 3 + && responseType_ != com.google.firestore.v1.DocumentChange.getDefaultInstance()) { + responseType_ = + com.google.firestore.v1.DocumentChange.newBuilder( + (com.google.firestore.v1.DocumentChange) responseType_) + .mergeFrom(value) + .buildPartial(); + } else { + responseType_ = value; + } + onChanged(); + } else { + if (responseTypeCase_ == 3) { + documentChangeBuilder_.mergeFrom(value); + } + documentChangeBuilder_.setMessage(value); + } + responseTypeCase_ = 3; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public Builder clearDocumentChange() { + if (documentChangeBuilder_ == null) { + if (responseTypeCase_ == 3) { + responseTypeCase_ = 0; + responseType_ = null; + onChanged(); + } + } else { + if (responseTypeCase_ == 3) { + responseTypeCase_ = 0; + responseType_ = null; + } + documentChangeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public com.google.firestore.v1.DocumentChange.Builder getDocumentChangeBuilder() { + return getDocumentChangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + public com.google.firestore.v1.DocumentChangeOrBuilder getDocumentChangeOrBuilder() { + if ((responseTypeCase_ == 3) && (documentChangeBuilder_ != null)) { + return documentChangeBuilder_.getMessageOrBuilder(); + } else { + if (responseTypeCase_ == 3) { + return (com.google.firestore.v1.DocumentChange) responseType_; + } + return com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has changed.
+     * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentChange, + com.google.firestore.v1.DocumentChange.Builder, + com.google.firestore.v1.DocumentChangeOrBuilder> + getDocumentChangeFieldBuilder() { + if (documentChangeBuilder_ == null) { + if (!(responseTypeCase_ == 3)) { + responseType_ = com.google.firestore.v1.DocumentChange.getDefaultInstance(); + } + documentChangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentChange, + com.google.firestore.v1.DocumentChange.Builder, + com.google.firestore.v1.DocumentChangeOrBuilder>( + (com.google.firestore.v1.DocumentChange) responseType_, + getParentForChildren(), + isClean()); + responseType_ = null; + } + responseTypeCase_ = 3; + onChanged(); + ; + return documentChangeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentDelete, + com.google.firestore.v1.DocumentDelete.Builder, + com.google.firestore.v1.DocumentDeleteOrBuilder> + documentDeleteBuilder_; + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public boolean hasDocumentDelete() { + return responseTypeCase_ == 4; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public com.google.firestore.v1.DocumentDelete getDocumentDelete() { + if (documentDeleteBuilder_ == null) { + if (responseTypeCase_ == 4) { + return (com.google.firestore.v1.DocumentDelete) responseType_; + } + return com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } else { + if (responseTypeCase_ == 4) { + return documentDeleteBuilder_.getMessage(); + } + return com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public Builder setDocumentDelete(com.google.firestore.v1.DocumentDelete value) { + if (documentDeleteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseType_ = value; + onChanged(); + } else { + documentDeleteBuilder_.setMessage(value); + } + responseTypeCase_ = 4; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public Builder setDocumentDelete( + com.google.firestore.v1.DocumentDelete.Builder builderForValue) { + if (documentDeleteBuilder_ == null) { + responseType_ = builderForValue.build(); + onChanged(); + } else { + documentDeleteBuilder_.setMessage(builderForValue.build()); + } + responseTypeCase_ = 4; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public Builder mergeDocumentDelete(com.google.firestore.v1.DocumentDelete value) { + if (documentDeleteBuilder_ == null) { + if (responseTypeCase_ == 4 + && responseType_ != com.google.firestore.v1.DocumentDelete.getDefaultInstance()) { + responseType_ = + com.google.firestore.v1.DocumentDelete.newBuilder( + (com.google.firestore.v1.DocumentDelete) responseType_) + .mergeFrom(value) + .buildPartial(); + } else { + responseType_ = value; + } + onChanged(); + } else { + if (responseTypeCase_ == 4) { + documentDeleteBuilder_.mergeFrom(value); + } + documentDeleteBuilder_.setMessage(value); + } + responseTypeCase_ = 4; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public Builder clearDocumentDelete() { + if (documentDeleteBuilder_ == null) { + if (responseTypeCase_ == 4) { + responseTypeCase_ = 0; + responseType_ = null; + onChanged(); + } + } else { + if (responseTypeCase_ == 4) { + responseTypeCase_ = 0; + responseType_ = null; + } + documentDeleteBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public com.google.firestore.v1.DocumentDelete.Builder getDocumentDeleteBuilder() { + return getDocumentDeleteFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + public com.google.firestore.v1.DocumentDeleteOrBuilder getDocumentDeleteOrBuilder() { + if ((responseTypeCase_ == 4) && (documentDeleteBuilder_ != null)) { + return documentDeleteBuilder_.getMessageOrBuilder(); + } else { + if (responseTypeCase_ == 4) { + return (com.google.firestore.v1.DocumentDelete) responseType_; + } + return com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been deleted.
+     * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentDelete, + com.google.firestore.v1.DocumentDelete.Builder, + com.google.firestore.v1.DocumentDeleteOrBuilder> + getDocumentDeleteFieldBuilder() { + if (documentDeleteBuilder_ == null) { + if (!(responseTypeCase_ == 4)) { + responseType_ = com.google.firestore.v1.DocumentDelete.getDefaultInstance(); + } + documentDeleteBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentDelete, + com.google.firestore.v1.DocumentDelete.Builder, + com.google.firestore.v1.DocumentDeleteOrBuilder>( + (com.google.firestore.v1.DocumentDelete) responseType_, + getParentForChildren(), + isClean()); + responseType_ = null; + } + responseTypeCase_ = 4; + onChanged(); + ; + return documentDeleteBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentRemove, + com.google.firestore.v1.DocumentRemove.Builder, + com.google.firestore.v1.DocumentRemoveOrBuilder> + documentRemoveBuilder_; + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public boolean hasDocumentRemove() { + return responseTypeCase_ == 6; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public com.google.firestore.v1.DocumentRemove getDocumentRemove() { + if (documentRemoveBuilder_ == null) { + if (responseTypeCase_ == 6) { + return (com.google.firestore.v1.DocumentRemove) responseType_; + } + return com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } else { + if (responseTypeCase_ == 6) { + return documentRemoveBuilder_.getMessage(); + } + return com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public Builder setDocumentRemove(com.google.firestore.v1.DocumentRemove value) { + if (documentRemoveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseType_ = value; + onChanged(); + } else { + documentRemoveBuilder_.setMessage(value); + } + responseTypeCase_ = 6; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public Builder setDocumentRemove( + com.google.firestore.v1.DocumentRemove.Builder builderForValue) { + if (documentRemoveBuilder_ == null) { + responseType_ = builderForValue.build(); + onChanged(); + } else { + documentRemoveBuilder_.setMessage(builderForValue.build()); + } + responseTypeCase_ = 6; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public Builder mergeDocumentRemove(com.google.firestore.v1.DocumentRemove value) { + if (documentRemoveBuilder_ == null) { + if (responseTypeCase_ == 6 + && responseType_ != com.google.firestore.v1.DocumentRemove.getDefaultInstance()) { + responseType_ = + com.google.firestore.v1.DocumentRemove.newBuilder( + (com.google.firestore.v1.DocumentRemove) responseType_) + .mergeFrom(value) + .buildPartial(); + } else { + responseType_ = value; + } + onChanged(); + } else { + if (responseTypeCase_ == 6) { + documentRemoveBuilder_.mergeFrom(value); + } + documentRemoveBuilder_.setMessage(value); + } + responseTypeCase_ = 6; + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public Builder clearDocumentRemove() { + if (documentRemoveBuilder_ == null) { + if (responseTypeCase_ == 6) { + responseTypeCase_ = 0; + responseType_ = null; + onChanged(); + } + } else { + if (responseTypeCase_ == 6) { + responseTypeCase_ = 0; + responseType_ = null; + } + documentRemoveBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public com.google.firestore.v1.DocumentRemove.Builder getDocumentRemoveBuilder() { + return getDocumentRemoveFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + public com.google.firestore.v1.DocumentRemoveOrBuilder getDocumentRemoveOrBuilder() { + if ((responseTypeCase_ == 6) && (documentRemoveBuilder_ != null)) { + return documentRemoveBuilder_.getMessageOrBuilder(); + } else { + if (responseTypeCase_ == 6) { + return (com.google.firestore.v1.DocumentRemove) responseType_; + } + return com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } + } + /** + * + * + *
+     * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+     * relevant to that target).
+     * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentRemove, + com.google.firestore.v1.DocumentRemove.Builder, + com.google.firestore.v1.DocumentRemoveOrBuilder> + getDocumentRemoveFieldBuilder() { + if (documentRemoveBuilder_ == null) { + if (!(responseTypeCase_ == 6)) { + responseType_ = com.google.firestore.v1.DocumentRemove.getDefaultInstance(); + } + documentRemoveBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentRemove, + com.google.firestore.v1.DocumentRemove.Builder, + com.google.firestore.v1.DocumentRemoveOrBuilder>( + (com.google.firestore.v1.DocumentRemove) responseType_, + getParentForChildren(), + isClean()); + responseType_ = null; + } + responseTypeCase_ = 6; + onChanged(); + ; + return documentRemoveBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExistenceFilter, + com.google.firestore.v1.ExistenceFilter.Builder, + com.google.firestore.v1.ExistenceFilterOrBuilder> + filterBuilder_; + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public boolean hasFilter() { + return responseTypeCase_ == 5; + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public com.google.firestore.v1.ExistenceFilter getFilter() { + if (filterBuilder_ == null) { + if (responseTypeCase_ == 5) { + return (com.google.firestore.v1.ExistenceFilter) responseType_; + } + return com.google.firestore.v1.ExistenceFilter.getDefaultInstance(); + } else { + if (responseTypeCase_ == 5) { + return filterBuilder_.getMessage(); + } + return com.google.firestore.v1.ExistenceFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public Builder setFilter(com.google.firestore.v1.ExistenceFilter value) { + if (filterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseType_ = value; + onChanged(); + } else { + filterBuilder_.setMessage(value); + } + responseTypeCase_ = 5; + return this; + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public Builder setFilter(com.google.firestore.v1.ExistenceFilter.Builder builderForValue) { + if (filterBuilder_ == null) { + responseType_ = builderForValue.build(); + onChanged(); + } else { + filterBuilder_.setMessage(builderForValue.build()); + } + responseTypeCase_ = 5; + return this; + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public Builder mergeFilter(com.google.firestore.v1.ExistenceFilter value) { + if (filterBuilder_ == null) { + if (responseTypeCase_ == 5 + && responseType_ != com.google.firestore.v1.ExistenceFilter.getDefaultInstance()) { + responseType_ = + com.google.firestore.v1.ExistenceFilter.newBuilder( + (com.google.firestore.v1.ExistenceFilter) responseType_) + .mergeFrom(value) + .buildPartial(); + } else { + responseType_ = value; + } + onChanged(); + } else { + if (responseTypeCase_ == 5) { + filterBuilder_.mergeFrom(value); + } + filterBuilder_.setMessage(value); + } + responseTypeCase_ = 5; + return this; + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public Builder clearFilter() { + if (filterBuilder_ == null) { + if (responseTypeCase_ == 5) { + responseTypeCase_ = 0; + responseType_ = null; + onChanged(); + } + } else { + if (responseTypeCase_ == 5) { + responseTypeCase_ = 0; + responseType_ = null; + } + filterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public com.google.firestore.v1.ExistenceFilter.Builder getFilterBuilder() { + return getFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + public com.google.firestore.v1.ExistenceFilterOrBuilder getFilterOrBuilder() { + if ((responseTypeCase_ == 5) && (filterBuilder_ != null)) { + return filterBuilder_.getMessageOrBuilder(); + } else { + if (responseTypeCase_ == 5) { + return (com.google.firestore.v1.ExistenceFilter) responseType_; + } + return com.google.firestore.v1.ExistenceFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * A filter to apply to the set of documents previously returned for the
+     * given target.
+     * Returned when documents may have been removed from the given target, but
+     * the exact documents are unknown.
+     * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExistenceFilter, + com.google.firestore.v1.ExistenceFilter.Builder, + com.google.firestore.v1.ExistenceFilterOrBuilder> + getFilterFieldBuilder() { + if (filterBuilder_ == null) { + if (!(responseTypeCase_ == 5)) { + responseType_ = com.google.firestore.v1.ExistenceFilter.getDefaultInstance(); + } + filterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExistenceFilter, + com.google.firestore.v1.ExistenceFilter.Builder, + com.google.firestore.v1.ExistenceFilterOrBuilder>( + (com.google.firestore.v1.ExistenceFilter) responseType_, + getParentForChildren(), + isClean()); + responseType_ = null; + } + responseTypeCase_ = 5; + onChanged(); + ; + return filterBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ListenResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ListenResponse) + private static final com.google.firestore.v1.ListenResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ListenResponse(); + } + + public static com.google.firestore.v1.ListenResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListenResponse(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.v1.ListenResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponseOrBuilder.java new file mode 100644 index 000000000000..3394cb55ed53 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ListenResponseOrBuilder.java @@ -0,0 +1,179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface ListenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ListenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Targets have changed.
+   * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + boolean hasTargetChange(); + /** + * + * + *
+   * Targets have changed.
+   * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + com.google.firestore.v1.TargetChange getTargetChange(); + /** + * + * + *
+   * Targets have changed.
+   * 
+ * + * .google.firestore.v1.TargetChange target_change = 2; + */ + com.google.firestore.v1.TargetChangeOrBuilder getTargetChangeOrBuilder(); + + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has changed.
+   * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + boolean hasDocumentChange(); + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has changed.
+   * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + com.google.firestore.v1.DocumentChange getDocumentChange(); + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has changed.
+   * 
+ * + * .google.firestore.v1.DocumentChange document_change = 3; + */ + com.google.firestore.v1.DocumentChangeOrBuilder getDocumentChangeOrBuilder(); + + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been deleted.
+   * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + boolean hasDocumentDelete(); + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been deleted.
+   * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + com.google.firestore.v1.DocumentDelete getDocumentDelete(); + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been deleted.
+   * 
+ * + * .google.firestore.v1.DocumentDelete document_delete = 4; + */ + com.google.firestore.v1.DocumentDeleteOrBuilder getDocumentDeleteOrBuilder(); + + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+   * relevant to that target).
+   * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + boolean hasDocumentRemove(); + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+   * relevant to that target).
+   * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + com.google.firestore.v1.DocumentRemove getDocumentRemove(); + /** + * + * + *
+   * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer
+   * relevant to that target).
+   * 
+ * + * .google.firestore.v1.DocumentRemove document_remove = 6; + */ + com.google.firestore.v1.DocumentRemoveOrBuilder getDocumentRemoveOrBuilder(); + + /** + * + * + *
+   * A filter to apply to the set of documents previously returned for the
+   * given target.
+   * Returned when documents may have been removed from the given target, but
+   * the exact documents are unknown.
+   * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + boolean hasFilter(); + /** + * + * + *
+   * A filter to apply to the set of documents previously returned for the
+   * given target.
+   * Returned when documents may have been removed from the given target, but
+   * the exact documents are unknown.
+   * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + com.google.firestore.v1.ExistenceFilter getFilter(); + /** + * + * + *
+   * A filter to apply to the set of documents previously returned for the
+   * given target.
+   * Returned when documents may have been removed from the given target, but
+   * the exact documents are unknown.
+   * 
+ * + * .google.firestore.v1.ExistenceFilter filter = 5; + */ + com.google.firestore.v1.ExistenceFilterOrBuilder getFilterOrBuilder(); + + public com.google.firestore.v1.ListenResponse.ResponseTypeCase getResponseTypeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValue.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValue.java new file mode 100644 index 000000000000..b80d3d47e6f8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValue.java @@ -0,0 +1,800 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A map value.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.MapValue} + */ +public final class MapValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.MapValue) + MapValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use MapValue.newBuilder() to construct. + private MapValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MapValue() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MapValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + fields_ = + com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + fields__ = + input.readMessage( + FieldsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + fields_.getMutableMap().put(fields__.getKey(), fields__.getValue()); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.DocumentProto + .internal_static_google_firestore_v1_MapValue_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_MapValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.MapValue.class, com.google.firestore.v1.MapValue.Builder.class); + } + + public static final int FIELDS_FIELD_NUMBER = 1; + + private static final class FieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_MapValue_FieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.firestore.v1.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField fields_; + + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField(FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public boolean containsFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetFields().getMap().containsKey(key); + } + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public java.util.Map getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public com.google.firestore.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.firestore.v1.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public com.google.firestore.v1.Value getFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetFields(), FieldsDefaultEntryHolder.defaultEntry, 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetFields().getMap().entrySet()) { + com.google.protobuf.MapEntry fields__ = + FieldsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, fields__); + } + 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.v1.MapValue)) { + return super.equals(obj); + } + com.google.firestore.v1.MapValue other = (com.google.firestore.v1.MapValue) obj; + + boolean result = true; + result = result && internalGetFields().equals(other.internalGetFields()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFields().getMap().isEmpty()) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetFields().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.MapValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.MapValue 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.v1.MapValue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.MapValue 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.v1.MapValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.MapValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.MapValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.MapValue 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.v1.MapValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.MapValue 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.v1.MapValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.MapValue 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.v1.MapValue 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 map value.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.MapValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.MapValue) + com.google.firestore.v1.MapValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_MapValue_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableFields(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_MapValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.MapValue.class, + com.google.firestore.v1.MapValue.Builder.class); + } + + // Construct using com.google.firestore.v1.MapValue.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(); + internalGetMutableFields().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_MapValue_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.MapValue getDefaultInstanceForType() { + return com.google.firestore.v1.MapValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.MapValue build() { + com.google.firestore.v1.MapValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.MapValue buildPartial() { + com.google.firestore.v1.MapValue result = new com.google.firestore.v1.MapValue(this); + int from_bitField0_ = bitField0_; + result.fields_ = internalGetFields(); + result.fields_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.MapValue) { + return mergeFrom((com.google.firestore.v1.MapValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.MapValue other) { + if (other == com.google.firestore.v1.MapValue.getDefaultInstance()) return this; + internalGetMutableFields().mergeFrom(other.internalGetFields()); + 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.v1.MapValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.MapValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField fields_; + + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField(FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + + private com.google.protobuf.MapField + internalGetMutableFields() { + onChanged(); + ; + if (fields_ == null) { + fields_ = com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry); + } + if (!fields_.isMutable()) { + fields_ = fields_.copy(); + } + return fields_; + } + + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public boolean containsFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetFields().getMap().containsKey(key); + } + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public java.util.Map getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public com.google.firestore.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.firestore.v1.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public com.google.firestore.v1.Value getFieldsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetFields().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFields() { + internalGetMutableFields().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public Builder removeFields(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableFields().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableFields() { + return internalGetMutableFields().getMutableMap(); + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public Builder putFields(java.lang.String key, com.google.firestore.v1.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableFields().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The map's fields.
+     * The map keys represent field names. Field names matching the regular
+     * expression `__.*__` are reserved. Reserved field names are forbidden except
+     * in certain documented contexts. The map keys, represented as UTF-8, must
+     * not exceed 1,500 bytes and cannot be empty.
+     * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + public Builder putAllFields( + java.util.Map values) { + internalGetMutableFields().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.MapValue) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.MapValue) + private static final com.google.firestore.v1.MapValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.MapValue(); + } + + public static com.google.firestore.v1.MapValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MapValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MapValue(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.v1.MapValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValueOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValueOrBuilder.java new file mode 100644 index 000000000000..755000e2d83b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/MapValueOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +public interface MapValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.MapValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + int getFieldsCount(); + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + boolean containsFields(java.lang.String key); + /** Use {@link #getFieldsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getFields(); + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + java.util.Map getFieldsMap(); + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + com.google.firestore.v1.Value getFieldsOrDefault( + java.lang.String key, com.google.firestore.v1.Value defaultValue); + /** + * + * + *
+   * The map's fields.
+   * The map keys represent field names. Field names matching the regular
+   * expression `__.*__` are reserved. Reserved field names are forbidden except
+   * in certain documented contexts. The map keys, represented as UTF-8, must
+   * not exceed 1,500 bytes and cannot be empty.
+   * 
+ * + * map<string, .google.firestore.v1.Value> fields = 1; + */ + com.google.firestore.v1.Value getFieldsOrThrow(java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Precondition.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Precondition.java new file mode 100644 index 000000000000..488b6dabba89 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Precondition.java @@ -0,0 +1,900 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A precondition on a document, used for conditional operations.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.Precondition} + */ +public final class Precondition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Precondition) + PreconditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Precondition.newBuilder() to construct. + private Precondition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Precondition() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Precondition( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + conditionTypeCase_ = 1; + conditionType_ = input.readBool(); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (conditionTypeCase_ == 2) { + subBuilder = ((com.google.protobuf.Timestamp) conditionType_).toBuilder(); + } + conditionType_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) conditionType_); + conditionType_ = subBuilder.buildPartial(); + } + conditionTypeCase_ = 2; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.CommonProto + .internal_static_google_firestore_v1_Precondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_Precondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Precondition.class, + com.google.firestore.v1.Precondition.Builder.class); + } + + private int conditionTypeCase_ = 0; + private java.lang.Object conditionType_; + + public enum ConditionTypeCase implements com.google.protobuf.Internal.EnumLite { + EXISTS(1), + UPDATE_TIME(2), + CONDITIONTYPE_NOT_SET(0); + private final int value; + + private ConditionTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ConditionTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ConditionTypeCase forNumber(int value) { + switch (value) { + case 1: + return EXISTS; + case 2: + return UPDATE_TIME; + case 0: + return CONDITIONTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConditionTypeCase getConditionTypeCase() { + return ConditionTypeCase.forNumber(conditionTypeCase_); + } + + public static final int EXISTS_FIELD_NUMBER = 1; + /** + * + * + *
+   * When set to `true`, the target document must exist.
+   * When set to `false`, the target document must not exist.
+   * 
+ * + * bool exists = 1; + */ + public boolean getExists() { + if (conditionTypeCase_ == 1) { + return (java.lang.Boolean) conditionType_; + } + return false; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 2; + /** + * + * + *
+   * When set, the target document must exist and have been last updated at
+   * that time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public boolean hasUpdateTime() { + return conditionTypeCase_ == 2; + } + /** + * + * + *
+   * When set, the target document must exist and have been last updated at
+   * that time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (conditionTypeCase_ == 2) { + return (com.google.protobuf.Timestamp) conditionType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * When set, the target document must exist and have been last updated at
+   * that time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (conditionTypeCase_ == 2) { + return (com.google.protobuf.Timestamp) conditionType_; + } + return com.google.protobuf.Timestamp.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 (conditionTypeCase_ == 1) { + output.writeBool(1, (boolean) ((java.lang.Boolean) conditionType_)); + } + if (conditionTypeCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Timestamp) conditionType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (conditionTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 1, (boolean) ((java.lang.Boolean) conditionType_)); + } + if (conditionTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Timestamp) conditionType_); + } + 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.v1.Precondition)) { + return super.equals(obj); + } + com.google.firestore.v1.Precondition other = (com.google.firestore.v1.Precondition) obj; + + boolean result = true; + result = result && getConditionTypeCase().equals(other.getConditionTypeCase()); + if (!result) return false; + switch (conditionTypeCase_) { + case 1: + result = result && (getExists() == other.getExists()); + break; + case 2: + result = result && getUpdateTime().equals(other.getUpdateTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (conditionTypeCase_) { + case 1: + hash = (37 * hash) + EXISTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExists()); + break; + case 2: + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Precondition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Precondition 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.v1.Precondition parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Precondition 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.v1.Precondition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Precondition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Precondition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Precondition 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.v1.Precondition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Precondition 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.v1.Precondition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Precondition 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.v1.Precondition 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 precondition on a document, used for conditional operations.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Precondition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Precondition) + com.google.firestore.v1.PreconditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_Precondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_Precondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Precondition.class, + com.google.firestore.v1.Precondition.Builder.class); + } + + // Construct using com.google.firestore.v1.Precondition.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(); + conditionTypeCase_ = 0; + conditionType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_Precondition_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Precondition getDefaultInstanceForType() { + return com.google.firestore.v1.Precondition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Precondition build() { + com.google.firestore.v1.Precondition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Precondition buildPartial() { + com.google.firestore.v1.Precondition result = new com.google.firestore.v1.Precondition(this); + if (conditionTypeCase_ == 1) { + result.conditionType_ = conditionType_; + } + if (conditionTypeCase_ == 2) { + if (updateTimeBuilder_ == null) { + result.conditionType_ = conditionType_; + } else { + result.conditionType_ = updateTimeBuilder_.build(); + } + } + result.conditionTypeCase_ = conditionTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Precondition) { + return mergeFrom((com.google.firestore.v1.Precondition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Precondition other) { + if (other == com.google.firestore.v1.Precondition.getDefaultInstance()) return this; + switch (other.getConditionTypeCase()) { + case EXISTS: + { + setExists(other.getExists()); + break; + } + case UPDATE_TIME: + { + mergeUpdateTime(other.getUpdateTime()); + break; + } + case CONDITIONTYPE_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.v1.Precondition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Precondition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int conditionTypeCase_ = 0; + private java.lang.Object conditionType_; + + public ConditionTypeCase getConditionTypeCase() { + return ConditionTypeCase.forNumber(conditionTypeCase_); + } + + public Builder clearConditionType() { + conditionTypeCase_ = 0; + conditionType_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * When set to `true`, the target document must exist.
+     * When set to `false`, the target document must not exist.
+     * 
+ * + * bool exists = 1; + */ + public boolean getExists() { + if (conditionTypeCase_ == 1) { + return (java.lang.Boolean) conditionType_; + } + return false; + } + /** + * + * + *
+     * When set to `true`, the target document must exist.
+     * When set to `false`, the target document must not exist.
+     * 
+ * + * bool exists = 1; + */ + public Builder setExists(boolean value) { + conditionTypeCase_ = 1; + conditionType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * When set to `true`, the target document must exist.
+     * When set to `false`, the target document must not exist.
+     * 
+ * + * bool exists = 1; + */ + public Builder clearExists() { + if (conditionTypeCase_ == 1) { + conditionTypeCase_ = 0; + conditionType_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public boolean hasUpdateTime() { + return conditionTypeCase_ == 2; + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + if (conditionTypeCase_ == 2) { + return (com.google.protobuf.Timestamp) conditionType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (conditionTypeCase_ == 2) { + return updateTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conditionType_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + conditionTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + conditionType_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + conditionTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (conditionTypeCase_ == 2 + && conditionType_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + conditionType_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) conditionType_) + .mergeFrom(value) + .buildPartial(); + } else { + conditionType_ = value; + } + onChanged(); + } else { + if (conditionTypeCase_ == 2) { + updateTimeBuilder_.mergeFrom(value); + } + updateTimeBuilder_.setMessage(value); + } + conditionTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + if (conditionTypeCase_ == 2) { + conditionTypeCase_ = 0; + conditionType_ = null; + onChanged(); + } + } else { + if (conditionTypeCase_ == 2) { + conditionTypeCase_ = 0; + conditionType_ = null; + } + updateTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if ((conditionTypeCase_ == 2) && (updateTimeBuilder_ != null)) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + if (conditionTypeCase_ == 2) { + return (com.google.protobuf.Timestamp) conditionType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * When set, the target document must exist and have been last updated at
+     * that time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + if (!(conditionTypeCase_ == 2)) { + conditionType_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) conditionType_, getParentForChildren(), isClean()); + conditionType_ = null; + } + conditionTypeCase_ = 2; + onChanged(); + ; + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Precondition) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Precondition) + private static final com.google.firestore.v1.Precondition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Precondition(); + } + + public static com.google.firestore.v1.Precondition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Precondition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Precondition(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.v1.Precondition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PreconditionOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PreconditionOrBuilder.java new file mode 100644 index 000000000000..ffcfbc9f462e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PreconditionOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +public interface PreconditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Precondition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * When set to `true`, the target document must exist.
+   * When set to `false`, the target document must not exist.
+   * 
+ * + * bool exists = 1; + */ + boolean getExists(); + + /** + * + * + *
+   * When set, the target document must exist and have been last updated at
+   * that time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * When set, the target document must exist and have been last updated at
+   * that time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * When set, the target document must exist and have been last updated at
+   * that time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + public com.google.firestore.v1.Precondition.ConditionTypeCase getConditionTypeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProto.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProto.java new file mode 100644 index 000000000000..bc3c06b1ada8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProto.java @@ -0,0 +1,225 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query.proto + +package com.google.firestore.v1; + +public final class QueryProto { + private QueryProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_Filter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_Filter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_FieldFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_FieldFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_Order_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_Order_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_FieldReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_FieldReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_StructuredQuery_Projection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_StructuredQuery_Projection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Cursor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Cursor_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\037google/firestore/v1/query.proto\022\023googl" + + "e.firestore.v1\032\034google/api/annotations.p" + + "roto\032\"google/firestore/v1/document.proto" + + "\032\036google/protobuf/wrappers.proto\"\332\016\n\017Str" + + "ucturedQuery\022?\n\006select\030\001 \001(\0132/.google.fi" + + "restore.v1.StructuredQuery.Projection\022E\n" + + "\004from\030\002 \003(\01327.google.firestore.v1.Struct" + + "uredQuery.CollectionSelector\022:\n\005where\030\003 " + + "\001(\0132+.google.firestore.v1.StructuredQuer" + + "y.Filter\022<\n\010order_by\030\004 \003(\0132*.google.fire" + + "store.v1.StructuredQuery.Order\022-\n\010start_" + + "at\030\007 \001(\0132\033.google.firestore.v1.Cursor\022+\n" + + "\006end_at\030\010 \001(\0132\033.google.firestore.v1.Curs" + + "or\022\016\n\006offset\030\006 \001(\005\022*\n\005limit\030\005 \001(\0132\033.goog" + + "le.protobuf.Int32Value\032D\n\022CollectionSele" + + "ctor\022\025\n\rcollection_id\030\002 \001(\t\022\027\n\017all_desce" + + "ndants\030\003 \001(\010\032\375\001\n\006Filter\022P\n\020composite_fil" + + "ter\030\001 \001(\01324.google.firestore.v1.Structur" + + "edQuery.CompositeFilterH\000\022H\n\014field_filte" + + "r\030\002 \001(\01320.google.firestore.v1.Structured" + + "Query.FieldFilterH\000\022H\n\014unary_filter\030\003 \001(" + + "\01320.google.firestore.v1.StructuredQuery." + + "UnaryFilterH\000B\r\n\013filter_type\032\311\001\n\017Composi" + + "teFilter\022I\n\002op\030\001 \001(\0162=.google.firestore." + + "v1.StructuredQuery.CompositeFilter.Opera" + + "tor\022<\n\007filters\030\002 \003(\0132+.google.firestore." + + "v1.StructuredQuery.Filter\"-\n\010Operator\022\030\n" + + "\024OPERATOR_UNSPECIFIED\020\000\022\007\n\003AND\020\001\032\335\002\n\013Fie" + + "ldFilter\022B\n\005field\030\001 \001(\01323.google.firesto" + + "re.v1.StructuredQuery.FieldReference\022E\n\002" + + "op\030\002 \001(\01629.google.firestore.v1.Structure" + + "dQuery.FieldFilter.Operator\022)\n\005value\030\003 \001" + + "(\0132\032.google.firestore.v1.Value\"\227\001\n\010Opera" + + "tor\022\030\n\024OPERATOR_UNSPECIFIED\020\000\022\r\n\tLESS_TH" + + "AN\020\001\022\026\n\022LESS_THAN_OR_EQUAL\020\002\022\020\n\014GREATER_" + + "THAN\020\003\022\031\n\025GREATER_THAN_OR_EQUAL\020\004\022\t\n\005EQU" + + "AL\020\005\022\022\n\016ARRAY_CONTAINS\020\007\032\351\001\n\013UnaryFilter" + + "\022E\n\002op\030\001 \001(\01629.google.firestore.v1.Struc" + + "turedQuery.UnaryFilter.Operator\022D\n\005field" + + "\030\002 \001(\01323.google.firestore.v1.StructuredQ" + + "uery.FieldReferenceH\000\"=\n\010Operator\022\030\n\024OPE" + + "RATOR_UNSPECIFIED\020\000\022\n\n\006IS_NAN\020\002\022\013\n\007IS_NU" + + "LL\020\003B\016\n\014operand_type\032\216\001\n\005Order\022B\n\005field\030" + + "\001 \001(\01323.google.firestore.v1.StructuredQu" + + "ery.FieldReference\022A\n\tdirection\030\002 \001(\0162.." + + "google.firestore.v1.StructuredQuery.Dire" + + "ction\032$\n\016FieldReference\022\022\n\nfield_path\030\002 " + + "\001(\t\032Q\n\nProjection\022C\n\006fields\030\002 \003(\01323.goog" + + "le.firestore.v1.StructuredQuery.FieldRef" + + "erence\"E\n\tDirection\022\031\n\025DIRECTION_UNSPECI" + + "FIED\020\000\022\r\n\tASCENDING\020\001\022\016\n\nDESCENDING\020\002\"D\n" + + "\006Cursor\022*\n\006values\030\001 \003(\0132\032.google.firesto" + + "re.v1.Value\022\016\n\006before\030\002 \001(\010B\244\001\n\027com.goog" + + "le.firestore.v1B\nQueryProtoP\001Z + * The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback]. + * + * + * Protobuf type {@code google.firestore.v1.RollbackRequest} + */ +public final class RollbackRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.RollbackRequest) + RollbackRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RollbackRequest.newBuilder() to construct. + private RollbackRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RollbackRequest() { + database_ = ""; + transaction_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RollbackRequest( + 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(); + + database_ = s; + break; + } + case 18: + { + transaction_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_RollbackRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RollbackRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.RollbackRequest.class, + com.google.firestore.v1.RollbackRequest.Builder.class); + } + + public static final int DATABASE_FIELD_NUMBER = 1; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + 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(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSACTION_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString transaction_; + /** + * + * + *
+   * The transaction to roll back.
+   * 
+ * + * bytes transaction = 2; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + + 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 (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + if (!transaction_.isEmpty()) { + output.writeBytes(2, transaction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + if (!transaction_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, transaction_); + } + 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.v1.RollbackRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.RollbackRequest other = (com.google.firestore.v1.RollbackRequest) obj; + + boolean result = true; + result = result && getDatabase().equals(other.getDatabase()); + result = result && getTransaction().equals(other.getTransaction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.RollbackRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RollbackRequest 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.v1.RollbackRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RollbackRequest 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.v1.RollbackRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RollbackRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.RollbackRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RollbackRequest 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.v1.RollbackRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RollbackRequest 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.v1.RollbackRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RollbackRequest 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.v1.RollbackRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.RollbackRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.RollbackRequest) + com.google.firestore.v1.RollbackRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RollbackRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RollbackRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.RollbackRequest.class, + com.google.firestore.v1.RollbackRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.RollbackRequest.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(); + database_ = ""; + + transaction_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RollbackRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.RollbackRequest getDefaultInstanceForType() { + return com.google.firestore.v1.RollbackRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.RollbackRequest build() { + com.google.firestore.v1.RollbackRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.RollbackRequest buildPartial() { + com.google.firestore.v1.RollbackRequest result = + new com.google.firestore.v1.RollbackRequest(this); + result.database_ = database_; + result.transaction_ = transaction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.RollbackRequest) { + return mergeFrom((com.google.firestore.v1.RollbackRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.RollbackRequest other) { + if (other == com.google.firestore.v1.RollbackRequest.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { + setTransaction(other.getTransaction()); + } + 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.v1.RollbackRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.RollbackRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString transaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The transaction to roll back.
+     * 
+ * + * bytes transaction = 2; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + /** + * + * + *
+     * The transaction to roll back.
+     * 
+ * + * bytes transaction = 2; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + transaction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction to roll back.
+     * 
+ * + * bytes transaction = 2; + */ + public Builder clearTransaction() { + + transaction_ = getDefaultInstance().getTransaction(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.RollbackRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.RollbackRequest) + private static final com.google.firestore.v1.RollbackRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.RollbackRequest(); + } + + public static com.google.firestore.v1.RollbackRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RollbackRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RollbackRequest(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.v1.RollbackRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RollbackRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RollbackRequestOrBuilder.java new file mode 100644 index 000000000000..82bf4f741f20 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RollbackRequestOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface RollbackRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.RollbackRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string database = 1; + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The transaction to roll back.
+   * 
+ * + * bytes transaction = 2; + */ + com.google.protobuf.ByteString getTransaction(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java new file mode 100644 index 000000000000..3fecded42c0c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java @@ -0,0 +1,1790 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.RunQueryRequest} + */ +public final class RunQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.RunQueryRequest) + RunQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunQueryRequest.newBuilder() to construct. + private RunQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RunQueryRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RunQueryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + + 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 42: + { + consistencySelectorCase_ = 5; + consistencySelector_ = input.readBytes(); + break; + } + case 50: + { + com.google.firestore.v1.TransactionOptions.Builder subBuilder = null; + if (consistencySelectorCase_ == 6) { + subBuilder = + ((com.google.firestore.v1.TransactionOptions) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage( + com.google.firestore.v1.TransactionOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.v1.TransactionOptions) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 6; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (consistencySelectorCase_ == 7) { + subBuilder = ((com.google.protobuf.Timestamp) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 7; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.RunQueryRequest.class, + com.google.firestore.v1.RunQueryRequest.Builder.class); + } + + private int queryTypeCase_ = 0; + private java.lang.Object queryType_; + + public enum QueryTypeCase implements com.google.protobuf.Internal.EnumLite { + STRUCTURED_QUERY(2), + QUERYTYPE_NOT_SET(0); + private final int value; + + private QueryTypeCase(int value) { + this.value = value; + } + /** @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_); + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public enum ConsistencySelectorCase implements com.google.protobuf.Internal.EnumLite { + TRANSACTION(5), + NEW_TRANSACTION(6), + READ_TIME(7), + CONSISTENCYSELECTOR_NOT_SET(0); + private final int value; + + private ConsistencySelectorCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ConsistencySelectorCase valueOf(int value) { + return forNumber(value); + } + + public static ConsistencySelectorCase forNumber(int value) { + switch (value) { + case 5: + return TRANSACTION; + case 6: + return NEW_TRANSACTION; + case 7: + return READ_TIME; + case 0: + return CONSISTENCYSELECTOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The parent resource name. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + 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. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + 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; + */ + public boolean hasStructuredQuery() { + return queryTypeCase_ == 2; + } + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + 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; + */ + 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 TRANSACTION_FIELD_NUMBER = 5; + /** + * + * + *
+   * Reads documents in a transaction.
+   * 
+ * + * bytes transaction = 5; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 5) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int NEW_TRANSACTION_FIELD_NUMBER = 6; + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public boolean hasNewTransaction() { + return consistencySelectorCase_ == 6; + } + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public com.google.firestore.v1.TransactionOptions getNewTransaction() { + if (consistencySelectorCase_ == 6) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public com.google.firestore.v1.TransactionOptionsOrBuilder getNewTransactionOrBuilder() { + if (consistencySelectorCase_ == 6) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + + public static final int READ_TIME_FIELD_NUMBER = 7; + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 7; + } + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (queryTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.StructuredQuery) queryType_); + } + if (consistencySelectorCase_ == 5) { + output.writeBytes(5, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 6) { + output.writeMessage(6, (com.google.firestore.v1.TransactionOptions) consistencySelector_); + } + if (consistencySelectorCase_ == 7) { + output.writeMessage(7, (com.google.protobuf.Timestamp) consistencySelector_); + } + 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 (consistencySelectorCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 5, (com.google.protobuf.ByteString) consistencySelector_); + } + if (consistencySelectorCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.firestore.v1.TransactionOptions) consistencySelector_); + } + if (consistencySelectorCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.protobuf.Timestamp) consistencySelector_); + } + 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.v1.RunQueryRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.RunQueryRequest other = (com.google.firestore.v1.RunQueryRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getQueryTypeCase().equals(other.getQueryTypeCase()); + if (!result) return false; + switch (queryTypeCase_) { + case 2: + result = result && getStructuredQuery().equals(other.getStructuredQuery()); + break; + case 0: + default: + } + result = result && getConsistencySelectorCase().equals(other.getConsistencySelectorCase()); + if (!result) return false; + switch (consistencySelectorCase_) { + case 5: + result = result && getTransaction().equals(other.getTransaction()); + break; + case 6: + result = result && getNewTransaction().equals(other.getNewTransaction()); + break; + case 7: + result = result && getReadTime().equals(other.getReadTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + switch (queryTypeCase_) { + case 2: + hash = (37 * hash) + STRUCTURED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getStructuredQuery().hashCode(); + break; + case 0: + default: + } + switch (consistencySelectorCase_) { + case 5: + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + break; + case 6: + hash = (37 * hash) + NEW_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getNewTransaction().hashCode(); + break; + case 7: + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.RunQueryRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RunQueryRequest 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.v1.RunQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RunQueryRequest 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.v1.RunQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RunQueryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.RunQueryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RunQueryRequest 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.v1.RunQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RunQueryRequest 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.v1.RunQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RunQueryRequest 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.v1.RunQueryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.RunQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.RunQueryRequest) + com.google.firestore.v1.RunQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.RunQueryRequest.class, + com.google.firestore.v1.RunQueryRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.RunQueryRequest.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_ = ""; + + queryTypeCase_ = 0; + queryType_ = null; + consistencySelectorCase_ = 0; + consistencySelector_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.RunQueryRequest getDefaultInstanceForType() { + return com.google.firestore.v1.RunQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.RunQueryRequest build() { + com.google.firestore.v1.RunQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.RunQueryRequest buildPartial() { + com.google.firestore.v1.RunQueryRequest result = + new com.google.firestore.v1.RunQueryRequest(this); + result.parent_ = parent_; + if (queryTypeCase_ == 2) { + if (structuredQueryBuilder_ == null) { + result.queryType_ = queryType_; + } else { + result.queryType_ = structuredQueryBuilder_.build(); + } + } + if (consistencySelectorCase_ == 5) { + result.consistencySelector_ = consistencySelector_; + } + if (consistencySelectorCase_ == 6) { + if (newTransactionBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = newTransactionBuilder_.build(); + } + } + if (consistencySelectorCase_ == 7) { + if (readTimeBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = readTimeBuilder_.build(); + } + } + result.queryTypeCase_ = queryTypeCase_; + result.consistencySelectorCase_ = consistencySelectorCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.RunQueryRequest) { + return mergeFrom((com.google.firestore.v1.RunQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.RunQueryRequest other) { + if (other == com.google.firestore.v1.RunQueryRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + switch (other.getQueryTypeCase()) { + case STRUCTURED_QUERY: + { + mergeStructuredQuery(other.getStructuredQuery()); + break; + } + case QUERYTYPE_NOT_SET: + { + break; + } + } + switch (other.getConsistencySelectorCase()) { + case TRANSACTION: + { + setTransaction(other.getTransaction()); + break; + } + case NEW_TRANSACTION: + { + mergeNewTransaction(other.getNewTransaction()); + break; + } + case READ_TIME: + { + mergeReadTime(other.getReadTime()); + break; + } + case CONSISTENCYSELECTOR_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.v1.RunQueryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.RunQueryRequest) 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 int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public Builder clearConsistencySelector() { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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; + */ + public boolean hasStructuredQuery() { + return queryTypeCase_ == 2; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + 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; + */ + 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_; + } + + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 5; + */ + public com.google.protobuf.ByteString getTransaction() { + if (consistencySelectorCase_ == 5) { + return (com.google.protobuf.ByteString) consistencySelector_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 5; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelectorCase_ = 5; + consistencySelector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Reads documents in a transaction.
+     * 
+ * + * bytes transaction = 5; + */ + public Builder clearTransaction() { + if (consistencySelectorCase_ == 5) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder> + newTransactionBuilder_; + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public boolean hasNewTransaction() { + return consistencySelectorCase_ == 6; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public com.google.firestore.v1.TransactionOptions getNewTransaction() { + if (newTransactionBuilder_ == null) { + if (consistencySelectorCase_ == 6) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 6) { + return newTransactionBuilder_.getMessage(); + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public Builder setNewTransaction(com.google.firestore.v1.TransactionOptions value) { + if (newTransactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + newTransactionBuilder_.setMessage(value); + } + consistencySelectorCase_ = 6; + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public Builder setNewTransaction( + com.google.firestore.v1.TransactionOptions.Builder builderForValue) { + if (newTransactionBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + newTransactionBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 6; + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public Builder mergeNewTransaction(com.google.firestore.v1.TransactionOptions value) { + if (newTransactionBuilder_ == null) { + if (consistencySelectorCase_ == 6 + && consistencySelector_ + != com.google.firestore.v1.TransactionOptions.getDefaultInstance()) { + consistencySelector_ = + com.google.firestore.v1.TransactionOptions.newBuilder( + (com.google.firestore.v1.TransactionOptions) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 6) { + newTransactionBuilder_.mergeFrom(value); + } + newTransactionBuilder_.setMessage(value); + } + consistencySelectorCase_ = 6; + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public Builder clearNewTransaction() { + if (newTransactionBuilder_ == null) { + if (consistencySelectorCase_ == 6) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 6) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + newTransactionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public com.google.firestore.v1.TransactionOptions.Builder getNewTransactionBuilder() { + return getNewTransactionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + public com.google.firestore.v1.TransactionOptionsOrBuilder getNewTransactionOrBuilder() { + if ((consistencySelectorCase_ == 6) && (newTransactionBuilder_ != null)) { + return newTransactionBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 6) { + return (com.google.firestore.v1.TransactionOptions) consistencySelector_; + } + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Starts a new transaction and reads the documents.
+     * Defaults to a read-only transaction.
+     * The new transaction ID will be returned as the first response in the
+     * stream.
+     * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder> + getNewTransactionFieldBuilder() { + if (newTransactionBuilder_ == null) { + if (!(consistencySelectorCase_ == 6)) { + consistencySelector_ = com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + newTransactionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions, + com.google.firestore.v1.TransactionOptions.Builder, + com.google.firestore.v1.TransactionOptionsOrBuilder>( + (com.google.firestore.v1.TransactionOptions) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 6; + onChanged(); + ; + return newTransactionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 7; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 7) { + return readTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 7; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 7; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 7 + && consistencySelector_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + consistencySelector_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 7) { + readTimeBuilder_.mergeFrom(value); + } + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 7; + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 7) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 7) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + readTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if ((consistencySelectorCase_ == 7) && (readTimeBuilder_ != null)) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 7) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Reads documents as they were at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + if (!(consistencySelectorCase_ == 7)) { + consistencySelector_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 7; + onChanged(); + ; + return readTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.RunQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.RunQueryRequest) + private static final com.google.firestore.v1.RunQueryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.RunQueryRequest(); + } + + public static com.google.firestore.v1.RunQueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunQueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunQueryRequest(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.v1.RunQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java new file mode 100644 index 000000000000..41562774f335 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java @@ -0,0 +1,162 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface RunQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.RunQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parent resource name. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The parent resource name. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents` or
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * For example:
+   * `projects/my-project/databases/my-database/documents` or
+   * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + boolean hasStructuredQuery(); + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + com.google.firestore.v1.StructuredQuery getStructuredQuery(); + /** + * + * + *
+   * A structured query.
+   * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + com.google.firestore.v1.StructuredQueryOrBuilder getStructuredQueryOrBuilder(); + + /** + * + * + *
+   * Reads documents in a transaction.
+   * 
+ * + * bytes transaction = 5; + */ + com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + boolean hasNewTransaction(); + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + com.google.firestore.v1.TransactionOptions getNewTransaction(); + /** + * + * + *
+   * Starts a new transaction and reads the documents.
+   * Defaults to a read-only transaction.
+   * The new transaction ID will be returned as the first response in the
+   * stream.
+   * 
+ * + * .google.firestore.v1.TransactionOptions new_transaction = 6; + */ + com.google.firestore.v1.TransactionOptionsOrBuilder getNewTransactionOrBuilder(); + + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Reads documents as they were at the given time.
+   * This may not be older than 60 seconds.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + public com.google.firestore.v1.RunQueryRequest.QueryTypeCase getQueryTypeCase(); + + public com.google.firestore.v1.RunQueryRequest.ConsistencySelectorCase + getConsistencySelectorCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java new file mode 100644 index 000000000000..bb1df98c4d6a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java @@ -0,0 +1,1206 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.RunQueryResponse} + */ +public final class RunQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.RunQueryResponse) + RunQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunQueryResponse.newBuilder() to construct. + private RunQueryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RunQueryResponse() { + transaction_ = com.google.protobuf.ByteString.EMPTY; + skippedResults_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RunQueryResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (document_ != null) { + subBuilder = document_.toBuilder(); + } + document_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(document_); + document_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + transaction_ = input.readBytes(); + 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; + } + case 32: + { + skippedResults_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.RunQueryResponse.class, + com.google.firestore.v1.RunQueryResponse.Builder.class); + } + + public static final int TRANSACTION_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString transaction_; + /** + * + * + *
+   * The transaction that was started as part of this request.
+   * Can only be set in the first response, and only if
+   * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request.
+   * If set, no other fields will be set in this response.
+   * 
+ * + * bytes transaction = 2; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.firestore.v1.Document document_; + /** + * + * + *
+   * A query result.
+   * Not set when reporting partial progress.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * A query result.
+   * Not set when reporting partial progress.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document getDocument() { + return document_ == null ? com.google.firestore.v1.Document.getDefaultInstance() : document_; + } + /** + * + * + *
+   * A query result.
+   * Not set when reporting partial progress.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int READ_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The time at which the document was read. This may be monotonically
+   * increasing; in this case, the previous documents in the result stream are
+   * guaranteed not to have changed between their `read_time` and this one.
+   * If the query returns no results, a response with `read_time` and no
+   * `document` will be sent, and this represents the time at which the query
+   * was run.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The time at which the document was read. This may be monotonically
+   * increasing; in this case, the previous documents in the result stream are
+   * guaranteed not to have changed between their `read_time` and this one.
+   * If the query returns no results, a response with `read_time` and no
+   * `document` will be sent, and this represents the time at which the query
+   * was run.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * The time at which the document was read. This may be monotonically
+   * increasing; in this case, the previous documents in the result stream are
+   * guaranteed not to have changed between their `read_time` and this one.
+   * If the query returns no results, a response with `read_time` and no
+   * `document` will be sent, and this represents the time at which the query
+   * was run.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int SKIPPED_RESULTS_FIELD_NUMBER = 4; + private int skippedResults_; + /** + * + * + *
+   * The number of results that have been skipped due to an offset between
+   * the last response and the current response.
+   * 
+ * + * int32 skipped_results = 4; + */ + public int getSkippedResults() { + return skippedResults_; + } + + 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 (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (!transaction_.isEmpty()) { + output.writeBytes(2, transaction_); + } + if (readTime_ != null) { + output.writeMessage(3, getReadTime()); + } + if (skippedResults_ != 0) { + output.writeInt32(4, skippedResults_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + if (!transaction_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, transaction_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReadTime()); + } + if (skippedResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, skippedResults_); + } + 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.v1.RunQueryResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.RunQueryResponse other = (com.google.firestore.v1.RunQueryResponse) obj; + + boolean result = true; + result = result && getTransaction().equals(other.getTransaction()); + result = result && (hasDocument() == other.hasDocument()); + if (hasDocument()) { + result = result && getDocument().equals(other.getDocument()); + } + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && (getSkippedResults() == other.getSkippedResults()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + SKIPPED_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getSkippedResults(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.RunQueryResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RunQueryResponse 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.v1.RunQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RunQueryResponse 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.v1.RunQueryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.RunQueryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.RunQueryResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RunQueryResponse 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.v1.RunQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RunQueryResponse 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.v1.RunQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.RunQueryResponse 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.v1.RunQueryResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.RunQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.RunQueryResponse) + com.google.firestore.v1.RunQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.RunQueryResponse.class, + com.google.firestore.v1.RunQueryResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.RunQueryResponse.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(); + transaction_ = com.google.protobuf.ByteString.EMPTY; + + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + skippedResults_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_RunQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.RunQueryResponse getDefaultInstanceForType() { + return com.google.firestore.v1.RunQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.RunQueryResponse build() { + com.google.firestore.v1.RunQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.RunQueryResponse buildPartial() { + com.google.firestore.v1.RunQueryResponse result = + new com.google.firestore.v1.RunQueryResponse(this); + result.transaction_ = transaction_; + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.skippedResults_ = skippedResults_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.RunQueryResponse) { + return mergeFrom((com.google.firestore.v1.RunQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.RunQueryResponse other) { + if (other == com.google.firestore.v1.RunQueryResponse.getDefaultInstance()) return this; + if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { + setTransaction(other.getTransaction()); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.getSkippedResults() != 0) { + setSkippedResults(other.getSkippedResults()); + } + 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.v1.RunQueryResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.RunQueryResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString transaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The transaction that was started as part of this request.
+     * Can only be set in the first response, and only if
+     * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request.
+     * If set, no other fields will be set in this response.
+     * 
+ * + * bytes transaction = 2; + */ + public com.google.protobuf.ByteString getTransaction() { + return transaction_; + } + /** + * + * + *
+     * The transaction that was started as part of this request.
+     * Can only be set in the first response, and only if
+     * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request.
+     * If set, no other fields will be set in this response.
+     * 
+ * + * bytes transaction = 2; + */ + public Builder setTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + transaction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction that was started as part of this request.
+     * Can only be set in the first response, and only if
+     * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request.
+     * If set, no other fields will be set in this response.
+     * 
+ * + * bytes transaction = 2; + */ + public Builder clearTransaction() { + + transaction_ = getDefaultInstance().getTransaction(); + onChanged(); + return this; + } + + private com.google.firestore.v1.Document document_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder setDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder setDocument(com.google.firestore.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder mergeDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.firestore.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * A query result.
+     * Not set when reporting partial progress.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + 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) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * The time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .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 time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .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 time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .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 time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .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 time at which the document was read. This may be monotonically
+     * increasing; in this case, the previous documents in the result stream are
+     * guaranteed not to have changed between their `read_time` and this one.
+     * If the query returns no results, a response with `read_time` and no
+     * `document` will be sent, and this represents the time at which the query
+     * was run.
+     * 
+ * + * .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_; + } + + private int skippedResults_; + /** + * + * + *
+     * The number of results that have been skipped due to an offset between
+     * the last response and the current response.
+     * 
+ * + * int32 skipped_results = 4; + */ + public int getSkippedResults() { + return skippedResults_; + } + /** + * + * + *
+     * The number of results that have been skipped due to an offset between
+     * the last response and the current response.
+     * 
+ * + * int32 skipped_results = 4; + */ + public Builder setSkippedResults(int value) { + + skippedResults_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of results that have been skipped due to an offset between
+     * the last response and the current response.
+     * 
+ * + * int32 skipped_results = 4; + */ + public Builder clearSkippedResults() { + + skippedResults_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.RunQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.RunQueryResponse) + private static final com.google.firestore.v1.RunQueryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.RunQueryResponse(); + } + + public static com.google.firestore.v1.RunQueryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunQueryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunQueryResponse(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.v1.RunQueryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java new file mode 100644 index 000000000000..2b18df04a319 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java @@ -0,0 +1,116 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface RunQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.RunQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The transaction that was started as part of this request.
+   * Can only be set in the first response, and only if
+   * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request.
+   * If set, no other fields will be set in this response.
+   * 
+ * + * bytes transaction = 2; + */ + com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * A query result.
+   * Not set when reporting partial progress.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + boolean hasDocument(); + /** + * + * + *
+   * A query result.
+   * Not set when reporting partial progress.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + com.google.firestore.v1.Document getDocument(); + /** + * + * + *
+   * A query result.
+   * Not set when reporting partial progress.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * The time at which the document was read. This may be monotonically
+   * increasing; in this case, the previous documents in the result stream are
+   * guaranteed not to have changed between their `read_time` and this one.
+   * If the query returns no results, a response with `read_time` and no
+   * `document` will be sent, and this represents the time at which the query
+   * was run.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + boolean hasReadTime(); + /** + * + * + *
+   * The time at which the document was read. This may be monotonically
+   * increasing; in this case, the previous documents in the result stream are
+   * guaranteed not to have changed between their `read_time` and this one.
+   * If the query returns no results, a response with `read_time` and no
+   * `document` will be sent, and this represents the time at which the query
+   * was run.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The time at which the document was read. This may be monotonically
+   * increasing; in this case, the previous documents in the result stream are
+   * guaranteed not to have changed between their `read_time` and this one.
+   * If the query returns no results, a response with `read_time` and no
+   * `document` will be sent, and this represents the time at which the query
+   * was run.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * The number of results that have been skipped due to an offset between
+   * the last response and the current response.
+   * 
+ * + * int32 skipped_results = 4; + */ + int getSkippedResults(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQuery.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQuery.java new file mode 100644 index 000000000000..606e72ffb75b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQuery.java @@ -0,0 +1,11934 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A Firestore query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery} + */ +public final class StructuredQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery) + StructuredQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use StructuredQuery.newBuilder() to construct. + private StructuredQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StructuredQuery() { + from_ = java.util.Collections.emptyList(); + orderBy_ = java.util.Collections.emptyList(); + offset_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StructuredQuery( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.StructuredQuery.Projection.Builder subBuilder = null; + if (select_ != null) { + subBuilder = select_.toBuilder(); + } + select_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.Projection.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(select_); + select_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + from_ = + new java.util.ArrayList< + com.google.firestore.v1.StructuredQuery.CollectionSelector>(); + mutable_bitField0_ |= 0x00000002; + } + from_.add( + input.readMessage( + com.google.firestore.v1.StructuredQuery.CollectionSelector.parser(), + extensionRegistry)); + break; + } + case 26: + { + com.google.firestore.v1.StructuredQuery.Filter.Builder subBuilder = null; + if (where_ != null) { + subBuilder = where_.toBuilder(); + } + where_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.Filter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(where_); + where_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + orderBy_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + orderBy_.add( + input.readMessage( + com.google.firestore.v1.StructuredQuery.Order.parser(), extensionRegistry)); + break; + } + case 42: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (limit_ != null) { + subBuilder = limit_.toBuilder(); + } + limit_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(limit_); + limit_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + offset_ = input.readInt32(); + break; + } + case 58: + { + com.google.firestore.v1.Cursor.Builder subBuilder = null; + if (startAt_ != null) { + subBuilder = startAt_.toBuilder(); + } + startAt_ = + input.readMessage(com.google.firestore.v1.Cursor.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startAt_); + startAt_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.firestore.v1.Cursor.Builder subBuilder = null; + if (endAt_ != null) { + subBuilder = endAt_.toBuilder(); + } + endAt_ = + input.readMessage(com.google.firestore.v1.Cursor.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endAt_); + endAt_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + from_ = java.util.Collections.unmodifiableList(from_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + orderBy_ = java.util.Collections.unmodifiableList(orderBy_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.class, + com.google.firestore.v1.StructuredQuery.Builder.class); + } + + /** + * + * + *
+   * A sort direction.
+   * 
+ * + * Protobuf enum {@code google.firestore.v1.StructuredQuery.Direction} + */ + public enum Direction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + DIRECTION_UNSPECIFIED(0), + /** + * + * + *
+     * Ascending.
+     * 
+ * + * ASCENDING = 1; + */ + ASCENDING(1), + /** + * + * + *
+     * Descending.
+     * 
+ * + * DESCENDING = 2; + */ + DESCENDING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + public static final int DIRECTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Ascending.
+     * 
+ * + * ASCENDING = 1; + */ + public static final int ASCENDING_VALUE = 1; + /** + * + * + *
+     * Descending.
+     * 
+ * + * DESCENDING = 2; + */ + public static final int DESCENDING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static Direction valueOf(int value) { + return forNumber(value); + } + + public static Direction forNumber(int value) { + switch (value) { + case 0: + return DIRECTION_UNSPECIFIED; + case 1: + return ASCENDING; + case 2: + return DESCENDING; + 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 Direction findValueByNumber(int number) { + return Direction.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.StructuredQuery.getDescriptor().getEnumTypes().get(0); + } + + private static final Direction[] VALUES = values(); + + public static Direction 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 Direction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.StructuredQuery.Direction) + } + + public interface CollectionSelectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.CollectionSelector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The collection ID.
+     * When set, selects only collections with this ID.
+     * 
+ * + * string collection_id = 2; + */ + java.lang.String getCollectionId(); + /** + * + * + *
+     * The collection ID.
+     * When set, selects only collections with this ID.
+     * 
+ * + * string collection_id = 2; + */ + com.google.protobuf.ByteString getCollectionIdBytes(); + + /** + * + * + *
+     * When false, selects only collections that are immediate children of
+     * the `parent` specified in the containing `RunQueryRequest`.
+     * When true, selects all descendant collections.
+     * 
+ * + * bool all_descendants = 3; + */ + boolean getAllDescendants(); + } + /** + * + * + *
+   * A selection of a collection, such as `messages as m1`.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.CollectionSelector} + */ + public static final class CollectionSelector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.CollectionSelector) + CollectionSelectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use CollectionSelector.newBuilder() to construct. + private CollectionSelector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CollectionSelector() { + collectionId_ = ""; + allDescendants_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CollectionSelector( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + collectionId_ = s; + break; + } + case 24: + { + allDescendants_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.CollectionSelector.class, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder.class); + } + + public static final int COLLECTION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object collectionId_; + /** + * + * + *
+     * The collection ID.
+     * When set, selects only collections with this ID.
+     * 
+ * + * string collection_id = 2; + */ + public java.lang.String getCollectionId() { + java.lang.Object ref = collectionId_; + 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(); + collectionId_ = s; + return s; + } + } + /** + * + * + *
+     * The collection ID.
+     * When set, selects only collections with this ID.
+     * 
+ * + * string collection_id = 2; + */ + public com.google.protobuf.ByteString getCollectionIdBytes() { + java.lang.Object ref = collectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALL_DESCENDANTS_FIELD_NUMBER = 3; + private boolean allDescendants_; + /** + * + * + *
+     * When false, selects only collections that are immediate children of
+     * the `parent` specified in the containing `RunQueryRequest`.
+     * When true, selects all descendant collections.
+     * 
+ * + * bool all_descendants = 3; + */ + public boolean getAllDescendants() { + return allDescendants_; + } + + 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 (!getCollectionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectionId_); + } + if (allDescendants_ != false) { + output.writeBool(3, allDescendants_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCollectionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, collectionId_); + } + if (allDescendants_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allDescendants_); + } + 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.v1.StructuredQuery.CollectionSelector)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.CollectionSelector other = + (com.google.firestore.v1.StructuredQuery.CollectionSelector) obj; + + boolean result = true; + result = result && getCollectionId().equals(other.getCollectionId()); + result = result && (getAllDescendants() == other.getAllDescendants()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COLLECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getCollectionId().hashCode(); + hash = (37 * hash) + ALL_DESCENDANTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllDescendants()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector 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.v1.StructuredQuery.CollectionSelector parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector 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.v1.StructuredQuery.CollectionSelector parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector 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.v1.StructuredQuery.CollectionSelector parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector 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.v1.StructuredQuery.CollectionSelector parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector 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.v1.StructuredQuery.CollectionSelector 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 selection of a collection, such as `messages as m1`.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.CollectionSelector} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.CollectionSelector) + com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.CollectionSelector.class, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.CollectionSelector.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(); + collectionId_ = ""; + + allDescendants_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CollectionSelector_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.CollectionSelector + getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.CollectionSelector.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.CollectionSelector build() { + com.google.firestore.v1.StructuredQuery.CollectionSelector result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.CollectionSelector buildPartial() { + com.google.firestore.v1.StructuredQuery.CollectionSelector result = + new com.google.firestore.v1.StructuredQuery.CollectionSelector(this); + result.collectionId_ = collectionId_; + result.allDescendants_ = allDescendants_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.CollectionSelector) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.CollectionSelector) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.CollectionSelector other) { + if (other + == com.google.firestore.v1.StructuredQuery.CollectionSelector.getDefaultInstance()) + return this; + if (!other.getCollectionId().isEmpty()) { + collectionId_ = other.collectionId_; + onChanged(); + } + if (other.getAllDescendants() != false) { + setAllDescendants(other.getAllDescendants()); + } + 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.v1.StructuredQuery.CollectionSelector parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.StructuredQuery.CollectionSelector) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object collectionId_ = ""; + /** + * + * + *
+       * The collection ID.
+       * When set, selects only collections with this ID.
+       * 
+ * + * string collection_id = 2; + */ + public java.lang.String getCollectionId() { + java.lang.Object ref = collectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The collection ID.
+       * When set, selects only collections with this ID.
+       * 
+ * + * string collection_id = 2; + */ + public com.google.protobuf.ByteString getCollectionIdBytes() { + java.lang.Object ref = collectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The collection ID.
+       * When set, selects only collections with this ID.
+       * 
+ * + * string collection_id = 2; + */ + public Builder setCollectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + collectionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The collection ID.
+       * When set, selects only collections with this ID.
+       * 
+ * + * string collection_id = 2; + */ + public Builder clearCollectionId() { + + collectionId_ = getDefaultInstance().getCollectionId(); + onChanged(); + return this; + } + /** + * + * + *
+       * The collection ID.
+       * When set, selects only collections with this ID.
+       * 
+ * + * string collection_id = 2; + */ + public Builder setCollectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + collectionId_ = value; + onChanged(); + return this; + } + + private boolean allDescendants_; + /** + * + * + *
+       * When false, selects only collections that are immediate children of
+       * the `parent` specified in the containing `RunQueryRequest`.
+       * When true, selects all descendant collections.
+       * 
+ * + * bool all_descendants = 3; + */ + public boolean getAllDescendants() { + return allDescendants_; + } + /** + * + * + *
+       * When false, selects only collections that are immediate children of
+       * the `parent` specified in the containing `RunQueryRequest`.
+       * When true, selects all descendant collections.
+       * 
+ * + * bool all_descendants = 3; + */ + public Builder setAllDescendants(boolean value) { + + allDescendants_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * When false, selects only collections that are immediate children of
+       * the `parent` specified in the containing `RunQueryRequest`.
+       * When true, selects all descendant collections.
+       * 
+ * + * bool all_descendants = 3; + */ + public Builder clearAllDescendants() { + + allDescendants_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.CollectionSelector) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.CollectionSelector) + private static final com.google.firestore.v1.StructuredQuery.CollectionSelector + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.CollectionSelector(); + } + + public static com.google.firestore.v1.StructuredQuery.CollectionSelector getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CollectionSelector parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CollectionSelector(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.v1.StructuredQuery.CollectionSelector getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.Filter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A composite filter.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + boolean hasCompositeFilter(); + /** + * + * + *
+     * A composite filter.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + com.google.firestore.v1.StructuredQuery.CompositeFilter getCompositeFilter(); + /** + * + * + *
+     * A composite filter.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder getCompositeFilterOrBuilder(); + + /** + * + * + *
+     * A filter on a document field.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + boolean hasFieldFilter(); + /** + * + * + *
+     * A filter on a document field.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldFilter getFieldFilter(); + /** + * + * + *
+     * A filter on a document field.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder getFieldFilterOrBuilder(); + + /** + * + * + *
+     * A filter that takes exactly one argument.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + boolean hasUnaryFilter(); + /** + * + * + *
+     * A filter that takes exactly one argument.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + com.google.firestore.v1.StructuredQuery.UnaryFilter getUnaryFilter(); + /** + * + * + *
+     * A filter that takes exactly one argument.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder getUnaryFilterOrBuilder(); + + public com.google.firestore.v1.StructuredQuery.Filter.FilterTypeCase getFilterTypeCase(); + } + /** + * + * + *
+   * A filter.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.Filter} + */ + public static final class Filter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.Filter) + FilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Filter.newBuilder() to construct. + private Filter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Filter() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Filter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder subBuilder = null; + if (filterTypeCase_ == 1) { + subBuilder = + ((com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_) + .toBuilder(); + } + filterType_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.CompositeFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_); + filterType_ = subBuilder.buildPartial(); + } + filterTypeCase_ = 1; + break; + } + case 18: + { + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder subBuilder = null; + if (filterTypeCase_ == 2) { + subBuilder = + ((com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_) + .toBuilder(); + } + filterType_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.FieldFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_); + filterType_ = subBuilder.buildPartial(); + } + filterTypeCase_ = 2; + break; + } + case 26: + { + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder subBuilder = null; + if (filterTypeCase_ == 3) { + subBuilder = + ((com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_) + .toBuilder(); + } + filterType_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.UnaryFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_); + filterType_ = subBuilder.buildPartial(); + } + filterTypeCase_ = 3; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Filter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Filter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.Filter.class, + com.google.firestore.v1.StructuredQuery.Filter.Builder.class); + } + + private int filterTypeCase_ = 0; + private java.lang.Object filterType_; + + public enum FilterTypeCase implements com.google.protobuf.Internal.EnumLite { + COMPOSITE_FILTER(1), + FIELD_FILTER(2), + UNARY_FILTER(3), + FILTERTYPE_NOT_SET(0); + private final int value; + + private FilterTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static FilterTypeCase valueOf(int value) { + return forNumber(value); + } + + public static FilterTypeCase forNumber(int value) { + switch (value) { + case 1: + return COMPOSITE_FILTER; + case 2: + return FIELD_FILTER; + case 3: + return UNARY_FILTER; + case 0: + return FILTERTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FilterTypeCase getFilterTypeCase() { + return FilterTypeCase.forNumber(filterTypeCase_); + } + + public static final int COMPOSITE_FILTER_FIELD_NUMBER = 1; + /** + * + * + *
+     * A composite filter.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public boolean hasCompositeFilter() { + return filterTypeCase_ == 1; + } + /** + * + * + *
+     * A composite filter.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilter getCompositeFilter() { + if (filterTypeCase_ == 1) { + return (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } + /** + * + * + *
+     * A composite filter.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder + getCompositeFilterOrBuilder() { + if (filterTypeCase_ == 1) { + return (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } + + public static final int FIELD_FILTER_FIELD_NUMBER = 2; + /** + * + * + *
+     * A filter on a document field.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public boolean hasFieldFilter() { + return filterTypeCase_ == 2; + } + /** + * + * + *
+     * A filter on a document field.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilter getFieldFilter() { + if (filterTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } + /** + * + * + *
+     * A filter on a document field.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder getFieldFilterOrBuilder() { + if (filterTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } + + public static final int UNARY_FILTER_FIELD_NUMBER = 3; + /** + * + * + *
+     * A filter that takes exactly one argument.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public boolean hasUnaryFilter() { + return filterTypeCase_ == 3; + } + /** + * + * + *
+     * A filter that takes exactly one argument.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilter getUnaryFilter() { + if (filterTypeCase_ == 3) { + return (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance(); + } + /** + * + * + *
+     * A filter that takes exactly one argument.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder getUnaryFilterOrBuilder() { + if (filterTypeCase_ == 3) { + return (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.UnaryFilter.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 (filterTypeCase_ == 1) { + output.writeMessage( + 1, (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_); + } + if (filterTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_); + } + if (filterTypeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (filterTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_); + } + if (filterTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_); + } + if (filterTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_); + } + 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.v1.StructuredQuery.Filter)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.Filter other = + (com.google.firestore.v1.StructuredQuery.Filter) obj; + + boolean result = true; + result = result && getFilterTypeCase().equals(other.getFilterTypeCase()); + if (!result) return false; + switch (filterTypeCase_) { + case 1: + result = result && getCompositeFilter().equals(other.getCompositeFilter()); + break; + case 2: + result = result && getFieldFilter().equals(other.getFieldFilter()); + break; + case 3: + result = result && getUnaryFilter().equals(other.getUnaryFilter()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (filterTypeCase_) { + case 1: + hash = (37 * hash) + COMPOSITE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCompositeFilter().hashCode(); + break; + case 2: + hash = (37 * hash) + FIELD_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFieldFilter().hashCode(); + break; + case 3: + hash = (37 * hash) + UNARY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getUnaryFilter().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.Filter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Filter 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.v1.StructuredQuery.Filter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Filter 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.v1.StructuredQuery.Filter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Filter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.Filter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Filter 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.v1.StructuredQuery.Filter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Filter 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.v1.StructuredQuery.Filter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Filter 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.v1.StructuredQuery.Filter 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 filter.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.Filter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.Filter) + com.google.firestore.v1.StructuredQuery.FilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Filter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Filter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.Filter.class, + com.google.firestore.v1.StructuredQuery.Filter.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.Filter.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(); + filterTypeCase_ = 0; + filterType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Filter_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Filter getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Filter build() { + com.google.firestore.v1.StructuredQuery.Filter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Filter buildPartial() { + com.google.firestore.v1.StructuredQuery.Filter result = + new com.google.firestore.v1.StructuredQuery.Filter(this); + if (filterTypeCase_ == 1) { + if (compositeFilterBuilder_ == null) { + result.filterType_ = filterType_; + } else { + result.filterType_ = compositeFilterBuilder_.build(); + } + } + if (filterTypeCase_ == 2) { + if (fieldFilterBuilder_ == null) { + result.filterType_ = filterType_; + } else { + result.filterType_ = fieldFilterBuilder_.build(); + } + } + if (filterTypeCase_ == 3) { + if (unaryFilterBuilder_ == null) { + result.filterType_ = filterType_; + } else { + result.filterType_ = unaryFilterBuilder_.build(); + } + } + result.filterTypeCase_ = filterTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.Filter) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.Filter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.Filter other) { + if (other == com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance()) + return this; + switch (other.getFilterTypeCase()) { + case COMPOSITE_FILTER: + { + mergeCompositeFilter(other.getCompositeFilter()); + break; + } + case FIELD_FILTER: + { + mergeFieldFilter(other.getFieldFilter()); + break; + } + case UNARY_FILTER: + { + mergeUnaryFilter(other.getUnaryFilter()); + break; + } + case FILTERTYPE_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.v1.StructuredQuery.Filter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.StructuredQuery.Filter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int filterTypeCase_ = 0; + private java.lang.Object filterType_; + + public FilterTypeCase getFilterTypeCase() { + return FilterTypeCase.forNumber(filterTypeCase_); + } + + public Builder clearFilterType() { + filterTypeCase_ = 0; + filterType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.CompositeFilter, + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder, + com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder> + compositeFilterBuilder_; + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public boolean hasCompositeFilter() { + return filterTypeCase_ == 1; + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilter getCompositeFilter() { + if (compositeFilterBuilder_ == null) { + if (filterTypeCase_ == 1) { + return (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } else { + if (filterTypeCase_ == 1) { + return compositeFilterBuilder_.getMessage(); + } + return com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public Builder setCompositeFilter( + com.google.firestore.v1.StructuredQuery.CompositeFilter value) { + if (compositeFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filterType_ = value; + onChanged(); + } else { + compositeFilterBuilder_.setMessage(value); + } + filterTypeCase_ = 1; + return this; + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public Builder setCompositeFilter( + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder builderForValue) { + if (compositeFilterBuilder_ == null) { + filterType_ = builderForValue.build(); + onChanged(); + } else { + compositeFilterBuilder_.setMessage(builderForValue.build()); + } + filterTypeCase_ = 1; + return this; + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public Builder mergeCompositeFilter( + com.google.firestore.v1.StructuredQuery.CompositeFilter value) { + if (compositeFilterBuilder_ == null) { + if (filterTypeCase_ == 1 + && filterType_ + != com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance()) { + filterType_ = + com.google.firestore.v1.StructuredQuery.CompositeFilter.newBuilder( + (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_) + .mergeFrom(value) + .buildPartial(); + } else { + filterType_ = value; + } + onChanged(); + } else { + if (filterTypeCase_ == 1) { + compositeFilterBuilder_.mergeFrom(value); + } + compositeFilterBuilder_.setMessage(value); + } + filterTypeCase_ = 1; + return this; + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public Builder clearCompositeFilter() { + if (compositeFilterBuilder_ == null) { + if (filterTypeCase_ == 1) { + filterTypeCase_ = 0; + filterType_ = null; + onChanged(); + } + } else { + if (filterTypeCase_ == 1) { + filterTypeCase_ = 0; + filterType_ = null; + } + compositeFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder + getCompositeFilterBuilder() { + return getCompositeFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder + getCompositeFilterOrBuilder() { + if ((filterTypeCase_ == 1) && (compositeFilterBuilder_ != null)) { + return compositeFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterTypeCase_ == 1) { + return (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } + } + /** + * + * + *
+       * A composite filter.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.CompositeFilter, + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder, + com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder> + getCompositeFilterFieldBuilder() { + if (compositeFilterBuilder_ == null) { + if (!(filterTypeCase_ == 1)) { + filterType_ = + com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } + compositeFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.CompositeFilter, + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder, + com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder>( + (com.google.firestore.v1.StructuredQuery.CompositeFilter) filterType_, + getParentForChildren(), + isClean()); + filterType_ = null; + } + filterTypeCase_ = 1; + onChanged(); + ; + return compositeFilterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldFilter, + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder, + com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder> + fieldFilterBuilder_; + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public boolean hasFieldFilter() { + return filterTypeCase_ == 2; + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilter getFieldFilter() { + if (fieldFilterBuilder_ == null) { + if (filterTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } else { + if (filterTypeCase_ == 2) { + return fieldFilterBuilder_.getMessage(); + } + return com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public Builder setFieldFilter(com.google.firestore.v1.StructuredQuery.FieldFilter value) { + if (fieldFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filterType_ = value; + onChanged(); + } else { + fieldFilterBuilder_.setMessage(value); + } + filterTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public Builder setFieldFilter( + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder builderForValue) { + if (fieldFilterBuilder_ == null) { + filterType_ = builderForValue.build(); + onChanged(); + } else { + fieldFilterBuilder_.setMessage(builderForValue.build()); + } + filterTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public Builder mergeFieldFilter(com.google.firestore.v1.StructuredQuery.FieldFilter value) { + if (fieldFilterBuilder_ == null) { + if (filterTypeCase_ == 2 + && filterType_ + != com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance()) { + filterType_ = + com.google.firestore.v1.StructuredQuery.FieldFilter.newBuilder( + (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_) + .mergeFrom(value) + .buildPartial(); + } else { + filterType_ = value; + } + onChanged(); + } else { + if (filterTypeCase_ == 2) { + fieldFilterBuilder_.mergeFrom(value); + } + fieldFilterBuilder_.setMessage(value); + } + filterTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public Builder clearFieldFilter() { + if (fieldFilterBuilder_ == null) { + if (filterTypeCase_ == 2) { + filterTypeCase_ = 0; + filterType_ = null; + onChanged(); + } + } else { + if (filterTypeCase_ == 2) { + filterTypeCase_ = 0; + filterType_ = null; + } + fieldFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilter.Builder getFieldFilterBuilder() { + return getFieldFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder + getFieldFilterOrBuilder() { + if ((filterTypeCase_ == 2) && (fieldFilterBuilder_ != null)) { + return fieldFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } + } + /** + * + * + *
+       * A filter on a document field.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldFilter, + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder, + com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder> + getFieldFilterFieldBuilder() { + if (fieldFilterBuilder_ == null) { + if (!(filterTypeCase_ == 2)) { + filterType_ = com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } + fieldFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldFilter, + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder, + com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder>( + (com.google.firestore.v1.StructuredQuery.FieldFilter) filterType_, + getParentForChildren(), + isClean()); + filterType_ = null; + } + filterTypeCase_ = 2; + onChanged(); + ; + return fieldFilterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.UnaryFilter, + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder, + com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder> + unaryFilterBuilder_; + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public boolean hasUnaryFilter() { + return filterTypeCase_ == 3; + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilter getUnaryFilter() { + if (unaryFilterBuilder_ == null) { + if (filterTypeCase_ == 3) { + return (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance(); + } else { + if (filterTypeCase_ == 3) { + return unaryFilterBuilder_.getMessage(); + } + return com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance(); + } + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public Builder setUnaryFilter(com.google.firestore.v1.StructuredQuery.UnaryFilter value) { + if (unaryFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filterType_ = value; + onChanged(); + } else { + unaryFilterBuilder_.setMessage(value); + } + filterTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public Builder setUnaryFilter( + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder builderForValue) { + if (unaryFilterBuilder_ == null) { + filterType_ = builderForValue.build(); + onChanged(); + } else { + unaryFilterBuilder_.setMessage(builderForValue.build()); + } + filterTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public Builder mergeUnaryFilter(com.google.firestore.v1.StructuredQuery.UnaryFilter value) { + if (unaryFilterBuilder_ == null) { + if (filterTypeCase_ == 3 + && filterType_ + != com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance()) { + filterType_ = + com.google.firestore.v1.StructuredQuery.UnaryFilter.newBuilder( + (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_) + .mergeFrom(value) + .buildPartial(); + } else { + filterType_ = value; + } + onChanged(); + } else { + if (filterTypeCase_ == 3) { + unaryFilterBuilder_.mergeFrom(value); + } + unaryFilterBuilder_.setMessage(value); + } + filterTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public Builder clearUnaryFilter() { + if (unaryFilterBuilder_ == null) { + if (filterTypeCase_ == 3) { + filterTypeCase_ = 0; + filterType_ = null; + onChanged(); + } + } else { + if (filterTypeCase_ == 3) { + filterTypeCase_ = 0; + filterType_ = null; + } + unaryFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder getUnaryFilterBuilder() { + return getUnaryFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder + getUnaryFilterOrBuilder() { + if ((filterTypeCase_ == 3) && (unaryFilterBuilder_ != null)) { + return unaryFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterTypeCase_ == 3) { + return (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_; + } + return com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance(); + } + } + /** + * + * + *
+       * A filter that takes exactly one argument.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.UnaryFilter, + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder, + com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder> + getUnaryFilterFieldBuilder() { + if (unaryFilterBuilder_ == null) { + if (!(filterTypeCase_ == 3)) { + filterType_ = com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance(); + } + unaryFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.UnaryFilter, + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder, + com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder>( + (com.google.firestore.v1.StructuredQuery.UnaryFilter) filterType_, + getParentForChildren(), + isClean()); + filterType_ = null; + } + filterTypeCase_ = 3; + onChanged(); + ; + return unaryFilterBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.Filter) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.Filter) + private static final com.google.firestore.v1.StructuredQuery.Filter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.Filter(); + } + + public static com.google.firestore.v1.StructuredQuery.Filter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Filter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Filter(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.v1.StructuredQuery.Filter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CompositeFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.CompositeFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The operator for combining multiple filters.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + int getOpValue(); + /** + * + * + *
+     * The operator for combining multiple filters.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator getOp(); + + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + java.util.List getFiltersList(); + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + com.google.firestore.v1.StructuredQuery.Filter getFilters(int index); + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + int getFiltersCount(); + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + java.util.List + getFiltersOrBuilderList(); + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + com.google.firestore.v1.StructuredQuery.FilterOrBuilder getFiltersOrBuilder(int index); + } + /** + * + * + *
+   * A filter that merges multiple other filters using the given operator.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.CompositeFilter} + */ + public static final class CompositeFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.CompositeFilter) + CompositeFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompositeFilter.newBuilder() to construct. + private CompositeFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompositeFilter() { + op_ = 0; + filters_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CompositeFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + op_ = rawValue; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + filters_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + filters_.add( + input.readMessage( + com.google.firestore.v1.StructuredQuery.Filter.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + filters_ = java.util.Collections.unmodifiableList(filters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.CompositeFilter.class, + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder.class); + } + + /** + * + * + *
+     * A composite filter operator.
+     * 
+ * + * Protobuf enum {@code google.firestore.v1.StructuredQuery.CompositeFilter.Operator} + */ + public enum Operator implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * OPERATOR_UNSPECIFIED = 0; + */ + OPERATOR_UNSPECIFIED(0), + /** + * + * + *
+       * The results are required to satisfy each of the combined filters.
+       * 
+ * + * AND = 1; + */ + AND(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * OPERATOR_UNSPECIFIED = 0; + */ + public static final int OPERATOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The results are required to satisfy each of the combined filters.
+       * 
+ * + * AND = 1; + */ + public static final int AND_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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static Operator valueOf(int value) { + return forNumber(value); + } + + public static Operator forNumber(int value) { + switch (value) { + case 0: + return OPERATOR_UNSPECIFIED; + case 1: + return AND; + 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 Operator findValueByNumber(int number) { + return Operator.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.StructuredQuery.CompositeFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Operator[] VALUES = values(); + + public static Operator 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 Operator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.StructuredQuery.CompositeFilter.Operator) + } + + private int bitField0_; + public static final int OP_FIELD_NUMBER = 1; + private int op_; + /** + * + * + *
+     * The operator for combining multiple filters.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public int getOpValue() { + return op_; + } + /** + * + * + *
+     * The operator for combining multiple filters.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator getOp() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator result = + com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator.valueOf(op_); + return result == null + ? com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator.UNRECOGNIZED + : result; + } + + public static final int FILTERS_FIELD_NUMBER = 2; + private java.util.List filters_; + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public java.util.List getFiltersList() { + return filters_; + } + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public java.util.List + getFiltersOrBuilderList() { + return filters_; + } + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public int getFiltersCount() { + return filters_.size(); + } + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.Filter getFilters(int index) { + return filters_.get(index); + } + /** + * + * + *
+     * The list of filters to combine.
+     * Must contain at least one filter.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.FilterOrBuilder getFiltersOrBuilder(int index) { + return filters_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (op_ + != com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator.OPERATOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, op_); + } + for (int i = 0; i < filters_.size(); i++) { + output.writeMessage(2, filters_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (op_ + != com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator.OPERATOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, op_); + } + for (int i = 0; i < filters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, filters_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.StructuredQuery.CompositeFilter)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.CompositeFilter other = + (com.google.firestore.v1.StructuredQuery.CompositeFilter) obj; + + boolean result = true; + result = result && op_ == other.op_; + result = result && getFiltersList().equals(other.getFiltersList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + op_; + if (getFiltersCount() > 0) { + hash = (37 * hash) + FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getFiltersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter 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.v1.StructuredQuery.CompositeFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter 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.v1.StructuredQuery.CompositeFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter 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.v1.StructuredQuery.CompositeFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter 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.v1.StructuredQuery.CompositeFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter 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.v1.StructuredQuery.CompositeFilter 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 filter that merges multiple other filters using the given operator.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.CompositeFilter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.CompositeFilter) + com.google.firestore.v1.StructuredQuery.CompositeFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.CompositeFilter.class, + com.google.firestore.v1.StructuredQuery.CompositeFilter.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.CompositeFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFiltersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + op_ = 0; + + if (filtersBuilder_ == null) { + filters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + filtersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_CompositeFilter_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.CompositeFilter getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.CompositeFilter build() { + com.google.firestore.v1.StructuredQuery.CompositeFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.CompositeFilter buildPartial() { + com.google.firestore.v1.StructuredQuery.CompositeFilter result = + new com.google.firestore.v1.StructuredQuery.CompositeFilter(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.op_ = op_; + if (filtersBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + filters_ = java.util.Collections.unmodifiableList(filters_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.filters_ = filters_; + } else { + result.filters_ = filtersBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.CompositeFilter) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.CompositeFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.CompositeFilter other) { + if (other == com.google.firestore.v1.StructuredQuery.CompositeFilter.getDefaultInstance()) + return this; + if (other.op_ != 0) { + setOpValue(other.getOpValue()); + } + if (filtersBuilder_ == null) { + if (!other.filters_.isEmpty()) { + if (filters_.isEmpty()) { + filters_ = other.filters_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFiltersIsMutable(); + filters_.addAll(other.filters_); + } + onChanged(); + } + } else { + if (!other.filters_.isEmpty()) { + if (filtersBuilder_.isEmpty()) { + filtersBuilder_.dispose(); + filtersBuilder_ = null; + filters_ = other.filters_; + bitField0_ = (bitField0_ & ~0x00000002); + filtersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFiltersFieldBuilder() + : null; + } else { + filtersBuilder_.addAllMessages(other.filters_); + } + } + } + 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.v1.StructuredQuery.CompositeFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.StructuredQuery.CompositeFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int op_ = 0; + /** + * + * + *
+       * The operator for combining multiple filters.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public int getOpValue() { + return op_; + } + /** + * + * + *
+       * The operator for combining multiple filters.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public Builder setOpValue(int value) { + op_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The operator for combining multiple filters.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator getOp() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator result = + com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator.valueOf(op_); + return result == null + ? com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The operator for combining multiple filters.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public Builder setOp(com.google.firestore.v1.StructuredQuery.CompositeFilter.Operator value) { + if (value == null) { + throw new NullPointerException(); + } + + op_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The operator for combining multiple filters.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + public Builder clearOp() { + + op_ = 0; + onChanged(); + return this; + } + + private java.util.List filters_ = + java.util.Collections.emptyList(); + + private void ensureFiltersIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + filters_ = + new java.util.ArrayList(filters_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Filter, + com.google.firestore.v1.StructuredQuery.Filter.Builder, + com.google.firestore.v1.StructuredQuery.FilterOrBuilder> + filtersBuilder_; + + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public java.util.List getFiltersList() { + if (filtersBuilder_ == null) { + return java.util.Collections.unmodifiableList(filters_); + } else { + return filtersBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public int getFiltersCount() { + if (filtersBuilder_ == null) { + return filters_.size(); + } else { + return filtersBuilder_.getCount(); + } + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.Filter getFilters(int index) { + if (filtersBuilder_ == null) { + return filters_.get(index); + } else { + return filtersBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder setFilters(int index, com.google.firestore.v1.StructuredQuery.Filter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.set(index, value); + onChanged(); + } else { + filtersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder setFilters( + int index, com.google.firestore.v1.StructuredQuery.Filter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.set(index, builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder addFilters(com.google.firestore.v1.StructuredQuery.Filter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.add(value); + onChanged(); + } else { + filtersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder addFilters(int index, com.google.firestore.v1.StructuredQuery.Filter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.add(index, value); + onChanged(); + } else { + filtersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder addFilters( + com.google.firestore.v1.StructuredQuery.Filter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder addFilters( + int index, com.google.firestore.v1.StructuredQuery.Filter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(index, builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder addAllFilters( + java.lang.Iterable values) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, filters_); + onChanged(); + } else { + filtersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder clearFilters() { + if (filtersBuilder_ == null) { + filters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + filtersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public Builder removeFilters(int index) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.remove(index); + onChanged(); + } else { + filtersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.Filter.Builder getFiltersBuilder(int index) { + return getFiltersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.FilterOrBuilder getFiltersOrBuilder( + int index) { + if (filtersBuilder_ == null) { + return filters_.get(index); + } else { + return filtersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public java.util.List + getFiltersOrBuilderList() { + if (filtersBuilder_ != null) { + return filtersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(filters_); + } + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.Filter.Builder addFiltersBuilder() { + return getFiltersFieldBuilder() + .addBuilder(com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance()); + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public com.google.firestore.v1.StructuredQuery.Filter.Builder addFiltersBuilder(int index) { + return getFiltersFieldBuilder() + .addBuilder(index, com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance()); + } + /** + * + * + *
+       * The list of filters to combine.
+       * Must contain at least one filter.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + public java.util.List + getFiltersBuilderList() { + return getFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Filter, + com.google.firestore.v1.StructuredQuery.Filter.Builder, + com.google.firestore.v1.StructuredQuery.FilterOrBuilder> + getFiltersFieldBuilder() { + if (filtersBuilder_ == null) { + filtersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Filter, + com.google.firestore.v1.StructuredQuery.Filter.Builder, + com.google.firestore.v1.StructuredQuery.FilterOrBuilder>( + filters_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + filters_ = null; + } + return filtersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.CompositeFilter) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.CompositeFilter) + private static final com.google.firestore.v1.StructuredQuery.CompositeFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.CompositeFilter(); + } + + public static com.google.firestore.v1.StructuredQuery.CompositeFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompositeFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CompositeFilter(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.v1.StructuredQuery.CompositeFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FieldFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.FieldFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The field to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + boolean hasField(); + /** + * + * + *
+     * The field to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + com.google.firestore.v1.StructuredQuery.FieldReference getField(); + /** + * + * + *
+     * The field to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder(); + + /** + * + * + *
+     * The operator to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + int getOpValue(); + /** + * + * + *
+     * The operator to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldFilter.Operator getOp(); + + /** + * + * + *
+     * The value to compare to.
+     * 
+ * + * .google.firestore.v1.Value value = 3; + */ + boolean hasValue(); + /** + * + * + *
+     * The value to compare to.
+     * 
+ * + * .google.firestore.v1.Value value = 3; + */ + com.google.firestore.v1.Value getValue(); + /** + * + * + *
+     * The value to compare to.
+     * 
+ * + * .google.firestore.v1.Value value = 3; + */ + com.google.firestore.v1.ValueOrBuilder getValueOrBuilder(); + } + /** + * + * + *
+   * A filter on a specific field.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.FieldFilter} + */ + public static final class FieldFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.FieldFilter) + FieldFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldFilter.newBuilder() to construct. + private FieldFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldFilter() { + op_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FieldFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.StructuredQuery.FieldReference.Builder subBuilder = null; + if (field_ != null) { + subBuilder = field_.toBuilder(); + } + field_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.FieldReference.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(field_); + field_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + op_ = rawValue; + break; + } + case 26: + { + com.google.firestore.v1.Value.Builder subBuilder = null; + if (value_ != null) { + subBuilder = value_.toBuilder(); + } + value_ = + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(value_); + value_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.FieldFilter.class, + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder.class); + } + + /** + * + * + *
+     * A field filter operator.
+     * 
+ * + * Protobuf enum {@code google.firestore.v1.StructuredQuery.FieldFilter.Operator} + */ + public enum Operator implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * OPERATOR_UNSPECIFIED = 0; + */ + OPERATOR_UNSPECIFIED(0), + /** + * + * + *
+       * Less than. Requires that the field come first in `order_by`.
+       * 
+ * + * LESS_THAN = 1; + */ + LESS_THAN(1), + /** + * + * + *
+       * Less than or equal. Requires that the field come first in `order_by`.
+       * 
+ * + * LESS_THAN_OR_EQUAL = 2; + */ + LESS_THAN_OR_EQUAL(2), + /** + * + * + *
+       * Greater than. Requires that the field come first in `order_by`.
+       * 
+ * + * GREATER_THAN = 3; + */ + GREATER_THAN(3), + /** + * + * + *
+       * Greater than or equal. Requires that the field come first in
+       * `order_by`.
+       * 
+ * + * GREATER_THAN_OR_EQUAL = 4; + */ + GREATER_THAN_OR_EQUAL(4), + /** + * + * + *
+       * Equal.
+       * 
+ * + * EQUAL = 5; + */ + EQUAL(5), + /** + * + * + *
+       * Contains. Requires that the field is an array.
+       * 
+ * + * ARRAY_CONTAINS = 7; + */ + ARRAY_CONTAINS(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * OPERATOR_UNSPECIFIED = 0; + */ + public static final int OPERATOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Less than. Requires that the field come first in `order_by`.
+       * 
+ * + * LESS_THAN = 1; + */ + public static final int LESS_THAN_VALUE = 1; + /** + * + * + *
+       * Less than or equal. Requires that the field come first in `order_by`.
+       * 
+ * + * LESS_THAN_OR_EQUAL = 2; + */ + public static final int LESS_THAN_OR_EQUAL_VALUE = 2; + /** + * + * + *
+       * Greater than. Requires that the field come first in `order_by`.
+       * 
+ * + * GREATER_THAN = 3; + */ + public static final int GREATER_THAN_VALUE = 3; + /** + * + * + *
+       * Greater than or equal. Requires that the field come first in
+       * `order_by`.
+       * 
+ * + * GREATER_THAN_OR_EQUAL = 4; + */ + public static final int GREATER_THAN_OR_EQUAL_VALUE = 4; + /** + * + * + *
+       * Equal.
+       * 
+ * + * EQUAL = 5; + */ + public static final int EQUAL_VALUE = 5; + /** + * + * + *
+       * Contains. Requires that the field is an array.
+       * 
+ * + * ARRAY_CONTAINS = 7; + */ + public static final int ARRAY_CONTAINS_VALUE = 7; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static Operator valueOf(int value) { + return forNumber(value); + } + + public static Operator forNumber(int value) { + switch (value) { + case 0: + return OPERATOR_UNSPECIFIED; + case 1: + return LESS_THAN; + case 2: + return LESS_THAN_OR_EQUAL; + case 3: + return GREATER_THAN; + case 4: + return GREATER_THAN_OR_EQUAL; + case 5: + return EQUAL; + case 7: + return ARRAY_CONTAINS; + 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 Operator findValueByNumber(int number) { + return Operator.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.StructuredQuery.FieldFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Operator[] VALUES = values(); + + public static Operator 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 Operator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.StructuredQuery.FieldFilter.Operator) + } + + public static final int FIELD_FIELD_NUMBER = 1; + private com.google.firestore.v1.StructuredQuery.FieldReference field_; + /** + * + * + *
+     * The field to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public boolean hasField() { + return field_ != null; + } + /** + * + * + *
+     * The field to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getField() { + return field_ == null + ? com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance() + : field_; + } + /** + * + * + *
+     * The field to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder() { + return getField(); + } + + public static final int OP_FIELD_NUMBER = 2; + private int op_; + /** + * + * + *
+     * The operator to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public int getOpValue() { + return op_; + } + /** + * + * + *
+     * The operator to filter by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilter.Operator getOp() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.FieldFilter.Operator result = + com.google.firestore.v1.StructuredQuery.FieldFilter.Operator.valueOf(op_); + return result == null + ? com.google.firestore.v1.StructuredQuery.FieldFilter.Operator.UNRECOGNIZED + : result; + } + + public static final int VALUE_FIELD_NUMBER = 3; + private com.google.firestore.v1.Value value_; + /** + * + * + *
+     * The value to compare to.
+     * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public boolean hasValue() { + return value_ != null; + } + /** + * + * + *
+     * The value to compare to.
+     * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public com.google.firestore.v1.Value getValue() { + return value_ == null ? com.google.firestore.v1.Value.getDefaultInstance() : value_; + } + /** + * + * + *
+     * The value to compare to.
+     * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public com.google.firestore.v1.ValueOrBuilder getValueOrBuilder() { + return getValue(); + } + + 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 (field_ != null) { + output.writeMessage(1, getField()); + } + if (op_ + != com.google.firestore.v1.StructuredQuery.FieldFilter.Operator.OPERATOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, op_); + } + if (value_ != null) { + output.writeMessage(3, getValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (field_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getField()); + } + if (op_ + != com.google.firestore.v1.StructuredQuery.FieldFilter.Operator.OPERATOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, op_); + } + if (value_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getValue()); + } + 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.v1.StructuredQuery.FieldFilter)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.FieldFilter other = + (com.google.firestore.v1.StructuredQuery.FieldFilter) obj; + + boolean result = true; + result = result && (hasField() == other.hasField()); + if (hasField()) { + result = result && getField().equals(other.getField()); + } + result = result && op_ == other.op_; + result = result && (hasValue() == other.hasValue()); + if (hasValue()) { + result = result && getValue().equals(other.getValue()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasField()) { + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + } + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + op_; + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter 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.v1.StructuredQuery.FieldFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter 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.v1.StructuredQuery.FieldFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter 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.v1.StructuredQuery.FieldFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter 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.v1.StructuredQuery.FieldFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter 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.v1.StructuredQuery.FieldFilter 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 filter on a specific field.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.FieldFilter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.FieldFilter) + com.google.firestore.v1.StructuredQuery.FieldFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.FieldFilter.class, + com.google.firestore.v1.StructuredQuery.FieldFilter.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.FieldFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (fieldBuilder_ == null) { + field_ = null; + } else { + field_ = null; + fieldBuilder_ = null; + } + op_ = 0; + + if (valueBuilder_ == null) { + value_ = null; + } else { + value_ = null; + valueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldFilter_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.FieldFilter getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.FieldFilter build() { + com.google.firestore.v1.StructuredQuery.FieldFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.FieldFilter buildPartial() { + com.google.firestore.v1.StructuredQuery.FieldFilter result = + new com.google.firestore.v1.StructuredQuery.FieldFilter(this); + if (fieldBuilder_ == null) { + result.field_ = field_; + } else { + result.field_ = fieldBuilder_.build(); + } + result.op_ = op_; + if (valueBuilder_ == null) { + result.value_ = value_; + } else { + result.value_ = valueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.FieldFilter) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.FieldFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.FieldFilter other) { + if (other == com.google.firestore.v1.StructuredQuery.FieldFilter.getDefaultInstance()) + return this; + if (other.hasField()) { + mergeField(other.getField()); + } + if (other.op_ != 0) { + setOpValue(other.getOpValue()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + 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.v1.StructuredQuery.FieldFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.StructuredQuery.FieldFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.firestore.v1.StructuredQuery.FieldReference field_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + fieldBuilder_; + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public boolean hasField() { + return fieldBuilder_ != null || field_ != null; + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getField() { + if (fieldBuilder_ == null) { + return field_ == null + ? com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance() + : field_; + } else { + return fieldBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder setField(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + field_ = value; + onChanged(); + } else { + fieldBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder setField( + com.google.firestore.v1.StructuredQuery.FieldReference.Builder builderForValue) { + if (fieldBuilder_ == null) { + field_ = builderForValue.build(); + onChanged(); + } else { + fieldBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder mergeField(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldBuilder_ == null) { + if (field_ != null) { + field_ = + com.google.firestore.v1.StructuredQuery.FieldReference.newBuilder(field_) + .mergeFrom(value) + .buildPartial(); + } else { + field_ = value; + } + onChanged(); + } else { + fieldBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder clearField() { + if (fieldBuilder_ == null) { + field_ = null; + onChanged(); + } else { + field_ = null; + fieldBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference.Builder getFieldBuilder() { + + onChanged(); + return getFieldFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder() { + if (fieldBuilder_ != null) { + return fieldBuilder_.getMessageOrBuilder(); + } else { + return field_ == null + ? com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance() + : field_; + } + } + /** + * + * + *
+       * The field to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + getFieldFieldBuilder() { + if (fieldBuilder_ == null) { + fieldBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder>( + getField(), getParentForChildren(), isClean()); + field_ = null; + } + return fieldBuilder_; + } + + private int op_ = 0; + /** + * + * + *
+       * The operator to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public int getOpValue() { + return op_; + } + /** + * + * + *
+       * The operator to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public Builder setOpValue(int value) { + op_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The operator to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldFilter.Operator getOp() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.FieldFilter.Operator result = + com.google.firestore.v1.StructuredQuery.FieldFilter.Operator.valueOf(op_); + return result == null + ? com.google.firestore.v1.StructuredQuery.FieldFilter.Operator.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The operator to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public Builder setOp(com.google.firestore.v1.StructuredQuery.FieldFilter.Operator value) { + if (value == null) { + throw new NullPointerException(); + } + + op_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The operator to filter by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + public Builder clearOp() { + + op_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.v1.Value value_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + valueBuilder_; + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public boolean hasValue() { + return valueBuilder_ != null || value_ != null; + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public com.google.firestore.v1.Value getValue() { + if (valueBuilder_ == null) { + return value_ == null ? com.google.firestore.v1.Value.getDefaultInstance() : value_; + } else { + return valueBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public Builder setValue(com.google.firestore.v1.Value value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + valueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public Builder setValue(com.google.firestore.v1.Value.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public Builder mergeValue(com.google.firestore.v1.Value value) { + if (valueBuilder_ == null) { + if (value_ != null) { + value_ = + com.google.firestore.v1.Value.newBuilder(value_).mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + valueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public Builder clearValue() { + if (valueBuilder_ == null) { + value_ = null; + onChanged(); + } else { + value_ = null; + valueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public com.google.firestore.v1.Value.Builder getValueBuilder() { + + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + public com.google.firestore.v1.ValueOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_ == null ? com.google.firestore.v1.Value.getDefaultInstance() : value_; + } + } + /** + * + * + *
+       * The value to compare to.
+       * 
+ * + * .google.firestore.v1.Value value = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + getValue(), getParentForChildren(), isClean()); + value_ = null; + } + return valueBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.FieldFilter) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.FieldFilter) + private static final com.google.firestore.v1.StructuredQuery.FieldFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.FieldFilter(); + } + + public static com.google.firestore.v1.StructuredQuery.FieldFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FieldFilter(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.v1.StructuredQuery.FieldFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UnaryFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.UnaryFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The unary operator to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + int getOpValue(); + /** + * + * + *
+     * The unary operator to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator getOp(); + + /** + * + * + *
+     * The field to which to apply the operator.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + boolean hasField(); + /** + * + * + *
+     * The field to which to apply the operator.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldReference getField(); + /** + * + * + *
+     * The field to which to apply the operator.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder(); + + public com.google.firestore.v1.StructuredQuery.UnaryFilter.OperandTypeCase getOperandTypeCase(); + } + /** + * + * + *
+   * A filter with a single operand.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.UnaryFilter} + */ + public static final class UnaryFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.UnaryFilter) + UnaryFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use UnaryFilter.newBuilder() to construct. + private UnaryFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UnaryFilter() { + op_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UnaryFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + op_ = rawValue; + break; + } + case 18: + { + com.google.firestore.v1.StructuredQuery.FieldReference.Builder subBuilder = null; + if (operandTypeCase_ == 2) { + subBuilder = + ((com.google.firestore.v1.StructuredQuery.FieldReference) operandType_) + .toBuilder(); + } + operandType_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.FieldReference.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_); + operandType_ = subBuilder.buildPartial(); + } + operandTypeCase_ = 2; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.UnaryFilter.class, + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder.class); + } + + /** + * + * + *
+     * A unary operator.
+     * 
+ * + * Protobuf enum {@code google.firestore.v1.StructuredQuery.UnaryFilter.Operator} + */ + public enum Operator implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * OPERATOR_UNSPECIFIED = 0; + */ + OPERATOR_UNSPECIFIED(0), + /** + * + * + *
+       * Test if a field is equal to NaN.
+       * 
+ * + * IS_NAN = 2; + */ + IS_NAN(2), + /** + * + * + *
+       * Test if an exprestion evaluates to Null.
+       * 
+ * + * IS_NULL = 3; + */ + IS_NULL(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified. This value must not be used.
+       * 
+ * + * OPERATOR_UNSPECIFIED = 0; + */ + public static final int OPERATOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Test if a field is equal to NaN.
+       * 
+ * + * IS_NAN = 2; + */ + public static final int IS_NAN_VALUE = 2; + /** + * + * + *
+       * Test if an exprestion evaluates to Null.
+       * 
+ * + * IS_NULL = 3; + */ + public static final int IS_NULL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static Operator valueOf(int value) { + return forNumber(value); + } + + public static Operator forNumber(int value) { + switch (value) { + case 0: + return OPERATOR_UNSPECIFIED; + case 2: + return IS_NAN; + case 3: + return IS_NULL; + 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 Operator findValueByNumber(int number) { + return Operator.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.StructuredQuery.UnaryFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Operator[] VALUES = values(); + + public static Operator 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 Operator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.StructuredQuery.UnaryFilter.Operator) + } + + private int operandTypeCase_ = 0; + private java.lang.Object operandType_; + + public enum OperandTypeCase implements com.google.protobuf.Internal.EnumLite { + FIELD(2), + OPERANDTYPE_NOT_SET(0); + private final int value; + + private OperandTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static OperandTypeCase valueOf(int value) { + return forNumber(value); + } + + public static OperandTypeCase forNumber(int value) { + switch (value) { + case 2: + return FIELD; + case 0: + return OPERANDTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OperandTypeCase getOperandTypeCase() { + return OperandTypeCase.forNumber(operandTypeCase_); + } + + public static final int OP_FIELD_NUMBER = 1; + private int op_; + /** + * + * + *
+     * The unary operator to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public int getOpValue() { + return op_; + } + /** + * + * + *
+     * The unary operator to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator getOp() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator result = + com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator.valueOf(op_); + return result == null + ? com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator.UNRECOGNIZED + : result; + } + + public static final int FIELD_FIELD_NUMBER = 2; + /** + * + * + *
+     * The field to which to apply the operator.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public boolean hasField() { + return operandTypeCase_ == 2; + } + /** + * + * + *
+     * The field to which to apply the operator.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getField() { + if (operandTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_; + } + return com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance(); + } + /** + * + * + *
+     * The field to which to apply the operator.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder() { + if (operandTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_; + } + return com.google.firestore.v1.StructuredQuery.FieldReference.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 (op_ + != com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator.OPERATOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, op_); + } + if (operandTypeCase_ == 2) { + output.writeMessage( + 2, (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (op_ + != com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator.OPERATOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, op_); + } + if (operandTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_); + } + 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.v1.StructuredQuery.UnaryFilter)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.UnaryFilter other = + (com.google.firestore.v1.StructuredQuery.UnaryFilter) obj; + + boolean result = true; + result = result && op_ == other.op_; + result = result && getOperandTypeCase().equals(other.getOperandTypeCase()); + if (!result) return false; + switch (operandTypeCase_) { + case 2: + result = result && getField().equals(other.getField()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + op_; + switch (operandTypeCase_) { + case 2: + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter 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.v1.StructuredQuery.UnaryFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter 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.v1.StructuredQuery.UnaryFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter 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.v1.StructuredQuery.UnaryFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter 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.v1.StructuredQuery.UnaryFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter 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.v1.StructuredQuery.UnaryFilter 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 filter with a single operand.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.UnaryFilter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.UnaryFilter) + com.google.firestore.v1.StructuredQuery.UnaryFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.UnaryFilter.class, + com.google.firestore.v1.StructuredQuery.UnaryFilter.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.UnaryFilter.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(); + op_ = 0; + + operandTypeCase_ = 0; + operandType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_UnaryFilter_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.UnaryFilter getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.UnaryFilter build() { + com.google.firestore.v1.StructuredQuery.UnaryFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.UnaryFilter buildPartial() { + com.google.firestore.v1.StructuredQuery.UnaryFilter result = + new com.google.firestore.v1.StructuredQuery.UnaryFilter(this); + result.op_ = op_; + if (operandTypeCase_ == 2) { + if (fieldBuilder_ == null) { + result.operandType_ = operandType_; + } else { + result.operandType_ = fieldBuilder_.build(); + } + } + result.operandTypeCase_ = operandTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.UnaryFilter) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.UnaryFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.UnaryFilter other) { + if (other == com.google.firestore.v1.StructuredQuery.UnaryFilter.getDefaultInstance()) + return this; + if (other.op_ != 0) { + setOpValue(other.getOpValue()); + } + switch (other.getOperandTypeCase()) { + case FIELD: + { + mergeField(other.getField()); + break; + } + case OPERANDTYPE_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.v1.StructuredQuery.UnaryFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.StructuredQuery.UnaryFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int operandTypeCase_ = 0; + private java.lang.Object operandType_; + + public OperandTypeCase getOperandTypeCase() { + return OperandTypeCase.forNumber(operandTypeCase_); + } + + public Builder clearOperandType() { + operandTypeCase_ = 0; + operandType_ = null; + onChanged(); + return this; + } + + private int op_ = 0; + /** + * + * + *
+       * The unary operator to apply.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public int getOpValue() { + return op_; + } + /** + * + * + *
+       * The unary operator to apply.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public Builder setOpValue(int value) { + op_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The unary operator to apply.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator getOp() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator result = + com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator.valueOf(op_); + return result == null + ? com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The unary operator to apply.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public Builder setOp(com.google.firestore.v1.StructuredQuery.UnaryFilter.Operator value) { + if (value == null) { + throw new NullPointerException(); + } + + op_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The unary operator to apply.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + public Builder clearOp() { + + op_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + fieldBuilder_; + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public boolean hasField() { + return operandTypeCase_ == 2; + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getField() { + if (fieldBuilder_ == null) { + if (operandTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_; + } + return com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance(); + } else { + if (operandTypeCase_ == 2) { + return fieldBuilder_.getMessage(); + } + return com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance(); + } + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public Builder setField(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operandType_ = value; + onChanged(); + } else { + fieldBuilder_.setMessage(value); + } + operandTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public Builder setField( + com.google.firestore.v1.StructuredQuery.FieldReference.Builder builderForValue) { + if (fieldBuilder_ == null) { + operandType_ = builderForValue.build(); + onChanged(); + } else { + fieldBuilder_.setMessage(builderForValue.build()); + } + operandTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public Builder mergeField(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldBuilder_ == null) { + if (operandTypeCase_ == 2 + && operandType_ + != com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance()) { + operandType_ = + com.google.firestore.v1.StructuredQuery.FieldReference.newBuilder( + (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_) + .mergeFrom(value) + .buildPartial(); + } else { + operandType_ = value; + } + onChanged(); + } else { + if (operandTypeCase_ == 2) { + fieldBuilder_.mergeFrom(value); + } + fieldBuilder_.setMessage(value); + } + operandTypeCase_ = 2; + return this; + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public Builder clearField() { + if (fieldBuilder_ == null) { + if (operandTypeCase_ == 2) { + operandTypeCase_ = 0; + operandType_ = null; + onChanged(); + } + } else { + if (operandTypeCase_ == 2) { + operandTypeCase_ = 0; + operandType_ = null; + } + fieldBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference.Builder getFieldBuilder() { + return getFieldFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder() { + if ((operandTypeCase_ == 2) && (fieldBuilder_ != null)) { + return fieldBuilder_.getMessageOrBuilder(); + } else { + if (operandTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_; + } + return com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance(); + } + } + /** + * + * + *
+       * The field to which to apply the operator.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + getFieldFieldBuilder() { + if (fieldBuilder_ == null) { + if (!(operandTypeCase_ == 2)) { + operandType_ = + com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance(); + } + fieldBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder>( + (com.google.firestore.v1.StructuredQuery.FieldReference) operandType_, + getParentForChildren(), + isClean()); + operandType_ = null; + } + operandTypeCase_ = 2; + onChanged(); + ; + return fieldBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.UnaryFilter) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.UnaryFilter) + private static final com.google.firestore.v1.StructuredQuery.UnaryFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.UnaryFilter(); + } + + public static com.google.firestore.v1.StructuredQuery.UnaryFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UnaryFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UnaryFilter(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.v1.StructuredQuery.UnaryFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OrderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.Order) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The field to order by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + boolean hasField(); + /** + * + * + *
+     * The field to order by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + com.google.firestore.v1.StructuredQuery.FieldReference getField(); + /** + * + * + *
+     * The field to order by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder(); + + /** + * + * + *
+     * The direction to order by. Defaults to `ASCENDING`.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + int getDirectionValue(); + /** + * + * + *
+     * The direction to order by. Defaults to `ASCENDING`.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + com.google.firestore.v1.StructuredQuery.Direction getDirection(); + } + /** + * + * + *
+   * An order on a field.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.Order} + */ + public static final class Order extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.Order) + OrderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Order.newBuilder() to construct. + private Order(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Order() { + direction_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Order( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.StructuredQuery.FieldReference.Builder subBuilder = null; + if (field_ != null) { + subBuilder = field_.toBuilder(); + } + field_ = + input.readMessage( + com.google.firestore.v1.StructuredQuery.FieldReference.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(field_); + field_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + direction_ = rawValue; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Order_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Order_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.Order.class, + com.google.firestore.v1.StructuredQuery.Order.Builder.class); + } + + public static final int FIELD_FIELD_NUMBER = 1; + private com.google.firestore.v1.StructuredQuery.FieldReference field_; + /** + * + * + *
+     * The field to order by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public boolean hasField() { + return field_ != null; + } + /** + * + * + *
+     * The field to order by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getField() { + return field_ == null + ? com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance() + : field_; + } + /** + * + * + *
+     * The field to order by.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder() { + return getField(); + } + + public static final int DIRECTION_FIELD_NUMBER = 2; + private int direction_; + /** + * + * + *
+     * The direction to order by. Defaults to `ASCENDING`.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+     * The direction to order by. Defaults to `ASCENDING`.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public com.google.firestore.v1.StructuredQuery.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.Direction result = + com.google.firestore.v1.StructuredQuery.Direction.valueOf(direction_); + return result == null + ? com.google.firestore.v1.StructuredQuery.Direction.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 (field_ != null) { + output.writeMessage(1, getField()); + } + if (direction_ + != com.google.firestore.v1.StructuredQuery.Direction.DIRECTION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, direction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (field_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getField()); + } + if (direction_ + != com.google.firestore.v1.StructuredQuery.Direction.DIRECTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, direction_); + } + 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.v1.StructuredQuery.Order)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.Order other = + (com.google.firestore.v1.StructuredQuery.Order) obj; + + boolean result = true; + result = result && (hasField() == other.hasField()); + if (hasField()) { + result = result && getField().equals(other.getField()); + } + result = result && direction_ == other.direction_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasField()) { + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + } + hash = (37 * hash) + DIRECTION_FIELD_NUMBER; + hash = (53 * hash) + direction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.Order parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Order 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.v1.StructuredQuery.Order parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Order 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.v1.StructuredQuery.Order parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Order parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.Order parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Order 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.v1.StructuredQuery.Order parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Order 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.v1.StructuredQuery.Order parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Order 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.v1.StructuredQuery.Order prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * An order on a field.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.Order} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.Order) + com.google.firestore.v1.StructuredQuery.OrderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Order_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Order_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.Order.class, + com.google.firestore.v1.StructuredQuery.Order.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.Order.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (fieldBuilder_ == null) { + field_ = null; + } else { + field_ = null; + fieldBuilder_ = null; + } + direction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Order_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Order getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.Order.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Order build() { + com.google.firestore.v1.StructuredQuery.Order result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Order buildPartial() { + com.google.firestore.v1.StructuredQuery.Order result = + new com.google.firestore.v1.StructuredQuery.Order(this); + if (fieldBuilder_ == null) { + result.field_ = field_; + } else { + result.field_ = fieldBuilder_.build(); + } + result.direction_ = direction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.Order) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.Order) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.Order other) { + if (other == com.google.firestore.v1.StructuredQuery.Order.getDefaultInstance()) + return this; + if (other.hasField()) { + mergeField(other.getField()); + } + if (other.direction_ != 0) { + setDirectionValue(other.getDirectionValue()); + } + 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.v1.StructuredQuery.Order parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.StructuredQuery.Order) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.firestore.v1.StructuredQuery.FieldReference field_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + fieldBuilder_; + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public boolean hasField() { + return fieldBuilder_ != null || field_ != null; + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getField() { + if (fieldBuilder_ == null) { + return field_ == null + ? com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance() + : field_; + } else { + return fieldBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder setField(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + field_ = value; + onChanged(); + } else { + fieldBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder setField( + com.google.firestore.v1.StructuredQuery.FieldReference.Builder builderForValue) { + if (fieldBuilder_ == null) { + field_ = builderForValue.build(); + onChanged(); + } else { + fieldBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder mergeField(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldBuilder_ == null) { + if (field_ != null) { + field_ = + com.google.firestore.v1.StructuredQuery.FieldReference.newBuilder(field_) + .mergeFrom(value) + .buildPartial(); + } else { + field_ = value; + } + onChanged(); + } else { + fieldBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public Builder clearField() { + if (fieldBuilder_ == null) { + field_ = null; + onChanged(); + } else { + field_ = null; + fieldBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference.Builder getFieldBuilder() { + + onChanged(); + return getFieldFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldOrBuilder() { + if (fieldBuilder_ != null) { + return fieldBuilder_.getMessageOrBuilder(); + } else { + return field_ == null + ? com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance() + : field_; + } + } + /** + * + * + *
+       * The field to order by.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + getFieldFieldBuilder() { + if (fieldBuilder_ == null) { + fieldBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder>( + getField(), getParentForChildren(), isClean()); + field_ = null; + } + return fieldBuilder_; + } + + private int direction_ = 0; + /** + * + * + *
+       * The direction to order by. Defaults to `ASCENDING`.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+       * The direction to order by. Defaults to `ASCENDING`.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public Builder setDirectionValue(int value) { + direction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The direction to order by. Defaults to `ASCENDING`.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public com.google.firestore.v1.StructuredQuery.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.StructuredQuery.Direction result = + com.google.firestore.v1.StructuredQuery.Direction.valueOf(direction_); + return result == null + ? com.google.firestore.v1.StructuredQuery.Direction.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The direction to order by. Defaults to `ASCENDING`.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public Builder setDirection(com.google.firestore.v1.StructuredQuery.Direction value) { + if (value == null) { + throw new NullPointerException(); + } + + direction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The direction to order by. Defaults to `ASCENDING`.
+       * 
+ * + * .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + public Builder clearDirection() { + + direction_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.Order) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.Order) + private static final com.google.firestore.v1.StructuredQuery.Order DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.Order(); + } + + public static com.google.firestore.v1.StructuredQuery.Order getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Order parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Order(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.v1.StructuredQuery.Order getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FieldReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.FieldReference) + com.google.protobuf.MessageOrBuilder { + + /** string field_path = 2; */ + java.lang.String getFieldPath(); + /** string field_path = 2; */ + com.google.protobuf.ByteString getFieldPathBytes(); + } + /** + * + * + *
+   * A reference to a field, such as `max(messages.time) as max_time`.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.FieldReference} + */ + public static final class FieldReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.FieldReference) + FieldReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldReference.newBuilder() to construct. + private FieldReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldReference() { + fieldPath_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FieldReference( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + fieldPath_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.FieldReference.class, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder.class); + } + + public static final int FIELD_PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object fieldPath_; + /** string field_path = 2; */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + 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(); + fieldPath_ = s; + return s; + } + } + /** string field_path = 2; */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getFieldPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fieldPath_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFieldPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fieldPath_); + } + 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.v1.StructuredQuery.FieldReference)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.FieldReference other = + (com.google.firestore.v1.StructuredQuery.FieldReference) obj; + + boolean result = true; + result = result && getFieldPath().equals(other.getFieldPath()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference 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.v1.StructuredQuery.FieldReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference 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.v1.StructuredQuery.FieldReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference 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.v1.StructuredQuery.FieldReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference 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.v1.StructuredQuery.FieldReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference 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.v1.StructuredQuery.FieldReference 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 reference to a field, such as `max(messages.time) as max_time`.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.FieldReference} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.FieldReference) + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.FieldReference.class, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.FieldReference.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(); + fieldPath_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_FieldReference_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.FieldReference getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.FieldReference build() { + com.google.firestore.v1.StructuredQuery.FieldReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.FieldReference buildPartial() { + com.google.firestore.v1.StructuredQuery.FieldReference result = + new com.google.firestore.v1.StructuredQuery.FieldReference(this); + result.fieldPath_ = fieldPath_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.FieldReference) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.FieldReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.FieldReference other) { + if (other == com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance()) + return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + 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.v1.StructuredQuery.FieldReference parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.StructuredQuery.FieldReference) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object fieldPath_ = ""; + /** string field_path = 2; */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** string field_path = 2; */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** string field_path = 2; */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fieldPath_ = value; + onChanged(); + return this; + } + /** string field_path = 2; */ + public Builder clearFieldPath() { + + fieldPath_ = getDefaultInstance().getFieldPath(); + onChanged(); + return this; + } + /** string field_path = 2; */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fieldPath_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.FieldReference) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.FieldReference) + private static final com.google.firestore.v1.StructuredQuery.FieldReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.FieldReference(); + } + + public static com.google.firestore.v1.StructuredQuery.FieldReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FieldReference(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.v1.StructuredQuery.FieldReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ProjectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery.Projection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + java.util.List getFieldsList(); + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldReference getFields(int index); + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + int getFieldsCount(); + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + java.util.List + getFieldsOrBuilderList(); + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldsOrBuilder(int index); + } + /** + * + * + *
+   * The projection of document's fields to return.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.Projection} + */ + public static final class Projection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.StructuredQuery.Projection) + ProjectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Projection.newBuilder() to construct. + private Projection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Projection() { + fields_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Projection( + 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 18: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + fields_ = + new java.util.ArrayList< + com.google.firestore.v1.StructuredQuery.FieldReference>(); + mutable_bitField0_ |= 0x00000001; + } + fields_.add( + input.readMessage( + com.google.firestore.v1.StructuredQuery.FieldReference.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Projection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Projection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.Projection.class, + com.google.firestore.v1.StructuredQuery.Projection.Builder.class); + } + + public static final int FIELDS_FIELD_NUMBER = 2; + private java.util.List fields_; + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public java.util.List getFieldsList() { + return fields_; + } + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public java.util.List + getFieldsOrBuilderList() { + return fields_; + } + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getFields(int index) { + return fields_.get(index); + } + /** + * + * + *
+     * The fields to return.
+     * If empty, all fields are returned. To only return the name
+     * of the document, use `['__name__']`.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldsOrBuilder( + int index) { + return fields_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < fields_.size(); i++) { + output.writeMessage(2, fields_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, fields_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.StructuredQuery.Projection)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery.Projection other = + (com.google.firestore.v1.StructuredQuery.Projection) obj; + + boolean result = true; + result = result && getFieldsList().equals(other.getFieldsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery.Projection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Projection 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.v1.StructuredQuery.Projection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Projection 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.v1.StructuredQuery.Projection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery.Projection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery.Projection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Projection 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.v1.StructuredQuery.Projection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Projection 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.v1.StructuredQuery.Projection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery.Projection 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.v1.StructuredQuery.Projection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The projection of document's fields to return.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery.Projection} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery.Projection) + com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Projection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Projection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.Projection.class, + com.google.firestore.v1.StructuredQuery.Projection.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.Projection.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFieldsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fieldsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_Projection_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Projection getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.Projection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Projection build() { + com.google.firestore.v1.StructuredQuery.Projection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery.Projection buildPartial() { + com.google.firestore.v1.StructuredQuery.Projection result = + new com.google.firestore.v1.StructuredQuery.Projection(this); + int from_bitField0_ = bitField0_; + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery.Projection) { + return mergeFrom((com.google.firestore.v1.StructuredQuery.Projection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery.Projection other) { + if (other == com.google.firestore.v1.StructuredQuery.Projection.getDefaultInstance()) + return this; + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + 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.v1.StructuredQuery.Projection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.StructuredQuery.Projection) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List fields_ = + java.util.Collections.emptyList(); + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + fields_ = + new java.util.ArrayList( + fields_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + fieldsBuilder_; + + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public java.util.List + getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder setFields( + int index, com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder setFields( + int index, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder addFields(com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder addFields( + int index, com.google.firestore.v1.StructuredQuery.FieldReference value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder addFields( + com.google.firestore.v1.StructuredQuery.FieldReference.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder addFields( + int index, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder addAllFields( + java.lang.Iterable + values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference.Builder getFieldsBuilder( + int index) { + return getFieldsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder getFieldsOrBuilder( + int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public java.util.List< + ? extends com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference.Builder addFieldsBuilder() { + return getFieldsFieldBuilder() + .addBuilder( + com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance()); + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public com.google.firestore.v1.StructuredQuery.FieldReference.Builder addFieldsBuilder( + int index) { + return getFieldsFieldBuilder() + .addBuilder( + index, com.google.firestore.v1.StructuredQuery.FieldReference.getDefaultInstance()); + } + /** + * + * + *
+       * The fields to return.
+       * If empty, all fields are returned. To only return the name
+       * of the document, use `['__name__']`.
+       * 
+ * + * repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + public java.util.List + getFieldsBuilderList() { + return getFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.FieldReference, + com.google.firestore.v1.StructuredQuery.FieldReference.Builder, + com.google.firestore.v1.StructuredQuery.FieldReferenceOrBuilder>( + fields_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery.Projection) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery.Projection) + private static final com.google.firestore.v1.StructuredQuery.Projection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery.Projection(); + } + + public static com.google.firestore.v1.StructuredQuery.Projection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Projection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Projection(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.v1.StructuredQuery.Projection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int SELECT_FIELD_NUMBER = 1; + private com.google.firestore.v1.StructuredQuery.Projection select_; + /** + * + * + *
+   * The projection to return.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public boolean hasSelect() { + return select_ != null; + } + /** + * + * + *
+   * The projection to return.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public com.google.firestore.v1.StructuredQuery.Projection getSelect() { + return select_ == null + ? com.google.firestore.v1.StructuredQuery.Projection.getDefaultInstance() + : select_; + } + /** + * + * + *
+   * The projection to return.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder getSelectOrBuilder() { + return getSelect(); + } + + public static final int FROM_FIELD_NUMBER = 2; + private java.util.List from_; + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public java.util.List getFromList() { + return from_; + } + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public java.util.List< + ? extends com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder> + getFromOrBuilderList() { + return from_; + } + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public int getFromCount() { + return from_.size(); + } + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelector getFrom(int index) { + return from_.get(index); + } + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder getFromOrBuilder( + int index) { + return from_.get(index); + } + + public static final int WHERE_FIELD_NUMBER = 3; + private com.google.firestore.v1.StructuredQuery.Filter where_; + /** + * + * + *
+   * The filter to apply.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public boolean hasWhere() { + return where_ != null; + } + /** + * + * + *
+   * The filter to apply.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public com.google.firestore.v1.StructuredQuery.Filter getWhere() { + return where_ == null + ? com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance() + : where_; + } + /** + * + * + *
+   * The filter to apply.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public com.google.firestore.v1.StructuredQuery.FilterOrBuilder getWhereOrBuilder() { + return getWhere(); + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private java.util.List orderBy_; + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public java.util.List getOrderByList() { + return orderBy_; + } + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public java.util.List + getOrderByOrBuilderList() { + return orderBy_; + } + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public int getOrderByCount() { + return orderBy_.size(); + } + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.Order getOrderBy(int index) { + return orderBy_.get(index); + } + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.OrderOrBuilder getOrderByOrBuilder(int index) { + return orderBy_.get(index); + } + + public static final int START_AT_FIELD_NUMBER = 7; + private com.google.firestore.v1.Cursor startAt_; + /** + * + * + *
+   * A starting point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public boolean hasStartAt() { + return startAt_ != null; + } + /** + * + * + *
+   * A starting point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public com.google.firestore.v1.Cursor getStartAt() { + return startAt_ == null ? com.google.firestore.v1.Cursor.getDefaultInstance() : startAt_; + } + /** + * + * + *
+   * A starting point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public com.google.firestore.v1.CursorOrBuilder getStartAtOrBuilder() { + return getStartAt(); + } + + public static final int END_AT_FIELD_NUMBER = 8; + private com.google.firestore.v1.Cursor endAt_; + /** + * + * + *
+   * A end point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public boolean hasEndAt() { + return endAt_ != null; + } + /** + * + * + *
+   * A end point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public com.google.firestore.v1.Cursor getEndAt() { + return endAt_ == null ? com.google.firestore.v1.Cursor.getDefaultInstance() : endAt_; + } + /** + * + * + *
+   * A end point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public com.google.firestore.v1.CursorOrBuilder getEndAtOrBuilder() { + return getEndAt(); + } + + public static final int OFFSET_FIELD_NUMBER = 6; + private int offset_; + /** + * + * + *
+   * The number of results to skip.
+   * Applies before limit, but after all other constraints. Must be >= 0 if
+   * specified.
+   * 
+ * + * int32 offset = 6; + */ + public int getOffset() { + return offset_; + } + + public static final int LIMIT_FIELD_NUMBER = 5; + private com.google.protobuf.Int32Value limit_; + /** + * + * + *
+   * The maximum number of results to return.
+   * Applies after all other constraints.
+   * Must be >= 0 if specified.
+   * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public boolean hasLimit() { + return limit_ != null; + } + /** + * + * + *
+   * The maximum number of results to return.
+   * Applies after all other constraints.
+   * Must be >= 0 if specified.
+   * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public com.google.protobuf.Int32Value getLimit() { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } + /** + * + * + *
+   * The maximum number of results to return.
+   * Applies after all other constraints.
+   * Must be >= 0 if specified.
+   * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { + return getLimit(); + } + + 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 (select_ != null) { + output.writeMessage(1, getSelect()); + } + for (int i = 0; i < from_.size(); i++) { + output.writeMessage(2, from_.get(i)); + } + if (where_ != null) { + output.writeMessage(3, getWhere()); + } + for (int i = 0; i < orderBy_.size(); i++) { + output.writeMessage(4, orderBy_.get(i)); + } + if (limit_ != null) { + output.writeMessage(5, getLimit()); + } + if (offset_ != 0) { + output.writeInt32(6, offset_); + } + if (startAt_ != null) { + output.writeMessage(7, getStartAt()); + } + if (endAt_ != null) { + output.writeMessage(8, getEndAt()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (select_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSelect()); + } + for (int i = 0; i < from_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, from_.get(i)); + } + if (where_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getWhere()); + } + for (int i = 0; i < orderBy_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, orderBy_.get(i)); + } + if (limit_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getLimit()); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, offset_); + } + if (startAt_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getStartAt()); + } + if (endAt_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getEndAt()); + } + 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.v1.StructuredQuery)) { + return super.equals(obj); + } + com.google.firestore.v1.StructuredQuery other = (com.google.firestore.v1.StructuredQuery) obj; + + boolean result = true; + result = result && (hasSelect() == other.hasSelect()); + if (hasSelect()) { + result = result && getSelect().equals(other.getSelect()); + } + result = result && getFromList().equals(other.getFromList()); + result = result && (hasWhere() == other.hasWhere()); + if (hasWhere()) { + result = result && getWhere().equals(other.getWhere()); + } + result = result && getOrderByList().equals(other.getOrderByList()); + result = result && (hasStartAt() == other.hasStartAt()); + if (hasStartAt()) { + result = result && getStartAt().equals(other.getStartAt()); + } + result = result && (hasEndAt() == other.hasEndAt()); + if (hasEndAt()) { + result = result && getEndAt().equals(other.getEndAt()); + } + result = result && (getOffset() == other.getOffset()); + result = result && (hasLimit() == other.hasLimit()); + if (hasLimit()) { + result = result && getLimit().equals(other.getLimit()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSelect()) { + hash = (37 * hash) + SELECT_FIELD_NUMBER; + hash = (53 * hash) + getSelect().hashCode(); + } + if (getFromCount() > 0) { + hash = (37 * hash) + FROM_FIELD_NUMBER; + hash = (53 * hash) + getFromList().hashCode(); + } + if (hasWhere()) { + hash = (37 * hash) + WHERE_FIELD_NUMBER; + hash = (53 * hash) + getWhere().hashCode(); + } + if (getOrderByCount() > 0) { + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderByList().hashCode(); + } + if (hasStartAt()) { + hash = (37 * hash) + START_AT_FIELD_NUMBER; + hash = (53 * hash) + getStartAt().hashCode(); + } + if (hasEndAt()) { + hash = (37 * hash) + END_AT_FIELD_NUMBER; + hash = (53 * hash) + getEndAt().hashCode(); + } + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + if (hasLimit()) { + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.StructuredQuery parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery 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.v1.StructuredQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery 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.v1.StructuredQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.StructuredQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.StructuredQuery parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery 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.v1.StructuredQuery parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery 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.v1.StructuredQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.StructuredQuery 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.v1.StructuredQuery 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 query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.StructuredQuery} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.StructuredQuery) + com.google.firestore.v1.StructuredQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.StructuredQuery.class, + com.google.firestore.v1.StructuredQuery.Builder.class); + } + + // Construct using com.google.firestore.v1.StructuredQuery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFromFieldBuilder(); + getOrderByFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (selectBuilder_ == null) { + select_ = null; + } else { + select_ = null; + selectBuilder_ = null; + } + if (fromBuilder_ == null) { + from_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + fromBuilder_.clear(); + } + if (whereBuilder_ == null) { + where_ = null; + } else { + where_ = null; + whereBuilder_ = null; + } + if (orderByBuilder_ == null) { + orderBy_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + orderByBuilder_.clear(); + } + if (startAtBuilder_ == null) { + startAt_ = null; + } else { + startAt_ = null; + startAtBuilder_ = null; + } + if (endAtBuilder_ == null) { + endAt_ = null; + } else { + endAt_ = null; + endAtBuilder_ = null; + } + offset_ = 0; + + if (limitBuilder_ == null) { + limit_ = null; + } else { + limit_ = null; + limitBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProto + .internal_static_google_firestore_v1_StructuredQuery_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery getDefaultInstanceForType() { + return com.google.firestore.v1.StructuredQuery.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery build() { + com.google.firestore.v1.StructuredQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.StructuredQuery buildPartial() { + com.google.firestore.v1.StructuredQuery result = + new com.google.firestore.v1.StructuredQuery(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (selectBuilder_ == null) { + result.select_ = select_; + } else { + result.select_ = selectBuilder_.build(); + } + if (fromBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + from_ = java.util.Collections.unmodifiableList(from_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.from_ = from_; + } else { + result.from_ = fromBuilder_.build(); + } + if (whereBuilder_ == null) { + result.where_ = where_; + } else { + result.where_ = whereBuilder_.build(); + } + if (orderByBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + orderBy_ = java.util.Collections.unmodifiableList(orderBy_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.orderBy_ = orderBy_; + } else { + result.orderBy_ = orderByBuilder_.build(); + } + if (startAtBuilder_ == null) { + result.startAt_ = startAt_; + } else { + result.startAt_ = startAtBuilder_.build(); + } + if (endAtBuilder_ == null) { + result.endAt_ = endAt_; + } else { + result.endAt_ = endAtBuilder_.build(); + } + result.offset_ = offset_; + if (limitBuilder_ == null) { + result.limit_ = limit_; + } else { + result.limit_ = limitBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.StructuredQuery) { + return mergeFrom((com.google.firestore.v1.StructuredQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.StructuredQuery other) { + if (other == com.google.firestore.v1.StructuredQuery.getDefaultInstance()) return this; + if (other.hasSelect()) { + mergeSelect(other.getSelect()); + } + if (fromBuilder_ == null) { + if (!other.from_.isEmpty()) { + if (from_.isEmpty()) { + from_ = other.from_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFromIsMutable(); + from_.addAll(other.from_); + } + onChanged(); + } + } else { + if (!other.from_.isEmpty()) { + if (fromBuilder_.isEmpty()) { + fromBuilder_.dispose(); + fromBuilder_ = null; + from_ = other.from_; + bitField0_ = (bitField0_ & ~0x00000002); + fromBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFromFieldBuilder() + : null; + } else { + fromBuilder_.addAllMessages(other.from_); + } + } + } + if (other.hasWhere()) { + mergeWhere(other.getWhere()); + } + if (orderByBuilder_ == null) { + if (!other.orderBy_.isEmpty()) { + if (orderBy_.isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureOrderByIsMutable(); + orderBy_.addAll(other.orderBy_); + } + onChanged(); + } + } else { + if (!other.orderBy_.isEmpty()) { + if (orderByBuilder_.isEmpty()) { + orderByBuilder_.dispose(); + orderByBuilder_ = null; + orderBy_ = other.orderBy_; + bitField0_ = (bitField0_ & ~0x00000008); + orderByBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOrderByFieldBuilder() + : null; + } else { + orderByBuilder_.addAllMessages(other.orderBy_); + } + } + } + if (other.hasStartAt()) { + mergeStartAt(other.getStartAt()); + } + if (other.hasEndAt()) { + mergeEndAt(other.getEndAt()); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (other.hasLimit()) { + mergeLimit(other.getLimit()); + } + 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.v1.StructuredQuery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.StructuredQuery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.firestore.v1.StructuredQuery.Projection select_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Projection, + com.google.firestore.v1.StructuredQuery.Projection.Builder, + com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder> + selectBuilder_; + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public boolean hasSelect() { + return selectBuilder_ != null || select_ != null; + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public com.google.firestore.v1.StructuredQuery.Projection getSelect() { + if (selectBuilder_ == null) { + return select_ == null + ? com.google.firestore.v1.StructuredQuery.Projection.getDefaultInstance() + : select_; + } else { + return selectBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public Builder setSelect(com.google.firestore.v1.StructuredQuery.Projection value) { + if (selectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + select_ = value; + onChanged(); + } else { + selectBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public Builder setSelect( + com.google.firestore.v1.StructuredQuery.Projection.Builder builderForValue) { + if (selectBuilder_ == null) { + select_ = builderForValue.build(); + onChanged(); + } else { + selectBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public Builder mergeSelect(com.google.firestore.v1.StructuredQuery.Projection value) { + if (selectBuilder_ == null) { + if (select_ != null) { + select_ = + com.google.firestore.v1.StructuredQuery.Projection.newBuilder(select_) + .mergeFrom(value) + .buildPartial(); + } else { + select_ = value; + } + onChanged(); + } else { + selectBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public Builder clearSelect() { + if (selectBuilder_ == null) { + select_ = null; + onChanged(); + } else { + select_ = null; + selectBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public com.google.firestore.v1.StructuredQuery.Projection.Builder getSelectBuilder() { + + onChanged(); + return getSelectFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + public com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder getSelectOrBuilder() { + if (selectBuilder_ != null) { + return selectBuilder_.getMessageOrBuilder(); + } else { + return select_ == null + ? com.google.firestore.v1.StructuredQuery.Projection.getDefaultInstance() + : select_; + } + } + /** + * + * + *
+     * The projection to return.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Projection, + com.google.firestore.v1.StructuredQuery.Projection.Builder, + com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder> + getSelectFieldBuilder() { + if (selectBuilder_ == null) { + selectBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Projection, + com.google.firestore.v1.StructuredQuery.Projection.Builder, + com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder>( + getSelect(), getParentForChildren(), isClean()); + select_ = null; + } + return selectBuilder_; + } + + private java.util.List from_ = + java.util.Collections.emptyList(); + + private void ensureFromIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + from_ = + new java.util.ArrayList( + from_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.CollectionSelector, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder, + com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder> + fromBuilder_; + + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public java.util.List + getFromList() { + if (fromBuilder_ == null) { + return java.util.Collections.unmodifiableList(from_); + } else { + return fromBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public int getFromCount() { + if (fromBuilder_ == null) { + return from_.size(); + } else { + return fromBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelector getFrom(int index) { + if (fromBuilder_ == null) { + return from_.get(index); + } else { + return fromBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder setFrom( + int index, com.google.firestore.v1.StructuredQuery.CollectionSelector value) { + if (fromBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFromIsMutable(); + from_.set(index, value); + onChanged(); + } else { + fromBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder setFrom( + int index, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder builderForValue) { + if (fromBuilder_ == null) { + ensureFromIsMutable(); + from_.set(index, builderForValue.build()); + onChanged(); + } else { + fromBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder addFrom(com.google.firestore.v1.StructuredQuery.CollectionSelector value) { + if (fromBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFromIsMutable(); + from_.add(value); + onChanged(); + } else { + fromBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder addFrom( + int index, com.google.firestore.v1.StructuredQuery.CollectionSelector value) { + if (fromBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFromIsMutable(); + from_.add(index, value); + onChanged(); + } else { + fromBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder addFrom( + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder builderForValue) { + if (fromBuilder_ == null) { + ensureFromIsMutable(); + from_.add(builderForValue.build()); + onChanged(); + } else { + fromBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder addFrom( + int index, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder builderForValue) { + if (fromBuilder_ == null) { + ensureFromIsMutable(); + from_.add(index, builderForValue.build()); + onChanged(); + } else { + fromBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder addAllFrom( + java.lang.Iterable + values) { + if (fromBuilder_ == null) { + ensureFromIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, from_); + onChanged(); + } else { + fromBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder clearFrom() { + if (fromBuilder_ == null) { + from_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + fromBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public Builder removeFrom(int index) { + if (fromBuilder_ == null) { + ensureFromIsMutable(); + from_.remove(index); + onChanged(); + } else { + fromBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder getFromBuilder( + int index) { + return getFromFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder getFromOrBuilder( + int index) { + if (fromBuilder_ == null) { + return from_.get(index); + } else { + return fromBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public java.util.List< + ? extends com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder> + getFromOrBuilderList() { + if (fromBuilder_ != null) { + return fromBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(from_); + } + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder addFromBuilder() { + return getFromFieldBuilder() + .addBuilder( + com.google.firestore.v1.StructuredQuery.CollectionSelector.getDefaultInstance()); + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder addFromBuilder( + int index) { + return getFromFieldBuilder() + .addBuilder( + index, + com.google.firestore.v1.StructuredQuery.CollectionSelector.getDefaultInstance()); + } + /** + * + * + *
+     * The collections to query.
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + public java.util.List + getFromBuilderList() { + return getFromFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.CollectionSelector, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder, + com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder> + getFromFieldBuilder() { + if (fromBuilder_ == null) { + fromBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.CollectionSelector, + com.google.firestore.v1.StructuredQuery.CollectionSelector.Builder, + com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder>( + from_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + from_ = null; + } + return fromBuilder_; + } + + private com.google.firestore.v1.StructuredQuery.Filter where_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Filter, + com.google.firestore.v1.StructuredQuery.Filter.Builder, + com.google.firestore.v1.StructuredQuery.FilterOrBuilder> + whereBuilder_; + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public boolean hasWhere() { + return whereBuilder_ != null || where_ != null; + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public com.google.firestore.v1.StructuredQuery.Filter getWhere() { + if (whereBuilder_ == null) { + return where_ == null + ? com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance() + : where_; + } else { + return whereBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public Builder setWhere(com.google.firestore.v1.StructuredQuery.Filter value) { + if (whereBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + where_ = value; + onChanged(); + } else { + whereBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public Builder setWhere( + com.google.firestore.v1.StructuredQuery.Filter.Builder builderForValue) { + if (whereBuilder_ == null) { + where_ = builderForValue.build(); + onChanged(); + } else { + whereBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public Builder mergeWhere(com.google.firestore.v1.StructuredQuery.Filter value) { + if (whereBuilder_ == null) { + if (where_ != null) { + where_ = + com.google.firestore.v1.StructuredQuery.Filter.newBuilder(where_) + .mergeFrom(value) + .buildPartial(); + } else { + where_ = value; + } + onChanged(); + } else { + whereBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public Builder clearWhere() { + if (whereBuilder_ == null) { + where_ = null; + onChanged(); + } else { + where_ = null; + whereBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public com.google.firestore.v1.StructuredQuery.Filter.Builder getWhereBuilder() { + + onChanged(); + return getWhereFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + public com.google.firestore.v1.StructuredQuery.FilterOrBuilder getWhereOrBuilder() { + if (whereBuilder_ != null) { + return whereBuilder_.getMessageOrBuilder(); + } else { + return where_ == null + ? com.google.firestore.v1.StructuredQuery.Filter.getDefaultInstance() + : where_; + } + } + /** + * + * + *
+     * The filter to apply.
+     * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Filter, + com.google.firestore.v1.StructuredQuery.Filter.Builder, + com.google.firestore.v1.StructuredQuery.FilterOrBuilder> + getWhereFieldBuilder() { + if (whereBuilder_ == null) { + whereBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Filter, + com.google.firestore.v1.StructuredQuery.Filter.Builder, + com.google.firestore.v1.StructuredQuery.FilterOrBuilder>( + getWhere(), getParentForChildren(), isClean()); + where_ = null; + } + return whereBuilder_; + } + + private java.util.List orderBy_ = + java.util.Collections.emptyList(); + + private void ensureOrderByIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + orderBy_ = new java.util.ArrayList(orderBy_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Order, + com.google.firestore.v1.StructuredQuery.Order.Builder, + com.google.firestore.v1.StructuredQuery.OrderOrBuilder> + orderByBuilder_; + + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public java.util.List getOrderByList() { + if (orderByBuilder_ == null) { + return java.util.Collections.unmodifiableList(orderBy_); + } else { + return orderByBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public int getOrderByCount() { + if (orderByBuilder_ == null) { + return orderBy_.size(); + } else { + return orderByBuilder_.getCount(); + } + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.Order getOrderBy(int index) { + if (orderByBuilder_ == null) { + return orderBy_.get(index); + } else { + return orderByBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder setOrderBy(int index, com.google.firestore.v1.StructuredQuery.Order value) { + if (orderByBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrderByIsMutable(); + orderBy_.set(index, value); + onChanged(); + } else { + orderByBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder setOrderBy( + int index, com.google.firestore.v1.StructuredQuery.Order.Builder builderForValue) { + if (orderByBuilder_ == null) { + ensureOrderByIsMutable(); + orderBy_.set(index, builderForValue.build()); + onChanged(); + } else { + orderByBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder addOrderBy(com.google.firestore.v1.StructuredQuery.Order value) { + if (orderByBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrderByIsMutable(); + orderBy_.add(value); + onChanged(); + } else { + orderByBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder addOrderBy(int index, com.google.firestore.v1.StructuredQuery.Order value) { + if (orderByBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrderByIsMutable(); + orderBy_.add(index, value); + onChanged(); + } else { + orderByBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder addOrderBy( + com.google.firestore.v1.StructuredQuery.Order.Builder builderForValue) { + if (orderByBuilder_ == null) { + ensureOrderByIsMutable(); + orderBy_.add(builderForValue.build()); + onChanged(); + } else { + orderByBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder addOrderBy( + int index, com.google.firestore.v1.StructuredQuery.Order.Builder builderForValue) { + if (orderByBuilder_ == null) { + ensureOrderByIsMutable(); + orderBy_.add(index, builderForValue.build()); + onChanged(); + } else { + orderByBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder addAllOrderBy( + java.lang.Iterable values) { + if (orderByBuilder_ == null) { + ensureOrderByIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, orderBy_); + onChanged(); + } else { + orderByBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder clearOrderBy() { + if (orderByBuilder_ == null) { + orderBy_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + orderByBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public Builder removeOrderBy(int index) { + if (orderByBuilder_ == null) { + ensureOrderByIsMutable(); + orderBy_.remove(index); + onChanged(); + } else { + orderByBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.Order.Builder getOrderByBuilder(int index) { + return getOrderByFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.OrderOrBuilder getOrderByOrBuilder(int index) { + if (orderByBuilder_ == null) { + return orderBy_.get(index); + } else { + return orderByBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public java.util.List + getOrderByOrBuilderList() { + if (orderByBuilder_ != null) { + return orderByBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(orderBy_); + } + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.Order.Builder addOrderByBuilder() { + return getOrderByFieldBuilder() + .addBuilder(com.google.firestore.v1.StructuredQuery.Order.getDefaultInstance()); + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public com.google.firestore.v1.StructuredQuery.Order.Builder addOrderByBuilder(int index) { + return getOrderByFieldBuilder() + .addBuilder(index, com.google.firestore.v1.StructuredQuery.Order.getDefaultInstance()); + } + /** + * + * + *
+     * The order to apply to the query results.
+     * Firestore guarantees a stable ordering through the following rules:
+     *  * Any field required to appear in `order_by`, that is not already
+     *    specified in `order_by`, is appended to the order in field name order
+     *    by default.
+     *  * If an order on `__name__` is not specified, it is appended by default.
+     * Fields are appended with the same sort direction as the last order
+     * specified, or 'ASCENDING' if no order was specified. For example:
+     *  * `SELECT * FROM Foo ORDER BY A` becomes
+     *    `SELECT * FROM Foo ORDER BY A, __name__`
+     *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+     *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+     *  * `SELECT * FROM Foo WHERE A > 1` becomes
+     *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+     * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + public java.util.List + getOrderByBuilderList() { + return getOrderByFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Order, + com.google.firestore.v1.StructuredQuery.Order.Builder, + com.google.firestore.v1.StructuredQuery.OrderOrBuilder> + getOrderByFieldBuilder() { + if (orderByBuilder_ == null) { + orderByBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.StructuredQuery.Order, + com.google.firestore.v1.StructuredQuery.Order.Builder, + com.google.firestore.v1.StructuredQuery.OrderOrBuilder>( + orderBy_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + orderBy_ = null; + } + return orderByBuilder_; + } + + private com.google.firestore.v1.Cursor startAt_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Cursor, + com.google.firestore.v1.Cursor.Builder, + com.google.firestore.v1.CursorOrBuilder> + startAtBuilder_; + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public boolean hasStartAt() { + return startAtBuilder_ != null || startAt_ != null; + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public com.google.firestore.v1.Cursor getStartAt() { + if (startAtBuilder_ == null) { + return startAt_ == null ? com.google.firestore.v1.Cursor.getDefaultInstance() : startAt_; + } else { + return startAtBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public Builder setStartAt(com.google.firestore.v1.Cursor value) { + if (startAtBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startAt_ = value; + onChanged(); + } else { + startAtBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public Builder setStartAt(com.google.firestore.v1.Cursor.Builder builderForValue) { + if (startAtBuilder_ == null) { + startAt_ = builderForValue.build(); + onChanged(); + } else { + startAtBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public Builder mergeStartAt(com.google.firestore.v1.Cursor value) { + if (startAtBuilder_ == null) { + if (startAt_ != null) { + startAt_ = + com.google.firestore.v1.Cursor.newBuilder(startAt_).mergeFrom(value).buildPartial(); + } else { + startAt_ = value; + } + onChanged(); + } else { + startAtBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public Builder clearStartAt() { + if (startAtBuilder_ == null) { + startAt_ = null; + onChanged(); + } else { + startAt_ = null; + startAtBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public com.google.firestore.v1.Cursor.Builder getStartAtBuilder() { + + onChanged(); + return getStartAtFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + public com.google.firestore.v1.CursorOrBuilder getStartAtOrBuilder() { + if (startAtBuilder_ != null) { + return startAtBuilder_.getMessageOrBuilder(); + } else { + return startAt_ == null ? com.google.firestore.v1.Cursor.getDefaultInstance() : startAt_; + } + } + /** + * + * + *
+     * A starting point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Cursor, + com.google.firestore.v1.Cursor.Builder, + com.google.firestore.v1.CursorOrBuilder> + getStartAtFieldBuilder() { + if (startAtBuilder_ == null) { + startAtBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Cursor, + com.google.firestore.v1.Cursor.Builder, + com.google.firestore.v1.CursorOrBuilder>( + getStartAt(), getParentForChildren(), isClean()); + startAt_ = null; + } + return startAtBuilder_; + } + + private com.google.firestore.v1.Cursor endAt_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Cursor, + com.google.firestore.v1.Cursor.Builder, + com.google.firestore.v1.CursorOrBuilder> + endAtBuilder_; + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public boolean hasEndAt() { + return endAtBuilder_ != null || endAt_ != null; + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public com.google.firestore.v1.Cursor getEndAt() { + if (endAtBuilder_ == null) { + return endAt_ == null ? com.google.firestore.v1.Cursor.getDefaultInstance() : endAt_; + } else { + return endAtBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public Builder setEndAt(com.google.firestore.v1.Cursor value) { + if (endAtBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endAt_ = value; + onChanged(); + } else { + endAtBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public Builder setEndAt(com.google.firestore.v1.Cursor.Builder builderForValue) { + if (endAtBuilder_ == null) { + endAt_ = builderForValue.build(); + onChanged(); + } else { + endAtBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public Builder mergeEndAt(com.google.firestore.v1.Cursor value) { + if (endAtBuilder_ == null) { + if (endAt_ != null) { + endAt_ = + com.google.firestore.v1.Cursor.newBuilder(endAt_).mergeFrom(value).buildPartial(); + } else { + endAt_ = value; + } + onChanged(); + } else { + endAtBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public Builder clearEndAt() { + if (endAtBuilder_ == null) { + endAt_ = null; + onChanged(); + } else { + endAt_ = null; + endAtBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public com.google.firestore.v1.Cursor.Builder getEndAtBuilder() { + + onChanged(); + return getEndAtFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + public com.google.firestore.v1.CursorOrBuilder getEndAtOrBuilder() { + if (endAtBuilder_ != null) { + return endAtBuilder_.getMessageOrBuilder(); + } else { + return endAt_ == null ? com.google.firestore.v1.Cursor.getDefaultInstance() : endAt_; + } + } + /** + * + * + *
+     * A end point for the query results.
+     * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Cursor, + com.google.firestore.v1.Cursor.Builder, + com.google.firestore.v1.CursorOrBuilder> + getEndAtFieldBuilder() { + if (endAtBuilder_ == null) { + endAtBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Cursor, + com.google.firestore.v1.Cursor.Builder, + com.google.firestore.v1.CursorOrBuilder>( + getEndAt(), getParentForChildren(), isClean()); + endAt_ = null; + } + return endAtBuilder_; + } + + private int offset_; + /** + * + * + *
+     * The number of results to skip.
+     * Applies before limit, but after all other constraints. Must be >= 0 if
+     * specified.
+     * 
+ * + * int32 offset = 6; + */ + public int getOffset() { + return offset_; + } + /** + * + * + *
+     * The number of results to skip.
+     * Applies before limit, but after all other constraints. Must be >= 0 if
+     * specified.
+     * 
+ * + * int32 offset = 6; + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of results to skip.
+     * Applies before limit, but after all other constraints. Must be >= 0 if
+     * specified.
+     * 
+ * + * int32 offset = 6; + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value limit_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + limitBuilder_; + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public boolean hasLimit() { + return limitBuilder_ != null || limit_ != null; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public com.google.protobuf.Int32Value getLimit() { + if (limitBuilder_ == null) { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } else { + return limitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public Builder setLimit(com.google.protobuf.Int32Value value) { + if (limitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + limit_ = value; + onChanged(); + } else { + limitBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public Builder setLimit(com.google.protobuf.Int32Value.Builder builderForValue) { + if (limitBuilder_ == null) { + limit_ = builderForValue.build(); + onChanged(); + } else { + limitBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public Builder mergeLimit(com.google.protobuf.Int32Value value) { + if (limitBuilder_ == null) { + if (limit_ != null) { + limit_ = + com.google.protobuf.Int32Value.newBuilder(limit_).mergeFrom(value).buildPartial(); + } else { + limit_ = value; + } + onChanged(); + } else { + limitBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public Builder clearLimit() { + if (limitBuilder_ == null) { + limit_ = null; + onChanged(); + } else { + limit_ = null; + limitBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public com.google.protobuf.Int32Value.Builder getLimitBuilder() { + + onChanged(); + return getLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { + if (limitBuilder_ != null) { + return limitBuilder_.getMessageOrBuilder(); + } else { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } + } + /** + * + * + *
+     * The maximum number of results to return.
+     * Applies after all other constraints.
+     * Must be >= 0 if specified.
+     * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getLimitFieldBuilder() { + if (limitBuilder_ == null) { + limitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getLimit(), getParentForChildren(), isClean()); + limit_ = null; + } + return limitBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.StructuredQuery) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery) + private static final com.google.firestore.v1.StructuredQuery DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.StructuredQuery(); + } + + public static com.google.firestore.v1.StructuredQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StructuredQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StructuredQuery(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.v1.StructuredQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQueryOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQueryOrBuilder.java new file mode 100644 index 000000000000..c93d60f72d88 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/StructuredQueryOrBuilder.java @@ -0,0 +1,353 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query.proto + +package com.google.firestore.v1; + +public interface StructuredQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.StructuredQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The projection to return.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + boolean hasSelect(); + /** + * + * + *
+   * The projection to return.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + com.google.firestore.v1.StructuredQuery.Projection getSelect(); + /** + * + * + *
+   * The projection to return.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + com.google.firestore.v1.StructuredQuery.ProjectionOrBuilder getSelectOrBuilder(); + + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + java.util.List getFromList(); + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + com.google.firestore.v1.StructuredQuery.CollectionSelector getFrom(int index); + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + int getFromCount(); + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + java.util.List + getFromOrBuilderList(); + /** + * + * + *
+   * The collections to query.
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + com.google.firestore.v1.StructuredQuery.CollectionSelectorOrBuilder getFromOrBuilder(int index); + + /** + * + * + *
+   * The filter to apply.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + boolean hasWhere(); + /** + * + * + *
+   * The filter to apply.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + com.google.firestore.v1.StructuredQuery.Filter getWhere(); + /** + * + * + *
+   * The filter to apply.
+   * 
+ * + * .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + com.google.firestore.v1.StructuredQuery.FilterOrBuilder getWhereOrBuilder(); + + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + java.util.List getOrderByList(); + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + com.google.firestore.v1.StructuredQuery.Order getOrderBy(int index); + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + int getOrderByCount(); + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + java.util.List + getOrderByOrBuilderList(); + /** + * + * + *
+   * The order to apply to the query results.
+   * Firestore guarantees a stable ordering through the following rules:
+   *  * Any field required to appear in `order_by`, that is not already
+   *    specified in `order_by`, is appended to the order in field name order
+   *    by default.
+   *  * If an order on `__name__` is not specified, it is appended by default.
+   * Fields are appended with the same sort direction as the last order
+   * specified, or 'ASCENDING' if no order was specified. For example:
+   *  * `SELECT * FROM Foo ORDER BY A` becomes
+   *    `SELECT * FROM Foo ORDER BY A, __name__`
+   *  * `SELECT * FROM Foo ORDER BY A DESC` becomes
+   *    `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
+   *  * `SELECT * FROM Foo WHERE A > 1` becomes
+   *    `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
+   * 
+ * + * repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + com.google.firestore.v1.StructuredQuery.OrderOrBuilder getOrderByOrBuilder(int index); + + /** + * + * + *
+   * A starting point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + boolean hasStartAt(); + /** + * + * + *
+   * A starting point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + com.google.firestore.v1.Cursor getStartAt(); + /** + * + * + *
+   * A starting point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor start_at = 7; + */ + com.google.firestore.v1.CursorOrBuilder getStartAtOrBuilder(); + + /** + * + * + *
+   * A end point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + boolean hasEndAt(); + /** + * + * + *
+   * A end point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + com.google.firestore.v1.Cursor getEndAt(); + /** + * + * + *
+   * A end point for the query results.
+   * 
+ * + * .google.firestore.v1.Cursor end_at = 8; + */ + com.google.firestore.v1.CursorOrBuilder getEndAtOrBuilder(); + + /** + * + * + *
+   * The number of results to skip.
+   * Applies before limit, but after all other constraints. Must be >= 0 if
+   * specified.
+   * 
+ * + * int32 offset = 6; + */ + int getOffset(); + + /** + * + * + *
+   * The maximum number of results to return.
+   * Applies after all other constraints.
+   * Must be >= 0 if specified.
+   * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + boolean hasLimit(); + /** + * + * + *
+   * The maximum number of results to return.
+   * Applies after all other constraints.
+   * Must be >= 0 if specified.
+   * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + com.google.protobuf.Int32Value getLimit(); + /** + * + * + *
+   * The maximum number of results to return.
+   * Applies after all other constraints.
+   * Must be >= 0 if specified.
+   * 
+ * + * .google.protobuf.Int32Value limit = 5; + */ + com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Target.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Target.java new file mode 100644 index 000000000000..167eaaa2aa9c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Target.java @@ -0,0 +1,3572 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A specification of a set of documents to listen to.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.Target} + */ +public final class Target extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Target) + TargetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Target.newBuilder() to construct. + private Target(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Target() { + targetId_ = 0; + once_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Target( + 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 18: + { + com.google.firestore.v1.Target.QueryTarget.Builder subBuilder = null; + if (targetTypeCase_ == 2) { + subBuilder = ((com.google.firestore.v1.Target.QueryTarget) targetType_).toBuilder(); + } + targetType_ = + input.readMessage( + com.google.firestore.v1.Target.QueryTarget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Target.QueryTarget) targetType_); + targetType_ = subBuilder.buildPartial(); + } + targetTypeCase_ = 2; + break; + } + case 26: + { + com.google.firestore.v1.Target.DocumentsTarget.Builder subBuilder = null; + if (targetTypeCase_ == 3) { + subBuilder = + ((com.google.firestore.v1.Target.DocumentsTarget) targetType_).toBuilder(); + } + targetType_ = + input.readMessage( + com.google.firestore.v1.Target.DocumentsTarget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Target.DocumentsTarget) targetType_); + targetType_ = subBuilder.buildPartial(); + } + targetTypeCase_ = 3; + break; + } + case 34: + { + resumeTypeCase_ = 4; + resumeType_ = input.readBytes(); + break; + } + case 40: + { + targetId_ = input.readInt32(); + break; + } + case 48: + { + once_ = input.readBool(); + break; + } + case 90: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (resumeTypeCase_ == 11) { + subBuilder = ((com.google.protobuf.Timestamp) resumeType_).toBuilder(); + } + resumeType_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) resumeType_); + resumeType_ = subBuilder.buildPartial(); + } + resumeTypeCase_ = 11; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Target.class, com.google.firestore.v1.Target.Builder.class); + } + + public interface DocumentsTargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Target.DocumentsTarget) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + java.util.List getDocumentsList(); + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + int getDocumentsCount(); + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + java.lang.String getDocuments(int index); + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + com.google.protobuf.ByteString getDocumentsBytes(int index); + } + /** + * + * + *
+   * A target specified by a set of documents names.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Target.DocumentsTarget} + */ + public static final class DocumentsTarget extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Target.DocumentsTarget) + DocumentsTargetOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentsTarget.newBuilder() to construct. + private DocumentsTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentsTarget() { + documents_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentsTarget( + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + documents_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + documents_.add(s); + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + documents_ = documents_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_DocumentsTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_DocumentsTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Target.DocumentsTarget.class, + com.google.firestore.v1.Target.DocumentsTarget.Builder.class); + } + + public static final int DOCUMENTS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList documents_; + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ProtocolStringList getDocumentsList() { + return documents_; + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public java.lang.String getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+     * The names of the documents to retrieve. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * The request will fail if any of the document is not a child resource of
+     * the given `database`. Duplicate names will be elided.
+     * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ByteString getDocumentsBytes(int index) { + return documents_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < documents_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, documents_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < documents_.size(); i++) { + dataSize += computeStringSizeNoTag(documents_.getRaw(i)); + } + size += dataSize; + size += 1 * getDocumentsList().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.v1.Target.DocumentsTarget)) { + return super.equals(obj); + } + com.google.firestore.v1.Target.DocumentsTarget other = + (com.google.firestore.v1.Target.DocumentsTarget) obj; + + boolean result = true; + result = result && getDocumentsList().equals(other.getDocumentsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentsCount() > 0) { + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Target.DocumentsTarget parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target.DocumentsTarget 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.v1.Target.DocumentsTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target.DocumentsTarget 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.v1.Target.DocumentsTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target.DocumentsTarget parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Target.DocumentsTarget parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target.DocumentsTarget 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.v1.Target.DocumentsTarget parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target.DocumentsTarget 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.v1.Target.DocumentsTarget parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target.DocumentsTarget 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.v1.Target.DocumentsTarget 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 target specified by a set of documents names.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.Target.DocumentsTarget} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Target.DocumentsTarget) + com.google.firestore.v1.Target.DocumentsTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_DocumentsTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_DocumentsTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Target.DocumentsTarget.class, + com.google.firestore.v1.Target.DocumentsTarget.Builder.class); + } + + // Construct using com.google.firestore.v1.Target.DocumentsTarget.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(); + documents_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_DocumentsTarget_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Target.DocumentsTarget getDefaultInstanceForType() { + return com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Target.DocumentsTarget build() { + com.google.firestore.v1.Target.DocumentsTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Target.DocumentsTarget buildPartial() { + com.google.firestore.v1.Target.DocumentsTarget result = + new com.google.firestore.v1.Target.DocumentsTarget(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + documents_ = documents_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documents_ = documents_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Target.DocumentsTarget) { + return mergeFrom((com.google.firestore.v1.Target.DocumentsTarget) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Target.DocumentsTarget other) { + if (other == com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance()) + return this; + if (!other.documents_.isEmpty()) { + if (documents_.isEmpty()) { + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentsIsMutable(); + documents_.addAll(other.documents_); + } + 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.v1.Target.DocumentsTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Target.DocumentsTarget) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList documents_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDocumentsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + documents_ = new com.google.protobuf.LazyStringArrayList(documents_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ProtocolStringList getDocumentsList() { + return documents_.getUnmodifiableView(); + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public java.lang.String getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public com.google.protobuf.ByteString getDocumentsBytes(int index) { + return documents_.getByteString(index); + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public Builder setDocuments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public Builder addDocuments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public Builder addAllDocuments(java.lang.Iterable values) { + ensureDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documents_); + onChanged(); + return this; + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public Builder clearDocuments() { + documents_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The names of the documents to retrieve. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * The request will fail if any of the document is not a child resource of
+       * the given `database`. Duplicate names will be elided.
+       * 
+ * + * repeated string documents = 2; + */ + public Builder addDocumentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Target.DocumentsTarget) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Target.DocumentsTarget) + private static final com.google.firestore.v1.Target.DocumentsTarget DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Target.DocumentsTarget(); + } + + public static com.google.firestore.v1.Target.DocumentsTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentsTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentsTarget(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.v1.Target.DocumentsTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryTargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Target.QueryTarget) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+     * The parent resource name. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + boolean hasStructuredQuery(); + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + com.google.firestore.v1.StructuredQuery getStructuredQuery(); + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + com.google.firestore.v1.StructuredQueryOrBuilder getStructuredQueryOrBuilder(); + + public com.google.firestore.v1.Target.QueryTarget.QueryTypeCase getQueryTypeCase(); + } + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Target.QueryTarget} + */ + public static final class QueryTarget extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Target.QueryTarget) + QueryTargetOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryTarget.newBuilder() to construct. + private QueryTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryTarget() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryTarget( + 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(); + + 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; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_QueryTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_QueryTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Target.QueryTarget.class, + com.google.firestore.v1.Target.QueryTarget.Builder.class); + } + + private int queryTypeCase_ = 0; + private java.lang.Object queryType_; + + public enum QueryTypeCase implements com.google.protobuf.Internal.EnumLite { + STRUCTURED_QUERY(2), + QUERYTYPE_NOT_SET(0); + private final int value; + + private QueryTypeCase(int value) { + this.value = value; + } + /** @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. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents` or
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * For example:
+     * `projects/my-project/databases/my-database/documents` or
+     * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+     * 
+ * + * string parent = 1; + */ + 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; + */ + public boolean hasStructuredQuery() { + return queryTypeCase_ == 2; + } + /** + * + * + *
+     * A structured query.
+     * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + 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; + */ + public com.google.firestore.v1.StructuredQueryOrBuilder getStructuredQueryOrBuilder() { + if (queryTypeCase_ == 2) { + return (com.google.firestore.v1.StructuredQuery) queryType_; + } + return com.google.firestore.v1.StructuredQuery.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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (queryTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.StructuredQuery) queryType_); + } + 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_); + } + 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.v1.Target.QueryTarget)) { + return super.equals(obj); + } + com.google.firestore.v1.Target.QueryTarget other = + (com.google.firestore.v1.Target.QueryTarget) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getQueryTypeCase().equals(other.getQueryTypeCase()); + if (!result) return false; + switch (queryTypeCase_) { + case 2: + result = result && getStructuredQuery().equals(other.getStructuredQuery()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + 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.v1.Target.QueryTarget parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target.QueryTarget 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.v1.Target.QueryTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target.QueryTarget 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.v1.Target.QueryTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target.QueryTarget parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Target.QueryTarget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target.QueryTarget 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.v1.Target.QueryTarget parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target.QueryTarget 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.v1.Target.QueryTarget parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target.QueryTarget 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.v1.Target.QueryTarget 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 target specified by a query.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.Target.QueryTarget} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Target.QueryTarget) + com.google.firestore.v1.Target.QueryTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_QueryTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_QueryTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Target.QueryTarget.class, + com.google.firestore.v1.Target.QueryTarget.Builder.class); + } + + // Construct using com.google.firestore.v1.Target.QueryTarget.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_ = ""; + + queryTypeCase_ = 0; + queryType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_QueryTarget_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Target.QueryTarget getDefaultInstanceForType() { + return com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Target.QueryTarget build() { + com.google.firestore.v1.Target.QueryTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Target.QueryTarget buildPartial() { + com.google.firestore.v1.Target.QueryTarget result = + new com.google.firestore.v1.Target.QueryTarget(this); + result.parent_ = parent_; + if (queryTypeCase_ == 2) { + if (structuredQueryBuilder_ == null) { + result.queryType_ = queryType_; + } else { + result.queryType_ = structuredQueryBuilder_.build(); + } + } + result.queryTypeCase_ = queryTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Target.QueryTarget) { + return mergeFrom((com.google.firestore.v1.Target.QueryTarget) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Target.QueryTarget other) { + if (other == com.google.firestore.v1.Target.QueryTarget.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + 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.v1.Target.QueryTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Target.QueryTarget) 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. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents` or
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * For example:
+       * `projects/my-project/databases/my-database/documents` or
+       * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+       * 
+ * + * string parent = 1; + */ + 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. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents` or
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * For example:
+       * `projects/my-project/databases/my-database/documents` or
+       * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+       * 
+ * + * string parent = 1; + */ + 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. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents` or
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * For example:
+       * `projects/my-project/databases/my-database/documents` or
+       * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+       * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The parent resource name. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents` or
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * For example:
+       * `projects/my-project/databases/my-database/documents` or
+       * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+       * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+       * The parent resource name. In the format:
+       * `projects/{project_id}/databases/{database_id}/documents` or
+       * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+       * For example:
+       * `projects/my-project/databases/my-database/documents` or
+       * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
+       * 
+ * + * string parent = 1; + */ + 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; + */ + public boolean hasStructuredQuery() { + return queryTypeCase_ == 2; + } + /** + * + * + *
+       * A structured query.
+       * 
+ * + * .google.firestore.v1.StructuredQuery structured_query = 2; + */ + 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; + */ + 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_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Target.QueryTarget) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Target.QueryTarget) + private static final com.google.firestore.v1.Target.QueryTarget DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Target.QueryTarget(); + } + + public static com.google.firestore.v1.Target.QueryTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryTarget(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.v1.Target.QueryTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int targetTypeCase_ = 0; + private java.lang.Object targetType_; + + public enum TargetTypeCase implements com.google.protobuf.Internal.EnumLite { + QUERY(2), + DOCUMENTS(3), + TARGETTYPE_NOT_SET(0); + private final int value; + + private TargetTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TargetTypeCase valueOf(int value) { + return forNumber(value); + } + + public static TargetTypeCase forNumber(int value) { + switch (value) { + case 2: + return QUERY; + case 3: + return DOCUMENTS; + case 0: + return TARGETTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetTypeCase getTargetTypeCase() { + return TargetTypeCase.forNumber(targetTypeCase_); + } + + private int resumeTypeCase_ = 0; + private java.lang.Object resumeType_; + + public enum ResumeTypeCase implements com.google.protobuf.Internal.EnumLite { + RESUME_TOKEN(4), + READ_TIME(11), + RESUMETYPE_NOT_SET(0); + private final int value; + + private ResumeTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ResumeTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ResumeTypeCase forNumber(int value) { + switch (value) { + case 4: + return RESUME_TOKEN; + case 11: + return READ_TIME; + case 0: + return RESUMETYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResumeTypeCase getResumeTypeCase() { + return ResumeTypeCase.forNumber(resumeTypeCase_); + } + + public static final int QUERY_FIELD_NUMBER = 2; + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public boolean hasQuery() { + return targetTypeCase_ == 2; + } + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public com.google.firestore.v1.Target.QueryTarget getQuery() { + if (targetTypeCase_ == 2) { + return (com.google.firestore.v1.Target.QueryTarget) targetType_; + } + return com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public com.google.firestore.v1.Target.QueryTargetOrBuilder getQueryOrBuilder() { + if (targetTypeCase_ == 2) { + return (com.google.firestore.v1.Target.QueryTarget) targetType_; + } + return com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } + + public static final int DOCUMENTS_FIELD_NUMBER = 3; + /** + * + * + *
+   * A target specified by a set of document names.
+   * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public boolean hasDocuments() { + return targetTypeCase_ == 3; + } + /** + * + * + *
+   * A target specified by a set of document names.
+   * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public com.google.firestore.v1.Target.DocumentsTarget getDocuments() { + if (targetTypeCase_ == 3) { + return (com.google.firestore.v1.Target.DocumentsTarget) targetType_; + } + return com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } + /** + * + * + *
+   * A target specified by a set of document names.
+   * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public com.google.firestore.v1.Target.DocumentsTargetOrBuilder getDocumentsOrBuilder() { + if (targetTypeCase_ == 3) { + return (com.google.firestore.v1.Target.DocumentsTarget) targetType_; + } + return com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } + + public static final int RESUME_TOKEN_FIELD_NUMBER = 4; + /** + * + * + *
+   * A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target.
+   * Using a resume token with a different target is unsupported and may fail.
+   * 
+ * + * bytes resume_token = 4; + */ + public com.google.protobuf.ByteString getResumeToken() { + if (resumeTypeCase_ == 4) { + return (com.google.protobuf.ByteString) resumeType_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int READ_TIME_FIELD_NUMBER = 11; + /** + * + * + *
+   * Start listening after a specific `read_time`.
+   * The client must know the state of matching documents at this time.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public boolean hasReadTime() { + return resumeTypeCase_ == 11; + } + /** + * + * + *
+   * Start listening after a specific `read_time`.
+   * The client must know the state of matching documents at this time.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (resumeTypeCase_ == 11) { + return (com.google.protobuf.Timestamp) resumeType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * Start listening after a specific `read_time`.
+   * The client must know the state of matching documents at this time.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (resumeTypeCase_ == 11) { + return (com.google.protobuf.Timestamp) resumeType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TARGET_ID_FIELD_NUMBER = 5; + private int targetId_; + /** + * + * + *
+   * A client provided target ID.
+   * If not set, the server will assign an ID for the target.
+   * Used for resuming a target without changing IDs. The IDs can either be
+   * client-assigned or be server-assigned in a previous stream. All targets
+   * with client provided IDs must be added before adding a target that needs
+   * a server-assigned id.
+   * 
+ * + * int32 target_id = 5; + */ + public int getTargetId() { + return targetId_; + } + + public static final int ONCE_FIELD_NUMBER = 6; + private boolean once_; + /** + * + * + *
+   * If the target should be removed once it is current and consistent.
+   * 
+ * + * bool once = 6; + */ + public boolean getOnce() { + return once_; + } + + 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 (targetTypeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.Target.QueryTarget) targetType_); + } + if (targetTypeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.v1.Target.DocumentsTarget) targetType_); + } + if (resumeTypeCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) resumeType_); + } + if (targetId_ != 0) { + output.writeInt32(5, targetId_); + } + if (once_ != false) { + output.writeBool(6, once_); + } + if (resumeTypeCase_ == 11) { + output.writeMessage(11, (com.google.protobuf.Timestamp) resumeType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.Target.QueryTarget) targetType_); + } + if (targetTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.v1.Target.DocumentsTarget) targetType_); + } + if (resumeTypeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) resumeType_); + } + if (targetId_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, targetId_); + } + if (once_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, once_); + } + if (resumeTypeCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.protobuf.Timestamp) resumeType_); + } + 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.v1.Target)) { + return super.equals(obj); + } + com.google.firestore.v1.Target other = (com.google.firestore.v1.Target) obj; + + boolean result = true; + result = result && (getTargetId() == other.getTargetId()); + result = result && (getOnce() == other.getOnce()); + result = result && getTargetTypeCase().equals(other.getTargetTypeCase()); + if (!result) return false; + switch (targetTypeCase_) { + case 2: + result = result && getQuery().equals(other.getQuery()); + break; + case 3: + result = result && getDocuments().equals(other.getDocuments()); + break; + case 0: + default: + } + result = result && getResumeTypeCase().equals(other.getResumeTypeCase()); + if (!result) return false; + switch (resumeTypeCase_) { + case 4: + result = result && getResumeToken().equals(other.getResumeToken()); + break; + case 11: + result = result && getReadTime().equals(other.getReadTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TARGET_ID_FIELD_NUMBER; + hash = (53 * hash) + getTargetId(); + hash = (37 * hash) + ONCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getOnce()); + switch (targetTypeCase_) { + case 2: + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + break; + case 3: + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocuments().hashCode(); + break; + case 0: + default: + } + switch (resumeTypeCase_) { + case 4: + hash = (37 * hash) + RESUME_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getResumeToken().hashCode(); + break; + case 11: + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Target parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target 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.v1.Target parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target 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.v1.Target parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Target parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Target parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target 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.v1.Target parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target 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.v1.Target parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Target 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.v1.Target 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 specification of a set of documents to listen to.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Target} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Target) + com.google.firestore.v1.TargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Target.class, com.google.firestore.v1.Target.Builder.class); + } + + // Construct using com.google.firestore.v1.Target.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(); + targetId_ = 0; + + once_ = false; + + targetTypeCase_ = 0; + targetType_ = null; + resumeTypeCase_ = 0; + resumeType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_Target_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Target getDefaultInstanceForType() { + return com.google.firestore.v1.Target.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Target build() { + com.google.firestore.v1.Target result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Target buildPartial() { + com.google.firestore.v1.Target result = new com.google.firestore.v1.Target(this); + if (targetTypeCase_ == 2) { + if (queryBuilder_ == null) { + result.targetType_ = targetType_; + } else { + result.targetType_ = queryBuilder_.build(); + } + } + if (targetTypeCase_ == 3) { + if (documentsBuilder_ == null) { + result.targetType_ = targetType_; + } else { + result.targetType_ = documentsBuilder_.build(); + } + } + if (resumeTypeCase_ == 4) { + result.resumeType_ = resumeType_; + } + if (resumeTypeCase_ == 11) { + if (readTimeBuilder_ == null) { + result.resumeType_ = resumeType_; + } else { + result.resumeType_ = readTimeBuilder_.build(); + } + } + result.targetId_ = targetId_; + result.once_ = once_; + result.targetTypeCase_ = targetTypeCase_; + result.resumeTypeCase_ = resumeTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Target) { + return mergeFrom((com.google.firestore.v1.Target) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Target other) { + if (other == com.google.firestore.v1.Target.getDefaultInstance()) return this; + if (other.getTargetId() != 0) { + setTargetId(other.getTargetId()); + } + if (other.getOnce() != false) { + setOnce(other.getOnce()); + } + switch (other.getTargetTypeCase()) { + case QUERY: + { + mergeQuery(other.getQuery()); + break; + } + case DOCUMENTS: + { + mergeDocuments(other.getDocuments()); + break; + } + case TARGETTYPE_NOT_SET: + { + break; + } + } + switch (other.getResumeTypeCase()) { + case RESUME_TOKEN: + { + setResumeToken(other.getResumeToken()); + break; + } + case READ_TIME: + { + mergeReadTime(other.getReadTime()); + break; + } + case RESUMETYPE_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.v1.Target parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Target) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int targetTypeCase_ = 0; + private java.lang.Object targetType_; + + public TargetTypeCase getTargetTypeCase() { + return TargetTypeCase.forNumber(targetTypeCase_); + } + + public Builder clearTargetType() { + targetTypeCase_ = 0; + targetType_ = null; + onChanged(); + return this; + } + + private int resumeTypeCase_ = 0; + private java.lang.Object resumeType_; + + public ResumeTypeCase getResumeTypeCase() { + return ResumeTypeCase.forNumber(resumeTypeCase_); + } + + public Builder clearResumeType() { + resumeTypeCase_ = 0; + resumeType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target.QueryTarget, + com.google.firestore.v1.Target.QueryTarget.Builder, + com.google.firestore.v1.Target.QueryTargetOrBuilder> + queryBuilder_; + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public boolean hasQuery() { + return targetTypeCase_ == 2; + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public com.google.firestore.v1.Target.QueryTarget getQuery() { + if (queryBuilder_ == null) { + if (targetTypeCase_ == 2) { + return (com.google.firestore.v1.Target.QueryTarget) targetType_; + } + return com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } else { + if (targetTypeCase_ == 2) { + return queryBuilder_.getMessage(); + } + return com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public Builder setQuery(com.google.firestore.v1.Target.QueryTarget value) { + if (queryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetType_ = value; + onChanged(); + } else { + queryBuilder_.setMessage(value); + } + targetTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public Builder setQuery(com.google.firestore.v1.Target.QueryTarget.Builder builderForValue) { + if (queryBuilder_ == null) { + targetType_ = builderForValue.build(); + onChanged(); + } else { + queryBuilder_.setMessage(builderForValue.build()); + } + targetTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public Builder mergeQuery(com.google.firestore.v1.Target.QueryTarget value) { + if (queryBuilder_ == null) { + if (targetTypeCase_ == 2 + && targetType_ != com.google.firestore.v1.Target.QueryTarget.getDefaultInstance()) { + targetType_ = + com.google.firestore.v1.Target.QueryTarget.newBuilder( + (com.google.firestore.v1.Target.QueryTarget) targetType_) + .mergeFrom(value) + .buildPartial(); + } else { + targetType_ = value; + } + onChanged(); + } else { + if (targetTypeCase_ == 2) { + queryBuilder_.mergeFrom(value); + } + queryBuilder_.setMessage(value); + } + targetTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public Builder clearQuery() { + if (queryBuilder_ == null) { + if (targetTypeCase_ == 2) { + targetTypeCase_ = 0; + targetType_ = null; + onChanged(); + } + } else { + if (targetTypeCase_ == 2) { + targetTypeCase_ = 0; + targetType_ = null; + } + queryBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public com.google.firestore.v1.Target.QueryTarget.Builder getQueryBuilder() { + return getQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + public com.google.firestore.v1.Target.QueryTargetOrBuilder getQueryOrBuilder() { + if ((targetTypeCase_ == 2) && (queryBuilder_ != null)) { + return queryBuilder_.getMessageOrBuilder(); + } else { + if (targetTypeCase_ == 2) { + return (com.google.firestore.v1.Target.QueryTarget) targetType_; + } + return com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } + } + /** + * + * + *
+     * A target specified by a query.
+     * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target.QueryTarget, + com.google.firestore.v1.Target.QueryTarget.Builder, + com.google.firestore.v1.Target.QueryTargetOrBuilder> + getQueryFieldBuilder() { + if (queryBuilder_ == null) { + if (!(targetTypeCase_ == 2)) { + targetType_ = com.google.firestore.v1.Target.QueryTarget.getDefaultInstance(); + } + queryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target.QueryTarget, + com.google.firestore.v1.Target.QueryTarget.Builder, + com.google.firestore.v1.Target.QueryTargetOrBuilder>( + (com.google.firestore.v1.Target.QueryTarget) targetType_, + getParentForChildren(), + isClean()); + targetType_ = null; + } + targetTypeCase_ = 2; + onChanged(); + ; + return queryBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target.DocumentsTarget, + com.google.firestore.v1.Target.DocumentsTarget.Builder, + com.google.firestore.v1.Target.DocumentsTargetOrBuilder> + documentsBuilder_; + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public boolean hasDocuments() { + return targetTypeCase_ == 3; + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public com.google.firestore.v1.Target.DocumentsTarget getDocuments() { + if (documentsBuilder_ == null) { + if (targetTypeCase_ == 3) { + return (com.google.firestore.v1.Target.DocumentsTarget) targetType_; + } + return com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } else { + if (targetTypeCase_ == 3) { + return documentsBuilder_.getMessage(); + } + return com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public Builder setDocuments(com.google.firestore.v1.Target.DocumentsTarget value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetType_ = value; + onChanged(); + } else { + documentsBuilder_.setMessage(value); + } + targetTypeCase_ = 3; + return this; + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public Builder setDocuments( + com.google.firestore.v1.Target.DocumentsTarget.Builder builderForValue) { + if (documentsBuilder_ == null) { + targetType_ = builderForValue.build(); + onChanged(); + } else { + documentsBuilder_.setMessage(builderForValue.build()); + } + targetTypeCase_ = 3; + return this; + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public Builder mergeDocuments(com.google.firestore.v1.Target.DocumentsTarget value) { + if (documentsBuilder_ == null) { + if (targetTypeCase_ == 3 + && targetType_ != com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance()) { + targetType_ = + com.google.firestore.v1.Target.DocumentsTarget.newBuilder( + (com.google.firestore.v1.Target.DocumentsTarget) targetType_) + .mergeFrom(value) + .buildPartial(); + } else { + targetType_ = value; + } + onChanged(); + } else { + if (targetTypeCase_ == 3) { + documentsBuilder_.mergeFrom(value); + } + documentsBuilder_.setMessage(value); + } + targetTypeCase_ = 3; + return this; + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public Builder clearDocuments() { + if (documentsBuilder_ == null) { + if (targetTypeCase_ == 3) { + targetTypeCase_ = 0; + targetType_ = null; + onChanged(); + } + } else { + if (targetTypeCase_ == 3) { + targetTypeCase_ = 0; + targetType_ = null; + } + documentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public com.google.firestore.v1.Target.DocumentsTarget.Builder getDocumentsBuilder() { + return getDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + public com.google.firestore.v1.Target.DocumentsTargetOrBuilder getDocumentsOrBuilder() { + if ((targetTypeCase_ == 3) && (documentsBuilder_ != null)) { + return documentsBuilder_.getMessageOrBuilder(); + } else { + if (targetTypeCase_ == 3) { + return (com.google.firestore.v1.Target.DocumentsTarget) targetType_; + } + return com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } + } + /** + * + * + *
+     * A target specified by a set of document names.
+     * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target.DocumentsTarget, + com.google.firestore.v1.Target.DocumentsTarget.Builder, + com.google.firestore.v1.Target.DocumentsTargetOrBuilder> + getDocumentsFieldBuilder() { + if (documentsBuilder_ == null) { + if (!(targetTypeCase_ == 3)) { + targetType_ = com.google.firestore.v1.Target.DocumentsTarget.getDefaultInstance(); + } + documentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Target.DocumentsTarget, + com.google.firestore.v1.Target.DocumentsTarget.Builder, + com.google.firestore.v1.Target.DocumentsTargetOrBuilder>( + (com.google.firestore.v1.Target.DocumentsTarget) targetType_, + getParentForChildren(), + isClean()); + targetType_ = null; + } + targetTypeCase_ = 3; + onChanged(); + ; + return documentsBuilder_; + } + + /** + * + * + *
+     * A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target.
+     * Using a resume token with a different target is unsupported and may fail.
+     * 
+ * + * bytes resume_token = 4; + */ + public com.google.protobuf.ByteString getResumeToken() { + if (resumeTypeCase_ == 4) { + return (com.google.protobuf.ByteString) resumeType_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target.
+     * Using a resume token with a different target is unsupported and may fail.
+     * 
+ * + * bytes resume_token = 4; + */ + public Builder setResumeToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + resumeTypeCase_ = 4; + resumeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target.
+     * Using a resume token with a different target is unsupported and may fail.
+     * 
+ * + * bytes resume_token = 4; + */ + public Builder clearResumeToken() { + if (resumeTypeCase_ == 4) { + resumeTypeCase_ = 0; + resumeType_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public boolean hasReadTime() { + return resumeTypeCase_ == 11; + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + if (resumeTypeCase_ == 11) { + return (com.google.protobuf.Timestamp) resumeType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (resumeTypeCase_ == 11) { + return readTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resumeType_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + resumeTypeCase_ = 11; + return this; + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + resumeType_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + resumeTypeCase_ = 11; + return this; + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (resumeTypeCase_ == 11 + && resumeType_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + resumeType_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) resumeType_) + .mergeFrom(value) + .buildPartial(); + } else { + resumeType_ = value; + } + onChanged(); + } else { + if (resumeTypeCase_ == 11) { + readTimeBuilder_.mergeFrom(value); + } + readTimeBuilder_.setMessage(value); + } + resumeTypeCase_ = 11; + return this; + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + if (resumeTypeCase_ == 11) { + resumeTypeCase_ = 0; + resumeType_ = null; + onChanged(); + } + } else { + if (resumeTypeCase_ == 11) { + resumeTypeCase_ = 0; + resumeType_ = null; + } + readTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if ((resumeTypeCase_ == 11) && (readTimeBuilder_ != null)) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + if (resumeTypeCase_ == 11) { + return (com.google.protobuf.Timestamp) resumeType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * Start listening after a specific `read_time`.
+     * The client must know the state of matching documents at this time.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + if (!(resumeTypeCase_ == 11)) { + resumeType_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) resumeType_, getParentForChildren(), isClean()); + resumeType_ = null; + } + resumeTypeCase_ = 11; + onChanged(); + ; + return readTimeBuilder_; + } + + private int targetId_; + /** + * + * + *
+     * A client provided target ID.
+     * If not set, the server will assign an ID for the target.
+     * Used for resuming a target without changing IDs. The IDs can either be
+     * client-assigned or be server-assigned in a previous stream. All targets
+     * with client provided IDs must be added before adding a target that needs
+     * a server-assigned id.
+     * 
+ * + * int32 target_id = 5; + */ + public int getTargetId() { + return targetId_; + } + /** + * + * + *
+     * A client provided target ID.
+     * If not set, the server will assign an ID for the target.
+     * Used for resuming a target without changing IDs. The IDs can either be
+     * client-assigned or be server-assigned in a previous stream. All targets
+     * with client provided IDs must be added before adding a target that needs
+     * a server-assigned id.
+     * 
+ * + * int32 target_id = 5; + */ + public Builder setTargetId(int value) { + + targetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A client provided target ID.
+     * If not set, the server will assign an ID for the target.
+     * Used for resuming a target without changing IDs. The IDs can either be
+     * client-assigned or be server-assigned in a previous stream. All targets
+     * with client provided IDs must be added before adding a target that needs
+     * a server-assigned id.
+     * 
+ * + * int32 target_id = 5; + */ + public Builder clearTargetId() { + + targetId_ = 0; + onChanged(); + return this; + } + + private boolean once_; + /** + * + * + *
+     * If the target should be removed once it is current and consistent.
+     * 
+ * + * bool once = 6; + */ + public boolean getOnce() { + return once_; + } + /** + * + * + *
+     * If the target should be removed once it is current and consistent.
+     * 
+ * + * bool once = 6; + */ + public Builder setOnce(boolean value) { + + once_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If the target should be removed once it is current and consistent.
+     * 
+ * + * bool once = 6; + */ + public Builder clearOnce() { + + once_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Target) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Target) + private static final com.google.firestore.v1.Target DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Target(); + } + + public static com.google.firestore.v1.Target getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Target parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Target(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.v1.Target getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChange.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChange.java new file mode 100644 index 000000000000..cf1a1c657758 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChange.java @@ -0,0 +1,1730 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * Targets being watched have changed.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.TargetChange} + */ +public final class TargetChange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.TargetChange) + TargetChangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use TargetChange.newBuilder() to construct. + private TargetChange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TargetChange() { + targetChangeType_ = 0; + targetIds_ = java.util.Collections.emptyList(); + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TargetChange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + targetChangeType_ = rawValue; + break; + } + case 16: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + targetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + targetIds_.add(input.readInt32()); + break; + } + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) + && input.getBytesUntilLimit() > 0) { + targetIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + targetIds_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 26: + { + com.google.rpc.Status.Builder subBuilder = null; + if (cause_ != null) { + subBuilder = cause_.toBuilder(); + } + cause_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cause_); + cause_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + resumeToken_ = input.readBytes(); + break; + } + case 50: + { + 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 (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + targetIds_ = java.util.Collections.unmodifiableList(targetIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_TargetChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_TargetChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TargetChange.class, + com.google.firestore.v1.TargetChange.Builder.class); + } + + /** + * + * + *
+   * The type of change.
+   * 
+ * + * Protobuf enum {@code google.firestore.v1.TargetChange.TargetChangeType} + */ + public enum TargetChangeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No change has occurred. Used only to send an updated `resume_token`.
+     * 
+ * + * NO_CHANGE = 0; + */ + NO_CHANGE(0), + /** + * + * + *
+     * The targets have been added.
+     * 
+ * + * ADD = 1; + */ + ADD(1), + /** + * + * + *
+     * The targets have been removed.
+     * 
+ * + * REMOVE = 2; + */ + REMOVE(2), + /** + * + * + *
+     * The targets reflect all changes committed before the targets were added
+     * to the stream.
+     * This will be sent after or with a `read_time` that is greater than or
+     * equal to the time at which the targets were added.
+     * Listeners can wait for this change if read-after-write semantics
+     * are desired.
+     * 
+ * + * CURRENT = 3; + */ + CURRENT(3), + /** + * + * + *
+     * The targets have been reset, and a new initial state for the targets
+     * will be returned in subsequent changes.
+     * After the initial state is complete, `CURRENT` will be returned even
+     * if the target was previously indicated to be `CURRENT`.
+     * 
+ * + * RESET = 4; + */ + RESET(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No change has occurred. Used only to send an updated `resume_token`.
+     * 
+ * + * NO_CHANGE = 0; + */ + public static final int NO_CHANGE_VALUE = 0; + /** + * + * + *
+     * The targets have been added.
+     * 
+ * + * ADD = 1; + */ + public static final int ADD_VALUE = 1; + /** + * + * + *
+     * The targets have been removed.
+     * 
+ * + * REMOVE = 2; + */ + public static final int REMOVE_VALUE = 2; + /** + * + * + *
+     * The targets reflect all changes committed before the targets were added
+     * to the stream.
+     * This will be sent after or with a `read_time` that is greater than or
+     * equal to the time at which the targets were added.
+     * Listeners can wait for this change if read-after-write semantics
+     * are desired.
+     * 
+ * + * CURRENT = 3; + */ + public static final int CURRENT_VALUE = 3; + /** + * + * + *
+     * The targets have been reset, and a new initial state for the targets
+     * will be returned in subsequent changes.
+     * After the initial state is complete, `CURRENT` will be returned even
+     * if the target was previously indicated to be `CURRENT`.
+     * 
+ * + * RESET = 4; + */ + public static final int RESET_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TargetChangeType valueOf(int value) { + return forNumber(value); + } + + public static TargetChangeType forNumber(int value) { + switch (value) { + case 0: + return NO_CHANGE; + case 1: + return ADD; + case 2: + return REMOVE; + case 3: + return CURRENT; + case 4: + return RESET; + 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 TargetChangeType findValueByNumber(int number) { + return TargetChangeType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.TargetChange.getDescriptor().getEnumTypes().get(0); + } + + private static final TargetChangeType[] VALUES = values(); + + public static TargetChangeType 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 TargetChangeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.TargetChange.TargetChangeType) + } + + private int bitField0_; + public static final int TARGET_CHANGE_TYPE_FIELD_NUMBER = 1; + private int targetChangeType_; + /** + * + * + *
+   * The type of change that occurred.
+   * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public int getTargetChangeTypeValue() { + return targetChangeType_; + } + /** + * + * + *
+   * The type of change that occurred.
+   * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public com.google.firestore.v1.TargetChange.TargetChangeType getTargetChangeType() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.TargetChange.TargetChangeType result = + com.google.firestore.v1.TargetChange.TargetChangeType.valueOf(targetChangeType_); + return result == null + ? com.google.firestore.v1.TargetChange.TargetChangeType.UNRECOGNIZED + : result; + } + + public static final int TARGET_IDS_FIELD_NUMBER = 2; + private java.util.List targetIds_; + /** + * + * + *
+   * The target IDs of targets that have changed.
+   * If empty, the change applies to all targets.
+   * For `target_change_type=ADD`, the order of the target IDs matches the order
+   * of the requests to add the targets. This allows clients to unambiguously
+   * associate server-assigned target IDs with added targets.
+   * For other states, the order of the target IDs is not defined.
+   * 
+ * + * repeated int32 target_ids = 2; + */ + public java.util.List getTargetIdsList() { + return targetIds_; + } + /** + * + * + *
+   * The target IDs of targets that have changed.
+   * If empty, the change applies to all targets.
+   * For `target_change_type=ADD`, the order of the target IDs matches the order
+   * of the requests to add the targets. This allows clients to unambiguously
+   * associate server-assigned target IDs with added targets.
+   * For other states, the order of the target IDs is not defined.
+   * 
+ * + * repeated int32 target_ids = 2; + */ + public int getTargetIdsCount() { + return targetIds_.size(); + } + /** + * + * + *
+   * The target IDs of targets that have changed.
+   * If empty, the change applies to all targets.
+   * For `target_change_type=ADD`, the order of the target IDs matches the order
+   * of the requests to add the targets. This allows clients to unambiguously
+   * associate server-assigned target IDs with added targets.
+   * For other states, the order of the target IDs is not defined.
+   * 
+ * + * repeated int32 target_ids = 2; + */ + public int getTargetIds(int index) { + return targetIds_.get(index); + } + + private int targetIdsMemoizedSerializedSize = -1; + + public static final int CAUSE_FIELD_NUMBER = 3; + private com.google.rpc.Status cause_; + /** + * + * + *
+   * The error that resulted in this change, if applicable.
+   * 
+ * + * .google.rpc.Status cause = 3; + */ + public boolean hasCause() { + return cause_ != null; + } + /** + * + * + *
+   * The error that resulted in this change, if applicable.
+   * 
+ * + * .google.rpc.Status cause = 3; + */ + public com.google.rpc.Status getCause() { + return cause_ == null ? com.google.rpc.Status.getDefaultInstance() : cause_; + } + /** + * + * + *
+   * The error that resulted in this change, if applicable.
+   * 
+ * + * .google.rpc.Status cause = 3; + */ + public com.google.rpc.StatusOrBuilder getCauseOrBuilder() { + return getCause(); + } + + public static final int RESUME_TOKEN_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString resumeToken_; + /** + * + * + *
+   * A token that can be used to resume the stream for the given `target_ids`,
+   * or all targets if `target_ids` is empty.
+   * Not set on every target change.
+   * 
+ * + * bytes resume_token = 4; + */ + public com.google.protobuf.ByteString getResumeToken() { + return resumeToken_; + } + + public static final int READ_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * The consistent `read_time` for the given `target_ids` (omitted when the
+   * target_ids are not at a consistent snapshot).
+   * The stream is guaranteed to send a `read_time` with `target_ids` empty
+   * whenever the entire stream reaches a new consistent snapshot. ADD,
+   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+   * For a given stream, `read_time` is guaranteed to be monotonically
+   * increasing.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * The consistent `read_time` for the given `target_ids` (omitted when the
+   * target_ids are not at a consistent snapshot).
+   * The stream is guaranteed to send a `read_time` with `target_ids` empty
+   * whenever the entire stream reaches a new consistent snapshot. ADD,
+   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+   * For a given stream, `read_time` is guaranteed to be monotonically
+   * increasing.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * The consistent `read_time` for the given `target_ids` (omitted when the
+   * target_ids are not at a consistent snapshot).
+   * The stream is guaranteed to send a `read_time` with `target_ids` empty
+   * whenever the entire stream reaches a new consistent snapshot. ADD,
+   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+   * For a given stream, `read_time` is guaranteed to be monotonically
+   * increasing.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + 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 { + getSerializedSize(); + if (targetChangeType_ + != com.google.firestore.v1.TargetChange.TargetChangeType.NO_CHANGE.getNumber()) { + output.writeEnum(1, targetChangeType_); + } + if (getTargetIdsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(targetIdsMemoizedSerializedSize); + } + for (int i = 0; i < targetIds_.size(); i++) { + output.writeInt32NoTag(targetIds_.get(i)); + } + if (cause_ != null) { + output.writeMessage(3, getCause()); + } + if (!resumeToken_.isEmpty()) { + output.writeBytes(4, resumeToken_); + } + if (readTime_ != null) { + output.writeMessage(6, getReadTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetChangeType_ + != com.google.firestore.v1.TargetChange.TargetChangeType.NO_CHANGE.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, targetChangeType_); + } + { + int dataSize = 0; + for (int i = 0; i < targetIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(targetIds_.get(i)); + } + size += dataSize; + if (!getTargetIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + targetIdsMemoizedSerializedSize = dataSize; + } + if (cause_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCause()); + } + if (!resumeToken_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, resumeToken_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, 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.v1.TargetChange)) { + return super.equals(obj); + } + com.google.firestore.v1.TargetChange other = (com.google.firestore.v1.TargetChange) obj; + + boolean result = true; + result = result && targetChangeType_ == other.targetChangeType_; + result = result && getTargetIdsList().equals(other.getTargetIdsList()); + result = result && (hasCause() == other.hasCause()); + if (hasCause()) { + result = result && getCause().equals(other.getCause()); + } + result = result && getResumeToken().equals(other.getResumeToken()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TARGET_CHANGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + targetChangeType_; + if (getTargetIdsCount() > 0) { + hash = (37 * hash) + TARGET_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTargetIdsList().hashCode(); + } + if (hasCause()) { + hash = (37 * hash) + CAUSE_FIELD_NUMBER; + hash = (53 * hash) + getCause().hashCode(); + } + hash = (37 * hash) + RESUME_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getResumeToken().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.v1.TargetChange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TargetChange 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.v1.TargetChange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TargetChange 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.v1.TargetChange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TargetChange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.TargetChange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TargetChange 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.v1.TargetChange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TargetChange 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.v1.TargetChange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TargetChange 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.v1.TargetChange 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; + } + /** + * + * + *
+   * Targets being watched have changed.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.TargetChange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.TargetChange) + com.google.firestore.v1.TargetChangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_TargetChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_TargetChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TargetChange.class, + com.google.firestore.v1.TargetChange.Builder.class); + } + + // Construct using com.google.firestore.v1.TargetChange.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(); + targetChangeType_ = 0; + + targetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + if (causeBuilder_ == null) { + cause_ = null; + } else { + cause_ = null; + causeBuilder_ = null; + } + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + + 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.v1.FirestoreProto + .internal_static_google_firestore_v1_TargetChange_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.TargetChange getDefaultInstanceForType() { + return com.google.firestore.v1.TargetChange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.TargetChange build() { + com.google.firestore.v1.TargetChange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.TargetChange buildPartial() { + com.google.firestore.v1.TargetChange result = new com.google.firestore.v1.TargetChange(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.targetChangeType_ = targetChangeType_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + targetIds_ = java.util.Collections.unmodifiableList(targetIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.targetIds_ = targetIds_; + if (causeBuilder_ == null) { + result.cause_ = cause_; + } else { + result.cause_ = causeBuilder_.build(); + } + result.resumeToken_ = resumeToken_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.TargetChange) { + return mergeFrom((com.google.firestore.v1.TargetChange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.TargetChange other) { + if (other == com.google.firestore.v1.TargetChange.getDefaultInstance()) return this; + if (other.targetChangeType_ != 0) { + setTargetChangeTypeValue(other.getTargetChangeTypeValue()); + } + if (!other.targetIds_.isEmpty()) { + if (targetIds_.isEmpty()) { + targetIds_ = other.targetIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTargetIdsIsMutable(); + targetIds_.addAll(other.targetIds_); + } + onChanged(); + } + if (other.hasCause()) { + mergeCause(other.getCause()); + } + if (other.getResumeToken() != com.google.protobuf.ByteString.EMPTY) { + setResumeToken(other.getResumeToken()); + } + 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.v1.TargetChange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.TargetChange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int targetChangeType_ = 0; + /** + * + * + *
+     * The type of change that occurred.
+     * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public int getTargetChangeTypeValue() { + return targetChangeType_; + } + /** + * + * + *
+     * The type of change that occurred.
+     * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public Builder setTargetChangeTypeValue(int value) { + targetChangeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of change that occurred.
+     * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public com.google.firestore.v1.TargetChange.TargetChangeType getTargetChangeType() { + @SuppressWarnings("deprecation") + com.google.firestore.v1.TargetChange.TargetChangeType result = + com.google.firestore.v1.TargetChange.TargetChangeType.valueOf(targetChangeType_); + return result == null + ? com.google.firestore.v1.TargetChange.TargetChangeType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The type of change that occurred.
+     * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public Builder setTargetChangeType( + com.google.firestore.v1.TargetChange.TargetChangeType value) { + if (value == null) { + throw new NullPointerException(); + } + + targetChangeType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of change that occurred.
+     * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + public Builder clearTargetChangeType() { + + targetChangeType_ = 0; + onChanged(); + return this; + } + + private java.util.List targetIds_ = java.util.Collections.emptyList(); + + private void ensureTargetIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + targetIds_ = new java.util.ArrayList(targetIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public java.util.List getTargetIdsList() { + return java.util.Collections.unmodifiableList(targetIds_); + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public int getTargetIdsCount() { + return targetIds_.size(); + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public int getTargetIds(int index) { + return targetIds_.get(index); + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public Builder setTargetIds(int index, int value) { + ensureTargetIdsIsMutable(); + targetIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public Builder addTargetIds(int value) { + ensureTargetIdsIsMutable(); + targetIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public Builder addAllTargetIds(java.lang.Iterable values) { + ensureTargetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The target IDs of targets that have changed.
+     * If empty, the change applies to all targets.
+     * For `target_change_type=ADD`, the order of the target IDs matches the order
+     * of the requests to add the targets. This allows clients to unambiguously
+     * associate server-assigned target IDs with added targets.
+     * For other states, the order of the target IDs is not defined.
+     * 
+ * + * repeated int32 target_ids = 2; + */ + public Builder clearTargetIds() { + targetIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.rpc.Status cause_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + causeBuilder_; + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public boolean hasCause() { + return causeBuilder_ != null || cause_ != null; + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public com.google.rpc.Status getCause() { + if (causeBuilder_ == null) { + return cause_ == null ? com.google.rpc.Status.getDefaultInstance() : cause_; + } else { + return causeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public Builder setCause(com.google.rpc.Status value) { + if (causeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cause_ = value; + onChanged(); + } else { + causeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public Builder setCause(com.google.rpc.Status.Builder builderForValue) { + if (causeBuilder_ == null) { + cause_ = builderForValue.build(); + onChanged(); + } else { + causeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public Builder mergeCause(com.google.rpc.Status value) { + if (causeBuilder_ == null) { + if (cause_ != null) { + cause_ = com.google.rpc.Status.newBuilder(cause_).mergeFrom(value).buildPartial(); + } else { + cause_ = value; + } + onChanged(); + } else { + causeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public Builder clearCause() { + if (causeBuilder_ == null) { + cause_ = null; + onChanged(); + } else { + cause_ = null; + causeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public com.google.rpc.Status.Builder getCauseBuilder() { + + onChanged(); + return getCauseFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + public com.google.rpc.StatusOrBuilder getCauseOrBuilder() { + if (causeBuilder_ != null) { + return causeBuilder_.getMessageOrBuilder(); + } else { + return cause_ == null ? com.google.rpc.Status.getDefaultInstance() : cause_; + } + } + /** + * + * + *
+     * The error that resulted in this change, if applicable.
+     * 
+ * + * .google.rpc.Status cause = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getCauseFieldBuilder() { + if (causeBuilder_ == null) { + causeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getCause(), getParentForChildren(), isClean()); + cause_ = null; + } + return causeBuilder_; + } + + private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * A token that can be used to resume the stream for the given `target_ids`,
+     * or all targets if `target_ids` is empty.
+     * Not set on every target change.
+     * 
+ * + * bytes resume_token = 4; + */ + public com.google.protobuf.ByteString getResumeToken() { + return resumeToken_; + } + /** + * + * + *
+     * A token that can be used to resume the stream for the given `target_ids`,
+     * or all targets if `target_ids` is empty.
+     * Not set on every target change.
+     * 
+ * + * bytes resume_token = 4; + */ + public Builder setResumeToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + resumeToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be used to resume the stream for the given `target_ids`,
+     * or all targets if `target_ids` is empty.
+     * Not set on every target change.
+     * 
+ * + * bytes resume_token = 4; + */ + public Builder clearResumeToken() { + + resumeToken_ = getDefaultInstance().getResumeToken(); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + 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 consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + 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 consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * The consistent `read_time` for the given `target_ids` (omitted when the
+     * target_ids are not at a consistent snapshot).
+     * The stream is guaranteed to send a `read_time` with `target_ids` empty
+     * whenever the entire stream reaches a new consistent snapshot. ADD,
+     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+     * For a given stream, `read_time` is guaranteed to be monotonically
+     * increasing.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.TargetChange) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.TargetChange) + private static final com.google.firestore.v1.TargetChange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.TargetChange(); + } + + public static com.google.firestore.v1.TargetChange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TargetChange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TargetChange(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.v1.TargetChange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChangeOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChangeOrBuilder.java new file mode 100644 index 000000000000..6719a99062cb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetChangeOrBuilder.java @@ -0,0 +1,173 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface TargetChangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.TargetChange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of change that occurred.
+   * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + int getTargetChangeTypeValue(); + /** + * + * + *
+   * The type of change that occurred.
+   * 
+ * + * .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + com.google.firestore.v1.TargetChange.TargetChangeType getTargetChangeType(); + + /** + * + * + *
+   * The target IDs of targets that have changed.
+   * If empty, the change applies to all targets.
+   * For `target_change_type=ADD`, the order of the target IDs matches the order
+   * of the requests to add the targets. This allows clients to unambiguously
+   * associate server-assigned target IDs with added targets.
+   * For other states, the order of the target IDs is not defined.
+   * 
+ * + * repeated int32 target_ids = 2; + */ + java.util.List getTargetIdsList(); + /** + * + * + *
+   * The target IDs of targets that have changed.
+   * If empty, the change applies to all targets.
+   * For `target_change_type=ADD`, the order of the target IDs matches the order
+   * of the requests to add the targets. This allows clients to unambiguously
+   * associate server-assigned target IDs with added targets.
+   * For other states, the order of the target IDs is not defined.
+   * 
+ * + * repeated int32 target_ids = 2; + */ + int getTargetIdsCount(); + /** + * + * + *
+   * The target IDs of targets that have changed.
+   * If empty, the change applies to all targets.
+   * For `target_change_type=ADD`, the order of the target IDs matches the order
+   * of the requests to add the targets. This allows clients to unambiguously
+   * associate server-assigned target IDs with added targets.
+   * For other states, the order of the target IDs is not defined.
+   * 
+ * + * repeated int32 target_ids = 2; + */ + int getTargetIds(int index); + + /** + * + * + *
+   * The error that resulted in this change, if applicable.
+   * 
+ * + * .google.rpc.Status cause = 3; + */ + boolean hasCause(); + /** + * + * + *
+   * The error that resulted in this change, if applicable.
+   * 
+ * + * .google.rpc.Status cause = 3; + */ + com.google.rpc.Status getCause(); + /** + * + * + *
+   * The error that resulted in this change, if applicable.
+   * 
+ * + * .google.rpc.Status cause = 3; + */ + com.google.rpc.StatusOrBuilder getCauseOrBuilder(); + + /** + * + * + *
+   * A token that can be used to resume the stream for the given `target_ids`,
+   * or all targets if `target_ids` is empty.
+   * Not set on every target change.
+   * 
+ * + * bytes resume_token = 4; + */ + com.google.protobuf.ByteString getResumeToken(); + + /** + * + * + *
+   * The consistent `read_time` for the given `target_ids` (omitted when the
+   * target_ids are not at a consistent snapshot).
+   * The stream is guaranteed to send a `read_time` with `target_ids` empty
+   * whenever the entire stream reaches a new consistent snapshot. ADD,
+   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+   * For a given stream, `read_time` is guaranteed to be monotonically
+   * increasing.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + boolean hasReadTime(); + /** + * + * + *
+   * The consistent `read_time` for the given `target_ids` (omitted when the
+   * target_ids are not at a consistent snapshot).
+   * The stream is guaranteed to send a `read_time` with `target_ids` empty
+   * whenever the entire stream reaches a new consistent snapshot. ADD,
+   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+   * For a given stream, `read_time` is guaranteed to be monotonically
+   * increasing.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * The consistent `read_time` for the given `target_ids` (omitted when the
+   * target_ids are not at a consistent snapshot).
+   * The stream is guaranteed to send a `read_time` with `target_ids` empty
+   * whenever the entire stream reaches a new consistent snapshot. ADD,
+   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
+   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
+   * For a given stream, `read_time` is guaranteed to be monotonically
+   * increasing.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetOrBuilder.java new file mode 100644 index 000000000000..806e74d3b237 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TargetOrBuilder.java @@ -0,0 +1,149 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface TargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Target) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + boolean hasQuery(); + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + com.google.firestore.v1.Target.QueryTarget getQuery(); + /** + * + * + *
+   * A target specified by a query.
+   * 
+ * + * .google.firestore.v1.Target.QueryTarget query = 2; + */ + com.google.firestore.v1.Target.QueryTargetOrBuilder getQueryOrBuilder(); + + /** + * + * + *
+   * A target specified by a set of document names.
+   * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + boolean hasDocuments(); + /** + * + * + *
+   * A target specified by a set of document names.
+   * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + com.google.firestore.v1.Target.DocumentsTarget getDocuments(); + /** + * + * + *
+   * A target specified by a set of document names.
+   * 
+ * + * .google.firestore.v1.Target.DocumentsTarget documents = 3; + */ + com.google.firestore.v1.Target.DocumentsTargetOrBuilder getDocumentsOrBuilder(); + + /** + * + * + *
+   * A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target.
+   * Using a resume token with a different target is unsupported and may fail.
+   * 
+ * + * bytes resume_token = 4; + */ + com.google.protobuf.ByteString getResumeToken(); + + /** + * + * + *
+   * Start listening after a specific `read_time`.
+   * The client must know the state of matching documents at this time.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Start listening after a specific `read_time`.
+   * The client must know the state of matching documents at this time.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Start listening after a specific `read_time`.
+   * The client must know the state of matching documents at this time.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 11; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * A client provided target ID.
+   * If not set, the server will assign an ID for the target.
+   * Used for resuming a target without changing IDs. The IDs can either be
+   * client-assigned or be server-assigned in a previous stream. All targets
+   * with client provided IDs must be added before adding a target that needs
+   * a server-assigned id.
+   * 
+ * + * int32 target_id = 5; + */ + int getTargetId(); + + /** + * + * + *
+   * If the target should be removed once it is current and consistent.
+   * 
+ * + * bool once = 6; + */ + boolean getOnce(); + + public com.google.firestore.v1.Target.TargetTypeCase getTargetTypeCase(); + + public com.google.firestore.v1.Target.ResumeTypeCase getResumeTypeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptions.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptions.java new file mode 100644 index 000000000000..78f8d7fe34f5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptions.java @@ -0,0 +1,2480 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * Options for creating a new transaction.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.TransactionOptions} + */ +public final class TransactionOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.TransactionOptions) + TransactionOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransactionOptions.newBuilder() to construct. + private TransactionOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TransactionOptions() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TransactionOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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 18: + { + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder subBuilder = null; + if (modeCase_ == 2) { + subBuilder = + ((com.google.firestore.v1.TransactionOptions.ReadOnly) mode_).toBuilder(); + } + mode_ = + input.readMessage( + com.google.firestore.v1.TransactionOptions.ReadOnly.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.TransactionOptions.ReadOnly) mode_); + mode_ = subBuilder.buildPartial(); + } + modeCase_ = 2; + break; + } + case 26: + { + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder subBuilder = null; + if (modeCase_ == 3) { + subBuilder = + ((com.google.firestore.v1.TransactionOptions.ReadWrite) mode_).toBuilder(); + } + mode_ = + input.readMessage( + com.google.firestore.v1.TransactionOptions.ReadWrite.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.TransactionOptions.ReadWrite) mode_); + mode_ = subBuilder.buildPartial(); + } + modeCase_ = 3; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TransactionOptions.class, + com.google.firestore.v1.TransactionOptions.Builder.class); + } + + public interface ReadWriteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.TransactionOptions.ReadWrite) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * An optional transaction to retry.
+     * 
+ * + * bytes retry_transaction = 1; + */ + com.google.protobuf.ByteString getRetryTransaction(); + } + /** + * + * + *
+   * Options for a transaction that can be used to read and write documents.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.TransactionOptions.ReadWrite} + */ + public static final class ReadWrite extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.TransactionOptions.ReadWrite) + ReadWriteOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadWrite.newBuilder() to construct. + private ReadWrite(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadWrite() { + retryTransaction_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadWrite( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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: + { + retryTransaction_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadWrite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadWrite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TransactionOptions.ReadWrite.class, + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder.class); + } + + public static final int RETRY_TRANSACTION_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString retryTransaction_; + /** + * + * + *
+     * An optional transaction to retry.
+     * 
+ * + * bytes retry_transaction = 1; + */ + public com.google.protobuf.ByteString getRetryTransaction() { + return retryTransaction_; + } + + 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 (!retryTransaction_.isEmpty()) { + output.writeBytes(1, retryTransaction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!retryTransaction_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, retryTransaction_); + } + 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.v1.TransactionOptions.ReadWrite)) { + return super.equals(obj); + } + com.google.firestore.v1.TransactionOptions.ReadWrite other = + (com.google.firestore.v1.TransactionOptions.ReadWrite) obj; + + boolean result = true; + result = result && getRetryTransaction().equals(other.getRetryTransaction()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RETRY_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getRetryTransaction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite 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.v1.TransactionOptions.ReadWrite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite 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.v1.TransactionOptions.ReadWrite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite 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.v1.TransactionOptions.ReadWrite parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite 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.v1.TransactionOptions.ReadWrite parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite 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.v1.TransactionOptions.ReadWrite 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; + } + /** + * + * + *
+     * Options for a transaction that can be used to read and write documents.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.TransactionOptions.ReadWrite} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.TransactionOptions.ReadWrite) + com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadWrite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadWrite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TransactionOptions.ReadWrite.class, + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder.class); + } + + // Construct using com.google.firestore.v1.TransactionOptions.ReadWrite.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(); + retryTransaction_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadWrite_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions.ReadWrite getDefaultInstanceForType() { + return com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions.ReadWrite build() { + com.google.firestore.v1.TransactionOptions.ReadWrite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions.ReadWrite buildPartial() { + com.google.firestore.v1.TransactionOptions.ReadWrite result = + new com.google.firestore.v1.TransactionOptions.ReadWrite(this); + result.retryTransaction_ = retryTransaction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.TransactionOptions.ReadWrite) { + return mergeFrom((com.google.firestore.v1.TransactionOptions.ReadWrite) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.TransactionOptions.ReadWrite other) { + if (other == com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance()) + return this; + if (other.getRetryTransaction() != com.google.protobuf.ByteString.EMPTY) { + setRetryTransaction(other.getRetryTransaction()); + } + 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.v1.TransactionOptions.ReadWrite parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.TransactionOptions.ReadWrite) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString retryTransaction_ = + com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+       * An optional transaction to retry.
+       * 
+ * + * bytes retry_transaction = 1; + */ + public com.google.protobuf.ByteString getRetryTransaction() { + return retryTransaction_; + } + /** + * + * + *
+       * An optional transaction to retry.
+       * 
+ * + * bytes retry_transaction = 1; + */ + public Builder setRetryTransaction(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + retryTransaction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * An optional transaction to retry.
+       * 
+ * + * bytes retry_transaction = 1; + */ + public Builder clearRetryTransaction() { + + retryTransaction_ = getDefaultInstance().getRetryTransaction(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.TransactionOptions.ReadWrite) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.TransactionOptions.ReadWrite) + private static final com.google.firestore.v1.TransactionOptions.ReadWrite DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.TransactionOptions.ReadWrite(); + } + + public static com.google.firestore.v1.TransactionOptions.ReadWrite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadWrite parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadWrite(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.v1.TransactionOptions.ReadWrite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReadOnlyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.TransactionOptions.ReadOnly) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Reads documents at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + boolean hasReadTime(); + /** + * + * + *
+     * Reads documents at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+     * Reads documents at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + public com.google.firestore.v1.TransactionOptions.ReadOnly.ConsistencySelectorCase + getConsistencySelectorCase(); + } + /** + * + * + *
+   * Options for a transaction that can only be used to read documents.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.TransactionOptions.ReadOnly} + */ + public static final class ReadOnly extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.TransactionOptions.ReadOnly) + ReadOnlyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadOnly.newBuilder() to construct. + private ReadOnly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadOnly() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadOnly( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (consistencySelectorCase_ == 2) { + subBuilder = ((com.google.protobuf.Timestamp) consistencySelector_).toBuilder(); + } + consistencySelector_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) consistencySelector_); + consistencySelector_ = subBuilder.buildPartial(); + } + consistencySelectorCase_ = 2; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TransactionOptions.ReadOnly.class, + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder.class); + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public enum ConsistencySelectorCase implements com.google.protobuf.Internal.EnumLite { + READ_TIME(2), + CONSISTENCYSELECTOR_NOT_SET(0); + private final int value; + + private ConsistencySelectorCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ConsistencySelectorCase valueOf(int value) { + return forNumber(value); + } + + public static ConsistencySelectorCase forNumber(int value) { + switch (value) { + case 2: + return READ_TIME; + case 0: + return CONSISTENCYSELECTOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + /** + * + * + *
+     * Reads documents at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 2; + } + /** + * + * + *
+     * Reads documents at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (consistencySelectorCase_ == 2) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+     * Reads documents at the given time.
+     * This may not be older than 60 seconds.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (consistencySelectorCase_ == 2) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.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 (consistencySelectorCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Timestamp) consistencySelector_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (consistencySelectorCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Timestamp) consistencySelector_); + } + 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.v1.TransactionOptions.ReadOnly)) { + return super.equals(obj); + } + com.google.firestore.v1.TransactionOptions.ReadOnly other = + (com.google.firestore.v1.TransactionOptions.ReadOnly) obj; + + boolean result = true; + result = result && getConsistencySelectorCase().equals(other.getConsistencySelectorCase()); + if (!result) return false; + switch (consistencySelectorCase_) { + case 2: + result = result && getReadTime().equals(other.getReadTime()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (consistencySelectorCase_) { + case 2: + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly 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.v1.TransactionOptions.ReadOnly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly 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.v1.TransactionOptions.ReadOnly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly 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.v1.TransactionOptions.ReadOnly parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly 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.v1.TransactionOptions.ReadOnly parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly 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.v1.TransactionOptions.ReadOnly 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; + } + /** + * + * + *
+     * Options for a transaction that can only be used to read documents.
+     * 
+ * + * Protobuf type {@code google.firestore.v1.TransactionOptions.ReadOnly} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.TransactionOptions.ReadOnly) + com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TransactionOptions.ReadOnly.class, + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder.class); + } + + // Construct using com.google.firestore.v1.TransactionOptions.ReadOnly.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(); + consistencySelectorCase_ = 0; + consistencySelector_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_ReadOnly_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions.ReadOnly getDefaultInstanceForType() { + return com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions.ReadOnly build() { + com.google.firestore.v1.TransactionOptions.ReadOnly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions.ReadOnly buildPartial() { + com.google.firestore.v1.TransactionOptions.ReadOnly result = + new com.google.firestore.v1.TransactionOptions.ReadOnly(this); + if (consistencySelectorCase_ == 2) { + if (readTimeBuilder_ == null) { + result.consistencySelector_ = consistencySelector_; + } else { + result.consistencySelector_ = readTimeBuilder_.build(); + } + } + result.consistencySelectorCase_ = consistencySelectorCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.TransactionOptions.ReadOnly) { + return mergeFrom((com.google.firestore.v1.TransactionOptions.ReadOnly) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.TransactionOptions.ReadOnly other) { + if (other == com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance()) + return this; + switch (other.getConsistencySelectorCase()) { + case READ_TIME: + { + mergeReadTime(other.getReadTime()); + break; + } + case CONSISTENCYSELECTOR_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.v1.TransactionOptions.ReadOnly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.v1.TransactionOptions.ReadOnly) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int consistencySelectorCase_ = 0; + private java.lang.Object consistencySelector_; + + public ConsistencySelectorCase getConsistencySelectorCase() { + return ConsistencySelectorCase.forNumber(consistencySelectorCase_); + } + + public Builder clearConsistencySelector() { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return consistencySelectorCase_ == 2; + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 2) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (consistencySelectorCase_ == 2) { + return readTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consistencySelector_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 2; + return this; + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + consistencySelector_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + consistencySelectorCase_ = 2; + return this; + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 2 + && consistencySelector_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + consistencySelector_ = + com.google.protobuf.Timestamp.newBuilder( + (com.google.protobuf.Timestamp) consistencySelector_) + .mergeFrom(value) + .buildPartial(); + } else { + consistencySelector_ = value; + } + onChanged(); + } else { + if (consistencySelectorCase_ == 2) { + readTimeBuilder_.mergeFrom(value); + } + readTimeBuilder_.setMessage(value); + } + consistencySelectorCase_ = 2; + return this; + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + if (consistencySelectorCase_ == 2) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + onChanged(); + } + } else { + if (consistencySelectorCase_ == 2) { + consistencySelectorCase_ = 0; + consistencySelector_ = null; + } + readTimeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if ((consistencySelectorCase_ == 2) && (readTimeBuilder_ != null)) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + if (consistencySelectorCase_ == 2) { + return (com.google.protobuf.Timestamp) consistencySelector_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+       * Reads documents at the given time.
+       * This may not be older than 60 seconds.
+       * 
+ * + * .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) { + if (!(consistencySelectorCase_ == 2)) { + consistencySelector_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) consistencySelector_, + getParentForChildren(), + isClean()); + consistencySelector_ = null; + } + consistencySelectorCase_ = 2; + onChanged(); + ; + return readTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.TransactionOptions.ReadOnly) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.TransactionOptions.ReadOnly) + private static final com.google.firestore.v1.TransactionOptions.ReadOnly DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.TransactionOptions.ReadOnly(); + } + + public static com.google.firestore.v1.TransactionOptions.ReadOnly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadOnly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadOnly(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.v1.TransactionOptions.ReadOnly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modeCase_ = 0; + private java.lang.Object mode_; + + public enum ModeCase implements com.google.protobuf.Internal.EnumLite { + READ_ONLY(2), + READ_WRITE(3), + MODE_NOT_SET(0); + private final int value; + + private ModeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ModeCase valueOf(int value) { + return forNumber(value); + } + + public static ModeCase forNumber(int value) { + switch (value) { + case 2: + return READ_ONLY; + case 3: + return READ_WRITE; + case 0: + return MODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public static final int READ_ONLY_FIELD_NUMBER = 2; + /** + * + * + *
+   * The transaction can only be used for read operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public boolean hasReadOnly() { + return modeCase_ == 2; + } + /** + * + * + *
+   * The transaction can only be used for read operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public com.google.firestore.v1.TransactionOptions.ReadOnly getReadOnly() { + if (modeCase_ == 2) { + return (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } + /** + * + * + *
+   * The transaction can only be used for read operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder getReadOnlyOrBuilder() { + if (modeCase_ == 2) { + return (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } + + public static final int READ_WRITE_FIELD_NUMBER = 3; + /** + * + * + *
+   * The transaction can be used for both read and write operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public boolean hasReadWrite() { + return modeCase_ == 3; + } + /** + * + * + *
+   * The transaction can be used for both read and write operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public com.google.firestore.v1.TransactionOptions.ReadWrite getReadWrite() { + if (modeCase_ == 3) { + return (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance(); + } + /** + * + * + *
+   * The transaction can be used for both read and write operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder getReadWriteOrBuilder() { + if (modeCase_ == 3) { + return (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadWrite.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 (modeCase_ == 2) { + output.writeMessage(2, (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_); + } + if (modeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (modeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_); + } + if (modeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_); + } + 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.v1.TransactionOptions)) { + return super.equals(obj); + } + com.google.firestore.v1.TransactionOptions other = + (com.google.firestore.v1.TransactionOptions) obj; + + boolean result = true; + result = result && getModeCase().equals(other.getModeCase()); + if (!result) return false; + switch (modeCase_) { + case 2: + result = result && getReadOnly().equals(other.getReadOnly()); + break; + case 3: + result = result && getReadWrite().equals(other.getReadWrite()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (modeCase_) { + case 2: + hash = (37 * hash) + READ_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getReadOnly().hashCode(); + break; + case 3: + hash = (37 * hash) + READ_WRITE_FIELD_NUMBER; + hash = (53 * hash) + getReadWrite().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.TransactionOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions 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.v1.TransactionOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions 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.v1.TransactionOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.TransactionOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.TransactionOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions 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.v1.TransactionOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions 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.v1.TransactionOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.TransactionOptions 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.v1.TransactionOptions 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; + } + /** + * + * + *
+   * Options for creating a new transaction.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.TransactionOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.TransactionOptions) + com.google.firestore.v1.TransactionOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.TransactionOptions.class, + com.google.firestore.v1.TransactionOptions.Builder.class); + } + + // Construct using com.google.firestore.v1.TransactionOptions.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(); + modeCase_ = 0; + mode_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.CommonProto + .internal_static_google_firestore_v1_TransactionOptions_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions getDefaultInstanceForType() { + return com.google.firestore.v1.TransactionOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions build() { + com.google.firestore.v1.TransactionOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.TransactionOptions buildPartial() { + com.google.firestore.v1.TransactionOptions result = + new com.google.firestore.v1.TransactionOptions(this); + if (modeCase_ == 2) { + if (readOnlyBuilder_ == null) { + result.mode_ = mode_; + } else { + result.mode_ = readOnlyBuilder_.build(); + } + } + if (modeCase_ == 3) { + if (readWriteBuilder_ == null) { + result.mode_ = mode_; + } else { + result.mode_ = readWriteBuilder_.build(); + } + } + result.modeCase_ = modeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.TransactionOptions) { + return mergeFrom((com.google.firestore.v1.TransactionOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.TransactionOptions other) { + if (other == com.google.firestore.v1.TransactionOptions.getDefaultInstance()) return this; + switch (other.getModeCase()) { + case READ_ONLY: + { + mergeReadOnly(other.getReadOnly()); + break; + } + case READ_WRITE: + { + mergeReadWrite(other.getReadWrite()); + break; + } + case MODE_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.v1.TransactionOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.TransactionOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modeCase_ = 0; + private java.lang.Object mode_; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public Builder clearMode() { + modeCase_ = 0; + mode_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions.ReadOnly, + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder, + com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder> + readOnlyBuilder_; + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public boolean hasReadOnly() { + return modeCase_ == 2; + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public com.google.firestore.v1.TransactionOptions.ReadOnly getReadOnly() { + if (readOnlyBuilder_ == null) { + if (modeCase_ == 2) { + return (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } else { + if (modeCase_ == 2) { + return readOnlyBuilder_.getMessage(); + } + return com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public Builder setReadOnly(com.google.firestore.v1.TransactionOptions.ReadOnly value) { + if (readOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + readOnlyBuilder_.setMessage(value); + } + modeCase_ = 2; + return this; + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public Builder setReadOnly( + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder builderForValue) { + if (readOnlyBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + readOnlyBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 2; + return this; + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public Builder mergeReadOnly(com.google.firestore.v1.TransactionOptions.ReadOnly value) { + if (readOnlyBuilder_ == null) { + if (modeCase_ == 2 + && mode_ != com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance()) { + mode_ = + com.google.firestore.v1.TransactionOptions.ReadOnly.newBuilder( + (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 2) { + readOnlyBuilder_.mergeFrom(value); + } + readOnlyBuilder_.setMessage(value); + } + modeCase_ = 2; + return this; + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public Builder clearReadOnly() { + if (readOnlyBuilder_ == null) { + if (modeCase_ == 2) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 2) { + modeCase_ = 0; + mode_ = null; + } + readOnlyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public com.google.firestore.v1.TransactionOptions.ReadOnly.Builder getReadOnlyBuilder() { + return getReadOnlyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + public com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder getReadOnlyOrBuilder() { + if ((modeCase_ == 2) && (readOnlyBuilder_ != null)) { + return readOnlyBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 2) { + return (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } + } + /** + * + * + *
+     * The transaction can only be used for read operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions.ReadOnly, + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder, + com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder> + getReadOnlyFieldBuilder() { + if (readOnlyBuilder_ == null) { + if (!(modeCase_ == 2)) { + mode_ = com.google.firestore.v1.TransactionOptions.ReadOnly.getDefaultInstance(); + } + readOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions.ReadOnly, + com.google.firestore.v1.TransactionOptions.ReadOnly.Builder, + com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder>( + (com.google.firestore.v1.TransactionOptions.ReadOnly) mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 2; + onChanged(); + ; + return readOnlyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions.ReadWrite, + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder, + com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder> + readWriteBuilder_; + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public boolean hasReadWrite() { + return modeCase_ == 3; + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public com.google.firestore.v1.TransactionOptions.ReadWrite getReadWrite() { + if (readWriteBuilder_ == null) { + if (modeCase_ == 3) { + return (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance(); + } else { + if (modeCase_ == 3) { + return readWriteBuilder_.getMessage(); + } + return com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance(); + } + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public Builder setReadWrite(com.google.firestore.v1.TransactionOptions.ReadWrite value) { + if (readWriteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + readWriteBuilder_.setMessage(value); + } + modeCase_ = 3; + return this; + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public Builder setReadWrite( + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder builderForValue) { + if (readWriteBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + readWriteBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 3; + return this; + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public Builder mergeReadWrite(com.google.firestore.v1.TransactionOptions.ReadWrite value) { + if (readWriteBuilder_ == null) { + if (modeCase_ == 3 + && mode_ != com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance()) { + mode_ = + com.google.firestore.v1.TransactionOptions.ReadWrite.newBuilder( + (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 3) { + readWriteBuilder_.mergeFrom(value); + } + readWriteBuilder_.setMessage(value); + } + modeCase_ = 3; + return this; + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public Builder clearReadWrite() { + if (readWriteBuilder_ == null) { + if (modeCase_ == 3) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 3) { + modeCase_ = 0; + mode_ = null; + } + readWriteBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public com.google.firestore.v1.TransactionOptions.ReadWrite.Builder getReadWriteBuilder() { + return getReadWriteFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + public com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder getReadWriteOrBuilder() { + if ((modeCase_ == 3) && (readWriteBuilder_ != null)) { + return readWriteBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 3) { + return (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_; + } + return com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance(); + } + } + /** + * + * + *
+     * The transaction can be used for both read and write operations.
+     * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions.ReadWrite, + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder, + com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder> + getReadWriteFieldBuilder() { + if (readWriteBuilder_ == null) { + if (!(modeCase_ == 3)) { + mode_ = com.google.firestore.v1.TransactionOptions.ReadWrite.getDefaultInstance(); + } + readWriteBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.TransactionOptions.ReadWrite, + com.google.firestore.v1.TransactionOptions.ReadWrite.Builder, + com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder>( + (com.google.firestore.v1.TransactionOptions.ReadWrite) mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 3; + onChanged(); + ; + return readWriteBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.TransactionOptions) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.TransactionOptions) + private static final com.google.firestore.v1.TransactionOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.TransactionOptions(); + } + + public static com.google.firestore.v1.TransactionOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransactionOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionOptions(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.v1.TransactionOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptionsOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptionsOrBuilder.java new file mode 100644 index 000000000000..bf167fbcb908 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/TransactionOptionsOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/common.proto + +package com.google.firestore.v1; + +public interface TransactionOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.TransactionOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The transaction can only be used for read operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + boolean hasReadOnly(); + /** + * + * + *
+   * The transaction can only be used for read operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + com.google.firestore.v1.TransactionOptions.ReadOnly getReadOnly(); + /** + * + * + *
+   * The transaction can only be used for read operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + */ + com.google.firestore.v1.TransactionOptions.ReadOnlyOrBuilder getReadOnlyOrBuilder(); + + /** + * + * + *
+   * The transaction can be used for both read and write operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + boolean hasReadWrite(); + /** + * + * + *
+   * The transaction can be used for both read and write operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + com.google.firestore.v1.TransactionOptions.ReadWrite getReadWrite(); + /** + * + * + *
+   * The transaction can be used for both read and write operations.
+   * 
+ * + * .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + */ + com.google.firestore.v1.TransactionOptions.ReadWriteOrBuilder getReadWriteOrBuilder(); + + public com.google.firestore.v1.TransactionOptions.ModeCase getModeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequest.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequest.java new file mode 100644 index 000000000000..862f6be5cda2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequest.java @@ -0,0 +1,1599 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The request for [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.UpdateDocumentRequest} + */ +public final class UpdateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.UpdateDocumentRequest) + UpdateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDocumentRequest.newBuilder() to construct. + private UpdateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDocumentRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateDocumentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (document_ != null) { + subBuilder = document_.toBuilder(); + } + document_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(document_); + document_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.firestore.v1.DocumentMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.firestore.v1.DocumentMask.Builder subBuilder = null; + if (mask_ != null) { + subBuilder = mask_.toBuilder(); + } + mask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mask_); + mask_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.firestore.v1.Precondition.Builder subBuilder = null; + if (currentDocument_ != null) { + subBuilder = currentDocument_.toBuilder(); + } + currentDocument_ = + input.readMessage( + com.google.firestore.v1.Precondition.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(currentDocument_); + currentDocument_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.FirestoreProto + .internal_static_google_firestore_v1_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_UpdateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.UpdateDocumentRequest.class, + com.google.firestore.v1.UpdateDocumentRequest.Builder.class); + } + + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.firestore.v1.Document document_; + /** + * + * + *
+   * The updated document.
+   * Creates the document if it does not already exist.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * The updated document.
+   * Creates the document if it does not already exist.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document getDocument() { + return document_ == null ? com.google.firestore.v1.Document.getDefaultInstance() : document_; + } + /** + * + * + *
+   * The updated document.
+   * Creates the document if it does not already exist.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + return getDocument(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.firestore.v1.DocumentMask updateMask_; + /** + * + * + *
+   * The fields to update.
+   * None of the field paths in the mask may contain a reserved name.
+   * If the document exists on the server and has fields not referenced in the
+   * mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The fields to update.
+   * None of the field paths in the mask may contain a reserved name.
+   * If the document exists on the server and has fields not referenced in the
+   * mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public com.google.firestore.v1.DocumentMask getUpdateMask() { + return updateMask_ == null + ? com.google.firestore.v1.DocumentMask.getDefaultInstance() + : updateMask_; + } + /** + * + * + *
+   * The fields to update.
+   * None of the field paths in the mask may contain a reserved name.
+   * If the document exists on the server and has fields not referenced in the
+   * mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int MASK_FIELD_NUMBER = 3; + private com.google.firestore.v1.DocumentMask mask_; + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public boolean hasMask() { + return mask_ != null; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMask getMask() { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + return getMask(); + } + + public static final int CURRENT_DOCUMENT_FIELD_NUMBER = 4; + private com.google.firestore.v1.Precondition currentDocument_; + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public boolean hasCurrentDocument() { + return currentDocument_ != null; + } + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.Precondition getCurrentDocument() { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { + return getCurrentDocument(); + } + + 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 (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (mask_ != null) { + output.writeMessage(3, getMask()); + } + if (currentDocument_ != null) { + output.writeMessage(4, getCurrentDocument()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (mask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMask()); + } + if (currentDocument_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCurrentDocument()); + } + 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.v1.UpdateDocumentRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.UpdateDocumentRequest other = + (com.google.firestore.v1.UpdateDocumentRequest) obj; + + boolean result = true; + result = result && (hasDocument() == other.hasDocument()); + if (hasDocument()) { + result = result && getDocument().equals(other.getDocument()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && (hasMask() == other.hasMask()); + if (hasMask()) { + result = result && getMask().equals(other.getMask()); + } + result = result && (hasCurrentDocument() == other.hasCurrentDocument()); + if (hasCurrentDocument()) { + result = result && getCurrentDocument().equals(other.getCurrentDocument()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasMask()) { + hash = (37 * hash) + MASK_FIELD_NUMBER; + hash = (53 * hash) + getMask().hashCode(); + } + if (hasCurrentDocument()) { + hash = (37 * hash) + CURRENT_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getCurrentDocument().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.UpdateDocumentRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.UpdateDocumentRequest 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.v1.UpdateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.UpdateDocumentRequest 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.v1.UpdateDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.UpdateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.UpdateDocumentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.UpdateDocumentRequest 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.v1.UpdateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.UpdateDocumentRequest 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.v1.UpdateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.UpdateDocumentRequest 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.v1.UpdateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.UpdateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.UpdateDocumentRequest) + com.google.firestore.v1.UpdateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_UpdateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.UpdateDocumentRequest.class, + com.google.firestore.v1.UpdateDocumentRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.UpdateDocumentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (documentBuilder_ == null) { + document_ = null; + } else { + document_ = null; + documentBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (maskBuilder_ == null) { + mask_ = null; + } else { + mask_ = null; + maskBuilder_ = null; + } + if (currentDocumentBuilder_ == null) { + currentDocument_ = null; + } else { + currentDocument_ = null; + currentDocumentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.UpdateDocumentRequest getDefaultInstanceForType() { + return com.google.firestore.v1.UpdateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.UpdateDocumentRequest build() { + com.google.firestore.v1.UpdateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.UpdateDocumentRequest buildPartial() { + com.google.firestore.v1.UpdateDocumentRequest result = + new com.google.firestore.v1.UpdateDocumentRequest(this); + if (documentBuilder_ == null) { + result.document_ = document_; + } else { + result.document_ = documentBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (maskBuilder_ == null) { + result.mask_ = mask_; + } else { + result.mask_ = maskBuilder_.build(); + } + if (currentDocumentBuilder_ == null) { + result.currentDocument_ = currentDocument_; + } else { + result.currentDocument_ = currentDocumentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.UpdateDocumentRequest) { + return mergeFrom((com.google.firestore.v1.UpdateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.UpdateDocumentRequest other) { + if (other == com.google.firestore.v1.UpdateDocumentRequest.getDefaultInstance()) return this; + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasMask()) { + mergeMask(other.getMask()); + } + if (other.hasCurrentDocument()) { + mergeCurrentDocument(other.getCurrentDocument()); + } + 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.v1.UpdateDocumentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.UpdateDocumentRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.firestore.v1.Document document_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public boolean hasDocument() { + return documentBuilder_ != null || document_ != null; + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder setDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + onChanged(); + } else { + documentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder setDocument(com.google.firestore.v1.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + onChanged(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder mergeDocument(com.google.firestore.v1.Document value) { + if (documentBuilder_ == null) { + if (document_ != null) { + document_ = + com.google.firestore.v1.Document.newBuilder(document_) + .mergeFrom(value) + .buildPartial(); + } else { + document_ = value; + } + onChanged(); + } else { + documentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public Builder clearDocument() { + if (documentBuilder_ == null) { + document_ = null; + onChanged(); + } else { + document_ = null; + documentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.Document.Builder getDocumentBuilder() { + + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.firestore.v1.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * The updated document.
+     * Creates the document if it does not already exist.
+     * 
+ * + * .google.firestore.v1.Document document = 1; + */ + 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) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.firestore.v1.DocumentMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public com.google.firestore.v1.DocumentMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.firestore.v1.DocumentMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.firestore.v1.DocumentMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.firestore.v1.DocumentMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.firestore.v1.DocumentMask.newBuilder(updateMask_) + .mergeFrom(value) + .buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public com.google.firestore.v1.DocumentMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.firestore.v1.DocumentMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The fields to update.
+     * None of the field paths in the mask may contain a reserved name.
+     * If the document exists on the server and has fields not referenced in the
+     * mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.firestore.v1.DocumentMask mask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + maskBuilder_; + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public boolean hasMask() { + return maskBuilder_ != null || mask_ != null; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMask getMask() { + if (maskBuilder_ == null) { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } else { + return maskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mask_ = value; + onChanged(); + } else { + maskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder setMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (maskBuilder_ == null) { + mask_ = builderForValue.build(); + onChanged(); + } else { + maskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder mergeMask(com.google.firestore.v1.DocumentMask value) { + if (maskBuilder_ == null) { + if (mask_ != null) { + mask_ = + com.google.firestore.v1.DocumentMask.newBuilder(mask_) + .mergeFrom(value) + .buildPartial(); + } else { + mask_ = value; + } + onChanged(); + } else { + maskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public Builder clearMask() { + if (maskBuilder_ == null) { + mask_ = null; + onChanged(); + } else { + mask_ = null; + maskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMask.Builder getMaskBuilder() { + + onChanged(); + return getMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder() { + if (maskBuilder_ != null) { + return maskBuilder_.getMessageOrBuilder(); + } else { + return mask_ == null ? com.google.firestore.v1.DocumentMask.getDefaultInstance() : mask_; + } + } + /** + * + * + *
+     * The fields to return. If not set, returns all fields.
+     * If the document has a field that is not present in this mask, that field
+     * will not be returned in the response.
+     * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getMaskFieldBuilder() { + if (maskBuilder_ == null) { + maskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getMask(), getParentForChildren(), isClean()); + mask_ = null; + } + return maskBuilder_; + } + + private com.google.firestore.v1.Precondition currentDocument_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder> + currentDocumentBuilder_; + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public boolean hasCurrentDocument() { + return currentDocumentBuilder_ != null || currentDocument_ != null; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.Precondition getCurrentDocument() { + if (currentDocumentBuilder_ == null) { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } else { + return currentDocumentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder setCurrentDocument(com.google.firestore.v1.Precondition value) { + if (currentDocumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentDocument_ = value; + onChanged(); + } else { + currentDocumentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder setCurrentDocument( + com.google.firestore.v1.Precondition.Builder builderForValue) { + if (currentDocumentBuilder_ == null) { + currentDocument_ = builderForValue.build(); + onChanged(); + } else { + currentDocumentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder mergeCurrentDocument(com.google.firestore.v1.Precondition value) { + if (currentDocumentBuilder_ == null) { + if (currentDocument_ != null) { + currentDocument_ = + com.google.firestore.v1.Precondition.newBuilder(currentDocument_) + .mergeFrom(value) + .buildPartial(); + } else { + currentDocument_ = value; + } + onChanged(); + } else { + currentDocumentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder clearCurrentDocument() { + if (currentDocumentBuilder_ == null) { + currentDocument_ = null; + onChanged(); + } else { + currentDocument_ = null; + currentDocumentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.Precondition.Builder getCurrentDocumentBuilder() { + + onChanged(); + return getCurrentDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { + if (currentDocumentBuilder_ != null) { + return currentDocumentBuilder_.getMessageOrBuilder(); + } else { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The request will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder> + getCurrentDocumentFieldBuilder() { + if (currentDocumentBuilder_ == null) { + currentDocumentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder>( + getCurrentDocument(), getParentForChildren(), isClean()); + currentDocument_ = null; + } + return currentDocumentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.UpdateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.UpdateDocumentRequest) + private static final com.google.firestore.v1.UpdateDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.UpdateDocumentRequest(); + } + + public static com.google.firestore.v1.UpdateDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateDocumentRequest(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.v1.UpdateDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..dbfc8ffc8dd9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/UpdateDocumentRequestOrBuilder.java @@ -0,0 +1,161 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface UpdateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.UpdateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The updated document.
+   * Creates the document if it does not already exist.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + boolean hasDocument(); + /** + * + * + *
+   * The updated document.
+   * Creates the document if it does not already exist.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + com.google.firestore.v1.Document getDocument(); + /** + * + * + *
+   * The updated document.
+   * Creates the document if it does not already exist.
+   * 
+ * + * .google.firestore.v1.Document document = 1; + */ + com.google.firestore.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * The fields to update.
+   * None of the field paths in the mask may contain a reserved name.
+   * If the document exists on the server and has fields not referenced in the
+   * mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The fields to update.
+   * None of the field paths in the mask may contain a reserved name.
+   * If the document exists on the server and has fields not referenced in the
+   * mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + com.google.firestore.v1.DocumentMask getUpdateMask(); + /** + * + * + *
+   * The fields to update.
+   * None of the field paths in the mask may contain a reserved name.
+   * If the document exists on the server and has fields not referenced in the
+   * mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 2; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + boolean hasMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + com.google.firestore.v1.DocumentMask getMask(); + /** + * + * + *
+   * The fields to return. If not set, returns all fields.
+   * If the document has a field that is not present in this mask, that field
+   * will not be returned in the response.
+   * 
+ * + * .google.firestore.v1.DocumentMask mask = 3; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getMaskOrBuilder(); + + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + boolean hasCurrentDocument(); + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + com.google.firestore.v1.Precondition getCurrentDocument(); + /** + * + * + *
+   * An optional precondition on the document.
+   * The request will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Value.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Value.java new file mode 100644 index 000000000000..96e75c68dc90 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Value.java @@ -0,0 +1,2654 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A message that can hold any of the supported value types.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.Value} + */ +public final class Value extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Value) + ValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Value() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Value( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + valueTypeCase_ = 1; + valueType_ = input.readBool(); + break; + } + case 16: + { + valueTypeCase_ = 2; + valueType_ = input.readInt64(); + break; + } + case 25: + { + valueTypeCase_ = 3; + valueType_ = input.readDouble(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + valueTypeCase_ = 5; + valueType_ = s; + break; + } + case 50: + { + com.google.firestore.v1.MapValue.Builder subBuilder = null; + if (valueTypeCase_ == 6) { + subBuilder = ((com.google.firestore.v1.MapValue) valueType_).toBuilder(); + } + valueType_ = + input.readMessage(com.google.firestore.v1.MapValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.MapValue) valueType_); + valueType_ = subBuilder.buildPartial(); + } + valueTypeCase_ = 6; + break; + } + case 66: + { + com.google.type.LatLng.Builder subBuilder = null; + if (valueTypeCase_ == 8) { + subBuilder = ((com.google.type.LatLng) valueType_).toBuilder(); + } + valueType_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.type.LatLng) valueType_); + valueType_ = subBuilder.buildPartial(); + } + valueTypeCase_ = 8; + break; + } + case 74: + { + com.google.firestore.v1.ArrayValue.Builder subBuilder = null; + if (valueTypeCase_ == 9) { + subBuilder = ((com.google.firestore.v1.ArrayValue) valueType_).toBuilder(); + } + valueType_ = + input.readMessage(com.google.firestore.v1.ArrayValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.ArrayValue) valueType_); + valueType_ = subBuilder.buildPartial(); + } + valueTypeCase_ = 9; + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (valueTypeCase_ == 10) { + subBuilder = ((com.google.protobuf.Timestamp) valueType_).toBuilder(); + } + valueType_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) valueType_); + valueType_ = subBuilder.buildPartial(); + } + valueTypeCase_ = 10; + break; + } + case 88: + { + int rawValue = input.readEnum(); + valueTypeCase_ = 11; + valueType_ = rawValue; + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + valueTypeCase_ = 17; + valueType_ = s; + break; + } + case 146: + { + valueTypeCase_ = 18; + valueType_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.DocumentProto + .internal_static_google_firestore_v1_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Value.class, com.google.firestore.v1.Value.Builder.class); + } + + private int valueTypeCase_ = 0; + private java.lang.Object valueType_; + + public enum ValueTypeCase implements com.google.protobuf.Internal.EnumLite { + NULL_VALUE(11), + BOOLEAN_VALUE(1), + INTEGER_VALUE(2), + DOUBLE_VALUE(3), + TIMESTAMP_VALUE(10), + STRING_VALUE(17), + BYTES_VALUE(18), + REFERENCE_VALUE(5), + GEO_POINT_VALUE(8), + ARRAY_VALUE(9), + MAP_VALUE(6), + VALUETYPE_NOT_SET(0); + private final int value; + + private ValueTypeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ValueTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ValueTypeCase forNumber(int value) { + switch (value) { + case 11: + return NULL_VALUE; + case 1: + return BOOLEAN_VALUE; + case 2: + return INTEGER_VALUE; + case 3: + return DOUBLE_VALUE; + case 10: + return TIMESTAMP_VALUE; + case 17: + return STRING_VALUE; + case 18: + return BYTES_VALUE; + case 5: + return REFERENCE_VALUE; + case 8: + return GEO_POINT_VALUE; + case 9: + return ARRAY_VALUE; + case 6: + return MAP_VALUE; + case 0: + return VALUETYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueTypeCase getValueTypeCase() { + return ValueTypeCase.forNumber(valueTypeCase_); + } + + public static final int NULL_VALUE_FIELD_NUMBER = 11; + /** + * + * + *
+   * A null value.
+   * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public int getNullValueValue() { + if (valueTypeCase_ == 11) { + return (java.lang.Integer) valueType_; + } + return 0; + } + /** + * + * + *
+   * A null value.
+   * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public com.google.protobuf.NullValue getNullValue() { + if (valueTypeCase_ == 11) { + @SuppressWarnings("deprecation") + com.google.protobuf.NullValue result = + com.google.protobuf.NullValue.valueOf((java.lang.Integer) valueType_); + return result == null ? com.google.protobuf.NullValue.UNRECOGNIZED : result; + } + return com.google.protobuf.NullValue.NULL_VALUE; + } + + public static final int BOOLEAN_VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+   * A boolean value.
+   * 
+ * + * bool boolean_value = 1; + */ + public boolean getBooleanValue() { + if (valueTypeCase_ == 1) { + return (java.lang.Boolean) valueType_; + } + return false; + } + + public static final int INTEGER_VALUE_FIELD_NUMBER = 2; + /** + * + * + *
+   * An integer value.
+   * 
+ * + * int64 integer_value = 2; + */ + public long getIntegerValue() { + if (valueTypeCase_ == 2) { + return (java.lang.Long) valueType_; + } + return 0L; + } + + public static final int DOUBLE_VALUE_FIELD_NUMBER = 3; + /** + * + * + *
+   * A double value.
+   * 
+ * + * double double_value = 3; + */ + public double getDoubleValue() { + if (valueTypeCase_ == 3) { + return (java.lang.Double) valueType_; + } + return 0D; + } + + public static final int TIMESTAMP_VALUE_FIELD_NUMBER = 10; + /** + * + * + *
+   * A timestamp value.
+   * Precise only to microseconds. When stored, any additional precision is
+   * rounded down.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public boolean hasTimestampValue() { + return valueTypeCase_ == 10; + } + /** + * + * + *
+   * A timestamp value.
+   * Precise only to microseconds. When stored, any additional precision is
+   * rounded down.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public com.google.protobuf.Timestamp getTimestampValue() { + if (valueTypeCase_ == 10) { + return (com.google.protobuf.Timestamp) valueType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + /** + * + * + *
+   * A timestamp value.
+   * Precise only to microseconds. When stored, any additional precision is
+   * rounded down.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() { + if (valueTypeCase_ == 10) { + return (com.google.protobuf.Timestamp) valueType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int STRING_VALUE_FIELD_NUMBER = 17; + /** + * + * + *
+   * A string value.
+   * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+   * Only the first 1,500 bytes of the UTF-8 representation are considered by
+   * queries.
+   * 
+ * + * string string_value = 17; + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 17) { + ref = valueType_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueTypeCase_ == 17) { + valueType_ = s; + } + return s; + } + } + /** + * + * + *
+   * A string value.
+   * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+   * Only the first 1,500 bytes of the UTF-8 representation are considered by
+   * queries.
+   * 
+ * + * string string_value = 17; + */ + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 17) { + ref = valueType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueTypeCase_ == 17) { + valueType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BYTES_VALUE_FIELD_NUMBER = 18; + /** + * + * + *
+   * A bytes value.
+   * Must not exceed 1 MiB - 89 bytes.
+   * Only the first 1,500 bytes are considered by queries.
+   * 
+ * + * bytes bytes_value = 18; + */ + public com.google.protobuf.ByteString getBytesValue() { + if (valueTypeCase_ == 18) { + return (com.google.protobuf.ByteString) valueType_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int REFERENCE_VALUE_FIELD_NUMBER = 5; + /** + * + * + *
+   * A reference to a document. For example:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string reference_value = 5; + */ + public java.lang.String getReferenceValue() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueTypeCase_ == 5) { + valueType_ = s; + } + return s; + } + } + /** + * + * + *
+   * A reference to a document. For example:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string reference_value = 5; + */ + public com.google.protobuf.ByteString getReferenceValueBytes() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueTypeCase_ == 5) { + valueType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GEO_POINT_VALUE_FIELD_NUMBER = 8; + /** + * + * + *
+   * A geo point value representing a point on the surface of Earth.
+   * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public boolean hasGeoPointValue() { + return valueTypeCase_ == 8; + } + /** + * + * + *
+   * A geo point value representing a point on the surface of Earth.
+   * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public com.google.type.LatLng getGeoPointValue() { + if (valueTypeCase_ == 8) { + return (com.google.type.LatLng) valueType_; + } + return com.google.type.LatLng.getDefaultInstance(); + } + /** + * + * + *
+   * A geo point value representing a point on the surface of Earth.
+   * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder() { + if (valueTypeCase_ == 8) { + return (com.google.type.LatLng) valueType_; + } + return com.google.type.LatLng.getDefaultInstance(); + } + + public static final int ARRAY_VALUE_FIELD_NUMBER = 9; + /** + * + * + *
+   * An array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
+   * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public boolean hasArrayValue() { + return valueTypeCase_ == 9; + } + /** + * + * + *
+   * An array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
+   * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public com.google.firestore.v1.ArrayValue getArrayValue() { + if (valueTypeCase_ == 9) { + return (com.google.firestore.v1.ArrayValue) valueType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + /** + * + * + *
+   * An array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
+   * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public com.google.firestore.v1.ArrayValueOrBuilder getArrayValueOrBuilder() { + if (valueTypeCase_ == 9) { + return (com.google.firestore.v1.ArrayValue) valueType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + + public static final int MAP_VALUE_FIELD_NUMBER = 6; + /** + * + * + *
+   * A map value.
+   * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public boolean hasMapValue() { + return valueTypeCase_ == 6; + } + /** + * + * + *
+   * A map value.
+   * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public com.google.firestore.v1.MapValue getMapValue() { + if (valueTypeCase_ == 6) { + return (com.google.firestore.v1.MapValue) valueType_; + } + return com.google.firestore.v1.MapValue.getDefaultInstance(); + } + /** + * + * + *
+   * A map value.
+   * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public com.google.firestore.v1.MapValueOrBuilder getMapValueOrBuilder() { + if (valueTypeCase_ == 6) { + return (com.google.firestore.v1.MapValue) valueType_; + } + return com.google.firestore.v1.MapValue.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 (valueTypeCase_ == 1) { + output.writeBool(1, (boolean) ((java.lang.Boolean) valueType_)); + } + if (valueTypeCase_ == 2) { + output.writeInt64(2, (long) ((java.lang.Long) valueType_)); + } + if (valueTypeCase_ == 3) { + output.writeDouble(3, (double) ((java.lang.Double) valueType_)); + } + if (valueTypeCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, valueType_); + } + if (valueTypeCase_ == 6) { + output.writeMessage(6, (com.google.firestore.v1.MapValue) valueType_); + } + if (valueTypeCase_ == 8) { + output.writeMessage(8, (com.google.type.LatLng) valueType_); + } + if (valueTypeCase_ == 9) { + output.writeMessage(9, (com.google.firestore.v1.ArrayValue) valueType_); + } + if (valueTypeCase_ == 10) { + output.writeMessage(10, (com.google.protobuf.Timestamp) valueType_); + } + if (valueTypeCase_ == 11) { + output.writeEnum(11, ((java.lang.Integer) valueType_)); + } + if (valueTypeCase_ == 17) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, valueType_); + } + if (valueTypeCase_ == 18) { + output.writeBytes(18, (com.google.protobuf.ByteString) valueType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 1, (boolean) ((java.lang.Boolean) valueType_)); + } + if (valueTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 2, (long) ((java.lang.Long) valueType_)); + } + if (valueTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 3, (double) ((java.lang.Double) valueType_)); + } + if (valueTypeCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, valueType_); + } + if (valueTypeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.firestore.v1.MapValue) valueType_); + } + if (valueTypeCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.type.LatLng) valueType_); + } + if (valueTypeCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.firestore.v1.ArrayValue) valueType_); + } + if (valueTypeCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.protobuf.Timestamp) valueType_); + } + if (valueTypeCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 11, ((java.lang.Integer) valueType_)); + } + if (valueTypeCase_ == 17) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, valueType_); + } + if (valueTypeCase_ == 18) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 18, (com.google.protobuf.ByteString) valueType_); + } + 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.v1.Value)) { + return super.equals(obj); + } + com.google.firestore.v1.Value other = (com.google.firestore.v1.Value) obj; + + boolean result = true; + result = result && getValueTypeCase().equals(other.getValueTypeCase()); + if (!result) return false; + switch (valueTypeCase_) { + case 11: + result = result && getNullValueValue() == other.getNullValueValue(); + break; + case 1: + result = result && (getBooleanValue() == other.getBooleanValue()); + break; + case 2: + result = result && (getIntegerValue() == other.getIntegerValue()); + break; + case 3: + result = + result + && (java.lang.Double.doubleToLongBits(getDoubleValue()) + == java.lang.Double.doubleToLongBits(other.getDoubleValue())); + break; + case 10: + result = result && getTimestampValue().equals(other.getTimestampValue()); + break; + case 17: + result = result && getStringValue().equals(other.getStringValue()); + break; + case 18: + result = result && getBytesValue().equals(other.getBytesValue()); + break; + case 5: + result = result && getReferenceValue().equals(other.getReferenceValue()); + break; + case 8: + result = result && getGeoPointValue().equals(other.getGeoPointValue()); + break; + case 9: + result = result && getArrayValue().equals(other.getArrayValue()); + break; + case 6: + result = result && getMapValue().equals(other.getMapValue()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (valueTypeCase_) { + case 11: + hash = (37 * hash) + NULL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getNullValueValue(); + break; + case 1: + hash = (37 * hash) + BOOLEAN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBooleanValue()); + break; + case 2: + hash = (37 * hash) + INTEGER_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIntegerValue()); + break; + case 3: + hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getDoubleValue())); + break; + case 10: + hash = (37 * hash) + TIMESTAMP_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTimestampValue().hashCode(); + break; + case 17: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 18: + hash = (37 * hash) + BYTES_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getBytesValue().hashCode(); + break; + case 5: + hash = (37 * hash) + REFERENCE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getReferenceValue().hashCode(); + break; + case 8: + hash = (37 * hash) + GEO_POINT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getGeoPointValue().hashCode(); + break; + case 9: + hash = (37 * hash) + ARRAY_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getArrayValue().hashCode(); + break; + case 6: + hash = (37 * hash) + MAP_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMapValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Value parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Value 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.v1.Value parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Value 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.v1.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Value parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Value 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.v1.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Value 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.v1.Value parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Value 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.v1.Value 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 message that can hold any of the supported value types.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Value} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Value) + com.google.firestore.v1.ValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Value.class, com.google.firestore.v1.Value.Builder.class); + } + + // Construct using com.google.firestore.v1.Value.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(); + valueTypeCase_ = 0; + valueType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.DocumentProto + .internal_static_google_firestore_v1_Value_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Value getDefaultInstanceForType() { + return com.google.firestore.v1.Value.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Value build() { + com.google.firestore.v1.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Value buildPartial() { + com.google.firestore.v1.Value result = new com.google.firestore.v1.Value(this); + if (valueTypeCase_ == 11) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 1) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 2) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 3) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 10) { + if (timestampValueBuilder_ == null) { + result.valueType_ = valueType_; + } else { + result.valueType_ = timestampValueBuilder_.build(); + } + } + if (valueTypeCase_ == 17) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 18) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 5) { + result.valueType_ = valueType_; + } + if (valueTypeCase_ == 8) { + if (geoPointValueBuilder_ == null) { + result.valueType_ = valueType_; + } else { + result.valueType_ = geoPointValueBuilder_.build(); + } + } + if (valueTypeCase_ == 9) { + if (arrayValueBuilder_ == null) { + result.valueType_ = valueType_; + } else { + result.valueType_ = arrayValueBuilder_.build(); + } + } + if (valueTypeCase_ == 6) { + if (mapValueBuilder_ == null) { + result.valueType_ = valueType_; + } else { + result.valueType_ = mapValueBuilder_.build(); + } + } + result.valueTypeCase_ = valueTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Value) { + return mergeFrom((com.google.firestore.v1.Value) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Value other) { + if (other == com.google.firestore.v1.Value.getDefaultInstance()) return this; + switch (other.getValueTypeCase()) { + case NULL_VALUE: + { + setNullValueValue(other.getNullValueValue()); + break; + } + case BOOLEAN_VALUE: + { + setBooleanValue(other.getBooleanValue()); + break; + } + case INTEGER_VALUE: + { + setIntegerValue(other.getIntegerValue()); + break; + } + case DOUBLE_VALUE: + { + setDoubleValue(other.getDoubleValue()); + break; + } + case TIMESTAMP_VALUE: + { + mergeTimestampValue(other.getTimestampValue()); + break; + } + case STRING_VALUE: + { + valueTypeCase_ = 17; + valueType_ = other.valueType_; + onChanged(); + break; + } + case BYTES_VALUE: + { + setBytesValue(other.getBytesValue()); + break; + } + case REFERENCE_VALUE: + { + valueTypeCase_ = 5; + valueType_ = other.valueType_; + onChanged(); + break; + } + case GEO_POINT_VALUE: + { + mergeGeoPointValue(other.getGeoPointValue()); + break; + } + case ARRAY_VALUE: + { + mergeArrayValue(other.getArrayValue()); + break; + } + case MAP_VALUE: + { + mergeMapValue(other.getMapValue()); + break; + } + case VALUETYPE_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.v1.Value parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Value) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int valueTypeCase_ = 0; + private java.lang.Object valueType_; + + public ValueTypeCase getValueTypeCase() { + return ValueTypeCase.forNumber(valueTypeCase_); + } + + public Builder clearValueType() { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * A null value.
+     * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public int getNullValueValue() { + if (valueTypeCase_ == 11) { + return ((java.lang.Integer) valueType_).intValue(); + } + return 0; + } + /** + * + * + *
+     * A null value.
+     * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public Builder setNullValueValue(int value) { + valueTypeCase_ = 11; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A null value.
+     * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public com.google.protobuf.NullValue getNullValue() { + if (valueTypeCase_ == 11) { + @SuppressWarnings("deprecation") + com.google.protobuf.NullValue result = + com.google.protobuf.NullValue.valueOf((java.lang.Integer) valueType_); + return result == null ? com.google.protobuf.NullValue.UNRECOGNIZED : result; + } + return com.google.protobuf.NullValue.NULL_VALUE; + } + /** + * + * + *
+     * A null value.
+     * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public Builder setNullValue(com.google.protobuf.NullValue value) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeCase_ = 11; + valueType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * A null value.
+     * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + public Builder clearNullValue() { + if (valueTypeCase_ == 11) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool boolean_value = 1; + */ + public boolean getBooleanValue() { + if (valueTypeCase_ == 1) { + return (java.lang.Boolean) valueType_; + } + return false; + } + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool boolean_value = 1; + */ + public Builder setBooleanValue(boolean value) { + valueTypeCase_ = 1; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A boolean value.
+     * 
+ * + * bool boolean_value = 1; + */ + public Builder clearBooleanValue() { + if (valueTypeCase_ == 1) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * An integer value.
+     * 
+ * + * int64 integer_value = 2; + */ + public long getIntegerValue() { + if (valueTypeCase_ == 2) { + return (java.lang.Long) valueType_; + } + return 0L; + } + /** + * + * + *
+     * An integer value.
+     * 
+ * + * int64 integer_value = 2; + */ + public Builder setIntegerValue(long value) { + valueTypeCase_ = 2; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An integer value.
+     * 
+ * + * int64 integer_value = 2; + */ + public Builder clearIntegerValue() { + if (valueTypeCase_ == 2) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A double value.
+     * 
+ * + * double double_value = 3; + */ + public double getDoubleValue() { + if (valueTypeCase_ == 3) { + return (java.lang.Double) valueType_; + } + return 0D; + } + /** + * + * + *
+     * A double value.
+     * 
+ * + * double double_value = 3; + */ + public Builder setDoubleValue(double value) { + valueTypeCase_ = 3; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A double value.
+     * 
+ * + * double double_value = 3; + */ + public Builder clearDoubleValue() { + if (valueTypeCase_ == 3) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timestampValueBuilder_; + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public boolean hasTimestampValue() { + return valueTypeCase_ == 10; + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public com.google.protobuf.Timestamp getTimestampValue() { + if (timestampValueBuilder_ == null) { + if (valueTypeCase_ == 10) { + return (com.google.protobuf.Timestamp) valueType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (valueTypeCase_ == 10) { + return timestampValueBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public Builder setTimestampValue(com.google.protobuf.Timestamp value) { + if (timestampValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + onChanged(); + } else { + timestampValueBuilder_.setMessage(value); + } + valueTypeCase_ = 10; + return this; + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public Builder setTimestampValue(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampValueBuilder_ == null) { + valueType_ = builderForValue.build(); + onChanged(); + } else { + timestampValueBuilder_.setMessage(builderForValue.build()); + } + valueTypeCase_ = 10; + return this; + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public Builder mergeTimestampValue(com.google.protobuf.Timestamp value) { + if (timestampValueBuilder_ == null) { + if (valueTypeCase_ == 10 + && valueType_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + valueType_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) valueType_) + .mergeFrom(value) + .buildPartial(); + } else { + valueType_ = value; + } + onChanged(); + } else { + if (valueTypeCase_ == 10) { + timestampValueBuilder_.mergeFrom(value); + } + timestampValueBuilder_.setMessage(value); + } + valueTypeCase_ = 10; + return this; + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public Builder clearTimestampValue() { + if (timestampValueBuilder_ == null) { + if (valueTypeCase_ == 10) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + } else { + if (valueTypeCase_ == 10) { + valueTypeCase_ = 0; + valueType_ = null; + } + timestampValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public com.google.protobuf.Timestamp.Builder getTimestampValueBuilder() { + return getTimestampValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() { + if ((valueTypeCase_ == 10) && (timestampValueBuilder_ != null)) { + return timestampValueBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeCase_ == 10) { + return (com.google.protobuf.Timestamp) valueType_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + /** + * + * + *
+     * A timestamp value.
+     * Precise only to microseconds. When stored, any additional precision is
+     * rounded down.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getTimestampValueFieldBuilder() { + if (timestampValueBuilder_ == null) { + if (!(valueTypeCase_ == 10)) { + valueType_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + timestampValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) valueType_, getParentForChildren(), isClean()); + valueType_ = null; + } + valueTypeCase_ = 10; + onChanged(); + ; + return timestampValueBuilder_; + } + + /** + * + * + *
+     * A string value.
+     * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes of the UTF-8 representation are considered by
+     * queries.
+     * 
+ * + * string string_value = 17; + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 17) { + ref = valueType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueTypeCase_ == 17) { + valueType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A string value.
+     * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes of the UTF-8 representation are considered by
+     * queries.
+     * 
+ * + * string string_value = 17; + */ + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 17) { + ref = valueType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueTypeCase_ == 17) { + valueType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A string value.
+     * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes of the UTF-8 representation are considered by
+     * queries.
+     * 
+ * + * string string_value = 17; + */ + public Builder setStringValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeCase_ = 17; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A string value.
+     * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes of the UTF-8 representation are considered by
+     * queries.
+     * 
+ * + * string string_value = 17; + */ + public Builder clearStringValue() { + if (valueTypeCase_ == 17) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A string value.
+     * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes of the UTF-8 representation are considered by
+     * queries.
+     * 
+ * + * string string_value = 17; + */ + public Builder setStringValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueTypeCase_ = 17; + valueType_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * A bytes value.
+     * Must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes are considered by queries.
+     * 
+ * + * bytes bytes_value = 18; + */ + public com.google.protobuf.ByteString getBytesValue() { + if (valueTypeCase_ == 18) { + return (com.google.protobuf.ByteString) valueType_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * A bytes value.
+     * Must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes are considered by queries.
+     * 
+ * + * bytes bytes_value = 18; + */ + public Builder setBytesValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeCase_ = 18; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A bytes value.
+     * Must not exceed 1 MiB - 89 bytes.
+     * Only the first 1,500 bytes are considered by queries.
+     * 
+ * + * bytes bytes_value = 18; + */ + public Builder clearBytesValue() { + if (valueTypeCase_ == 18) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A reference to a document. For example:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string reference_value = 5; + */ + public java.lang.String getReferenceValue() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueTypeCase_ == 5) { + valueType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A reference to a document. For example:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string reference_value = 5; + */ + public com.google.protobuf.ByteString getReferenceValueBytes() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueTypeCase_ == 5) { + valueType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A reference to a document. For example:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string reference_value = 5; + */ + public Builder setReferenceValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeCase_ = 5; + valueType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A reference to a document. For example:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string reference_value = 5; + */ + public Builder clearReferenceValue() { + if (valueTypeCase_ == 5) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A reference to a document. For example:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string reference_value = 5; + */ + public Builder setReferenceValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueTypeCase_ = 5; + valueType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + geoPointValueBuilder_; + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public boolean hasGeoPointValue() { + return valueTypeCase_ == 8; + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public com.google.type.LatLng getGeoPointValue() { + if (geoPointValueBuilder_ == null) { + if (valueTypeCase_ == 8) { + return (com.google.type.LatLng) valueType_; + } + return com.google.type.LatLng.getDefaultInstance(); + } else { + if (valueTypeCase_ == 8) { + return geoPointValueBuilder_.getMessage(); + } + return com.google.type.LatLng.getDefaultInstance(); + } + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public Builder setGeoPointValue(com.google.type.LatLng value) { + if (geoPointValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + onChanged(); + } else { + geoPointValueBuilder_.setMessage(value); + } + valueTypeCase_ = 8; + return this; + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public Builder setGeoPointValue(com.google.type.LatLng.Builder builderForValue) { + if (geoPointValueBuilder_ == null) { + valueType_ = builderForValue.build(); + onChanged(); + } else { + geoPointValueBuilder_.setMessage(builderForValue.build()); + } + valueTypeCase_ = 8; + return this; + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public Builder mergeGeoPointValue(com.google.type.LatLng value) { + if (geoPointValueBuilder_ == null) { + if (valueTypeCase_ == 8 && valueType_ != com.google.type.LatLng.getDefaultInstance()) { + valueType_ = + com.google.type.LatLng.newBuilder((com.google.type.LatLng) valueType_) + .mergeFrom(value) + .buildPartial(); + } else { + valueType_ = value; + } + onChanged(); + } else { + if (valueTypeCase_ == 8) { + geoPointValueBuilder_.mergeFrom(value); + } + geoPointValueBuilder_.setMessage(value); + } + valueTypeCase_ = 8; + return this; + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public Builder clearGeoPointValue() { + if (geoPointValueBuilder_ == null) { + if (valueTypeCase_ == 8) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + } else { + if (valueTypeCase_ == 8) { + valueTypeCase_ = 0; + valueType_ = null; + } + geoPointValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public com.google.type.LatLng.Builder getGeoPointValueBuilder() { + return getGeoPointValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + public com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder() { + if ((valueTypeCase_ == 8) && (geoPointValueBuilder_ != null)) { + return geoPointValueBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeCase_ == 8) { + return (com.google.type.LatLng) valueType_; + } + return com.google.type.LatLng.getDefaultInstance(); + } + } + /** + * + * + *
+     * A geo point value representing a point on the surface of Earth.
+     * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> + getGeoPointValueFieldBuilder() { + if (geoPointValueBuilder_ == null) { + if (!(valueTypeCase_ == 8)) { + valueType_ = com.google.type.LatLng.getDefaultInstance(); + } + geoPointValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.LatLng, + com.google.type.LatLng.Builder, + com.google.type.LatLngOrBuilder>( + (com.google.type.LatLng) valueType_, getParentForChildren(), isClean()); + valueType_ = null; + } + valueTypeCase_ = 8; + onChanged(); + ; + return geoPointValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder> + arrayValueBuilder_; + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public boolean hasArrayValue() { + return valueTypeCase_ == 9; + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public com.google.firestore.v1.ArrayValue getArrayValue() { + if (arrayValueBuilder_ == null) { + if (valueTypeCase_ == 9) { + return (com.google.firestore.v1.ArrayValue) valueType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } else { + if (valueTypeCase_ == 9) { + return arrayValueBuilder_.getMessage(); + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public Builder setArrayValue(com.google.firestore.v1.ArrayValue value) { + if (arrayValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + onChanged(); + } else { + arrayValueBuilder_.setMessage(value); + } + valueTypeCase_ = 9; + return this; + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public Builder setArrayValue(com.google.firestore.v1.ArrayValue.Builder builderForValue) { + if (arrayValueBuilder_ == null) { + valueType_ = builderForValue.build(); + onChanged(); + } else { + arrayValueBuilder_.setMessage(builderForValue.build()); + } + valueTypeCase_ = 9; + return this; + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public Builder mergeArrayValue(com.google.firestore.v1.ArrayValue value) { + if (arrayValueBuilder_ == null) { + if (valueTypeCase_ == 9 + && valueType_ != com.google.firestore.v1.ArrayValue.getDefaultInstance()) { + valueType_ = + com.google.firestore.v1.ArrayValue.newBuilder( + (com.google.firestore.v1.ArrayValue) valueType_) + .mergeFrom(value) + .buildPartial(); + } else { + valueType_ = value; + } + onChanged(); + } else { + if (valueTypeCase_ == 9) { + arrayValueBuilder_.mergeFrom(value); + } + arrayValueBuilder_.setMessage(value); + } + valueTypeCase_ = 9; + return this; + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public Builder clearArrayValue() { + if (arrayValueBuilder_ == null) { + if (valueTypeCase_ == 9) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + } else { + if (valueTypeCase_ == 9) { + valueTypeCase_ = 0; + valueType_ = null; + } + arrayValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public com.google.firestore.v1.ArrayValue.Builder getArrayValueBuilder() { + return getArrayValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + public com.google.firestore.v1.ArrayValueOrBuilder getArrayValueOrBuilder() { + if ((valueTypeCase_ == 9) && (arrayValueBuilder_ != null)) { + return arrayValueBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeCase_ == 9) { + return (com.google.firestore.v1.ArrayValue) valueType_; + } + return com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * An array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
+     * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder> + getArrayValueFieldBuilder() { + if (arrayValueBuilder_ == null) { + if (!(valueTypeCase_ == 9)) { + valueType_ = com.google.firestore.v1.ArrayValue.getDefaultInstance(); + } + arrayValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ArrayValue, + com.google.firestore.v1.ArrayValue.Builder, + com.google.firestore.v1.ArrayValueOrBuilder>( + (com.google.firestore.v1.ArrayValue) valueType_, getParentForChildren(), isClean()); + valueType_ = null; + } + valueTypeCase_ = 9; + onChanged(); + ; + return arrayValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.MapValue, + com.google.firestore.v1.MapValue.Builder, + com.google.firestore.v1.MapValueOrBuilder> + mapValueBuilder_; + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public boolean hasMapValue() { + return valueTypeCase_ == 6; + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public com.google.firestore.v1.MapValue getMapValue() { + if (mapValueBuilder_ == null) { + if (valueTypeCase_ == 6) { + return (com.google.firestore.v1.MapValue) valueType_; + } + return com.google.firestore.v1.MapValue.getDefaultInstance(); + } else { + if (valueTypeCase_ == 6) { + return mapValueBuilder_.getMessage(); + } + return com.google.firestore.v1.MapValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public Builder setMapValue(com.google.firestore.v1.MapValue value) { + if (mapValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + onChanged(); + } else { + mapValueBuilder_.setMessage(value); + } + valueTypeCase_ = 6; + return this; + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public Builder setMapValue(com.google.firestore.v1.MapValue.Builder builderForValue) { + if (mapValueBuilder_ == null) { + valueType_ = builderForValue.build(); + onChanged(); + } else { + mapValueBuilder_.setMessage(builderForValue.build()); + } + valueTypeCase_ = 6; + return this; + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public Builder mergeMapValue(com.google.firestore.v1.MapValue value) { + if (mapValueBuilder_ == null) { + if (valueTypeCase_ == 6 + && valueType_ != com.google.firestore.v1.MapValue.getDefaultInstance()) { + valueType_ = + com.google.firestore.v1.MapValue.newBuilder( + (com.google.firestore.v1.MapValue) valueType_) + .mergeFrom(value) + .buildPartial(); + } else { + valueType_ = value; + } + onChanged(); + } else { + if (valueTypeCase_ == 6) { + mapValueBuilder_.mergeFrom(value); + } + mapValueBuilder_.setMessage(value); + } + valueTypeCase_ = 6; + return this; + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public Builder clearMapValue() { + if (mapValueBuilder_ == null) { + if (valueTypeCase_ == 6) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + } else { + if (valueTypeCase_ == 6) { + valueTypeCase_ = 0; + valueType_ = null; + } + mapValueBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public com.google.firestore.v1.MapValue.Builder getMapValueBuilder() { + return getMapValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + public com.google.firestore.v1.MapValueOrBuilder getMapValueOrBuilder() { + if ((valueTypeCase_ == 6) && (mapValueBuilder_ != null)) { + return mapValueBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeCase_ == 6) { + return (com.google.firestore.v1.MapValue) valueType_; + } + return com.google.firestore.v1.MapValue.getDefaultInstance(); + } + } + /** + * + * + *
+     * A map value.
+     * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.MapValue, + com.google.firestore.v1.MapValue.Builder, + com.google.firestore.v1.MapValueOrBuilder> + getMapValueFieldBuilder() { + if (mapValueBuilder_ == null) { + if (!(valueTypeCase_ == 6)) { + valueType_ = com.google.firestore.v1.MapValue.getDefaultInstance(); + } + mapValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.MapValue, + com.google.firestore.v1.MapValue.Builder, + com.google.firestore.v1.MapValueOrBuilder>( + (com.google.firestore.v1.MapValue) valueType_, getParentForChildren(), isClean()); + valueType_ = null; + } + valueTypeCase_ = 6; + onChanged(); + ; + return mapValueBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Value) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Value) + private static final com.google.firestore.v1.Value DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Value(); + } + + public static com.google.firestore.v1.Value getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Value(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.v1.Value getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ValueOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ValueOrBuilder.java new file mode 100644 index 000000000000..73ec20e7557b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ValueOrBuilder.java @@ -0,0 +1,265 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/document.proto + +package com.google.firestore.v1; + +public interface ValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Value) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A null value.
+   * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + int getNullValueValue(); + /** + * + * + *
+   * A null value.
+   * 
+ * + * .google.protobuf.NullValue null_value = 11; + */ + com.google.protobuf.NullValue getNullValue(); + + /** + * + * + *
+   * A boolean value.
+   * 
+ * + * bool boolean_value = 1; + */ + boolean getBooleanValue(); + + /** + * + * + *
+   * An integer value.
+   * 
+ * + * int64 integer_value = 2; + */ + long getIntegerValue(); + + /** + * + * + *
+   * A double value.
+   * 
+ * + * double double_value = 3; + */ + double getDoubleValue(); + + /** + * + * + *
+   * A timestamp value.
+   * Precise only to microseconds. When stored, any additional precision is
+   * rounded down.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + boolean hasTimestampValue(); + /** + * + * + *
+   * A timestamp value.
+   * Precise only to microseconds. When stored, any additional precision is
+   * rounded down.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + com.google.protobuf.Timestamp getTimestampValue(); + /** + * + * + *
+   * A timestamp value.
+   * Precise only to microseconds. When stored, any additional precision is
+   * rounded down.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 10; + */ + com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder(); + + /** + * + * + *
+   * A string value.
+   * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+   * Only the first 1,500 bytes of the UTF-8 representation are considered by
+   * queries.
+   * 
+ * + * string string_value = 17; + */ + java.lang.String getStringValue(); + /** + * + * + *
+   * A string value.
+   * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
+   * Only the first 1,500 bytes of the UTF-8 representation are considered by
+   * queries.
+   * 
+ * + * string string_value = 17; + */ + com.google.protobuf.ByteString getStringValueBytes(); + + /** + * + * + *
+   * A bytes value.
+   * Must not exceed 1 MiB - 89 bytes.
+   * Only the first 1,500 bytes are considered by queries.
+   * 
+ * + * bytes bytes_value = 18; + */ + com.google.protobuf.ByteString getBytesValue(); + + /** + * + * + *
+   * A reference to a document. For example:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string reference_value = 5; + */ + java.lang.String getReferenceValue(); + /** + * + * + *
+   * A reference to a document. For example:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string reference_value = 5; + */ + com.google.protobuf.ByteString getReferenceValueBytes(); + + /** + * + * + *
+   * A geo point value representing a point on the surface of Earth.
+   * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + boolean hasGeoPointValue(); + /** + * + * + *
+   * A geo point value representing a point on the surface of Earth.
+   * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + com.google.type.LatLng getGeoPointValue(); + /** + * + * + *
+   * A geo point value representing a point on the surface of Earth.
+   * 
+ * + * .google.type.LatLng geo_point_value = 8; + */ + com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder(); + + /** + * + * + *
+   * An array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
+   * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + boolean hasArrayValue(); + /** + * + * + *
+   * An array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
+   * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + com.google.firestore.v1.ArrayValue getArrayValue(); + /** + * + * + *
+   * An array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
+   * 
+ * + * .google.firestore.v1.ArrayValue array_value = 9; + */ + com.google.firestore.v1.ArrayValueOrBuilder getArrayValueOrBuilder(); + + /** + * + * + *
+   * A map value.
+   * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + boolean hasMapValue(); + /** + * + * + *
+   * A map value.
+   * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + com.google.firestore.v1.MapValue getMapValue(); + /** + * + * + *
+   * A map value.
+   * 
+ * + * .google.firestore.v1.MapValue map_value = 6; + */ + com.google.firestore.v1.MapValueOrBuilder getMapValueOrBuilder(); + + public com.google.firestore.v1.Value.ValueTypeCase getValueTypeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Write.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Write.java new file mode 100644 index 000000000000..80ab262603b2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/Write.java @@ -0,0 +1,1949 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * A write on a document.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.Write} + */ +public final class Write extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.Write) + WriteOrBuilder { + private static final long serialVersionUID = 0L; + // Use Write.newBuilder() to construct. + private Write(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Write() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Write( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.firestore.v1.Document.Builder subBuilder = null; + if (operationCase_ == 1) { + subBuilder = ((com.google.firestore.v1.Document) operation_).toBuilder(); + } + operation_ = + input.readMessage(com.google.firestore.v1.Document.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.Document) operation_); + operation_ = subBuilder.buildPartial(); + } + operationCase_ = 1; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + operationCase_ = 2; + operation_ = s; + break; + } + case 26: + { + com.google.firestore.v1.DocumentMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage( + com.google.firestore.v1.DocumentMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.firestore.v1.Precondition.Builder subBuilder = null; + if (currentDocument_ != null) { + subBuilder = currentDocument_.toBuilder(); + } + currentDocument_ = + input.readMessage( + com.google.firestore.v1.Precondition.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(currentDocument_); + currentDocument_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.firestore.v1.DocumentTransform.Builder subBuilder = null; + if (operationCase_ == 6) { + subBuilder = ((com.google.firestore.v1.DocumentTransform) operation_).toBuilder(); + } + operation_ = + input.readMessage( + com.google.firestore.v1.DocumentTransform.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1.DocumentTransform) operation_); + operation_ = subBuilder.buildPartial(); + } + operationCase_ = 6; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.v1.WriteProto.internal_static_google_firestore_v1_Write_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_Write_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Write.class, com.google.firestore.v1.Write.Builder.class); + } + + private int operationCase_ = 0; + private java.lang.Object operation_; + + public enum OperationCase implements com.google.protobuf.Internal.EnumLite { + UPDATE(1), + DELETE(2), + TRANSFORM(6), + OPERATION_NOT_SET(0); + private final int value; + + private OperationCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static OperationCase valueOf(int value) { + return forNumber(value); + } + + public static OperationCase forNumber(int value) { + switch (value) { + case 1: + return UPDATE; + case 2: + return DELETE; + case 6: + return TRANSFORM; + case 0: + return OPERATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OperationCase getOperationCase() { + return OperationCase.forNumber(operationCase_); + } + + public static final int UPDATE_FIELD_NUMBER = 1; + /** + * + * + *
+   * A document to write.
+   * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public boolean hasUpdate() { + return operationCase_ == 1; + } + /** + * + * + *
+   * A document to write.
+   * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public com.google.firestore.v1.Document getUpdate() { + if (operationCase_ == 1) { + return (com.google.firestore.v1.Document) operation_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + /** + * + * + *
+   * A document to write.
+   * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getUpdateOrBuilder() { + if (operationCase_ == 1) { + return (com.google.firestore.v1.Document) operation_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + + public static final int DELETE_FIELD_NUMBER = 2; + /** + * + * + *
+   * A document name to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string delete = 2; + */ + public java.lang.String getDelete() { + java.lang.Object ref = ""; + if (operationCase_ == 2) { + ref = operation_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (operationCase_ == 2) { + operation_ = s; + } + return s; + } + } + /** + * + * + *
+   * A document name to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string delete = 2; + */ + public com.google.protobuf.ByteString getDeleteBytes() { + java.lang.Object ref = ""; + if (operationCase_ == 2) { + ref = operation_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (operationCase_ == 2) { + operation_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSFORM_FIELD_NUMBER = 6; + /** + * + * + *
+   * Applies a tranformation to a document.
+   * At most one `transform` per document is allowed in a given request.
+   * An `update` cannot follow a `transform` on the same document in a given
+   * request.
+   * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public boolean hasTransform() { + return operationCase_ == 6; + } + /** + * + * + *
+   * Applies a tranformation to a document.
+   * At most one `transform` per document is allowed in a given request.
+   * An `update` cannot follow a `transform` on the same document in a given
+   * request.
+   * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public com.google.firestore.v1.DocumentTransform getTransform() { + if (operationCase_ == 6) { + return (com.google.firestore.v1.DocumentTransform) operation_; + } + return com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } + /** + * + * + *
+   * Applies a tranformation to a document.
+   * At most one `transform` per document is allowed in a given request.
+   * An `update` cannot follow a `transform` on the same document in a given
+   * request.
+   * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public com.google.firestore.v1.DocumentTransformOrBuilder getTransformOrBuilder() { + if (operationCase_ == 6) { + return (com.google.firestore.v1.DocumentTransform) operation_; + } + return com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.firestore.v1.DocumentMask updateMask_; + /** + * + * + *
+   * The fields to update in this write.
+   * This field can be set only when the operation is `update`.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * The field paths in this mask must not contain a reserved field name.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The fields to update in this write.
+   * This field can be set only when the operation is `update`.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * The field paths in this mask must not contain a reserved field name.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public com.google.firestore.v1.DocumentMask getUpdateMask() { + return updateMask_ == null + ? com.google.firestore.v1.DocumentMask.getDefaultInstance() + : updateMask_; + } + /** + * + * + *
+   * The fields to update in this write.
+   * This field can be set only when the operation is `update`.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * The field paths in this mask must not contain a reserved field name.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int CURRENT_DOCUMENT_FIELD_NUMBER = 4; + private com.google.firestore.v1.Precondition currentDocument_; + /** + * + * + *
+   * An optional precondition on the document.
+   * The write will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public boolean hasCurrentDocument() { + return currentDocument_ != null; + } + /** + * + * + *
+   * An optional precondition on the document.
+   * The write will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.Precondition getCurrentDocument() { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } + /** + * + * + *
+   * An optional precondition on the document.
+   * The write will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { + return getCurrentDocument(); + } + + 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 (operationCase_ == 1) { + output.writeMessage(1, (com.google.firestore.v1.Document) operation_); + } + if (operationCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, operation_); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + if (currentDocument_ != null) { + output.writeMessage(4, getCurrentDocument()); + } + if (operationCase_ == 6) { + output.writeMessage(6, (com.google.firestore.v1.DocumentTransform) operation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (operationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.firestore.v1.Document) operation_); + } + if (operationCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, operation_); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + if (currentDocument_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCurrentDocument()); + } + if (operationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.firestore.v1.DocumentTransform) operation_); + } + 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.v1.Write)) { + return super.equals(obj); + } + com.google.firestore.v1.Write other = (com.google.firestore.v1.Write) obj; + + boolean result = true; + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && (hasCurrentDocument() == other.hasCurrentDocument()); + if (hasCurrentDocument()) { + result = result && getCurrentDocument().equals(other.getCurrentDocument()); + } + result = result && getOperationCase().equals(other.getOperationCase()); + if (!result) return false; + switch (operationCase_) { + case 1: + result = result && getUpdate().equals(other.getUpdate()); + break; + case 2: + result = result && getDelete().equals(other.getDelete()); + break; + case 6: + result = result && getTransform().equals(other.getTransform()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasCurrentDocument()) { + hash = (37 * hash) + CURRENT_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getCurrentDocument().hashCode(); + } + switch (operationCase_) { + case 1: + hash = (37 * hash) + UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getUpdate().hashCode(); + break; + case 2: + hash = (37 * hash) + DELETE_FIELD_NUMBER; + hash = (53 * hash) + getDelete().hashCode(); + break; + case 6: + hash = (37 * hash) + TRANSFORM_FIELD_NUMBER; + hash = (53 * hash) + getTransform().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.Write parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Write 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.v1.Write parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Write 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.v1.Write parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.Write parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.Write parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Write 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.v1.Write parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Write 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.v1.Write parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.Write 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.v1.Write 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 write on a document.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.Write} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.Write) + com.google.firestore.v1.WriteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_Write_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_Write_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.Write.class, com.google.firestore.v1.Write.Builder.class); + } + + // Construct using com.google.firestore.v1.Write.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (currentDocumentBuilder_ == null) { + currentDocument_ = null; + } else { + currentDocument_ = null; + currentDocumentBuilder_ = null; + } + operationCase_ = 0; + operation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_Write_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.Write getDefaultInstanceForType() { + return com.google.firestore.v1.Write.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.Write build() { + com.google.firestore.v1.Write result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.Write buildPartial() { + com.google.firestore.v1.Write result = new com.google.firestore.v1.Write(this); + if (operationCase_ == 1) { + if (updateBuilder_ == null) { + result.operation_ = operation_; + } else { + result.operation_ = updateBuilder_.build(); + } + } + if (operationCase_ == 2) { + result.operation_ = operation_; + } + if (operationCase_ == 6) { + if (transformBuilder_ == null) { + result.operation_ = operation_; + } else { + result.operation_ = transformBuilder_.build(); + } + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (currentDocumentBuilder_ == null) { + result.currentDocument_ = currentDocument_; + } else { + result.currentDocument_ = currentDocumentBuilder_.build(); + } + result.operationCase_ = operationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.Write) { + return mergeFrom((com.google.firestore.v1.Write) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.Write other) { + if (other == com.google.firestore.v1.Write.getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasCurrentDocument()) { + mergeCurrentDocument(other.getCurrentDocument()); + } + switch (other.getOperationCase()) { + case UPDATE: + { + mergeUpdate(other.getUpdate()); + break; + } + case DELETE: + { + operationCase_ = 2; + operation_ = other.operation_; + onChanged(); + break; + } + case TRANSFORM: + { + mergeTransform(other.getTransform()); + break; + } + case OPERATION_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.v1.Write parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.Write) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int operationCase_ = 0; + private java.lang.Object operation_; + + public OperationCase getOperationCase() { + return OperationCase.forNumber(operationCase_); + } + + public Builder clearOperation() { + operationCase_ = 0; + operation_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + updateBuilder_; + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public boolean hasUpdate() { + return operationCase_ == 1; + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public com.google.firestore.v1.Document getUpdate() { + if (updateBuilder_ == null) { + if (operationCase_ == 1) { + return (com.google.firestore.v1.Document) operation_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } else { + if (operationCase_ == 1) { + return updateBuilder_.getMessage(); + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public Builder setUpdate(com.google.firestore.v1.Document value) { + if (updateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + updateBuilder_.setMessage(value); + } + operationCase_ = 1; + return this; + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public Builder setUpdate(com.google.firestore.v1.Document.Builder builderForValue) { + if (updateBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + updateBuilder_.setMessage(builderForValue.build()); + } + operationCase_ = 1; + return this; + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public Builder mergeUpdate(com.google.firestore.v1.Document value) { + if (updateBuilder_ == null) { + if (operationCase_ == 1 + && operation_ != com.google.firestore.v1.Document.getDefaultInstance()) { + operation_ = + com.google.firestore.v1.Document.newBuilder( + (com.google.firestore.v1.Document) operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + if (operationCase_ == 1) { + updateBuilder_.mergeFrom(value); + } + updateBuilder_.setMessage(value); + } + operationCase_ = 1; + return this; + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public Builder clearUpdate() { + if (updateBuilder_ == null) { + if (operationCase_ == 1) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + } else { + if (operationCase_ == 1) { + operationCase_ = 0; + operation_ = null; + } + updateBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public com.google.firestore.v1.Document.Builder getUpdateBuilder() { + return getUpdateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + public com.google.firestore.v1.DocumentOrBuilder getUpdateOrBuilder() { + if ((operationCase_ == 1) && (updateBuilder_ != null)) { + return updateBuilder_.getMessageOrBuilder(); + } else { + if (operationCase_ == 1) { + return (com.google.firestore.v1.Document) operation_; + } + return com.google.firestore.v1.Document.getDefaultInstance(); + } + } + /** + * + * + *
+     * A document to write.
+     * 
+ * + * .google.firestore.v1.Document update = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Document, + com.google.firestore.v1.Document.Builder, + com.google.firestore.v1.DocumentOrBuilder> + getUpdateFieldBuilder() { + if (updateBuilder_ == null) { + if (!(operationCase_ == 1)) { + operation_ = com.google.firestore.v1.Document.getDefaultInstance(); + } + updateBuilder_ = + 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) operation_, getParentForChildren(), isClean()); + operation_ = null; + } + operationCase_ = 1; + onChanged(); + ; + return updateBuilder_; + } + + /** + * + * + *
+     * A document name to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string delete = 2; + */ + public java.lang.String getDelete() { + java.lang.Object ref = ""; + if (operationCase_ == 2) { + ref = operation_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (operationCase_ == 2) { + operation_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A document name to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string delete = 2; + */ + public com.google.protobuf.ByteString getDeleteBytes() { + java.lang.Object ref = ""; + if (operationCase_ == 2) { + ref = operation_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (operationCase_ == 2) { + operation_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A document name to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string delete = 2; + */ + public Builder setDelete(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operationCase_ = 2; + operation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A document name to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string delete = 2; + */ + public Builder clearDelete() { + if (operationCase_ == 2) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A document name to delete. In the format:
+     * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+     * 
+ * + * string delete = 2; + */ + public Builder setDeleteBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operationCase_ = 2; + operation_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentTransform, + com.google.firestore.v1.DocumentTransform.Builder, + com.google.firestore.v1.DocumentTransformOrBuilder> + transformBuilder_; + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public boolean hasTransform() { + return operationCase_ == 6; + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public com.google.firestore.v1.DocumentTransform getTransform() { + if (transformBuilder_ == null) { + if (operationCase_ == 6) { + return (com.google.firestore.v1.DocumentTransform) operation_; + } + return com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } else { + if (operationCase_ == 6) { + return transformBuilder_.getMessage(); + } + return com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public Builder setTransform(com.google.firestore.v1.DocumentTransform value) { + if (transformBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + transformBuilder_.setMessage(value); + } + operationCase_ = 6; + return this; + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public Builder setTransform(com.google.firestore.v1.DocumentTransform.Builder builderForValue) { + if (transformBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + transformBuilder_.setMessage(builderForValue.build()); + } + operationCase_ = 6; + return this; + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public Builder mergeTransform(com.google.firestore.v1.DocumentTransform value) { + if (transformBuilder_ == null) { + if (operationCase_ == 6 + && operation_ != com.google.firestore.v1.DocumentTransform.getDefaultInstance()) { + operation_ = + com.google.firestore.v1.DocumentTransform.newBuilder( + (com.google.firestore.v1.DocumentTransform) operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + if (operationCase_ == 6) { + transformBuilder_.mergeFrom(value); + } + transformBuilder_.setMessage(value); + } + operationCase_ = 6; + return this; + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public Builder clearTransform() { + if (transformBuilder_ == null) { + if (operationCase_ == 6) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + } else { + if (operationCase_ == 6) { + operationCase_ = 0; + operation_ = null; + } + transformBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public com.google.firestore.v1.DocumentTransform.Builder getTransformBuilder() { + return getTransformFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + public com.google.firestore.v1.DocumentTransformOrBuilder getTransformOrBuilder() { + if ((operationCase_ == 6) && (transformBuilder_ != null)) { + return transformBuilder_.getMessageOrBuilder(); + } else { + if (operationCase_ == 6) { + return (com.google.firestore.v1.DocumentTransform) operation_; + } + return com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } + } + /** + * + * + *
+     * Applies a tranformation to a document.
+     * At most one `transform` per document is allowed in a given request.
+     * An `update` cannot follow a `transform` on the same document in a given
+     * request.
+     * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentTransform, + com.google.firestore.v1.DocumentTransform.Builder, + com.google.firestore.v1.DocumentTransformOrBuilder> + getTransformFieldBuilder() { + if (transformBuilder_ == null) { + if (!(operationCase_ == 6)) { + operation_ = com.google.firestore.v1.DocumentTransform.getDefaultInstance(); + } + transformBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentTransform, + com.google.firestore.v1.DocumentTransform.Builder, + com.google.firestore.v1.DocumentTransformOrBuilder>( + (com.google.firestore.v1.DocumentTransform) operation_, + getParentForChildren(), + isClean()); + operation_ = null; + } + operationCase_ = 6; + onChanged(); + ; + return transformBuilder_; + } + + private com.google.firestore.v1.DocumentMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public com.google.firestore.v1.DocumentMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.firestore.v1.DocumentMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.firestore.v1.DocumentMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.firestore.v1.DocumentMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.firestore.v1.DocumentMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.firestore.v1.DocumentMask.newBuilder(updateMask_) + .mergeFrom(value) + .buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public com.google.firestore.v1.DocumentMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + public com.google.firestore.v1.DocumentMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.firestore.v1.DocumentMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The fields to update in this write.
+     * This field can be set only when the operation is `update`.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
+     * Fields referenced in the mask, but not present in the input document, are
+     * deleted from the document on the server.
+     * The field paths in this mask must not contain a reserved field name.
+     * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.DocumentMask, + com.google.firestore.v1.DocumentMask.Builder, + com.google.firestore.v1.DocumentMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.firestore.v1.Precondition currentDocument_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder> + currentDocumentBuilder_; + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public boolean hasCurrentDocument() { + return currentDocumentBuilder_ != null || currentDocument_ != null; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.Precondition getCurrentDocument() { + if (currentDocumentBuilder_ == null) { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } else { + return currentDocumentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder setCurrentDocument(com.google.firestore.v1.Precondition value) { + if (currentDocumentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentDocument_ = value; + onChanged(); + } else { + currentDocumentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder setCurrentDocument( + com.google.firestore.v1.Precondition.Builder builderForValue) { + if (currentDocumentBuilder_ == null) { + currentDocument_ = builderForValue.build(); + onChanged(); + } else { + currentDocumentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder mergeCurrentDocument(com.google.firestore.v1.Precondition value) { + if (currentDocumentBuilder_ == null) { + if (currentDocument_ != null) { + currentDocument_ = + com.google.firestore.v1.Precondition.newBuilder(currentDocument_) + .mergeFrom(value) + .buildPartial(); + } else { + currentDocument_ = value; + } + onChanged(); + } else { + currentDocumentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public Builder clearCurrentDocument() { + if (currentDocumentBuilder_ == null) { + currentDocument_ = null; + onChanged(); + } else { + currentDocument_ = null; + currentDocumentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.Precondition.Builder getCurrentDocumentBuilder() { + + onChanged(); + return getCurrentDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + public com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { + if (currentDocumentBuilder_ != null) { + return currentDocumentBuilder_.getMessageOrBuilder(); + } else { + return currentDocument_ == null + ? com.google.firestore.v1.Precondition.getDefaultInstance() + : currentDocument_; + } + } + /** + * + * + *
+     * An optional precondition on the document.
+     * The write will fail if this is set and not met by the target document.
+     * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder> + getCurrentDocumentFieldBuilder() { + if (currentDocumentBuilder_ == null) { + currentDocumentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.Precondition, + com.google.firestore.v1.Precondition.Builder, + com.google.firestore.v1.PreconditionOrBuilder>( + getCurrentDocument(), getParentForChildren(), isClean()); + currentDocument_ = null; + } + return currentDocumentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.Write) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.Write) + private static final com.google.firestore.v1.Write DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.Write(); + } + + public static com.google.firestore.v1.Write getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Write parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Write(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.v1.Write getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteOrBuilder.java new file mode 100644 index 000000000000..fc57ec54ce70 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteOrBuilder.java @@ -0,0 +1,195 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface WriteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.Write) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A document to write.
+   * 
+ * + * .google.firestore.v1.Document update = 1; + */ + boolean hasUpdate(); + /** + * + * + *
+   * A document to write.
+   * 
+ * + * .google.firestore.v1.Document update = 1; + */ + com.google.firestore.v1.Document getUpdate(); + /** + * + * + *
+   * A document to write.
+   * 
+ * + * .google.firestore.v1.Document update = 1; + */ + com.google.firestore.v1.DocumentOrBuilder getUpdateOrBuilder(); + + /** + * + * + *
+   * A document name to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string delete = 2; + */ + java.lang.String getDelete(); + /** + * + * + *
+   * A document name to delete. In the format:
+   * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
+   * 
+ * + * string delete = 2; + */ + com.google.protobuf.ByteString getDeleteBytes(); + + /** + * + * + *
+   * Applies a tranformation to a document.
+   * At most one `transform` per document is allowed in a given request.
+   * An `update` cannot follow a `transform` on the same document in a given
+   * request.
+   * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + boolean hasTransform(); + /** + * + * + *
+   * Applies a tranformation to a document.
+   * At most one `transform` per document is allowed in a given request.
+   * An `update` cannot follow a `transform` on the same document in a given
+   * request.
+   * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + com.google.firestore.v1.DocumentTransform getTransform(); + /** + * + * + *
+   * Applies a tranformation to a document.
+   * At most one `transform` per document is allowed in a given request.
+   * An `update` cannot follow a `transform` on the same document in a given
+   * request.
+   * 
+ * + * .google.firestore.v1.DocumentTransform transform = 6; + */ + com.google.firestore.v1.DocumentTransformOrBuilder getTransformOrBuilder(); + + /** + * + * + *
+   * The fields to update in this write.
+   * This field can be set only when the operation is `update`.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * The field paths in this mask must not contain a reserved field name.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The fields to update in this write.
+   * This field can be set only when the operation is `update`.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * The field paths in this mask must not contain a reserved field name.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + com.google.firestore.v1.DocumentMask getUpdateMask(); + /** + * + * + *
+   * The fields to update in this write.
+   * This field can be set only when the operation is `update`.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
+   * Fields referenced in the mask, but not present in the input document, are
+   * deleted from the document on the server.
+   * The field paths in this mask must not contain a reserved field name.
+   * 
+ * + * .google.firestore.v1.DocumentMask update_mask = 3; + */ + com.google.firestore.v1.DocumentMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * An optional precondition on the document.
+   * The write will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + boolean hasCurrentDocument(); + /** + * + * + *
+   * An optional precondition on the document.
+   * The write will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + com.google.firestore.v1.Precondition getCurrentDocument(); + /** + * + * + *
+   * An optional precondition on the document.
+   * The write will fail if this is set and not met by the target document.
+   * 
+ * + * .google.firestore.v1.Precondition current_document = 4; + */ + com.google.firestore.v1.PreconditionOrBuilder getCurrentDocumentOrBuilder(); + + public com.google.firestore.v1.Write.OperationCase getOperationCase(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteProto.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteProto.java new file mode 100644 index 000000000000..c4a49ca91042 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteProto.java @@ -0,0 +1,195 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public final class WriteProto { + private WriteProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_Write_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_Write_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DocumentTransform_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DocumentTransform_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DocumentTransform_FieldTransform_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DocumentTransform_FieldTransform_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_WriteResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_WriteResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DocumentChange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DocumentChange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DocumentDelete_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DocumentDelete_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_DocumentRemove_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_DocumentRemove_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ExistenceFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExistenceFilter_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\037google/firestore/v1/write.proto\022\023googl" + + "e.firestore.v1\032\034google/api/annotations.p" + + "roto\032 google/firestore/v1/common.proto\032\"" + + "google/firestore/v1/document.proto\032\037goog" + + "le/protobuf/timestamp.proto\"\211\002\n\005Write\022/\n" + + "\006update\030\001 \001(\0132\035.google.firestore.v1.Docu" + + "mentH\000\022\020\n\006delete\030\002 \001(\tH\000\022;\n\ttransform\030\006 " + + "\001(\0132&.google.firestore.v1.DocumentTransf" + + "ormH\000\0226\n\013update_mask\030\003 \001(\0132!.google.fire" + + "store.v1.DocumentMask\022;\n\020current_documen" + + "t\030\004 \001(\0132!.google.firestore.v1.Preconditi" + + "onB\013\n\toperation\"\345\004\n\021DocumentTransform\022\020\n" + + "\010document\030\001 \001(\t\022O\n\020field_transforms\030\002 \003(" + + "\01325.google.firestore.v1.DocumentTransfor" + + "m.FieldTransform\032\354\003\n\016FieldTransform\022\022\n\nf" + + "ield_path\030\001 \001(\t\022`\n\023set_to_server_value\030\002" + + " \001(\0162A.google.firestore.v1.DocumentTrans" + + "form.FieldTransform.ServerValueH\000\022/\n\tinc" + + "rement\030\003 \001(\0132\032.google.firestore.v1.Value" + + "H\000\022-\n\007maximum\030\004 \001(\0132\032.google.firestore.v" + + "1.ValueH\000\022-\n\007minimum\030\005 \001(\0132\032.google.fire" + + "store.v1.ValueH\000\022B\n\027append_missing_eleme" + + "nts\030\006 \001(\0132\037.google.firestore.v1.ArrayVal" + + "ueH\000\022@\n\025remove_all_from_array\030\007 \001(\0132\037.go" + + "ogle.firestore.v1.ArrayValueH\000\"=\n\013Server" + + "Value\022\034\n\030SERVER_VALUE_UNSPECIFIED\020\000\022\020\n\014R" + + "EQUEST_TIME\020\001B\020\n\016transform_type\"u\n\013Write" + + "Result\022/\n\013update_time\030\001 \001(\0132\032.google.pro" + + "tobuf.Timestamp\0225\n\021transform_results\030\002 \003" + + "(\0132\032.google.firestore.v1.Value\"q\n\016Docume" + + "ntChange\022/\n\010document\030\001 \001(\0132\035.google.fire" + + "store.v1.Document\022\022\n\ntarget_ids\030\005 \003(\005\022\032\n" + + "\022removed_target_ids\030\006 \003(\005\"m\n\016DocumentDel" + + "ete\022\020\n\010document\030\001 \001(\t\022\032\n\022removed_target_" + + "ids\030\006 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.google.pr" + + "otobuf.Timestamp\"m\n\016DocumentRemove\022\020\n\010do" + + "cument\030\001 \001(\t\022\032\n\022removed_target_ids\030\002 \003(\005" + + "\022-\n\tread_time\030\004 \001(\0132\032.google.protobuf.Ti" + + "mestamp\"3\n\017ExistenceFilter\022\021\n\ttarget_id\030" + + "\001 \001(\005\022\r\n\005count\030\002 \001(\005B\244\001\n\027com.google.fire" + + "store.v1B\nWriteProtoP\001Z + * The request for [Firestore.Write][google.firestore.v1.Firestore.Write]. + * The first request creates a stream, or resumes an existing one from a token. + * When creating a new stream, the server replies with a response containing + * only an ID and a token, to use in the next request. + * When resuming a stream, the server first streams any responses later than the + * given token, then a response containing only an up-to-date token, to use in + * the next request. + * + * + * Protobuf type {@code google.firestore.v1.WriteRequest} + */ +public final class WriteRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.WriteRequest) + WriteRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteRequest.newBuilder() to construct. + private WriteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteRequest() { + database_ = ""; + streamId_ = ""; + writes_ = java.util.Collections.emptyList(); + streamToken_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteRequest( + 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(); + + database_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + streamId_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + writes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + writes_.add( + input.readMessage(com.google.firestore.v1.Write.parser(), extensionRegistry)); + break; + } + case 34: + { + streamToken_ = input.readBytes(); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000004) == 0x00000004)) { + writes_ = java.util.Collections.unmodifiableList(writes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.WriteRequest.class, + com.google.firestore.v1.WriteRequest.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_FIELD_NUMBER = 1; + private volatile java.lang.Object database_; + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * This is only required in the first message.
+   * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + 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(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * This is only required in the first message.
+   * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STREAM_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object streamId_; + /** + * + * + *
+   * The ID of the write stream to resume.
+   * This may only be set in the first message. When left empty, a new write
+   * stream will be created.
+   * 
+ * + * string stream_id = 2; + */ + public java.lang.String getStreamId() { + java.lang.Object ref = streamId_; + 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(); + streamId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the write stream to resume.
+   * This may only be set in the first message. When left empty, a new write
+   * stream will be created.
+   * 
+ * + * string stream_id = 2; + */ + public com.google.protobuf.ByteString getStreamIdBytes() { + java.lang.Object ref = streamId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + streamId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITES_FIELD_NUMBER = 3; + private java.util.List writes_; + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public java.util.List getWritesList() { + return writes_; + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public java.util.List getWritesOrBuilderList() { + return writes_; + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public int getWritesCount() { + return writes_.size(); + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.Write getWrites(int index) { + return writes_.get(index); + } + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.WriteOrBuilder getWritesOrBuilder(int index) { + return writes_.get(index); + } + + public static final int STREAM_TOKEN_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString streamToken_; + /** + * + * + *
+   * A stream token that was previously sent by the server.
+   * The client should set this field to the token from the most recent
+   * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has
+   * received responses up to this token. After sending this token, earlier
+   * tokens may not be used anymore.
+   * The server may close the stream if there are too many unacknowledged
+   * responses.
+   * Leave this field unset when creating a new stream. To resume a stream at
+   * a specific point, set this field and the `stream_id` field.
+   * Leave this field unset when creating a new stream.
+   * 
+ * + * bytes stream_token = 4; + */ + public com.google.protobuf.ByteString getStreamToken() { + return streamToken_; + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_); + } + if (!getStreamIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, streamId_); + } + for (int i = 0; i < writes_.size(); i++) { + output.writeMessage(3, writes_.get(i)); + } + if (!streamToken_.isEmpty()) { + output.writeBytes(4, streamToken_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_); + } + if (!getStreamIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, streamId_); + } + for (int i = 0; i < writes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, writes_.get(i)); + } + if (!streamToken_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, streamToken_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); + } + 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.v1.WriteRequest)) { + return super.equals(obj); + } + com.google.firestore.v1.WriteRequest other = (com.google.firestore.v1.WriteRequest) obj; + + boolean result = true; + result = result && getDatabase().equals(other.getDatabase()); + result = result && getStreamId().equals(other.getStreamId()); + result = result && getWritesList().equals(other.getWritesList()); + result = result && getStreamToken().equals(other.getStreamToken()); + result = result && internalGetLabels().equals(other.internalGetLabels()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + STREAM_ID_FIELD_NUMBER; + hash = (53 * hash) + getStreamId().hashCode(); + if (getWritesCount() > 0) { + hash = (37 * hash) + WRITES_FIELD_NUMBER; + hash = (53 * hash) + getWritesList().hashCode(); + } + hash = (37 * hash) + STREAM_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getStreamToken().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.WriteRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteRequest 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.v1.WriteRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteRequest 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.v1.WriteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.WriteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteRequest 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.v1.WriteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteRequest 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.v1.WriteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteRequest 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.v1.WriteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [Firestore.Write][google.firestore.v1.Firestore.Write].
+   * The first request creates a stream, or resumes an existing one from a token.
+   * When creating a new stream, the server replies with a response containing
+   * only an ID and a token, to use in the next request.
+   * When resuming a stream, the server first streams any responses later than the
+   * given token, then a response containing only an up-to-date token, to use in
+   * the next request.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.WriteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.WriteRequest) + com.google.firestore.v1.WriteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.WriteRequest.class, + com.google.firestore.v1.WriteRequest.Builder.class); + } + + // Construct using com.google.firestore.v1.WriteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWritesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + database_ = ""; + + streamId_ = ""; + + if (writesBuilder_ == null) { + writes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + writesBuilder_.clear(); + } + streamToken_ = com.google.protobuf.ByteString.EMPTY; + + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.WriteRequest getDefaultInstanceForType() { + return com.google.firestore.v1.WriteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.WriteRequest build() { + com.google.firestore.v1.WriteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.WriteRequest buildPartial() { + com.google.firestore.v1.WriteRequest result = new com.google.firestore.v1.WriteRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.database_ = database_; + result.streamId_ = streamId_; + if (writesBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + writes_ = java.util.Collections.unmodifiableList(writes_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.writes_ = writes_; + } else { + result.writes_ = writesBuilder_.build(); + } + result.streamToken_ = streamToken_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.WriteRequest) { + return mergeFrom((com.google.firestore.v1.WriteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.WriteRequest other) { + if (other == com.google.firestore.v1.WriteRequest.getDefaultInstance()) return this; + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (!other.getStreamId().isEmpty()) { + streamId_ = other.streamId_; + onChanged(); + } + if (writesBuilder_ == null) { + if (!other.writes_.isEmpty()) { + if (writes_.isEmpty()) { + writes_ = other.writes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWritesIsMutable(); + writes_.addAll(other.writes_); + } + onChanged(); + } + } else { + if (!other.writes_.isEmpty()) { + if (writesBuilder_.isEmpty()) { + writesBuilder_.dispose(); + writesBuilder_ = null; + writes_ = other.writes_; + bitField0_ = (bitField0_ & ~0x00000004); + writesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWritesFieldBuilder() + : null; + } else { + writesBuilder_.addAllMessages(other.writes_); + } + } + } + if (other.getStreamToken() != com.google.protobuf.ByteString.EMPTY) { + setStreamToken(other.getStreamToken()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + 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.v1.WriteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.WriteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * This is only required in the first message.
+     * 
+ * + * string database = 1; + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * This is only required in the first message.
+     * 
+ * + * string database = 1; + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * This is only required in the first message.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * This is only required in the first message.
+     * 
+ * + * string database = 1; + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * The database name. In the format:
+     * `projects/{project_id}/databases/{database_id}`.
+     * This is only required in the first message.
+     * 
+ * + * string database = 1; + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private java.lang.Object streamId_ = ""; + /** + * + * + *
+     * The ID of the write stream to resume.
+     * This may only be set in the first message. When left empty, a new write
+     * stream will be created.
+     * 
+ * + * string stream_id = 2; + */ + public java.lang.String getStreamId() { + java.lang.Object ref = streamId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + streamId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the write stream to resume.
+     * This may only be set in the first message. When left empty, a new write
+     * stream will be created.
+     * 
+ * + * string stream_id = 2; + */ + public com.google.protobuf.ByteString getStreamIdBytes() { + java.lang.Object ref = streamId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + streamId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the write stream to resume.
+     * This may only be set in the first message. When left empty, a new write
+     * stream will be created.
+     * 
+ * + * string stream_id = 2; + */ + public Builder setStreamId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + streamId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the write stream to resume.
+     * This may only be set in the first message. When left empty, a new write
+     * stream will be created.
+     * 
+ * + * string stream_id = 2; + */ + public Builder clearStreamId() { + + streamId_ = getDefaultInstance().getStreamId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the write stream to resume.
+     * This may only be set in the first message. When left empty, a new write
+     * stream will be created.
+     * 
+ * + * string stream_id = 2; + */ + public Builder setStreamIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + streamId_ = value; + onChanged(); + return this; + } + + private java.util.List writes_ = + java.util.Collections.emptyList(); + + private void ensureWritesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + writes_ = new java.util.ArrayList(writes_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Write, + com.google.firestore.v1.Write.Builder, + com.google.firestore.v1.WriteOrBuilder> + writesBuilder_; + + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public java.util.List getWritesList() { + if (writesBuilder_ == null) { + return java.util.Collections.unmodifiableList(writes_); + } else { + return writesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public int getWritesCount() { + if (writesBuilder_ == null) { + return writes_.size(); + } else { + return writesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.Write getWrites(int index) { + if (writesBuilder_ == null) { + return writes_.get(index); + } else { + return writesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder setWrites(int index, com.google.firestore.v1.Write value) { + if (writesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWritesIsMutable(); + writes_.set(index, value); + onChanged(); + } else { + writesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder setWrites(int index, com.google.firestore.v1.Write.Builder builderForValue) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.set(index, builderForValue.build()); + onChanged(); + } else { + writesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder addWrites(com.google.firestore.v1.Write value) { + if (writesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWritesIsMutable(); + writes_.add(value); + onChanged(); + } else { + writesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder addWrites(int index, com.google.firestore.v1.Write value) { + if (writesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWritesIsMutable(); + writes_.add(index, value); + onChanged(); + } else { + writesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder addWrites(com.google.firestore.v1.Write.Builder builderForValue) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.add(builderForValue.build()); + onChanged(); + } else { + writesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder addWrites(int index, com.google.firestore.v1.Write.Builder builderForValue) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.add(index, builderForValue.build()); + onChanged(); + } else { + writesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder addAllWrites( + java.lang.Iterable values) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, writes_); + onChanged(); + } else { + writesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder clearWrites() { + if (writesBuilder_ == null) { + writes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + writesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public Builder removeWrites(int index) { + if (writesBuilder_ == null) { + ensureWritesIsMutable(); + writes_.remove(index); + onChanged(); + } else { + writesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.Write.Builder getWritesBuilder(int index) { + return getWritesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.WriteOrBuilder getWritesOrBuilder(int index) { + if (writesBuilder_ == null) { + return writes_.get(index); + } else { + return writesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public java.util.List + getWritesOrBuilderList() { + if (writesBuilder_ != null) { + return writesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(writes_); + } + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.Write.Builder addWritesBuilder() { + return getWritesFieldBuilder().addBuilder(com.google.firestore.v1.Write.getDefaultInstance()); + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public com.google.firestore.v1.Write.Builder addWritesBuilder(int index) { + return getWritesFieldBuilder() + .addBuilder(index, com.google.firestore.v1.Write.getDefaultInstance()); + } + /** + * + * + *
+     * The writes to apply.
+     * Always executed atomically and in order.
+     * This must be empty on the first request.
+     * This may be empty on the last request.
+     * This must not be empty on all other requests.
+     * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + public java.util.List getWritesBuilderList() { + return getWritesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Write, + com.google.firestore.v1.Write.Builder, + com.google.firestore.v1.WriteOrBuilder> + getWritesFieldBuilder() { + if (writesBuilder_ == null) { + writesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Write, + com.google.firestore.v1.Write.Builder, + com.google.firestore.v1.WriteOrBuilder>( + writes_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + writes_ = null; + } + return writesBuilder_; + } + + private com.google.protobuf.ByteString streamToken_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * A stream token that was previously sent by the server.
+     * The client should set this field to the token from the most recent
+     * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has
+     * received responses up to this token. After sending this token, earlier
+     * tokens may not be used anymore.
+     * The server may close the stream if there are too many unacknowledged
+     * responses.
+     * Leave this field unset when creating a new stream. To resume a stream at
+     * a specific point, set this field and the `stream_id` field.
+     * Leave this field unset when creating a new stream.
+     * 
+ * + * bytes stream_token = 4; + */ + public com.google.protobuf.ByteString getStreamToken() { + return streamToken_; + } + /** + * + * + *
+     * A stream token that was previously sent by the server.
+     * The client should set this field to the token from the most recent
+     * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has
+     * received responses up to this token. After sending this token, earlier
+     * tokens may not be used anymore.
+     * The server may close the stream if there are too many unacknowledged
+     * responses.
+     * Leave this field unset when creating a new stream. To resume a stream at
+     * a specific point, set this field and the `stream_id` field.
+     * Leave this field unset when creating a new stream.
+     * 
+ * + * bytes stream_token = 4; + */ + public Builder setStreamToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + streamToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A stream token that was previously sent by the server.
+     * The client should set this field to the token from the most recent
+     * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has
+     * received responses up to this token. After sending this token, earlier
+     * tokens may not be used anymore.
+     * The server may close the stream if there are too many unacknowledged
+     * responses.
+     * Leave this field unset when creating a new stream. To resume a stream at
+     * a specific point, set this field and the `stream_id` field.
+     * Leave this field unset when creating a new stream.
+     * 
+ * + * bytes stream_token = 4; + */ + public Builder clearStreamToken() { + + streamToken_ = getDefaultInstance().getStreamToken(); + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this write request.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.WriteRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.WriteRequest) + private static final com.google.firestore.v1.WriteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.WriteRequest(); + } + + public static com.google.firestore.v1.WriteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteRequest(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.v1.WriteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteRequestOrBuilder.java new file mode 100644 index 000000000000..8532f2b02d94 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteRequestOrBuilder.java @@ -0,0 +1,205 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface WriteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.WriteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * This is only required in the first message.
+   * 
+ * + * string database = 1; + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * The database name. In the format:
+   * `projects/{project_id}/databases/{database_id}`.
+   * This is only required in the first message.
+   * 
+ * + * string database = 1; + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * The ID of the write stream to resume.
+   * This may only be set in the first message. When left empty, a new write
+   * stream will be created.
+   * 
+ * + * string stream_id = 2; + */ + java.lang.String getStreamId(); + /** + * + * + *
+   * The ID of the write stream to resume.
+   * This may only be set in the first message. When left empty, a new write
+   * stream will be created.
+   * 
+ * + * string stream_id = 2; + */ + com.google.protobuf.ByteString getStreamIdBytes(); + + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + java.util.List getWritesList(); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + com.google.firestore.v1.Write getWrites(int index); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + int getWritesCount(); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + java.util.List getWritesOrBuilderList(); + /** + * + * + *
+   * The writes to apply.
+   * Always executed atomically and in order.
+   * This must be empty on the first request.
+   * This may be empty on the last request.
+   * This must not be empty on all other requests.
+   * 
+ * + * repeated .google.firestore.v1.Write writes = 3; + */ + com.google.firestore.v1.WriteOrBuilder getWritesOrBuilder(int index); + + /** + * + * + *
+   * A stream token that was previously sent by the server.
+   * The client should set this field to the token from the most recent
+   * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has
+   * received responses up to this token. After sending this token, earlier
+   * tokens may not be used anymore.
+   * The server may close the stream if there are too many unacknowledged
+   * responses.
+   * Leave this field unset when creating a new stream. To resume a stream at
+   * a specific point, set this field and the `stream_id` field.
+   * Leave this field unset when creating a new stream.
+   * 
+ * + * bytes stream_token = 4; + */ + com.google.protobuf.ByteString getStreamToken(); + + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this write request.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponse.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponse.java new file mode 100644 index 000000000000..33bb13d0719e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponse.java @@ -0,0 +1,1492 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The response for [Firestore.Write][google.firestore.v1.Firestore.Write].
+ * 
+ * + * Protobuf type {@code google.firestore.v1.WriteResponse} + */ +public final class WriteResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.WriteResponse) + WriteResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteResponse.newBuilder() to construct. + private WriteResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteResponse() { + streamId_ = ""; + streamToken_ = com.google.protobuf.ByteString.EMPTY; + writeResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteResponse( + 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(); + + streamId_ = s; + break; + } + case 18: + { + streamToken_ = input.readBytes(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + writeResults_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + writeResults_.add( + input.readMessage( + com.google.firestore.v1.WriteResult.parser(), extensionRegistry)); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (commitTime_ != null) { + subBuilder = commitTime_.toBuilder(); + } + commitTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commitTime_); + commitTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000004) == 0x00000004)) { + writeResults_ = java.util.Collections.unmodifiableList(writeResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.WriteResponse.class, + com.google.firestore.v1.WriteResponse.Builder.class); + } + + private int bitField0_; + public static final int STREAM_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object streamId_; + /** + * + * + *
+   * The ID of the stream.
+   * Only set on the first message, when a new stream was created.
+   * 
+ * + * string stream_id = 1; + */ + public java.lang.String getStreamId() { + java.lang.Object ref = streamId_; + 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(); + streamId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the stream.
+   * Only set on the first message, when a new stream was created.
+   * 
+ * + * string stream_id = 1; + */ + public com.google.protobuf.ByteString getStreamIdBytes() { + java.lang.Object ref = streamId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + streamId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STREAM_TOKEN_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString streamToken_; + /** + * + * + *
+   * A token that represents the position of this response in the stream.
+   * This can be used by a client to resume the stream at this point.
+   * This field is always set.
+   * 
+ * + * bytes stream_token = 2; + */ + public com.google.protobuf.ByteString getStreamToken() { + return streamToken_; + } + + public static final int WRITE_RESULTS_FIELD_NUMBER = 3; + private java.util.List writeResults_; + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public java.util.List getWriteResultsList() { + return writeResults_; + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public java.util.List + getWriteResultsOrBuilderList() { + return writeResults_; + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public int getWriteResultsCount() { + return writeResults_.size(); + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResult getWriteResults(int index) { + return writeResults_.get(index); + } + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResultOrBuilder getWriteResultsOrBuilder(int index) { + return writeResults_.get(index); + } + + public static final int COMMIT_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp commitTime_; + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public boolean hasCommitTime() { + return commitTime_ != null; + } + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public com.google.protobuf.Timestamp getCommitTime() { + return commitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : commitTime_; + } + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder() { + return getCommitTime(); + } + + 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 (!getStreamIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, streamId_); + } + if (!streamToken_.isEmpty()) { + output.writeBytes(2, streamToken_); + } + for (int i = 0; i < writeResults_.size(); i++) { + output.writeMessage(3, writeResults_.get(i)); + } + if (commitTime_ != null) { + output.writeMessage(4, getCommitTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStreamIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, streamId_); + } + if (!streamToken_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, streamToken_); + } + for (int i = 0; i < writeResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, writeResults_.get(i)); + } + if (commitTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCommitTime()); + } + 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.v1.WriteResponse)) { + return super.equals(obj); + } + com.google.firestore.v1.WriteResponse other = (com.google.firestore.v1.WriteResponse) obj; + + boolean result = true; + result = result && getStreamId().equals(other.getStreamId()); + result = result && getStreamToken().equals(other.getStreamToken()); + result = result && getWriteResultsList().equals(other.getWriteResultsList()); + result = result && (hasCommitTime() == other.hasCommitTime()); + if (hasCommitTime()) { + result = result && getCommitTime().equals(other.getCommitTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STREAM_ID_FIELD_NUMBER; + hash = (53 * hash) + getStreamId().hashCode(); + hash = (37 * hash) + STREAM_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getStreamToken().hashCode(); + if (getWriteResultsCount() > 0) { + hash = (37 * hash) + WRITE_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getWriteResultsList().hashCode(); + } + if (hasCommitTime()) { + hash = (37 * hash) + COMMIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCommitTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.WriteResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteResponse 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.v1.WriteResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteResponse 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.v1.WriteResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.WriteResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteResponse 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.v1.WriteResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteResponse 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.v1.WriteResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteResponse 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.v1.WriteResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [Firestore.Write][google.firestore.v1.Firestore.Write].
+   * 
+ * + * Protobuf type {@code google.firestore.v1.WriteResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.WriteResponse) + com.google.firestore.v1.WriteResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.WriteResponse.class, + com.google.firestore.v1.WriteResponse.Builder.class); + } + + // Construct using com.google.firestore.v1.WriteResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWriteResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + streamId_ = ""; + + streamToken_ = com.google.protobuf.ByteString.EMPTY; + + if (writeResultsBuilder_ == null) { + writeResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + writeResultsBuilder_.clear(); + } + if (commitTimeBuilder_ == null) { + commitTime_ = null; + } else { + commitTime_ = null; + commitTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.FirestoreProto + .internal_static_google_firestore_v1_WriteResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.WriteResponse getDefaultInstanceForType() { + return com.google.firestore.v1.WriteResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.WriteResponse build() { + com.google.firestore.v1.WriteResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.WriteResponse buildPartial() { + com.google.firestore.v1.WriteResponse result = + new com.google.firestore.v1.WriteResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.streamId_ = streamId_; + result.streamToken_ = streamToken_; + if (writeResultsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + writeResults_ = java.util.Collections.unmodifiableList(writeResults_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.writeResults_ = writeResults_; + } else { + result.writeResults_ = writeResultsBuilder_.build(); + } + if (commitTimeBuilder_ == null) { + result.commitTime_ = commitTime_; + } else { + result.commitTime_ = commitTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.WriteResponse) { + return mergeFrom((com.google.firestore.v1.WriteResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.WriteResponse other) { + if (other == com.google.firestore.v1.WriteResponse.getDefaultInstance()) return this; + if (!other.getStreamId().isEmpty()) { + streamId_ = other.streamId_; + onChanged(); + } + if (other.getStreamToken() != com.google.protobuf.ByteString.EMPTY) { + setStreamToken(other.getStreamToken()); + } + if (writeResultsBuilder_ == null) { + if (!other.writeResults_.isEmpty()) { + if (writeResults_.isEmpty()) { + writeResults_ = other.writeResults_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureWriteResultsIsMutable(); + writeResults_.addAll(other.writeResults_); + } + onChanged(); + } + } else { + if (!other.writeResults_.isEmpty()) { + if (writeResultsBuilder_.isEmpty()) { + writeResultsBuilder_.dispose(); + writeResultsBuilder_ = null; + writeResults_ = other.writeResults_; + bitField0_ = (bitField0_ & ~0x00000004); + writeResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWriteResultsFieldBuilder() + : null; + } else { + writeResultsBuilder_.addAllMessages(other.writeResults_); + } + } + } + if (other.hasCommitTime()) { + mergeCommitTime(other.getCommitTime()); + } + 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.v1.WriteResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.WriteResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object streamId_ = ""; + /** + * + * + *
+     * The ID of the stream.
+     * Only set on the first message, when a new stream was created.
+     * 
+ * + * string stream_id = 1; + */ + public java.lang.String getStreamId() { + java.lang.Object ref = streamId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + streamId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the stream.
+     * Only set on the first message, when a new stream was created.
+     * 
+ * + * string stream_id = 1; + */ + public com.google.protobuf.ByteString getStreamIdBytes() { + java.lang.Object ref = streamId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + streamId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the stream.
+     * Only set on the first message, when a new stream was created.
+     * 
+ * + * string stream_id = 1; + */ + public Builder setStreamId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + streamId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the stream.
+     * Only set on the first message, when a new stream was created.
+     * 
+ * + * string stream_id = 1; + */ + public Builder clearStreamId() { + + streamId_ = getDefaultInstance().getStreamId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the stream.
+     * Only set on the first message, when a new stream was created.
+     * 
+ * + * string stream_id = 1; + */ + public Builder setStreamIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + streamId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString streamToken_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * A token that represents the position of this response in the stream.
+     * This can be used by a client to resume the stream at this point.
+     * This field is always set.
+     * 
+ * + * bytes stream_token = 2; + */ + public com.google.protobuf.ByteString getStreamToken() { + return streamToken_; + } + /** + * + * + *
+     * A token that represents the position of this response in the stream.
+     * This can be used by a client to resume the stream at this point.
+     * This field is always set.
+     * 
+ * + * bytes stream_token = 2; + */ + public Builder setStreamToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + streamToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that represents the position of this response in the stream.
+     * This can be used by a client to resume the stream at this point.
+     * This field is always set.
+     * 
+ * + * bytes stream_token = 2; + */ + public Builder clearStreamToken() { + + streamToken_ = getDefaultInstance().getStreamToken(); + onChanged(); + return this; + } + + private java.util.List writeResults_ = + java.util.Collections.emptyList(); + + private void ensureWriteResultsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + writeResults_ = new java.util.ArrayList(writeResults_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.WriteResult, + com.google.firestore.v1.WriteResult.Builder, + com.google.firestore.v1.WriteResultOrBuilder> + writeResultsBuilder_; + + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public java.util.List getWriteResultsList() { + if (writeResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(writeResults_); + } else { + return writeResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public int getWriteResultsCount() { + if (writeResultsBuilder_ == null) { + return writeResults_.size(); + } else { + return writeResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResult getWriteResults(int index) { + if (writeResultsBuilder_ == null) { + return writeResults_.get(index); + } else { + return writeResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder setWriteResults(int index, com.google.firestore.v1.WriteResult value) { + if (writeResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWriteResultsIsMutable(); + writeResults_.set(index, value); + onChanged(); + } else { + writeResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder setWriteResults( + int index, com.google.firestore.v1.WriteResult.Builder builderForValue) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.set(index, builderForValue.build()); + onChanged(); + } else { + writeResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder addWriteResults(com.google.firestore.v1.WriteResult value) { + if (writeResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWriteResultsIsMutable(); + writeResults_.add(value); + onChanged(); + } else { + writeResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder addWriteResults(int index, com.google.firestore.v1.WriteResult value) { + if (writeResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWriteResultsIsMutable(); + writeResults_.add(index, value); + onChanged(); + } else { + writeResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder addWriteResults(com.google.firestore.v1.WriteResult.Builder builderForValue) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.add(builderForValue.build()); + onChanged(); + } else { + writeResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder addWriteResults( + int index, com.google.firestore.v1.WriteResult.Builder builderForValue) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.add(index, builderForValue.build()); + onChanged(); + } else { + writeResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder addAllWriteResults( + java.lang.Iterable values) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, writeResults_); + onChanged(); + } else { + writeResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder clearWriteResults() { + if (writeResultsBuilder_ == null) { + writeResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + writeResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public Builder removeWriteResults(int index) { + if (writeResultsBuilder_ == null) { + ensureWriteResultsIsMutable(); + writeResults_.remove(index); + onChanged(); + } else { + writeResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResult.Builder getWriteResultsBuilder(int index) { + return getWriteResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResultOrBuilder getWriteResultsOrBuilder(int index) { + if (writeResultsBuilder_ == null) { + return writeResults_.get(index); + } else { + return writeResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public java.util.List + getWriteResultsOrBuilderList() { + if (writeResultsBuilder_ != null) { + return writeResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(writeResults_); + } + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResult.Builder addWriteResultsBuilder() { + return getWriteResultsFieldBuilder() + .addBuilder(com.google.firestore.v1.WriteResult.getDefaultInstance()); + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public com.google.firestore.v1.WriteResult.Builder addWriteResultsBuilder(int index) { + return getWriteResultsFieldBuilder() + .addBuilder(index, com.google.firestore.v1.WriteResult.getDefaultInstance()); + } + /** + * + * + *
+     * The result of applying the writes.
+     * This i-th write result corresponds to the i-th write in the
+     * request.
+     * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + public java.util.List + getWriteResultsBuilderList() { + return getWriteResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.WriteResult, + com.google.firestore.v1.WriteResult.Builder, + com.google.firestore.v1.WriteResultOrBuilder> + getWriteResultsFieldBuilder() { + if (writeResultsBuilder_ == null) { + writeResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.WriteResult, + com.google.firestore.v1.WriteResult.Builder, + com.google.firestore.v1.WriteResultOrBuilder>( + writeResults_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + writeResults_ = null; + } + return writeResultsBuilder_; + } + + private com.google.protobuf.Timestamp commitTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitTimeBuilder_; + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public boolean hasCommitTime() { + return commitTimeBuilder_ != null || commitTime_ != null; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public com.google.protobuf.Timestamp getCommitTime() { + if (commitTimeBuilder_ == null) { + return commitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTime_; + } else { + return commitTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public Builder setCommitTime(com.google.protobuf.Timestamp value) { + if (commitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitTime_ = value; + onChanged(); + } else { + commitTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public Builder setCommitTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitTimeBuilder_ == null) { + commitTime_ = builderForValue.build(); + onChanged(); + } else { + commitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public Builder mergeCommitTime(com.google.protobuf.Timestamp value) { + if (commitTimeBuilder_ == null) { + if (commitTime_ != null) { + commitTime_ = + com.google.protobuf.Timestamp.newBuilder(commitTime_).mergeFrom(value).buildPartial(); + } else { + commitTime_ = value; + } + onChanged(); + } else { + commitTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public Builder clearCommitTime() { + if (commitTimeBuilder_ == null) { + commitTime_ = null; + onChanged(); + } else { + commitTime_ = null; + commitTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCommitTimeBuilder() { + + onChanged(); + return getCommitTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder() { + if (commitTimeBuilder_ != null) { + return commitTimeBuilder_.getMessageOrBuilder(); + } else { + return commitTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTime_; + } + } + /** + * + * + *
+     * The time at which the commit occurred.
+     * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitTimeFieldBuilder() { + if (commitTimeBuilder_ == null) { + commitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitTime(), getParentForChildren(), isClean()); + commitTime_ = null; + } + return commitTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.WriteResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.WriteResponse) + private static final com.google.firestore.v1.WriteResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.WriteResponse(); + } + + public static com.google.firestore.v1.WriteResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteResponse(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.v1.WriteResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponseOrBuilder.java new file mode 100644 index 000000000000..55fe97bb71d8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResponseOrBuilder.java @@ -0,0 +1,139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/firestore.proto + +package com.google.firestore.v1; + +public interface WriteResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.WriteResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the stream.
+   * Only set on the first message, when a new stream was created.
+   * 
+ * + * string stream_id = 1; + */ + java.lang.String getStreamId(); + /** + * + * + *
+   * The ID of the stream.
+   * Only set on the first message, when a new stream was created.
+   * 
+ * + * string stream_id = 1; + */ + com.google.protobuf.ByteString getStreamIdBytes(); + + /** + * + * + *
+   * A token that represents the position of this response in the stream.
+   * This can be used by a client to resume the stream at this point.
+   * This field is always set.
+   * 
+ * + * bytes stream_token = 2; + */ + com.google.protobuf.ByteString getStreamToken(); + + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + java.util.List getWriteResultsList(); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + com.google.firestore.v1.WriteResult getWriteResults(int index); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + int getWriteResultsCount(); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + java.util.List + getWriteResultsOrBuilderList(); + /** + * + * + *
+   * The result of applying the writes.
+   * This i-th write result corresponds to the i-th write in the
+   * request.
+   * 
+ * + * repeated .google.firestore.v1.WriteResult write_results = 3; + */ + com.google.firestore.v1.WriteResultOrBuilder getWriteResultsOrBuilder(int index); + + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + boolean hasCommitTime(); + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + com.google.protobuf.Timestamp getCommitTime(); + /** + * + * + *
+   * The time at which the commit occurred.
+   * 
+ * + * .google.protobuf.Timestamp commit_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResult.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResult.java new file mode 100644 index 000000000000..3ce81de7ecdd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResult.java @@ -0,0 +1,1244 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * The result of applying a write.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.WriteResult} + */ +public final class WriteResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.WriteResult) + WriteResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteResult.newBuilder() to construct. + private WriteResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteResult() { + transformResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + transformResults_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + transformResults_.add( + input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + transformResults_ = java.util.Collections.unmodifiableList(transformResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_WriteResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_WriteResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.WriteResult.class, + com.google.firestore.v1.WriteResult.Builder.class); + } + + private int bitField0_; + public static final int UPDATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The last update time of the document after applying the write. Not set
+   * after a `delete`.
+   * If the write did not actually change the document, this will be the
+   * previous update_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The last update time of the document after applying the write. Not set
+   * after a `delete`.
+   * If the write did not actually change the document, this will be the
+   * previous update_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The last update time of the document after applying the write. Not set
+   * after a `delete`.
+   * If the write did not actually change the document, this will be the
+   * previous update_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int TRANSFORM_RESULTS_FIELD_NUMBER = 2; + private java.util.List transformResults_; + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public java.util.List getTransformResultsList() { + return transformResults_; + } + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public java.util.List + getTransformResultsOrBuilderList() { + return transformResults_; + } + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public int getTransformResultsCount() { + return transformResults_.size(); + } + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.Value getTransformResults(int index) { + return transformResults_.get(index); + } + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.ValueOrBuilder getTransformResultsOrBuilder(int index) { + return transformResults_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (updateTime_ != null) { + output.writeMessage(1, getUpdateTime()); + } + for (int i = 0; i < transformResults_.size(); i++) { + output.writeMessage(2, transformResults_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateTime()); + } + for (int i = 0; i < transformResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, transformResults_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.WriteResult)) { + return super.equals(obj); + } + com.google.firestore.v1.WriteResult other = (com.google.firestore.v1.WriteResult) obj; + + boolean result = true; + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime().equals(other.getUpdateTime()); + } + result = result && getTransformResultsList().equals(other.getTransformResultsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (getTransformResultsCount() > 0) { + hash = (37 * hash) + TRANSFORM_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getTransformResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.WriteResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteResult 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.v1.WriteResult parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteResult 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.v1.WriteResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.WriteResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.WriteResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteResult 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.v1.WriteResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteResult 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.v1.WriteResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.WriteResult 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.v1.WriteResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The result of applying a write.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.WriteResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.WriteResult) + com.google.firestore.v1.WriteResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_WriteResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_WriteResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.WriteResult.class, + com.google.firestore.v1.WriteResult.Builder.class); + } + + // Construct using com.google.firestore.v1.WriteResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTransformResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (transformResultsBuilder_ == null) { + transformResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + transformResultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.WriteProto + .internal_static_google_firestore_v1_WriteResult_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.WriteResult getDefaultInstanceForType() { + return com.google.firestore.v1.WriteResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.WriteResult build() { + com.google.firestore.v1.WriteResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.WriteResult buildPartial() { + com.google.firestore.v1.WriteResult result = new com.google.firestore.v1.WriteResult(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (transformResultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + transformResults_ = java.util.Collections.unmodifiableList(transformResults_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.transformResults_ = transformResults_; + } else { + result.transformResults_ = transformResultsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.WriteResult) { + return mergeFrom((com.google.firestore.v1.WriteResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.WriteResult other) { + if (other == com.google.firestore.v1.WriteResult.getDefaultInstance()) return this; + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (transformResultsBuilder_ == null) { + if (!other.transformResults_.isEmpty()) { + if (transformResults_.isEmpty()) { + transformResults_ = other.transformResults_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTransformResultsIsMutable(); + transformResults_.addAll(other.transformResults_); + } + onChanged(); + } + } else { + if (!other.transformResults_.isEmpty()) { + if (transformResultsBuilder_.isEmpty()) { + transformResultsBuilder_.dispose(); + transformResultsBuilder_ = null; + transformResults_ = other.transformResults_; + bitField0_ = (bitField0_ & ~0x00000002); + transformResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransformResultsFieldBuilder() + : null; + } else { + transformResultsBuilder_.addAllMessages(other.transformResults_); + } + } + } + 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.v1.WriteResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.v1.WriteResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The last update time of the document after applying the write. Not set
+     * after a `delete`.
+     * If the write did not actually change the document, this will be the
+     * previous update_time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.util.List transformResults_ = + java.util.Collections.emptyList(); + + private void ensureTransformResultsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + transformResults_ = + new java.util.ArrayList(transformResults_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + transformResultsBuilder_; + + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public java.util.List getTransformResultsList() { + if (transformResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(transformResults_); + } else { + return transformResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public int getTransformResultsCount() { + if (transformResultsBuilder_ == null) { + return transformResults_.size(); + } else { + return transformResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.Value getTransformResults(int index) { + if (transformResultsBuilder_ == null) { + return transformResults_.get(index); + } else { + return transformResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder setTransformResults(int index, com.google.firestore.v1.Value value) { + if (transformResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransformResultsIsMutable(); + transformResults_.set(index, value); + onChanged(); + } else { + transformResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder setTransformResults( + int index, com.google.firestore.v1.Value.Builder builderForValue) { + if (transformResultsBuilder_ == null) { + ensureTransformResultsIsMutable(); + transformResults_.set(index, builderForValue.build()); + onChanged(); + } else { + transformResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder addTransformResults(com.google.firestore.v1.Value value) { + if (transformResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransformResultsIsMutable(); + transformResults_.add(value); + onChanged(); + } else { + transformResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder addTransformResults(int index, com.google.firestore.v1.Value value) { + if (transformResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransformResultsIsMutable(); + transformResults_.add(index, value); + onChanged(); + } else { + transformResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder addTransformResults(com.google.firestore.v1.Value.Builder builderForValue) { + if (transformResultsBuilder_ == null) { + ensureTransformResultsIsMutable(); + transformResults_.add(builderForValue.build()); + onChanged(); + } else { + transformResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder addTransformResults( + int index, com.google.firestore.v1.Value.Builder builderForValue) { + if (transformResultsBuilder_ == null) { + ensureTransformResultsIsMutable(); + transformResults_.add(index, builderForValue.build()); + onChanged(); + } else { + transformResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder addAllTransformResults( + java.lang.Iterable values) { + if (transformResultsBuilder_ == null) { + ensureTransformResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transformResults_); + onChanged(); + } else { + transformResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder clearTransformResults() { + if (transformResultsBuilder_ == null) { + transformResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + transformResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public Builder removeTransformResults(int index) { + if (transformResultsBuilder_ == null) { + ensureTransformResultsIsMutable(); + transformResults_.remove(index); + onChanged(); + } else { + transformResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.Value.Builder getTransformResultsBuilder(int index) { + return getTransformResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.ValueOrBuilder getTransformResultsOrBuilder(int index) { + if (transformResultsBuilder_ == null) { + return transformResults_.get(index); + } else { + return transformResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public java.util.List + getTransformResultsOrBuilderList() { + if (transformResultsBuilder_ != null) { + return transformResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(transformResults_); + } + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.Value.Builder addTransformResultsBuilder() { + return getTransformResultsFieldBuilder() + .addBuilder(com.google.firestore.v1.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public com.google.firestore.v1.Value.Builder addTransformResultsBuilder(int index) { + return getTransformResultsFieldBuilder() + .addBuilder(index, com.google.firestore.v1.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+     * same order.
+     * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + public java.util.List getTransformResultsBuilderList() { + return getTransformResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder> + getTransformResultsFieldBuilder() { + if (transformResultsBuilder_ == null) { + transformResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.v1.Value, + com.google.firestore.v1.Value.Builder, + com.google.firestore.v1.ValueOrBuilder>( + transformResults_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + transformResults_ = null; + } + return transformResultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.WriteResult) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.WriteResult) + private static final com.google.firestore.v1.WriteResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.WriteResult(); + } + + public static com.google.firestore.v1.WriteResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteResult(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.v1.WriteResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResultOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResultOrBuilder.java new file mode 100644 index 000000000000..c204f2527e71 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/WriteResultOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/write.proto + +package com.google.firestore.v1; + +public interface WriteResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.WriteResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The last update time of the document after applying the write. Not set
+   * after a `delete`.
+   * If the write did not actually change the document, this will be the
+   * previous update_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The last update time of the document after applying the write. Not set
+   * after a `delete`.
+   * If the write did not actually change the document, this will be the
+   * previous update_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The last update time of the document after applying the write. Not set
+   * after a `delete`.
+   * If the write did not actually change the document, this will be the
+   * previous update_time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + java.util.List getTransformResultsList(); + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + com.google.firestore.v1.Value getTransformResults(int index); + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + int getTransformResultsCount(); + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + java.util.List + getTransformResultsOrBuilderList(); + /** + * + * + *
+   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
+   * same order.
+   * 
+ * + * repeated .google.firestore.v1.Value transform_results = 2; + */ + com.google.firestore.v1.ValueOrBuilder getTransformResultsOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/common.proto b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/common.proto new file mode 100644 index 000000000000..670cb41739b7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/common.proto @@ -0,0 +1,84 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; + + +// A set of field paths on a document. +// Used to restrict a get or update operation on a document to a subset of its +// fields. +// This is different from standard field masks, as this is always scoped to a +// [Document][google.firestore.v1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1.Value]. +message DocumentMask { + // The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field + // path syntax reference. + repeated string field_paths = 1; +} + +// A precondition on a document, used for conditional operations. +message Precondition { + // The type of precondition. + oneof condition_type { + // When set to `true`, the target document must exist. + // When set to `false`, the target document must not exist. + bool exists = 1; + + // When set, the target document must exist and have been last updated at + // that time. + google.protobuf.Timestamp update_time = 2; + } +} + +// Options for creating a new transaction. +message TransactionOptions { + // Options for a transaction that can be used to read and write documents. + message ReadWrite { + // An optional transaction to retry. + bytes retry_transaction = 1; + } + + // Options for a transaction that can only be used to read documents. + message ReadOnly { + // The consistency mode for this transaction. If not set, defaults to strong + // consistency. + oneof consistency_selector { + // Reads documents at the given time. + // This may not be older than 60 seconds. + google.protobuf.Timestamp read_time = 2; + } + } + + // The mode of the transaction. + oneof mode { + // The transaction can only be used for read operations. + ReadOnly read_only = 2; + + // The transaction can be used for both read and write operations. + ReadWrite read_write = 3; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/document.proto b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/document.proto new file mode 100644 index 000000000000..268947856a8b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/document.proto @@ -0,0 +1,151 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/api/annotations.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/latlng.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; + + +// A Firestore document. +// +// Must not exceed 1 MiB - 4 bytes. +message Document { + // The resource name of the document, for example + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + string name = 1; + + // The document's fields. + // + // The map keys represent field names. + // + // A simple field name contains only characters `a` to `z`, `A` to `Z`, + // `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + // `foo_bar_17`. + // + // Field names matching the regular expression `__.*__` are reserved. Reserved + // field names are forbidden except in certain documented contexts. The map + // keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be + // empty. + // + // Field paths may be used in other contexts to refer to structured fields + // defined here. For `map_value`, the field path is represented by the simple + // or quoted field names of the containing fields, delimited by `.`. For + // example, the structured field + // `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be + // represented by the field path `foo.x&y`. + // + // Within a field path, a quoted field name starts and ends with `` ` `` and + // may contain any character. Some characters, including `` ` ``, must be + // escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + // `` `bak\`tik` `` represents `` bak`tik ``. + map fields = 2; + + // Output only. The time at which the document was created. + // + // This value increases monotonically when a document is deleted then + // recreated. It can also be compared to values from other documents and + // the `read_time` of a query. + google.protobuf.Timestamp create_time = 3; + + // Output only. The time at which the document was last changed. + // + // This value is initially set to the `create_time` then increases + // monotonically with each change to the document. It can also be + // compared to values from other documents and the `read_time` of a query. + google.protobuf.Timestamp update_time = 4; +} + +// A message that can hold any of the supported value types. +message Value { + // Must have a value set. + oneof value_type { + // A null value. + google.protobuf.NullValue null_value = 11; + + // A boolean value. + bool boolean_value = 1; + + // An integer value. + int64 integer_value = 2; + + // A double value. + double double_value = 3; + + // A timestamp value. + // + // Precise only to microseconds. When stored, any additional precision is + // rounded down. + google.protobuf.Timestamp timestamp_value = 10; + + // A string value. + // + // The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + // Only the first 1,500 bytes of the UTF-8 representation are considered by + // queries. + string string_value = 17; + + // A bytes value. + // + // Must not exceed 1 MiB - 89 bytes. + // Only the first 1,500 bytes are considered by queries. + bytes bytes_value = 18; + + // A reference to a document. For example: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + string reference_value = 5; + + // A geo point value representing a point on the surface of Earth. + google.type.LatLng geo_point_value = 8; + + // An array value. + // + // Cannot directly contain another array value, though can contain an + // map which contains another array. + ArrayValue array_value = 9; + + // A map value. + MapValue map_value = 6; + } +} + +// An array value. +message ArrayValue { + // Values in the array. + repeated Value values = 1; +} + +// A map value. +message MapValue { + // The map's fields. + // + // The map keys represent field names. Field names matching the regular + // expression `__.*__` are reserved. Reserved field names are forbidden except + // in certain documented contexts. The map keys, represented as UTF-8, must + // not exceed 1,500 bytes and cannot be empty. + map fields = 1; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto new file mode 100644 index 000000000000..d425edf9e0f9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto @@ -0,0 +1,761 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/api/annotations.proto"; +import "google/firestore/v1/common.proto"; +import "google/firestore/v1/document.proto"; +import "google/firestore/v1/query.proto"; +import "google/firestore/v1/write.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore"; +option java_multiple_files = true; +option java_outer_classname = "FirestoreProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +// Specification of the Firestore API. + +// The Cloud Firestore service. +// +// This service exposes several types of comparable timestamps: +// +// * `create_time` - The time at which a document was created. Changes only +// when a document is deleted, then re-created. Increases in a strict +// monotonic fashion. +// * `update_time` - The time at which a document was last updated. Changes +// every time a document is modified. Does not change when a write results +// in no modifications. Increases in a strict monotonic fashion. +// * `read_time` - The time at which a particular state was observed. Used +// to denote a consistent snapshot of the database or the time at which a +// Document was observed to not exist. +// * `commit_time` - The time at which the writes in a transaction were +// committed. Any read with an equal or greater `read_time` is guaranteed +// to see the effects of the transaction. +service Firestore { + // Gets a single document. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + get: "/v1/{name=projects/*/databases/*/documents/*/**}" + }; + } + + // Lists documents. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}" + }; + } + + // Creates a new document. + rpc CreateDocument(CreateDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/databases/*/documents/**}/{collection_id}" + body: "document" + }; + } + + // Updates or inserts a document. + rpc UpdateDocument(UpdateDocumentRequest) returns (Document) { + option (google.api.http) = { + patch: "/v1/{document.name=projects/*/databases/*/documents/*/**}" + body: "document" + }; + } + + // Deletes a document. + rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/databases/*/documents/*/**}" + }; + } + + // Gets multiple documents. + // + // Documents returned by this method are not guaranteed to be returned in the + // same order that they were requested. + rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (stream BatchGetDocumentsResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:batchGet" + body: "*" + }; + } + + // Starts a new transaction. + rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:beginTransaction" + body: "*" + }; + } + + // Commits a transaction, while optionally updating documents. + rpc Commit(CommitRequest) returns (CommitResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:commit" + body: "*" + }; + } + + // Rolls back a transaction. + rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:rollback" + body: "*" + }; + } + + // Runs a query. + rpc RunQuery(RunQueryRequest) returns (stream RunQueryResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/databases/*/documents}:runQuery" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery" + body: "*" + } + }; + } + + // Streams batches of document updates and deletes, in order. + rpc Write(stream WriteRequest) returns (stream WriteResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:write" + body: "*" + }; + } + + // Listens to changes. + rpc Listen(stream ListenRequest) returns (stream ListenResponse) { + option (google.api.http) = { + post: "/v1/{database=projects/*/databases/*}/documents:listen" + body: "*" + }; + } + + // Lists all the collection IDs underneath a document. + rpc ListCollectionIds(ListCollectionIdsRequest) returns (ListCollectionIdsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/databases/*/documents}:listCollectionIds" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds" + body: "*" + } + }; + } +} + +// The request for [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument]. +message GetDocumentRequest { + // The resource name of the Document to get. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + string name = 1; + + // The fields to return. If not set, returns all fields. + // + // If the document has a field that is not present in this mask, that field + // will not be returned in the response. + DocumentMask mask = 2; + + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + oneof consistency_selector { + // Reads the document in a transaction. + bytes transaction = 3; + + // Reads the version of the document at the given time. + // This may not be older than 60 seconds. + google.protobuf.Timestamp read_time = 5; + } +} + +// The request for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments]. +message ListDocumentsRequest { + // The parent resource name. In the format: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents` or + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + string parent = 1; + + // The collection ID, relative to `parent`, to list. For example: `chatrooms` + // or `messages`. + string collection_id = 2; + + // The maximum number of documents to return. + int32 page_size = 3; + + // The `next_page_token` value returned from a previous List request, if any. + string page_token = 4; + + // The order to sort results by. For example: `priority desc, name`. + string order_by = 6; + + // The fields to return. If not set, returns all fields. + // + // If a document has a field that is not present in this mask, that field + // will not be returned in the response. + DocumentMask mask = 7; + + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + oneof consistency_selector { + // Reads documents in a transaction. + bytes transaction = 8; + + // Reads documents as they were at the given time. + // This may not be older than 60 seconds. + google.protobuf.Timestamp read_time = 10; + } + + // If the list should show missing documents. A missing document is a + // document that does not exist but has sub-documents. These documents will + // be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time], + // or [Document.update_time][google.firestore.v1.Document.update_time] set. + // + // Requests with `show_missing` may not specify `where` or + // `order_by`. + bool show_missing = 12; +} + +// The response for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments]. +message ListDocumentsResponse { + // The Documents found. + repeated Document documents = 1; + + // The next page token. + string next_page_token = 2; +} + +// The request for [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument]. +message CreateDocumentRequest { + // The parent resource. For example: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + string parent = 1; + + // The collection ID, relative to `parent`, to list. For example: `chatrooms`. + string collection_id = 2; + + // The client-assigned document ID to use for this document. + // + // Optional. If not specified, an ID will be assigned by the service. + string document_id = 3; + + // The document to create. `name` must not be set. + Document document = 4; + + // The fields to return. If not set, returns all fields. + // + // If the document has a field that is not present in this mask, that field + // will not be returned in the response. + DocumentMask mask = 5; +} + +// The request for [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument]. +message UpdateDocumentRequest { + // The updated document. + // Creates the document if it does not already exist. + Document document = 1; + + // The fields to update. + // None of the field paths in the mask may contain a reserved name. + // + // If the document exists on the server and has fields not referenced in the + // mask, they are left unchanged. + // Fields referenced in the mask, but not present in the input document, are + // deleted from the document on the server. + DocumentMask update_mask = 2; + + // The fields to return. If not set, returns all fields. + // + // If the document has a field that is not present in this mask, that field + // will not be returned in the response. + DocumentMask mask = 3; + + // An optional precondition on the document. + // The request will fail if this is set and not met by the target document. + Precondition current_document = 4; +} + +// The request for [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument]. +message DeleteDocumentRequest { + // The resource name of the Document to delete. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + string name = 1; + + // An optional precondition on the document. + // The request will fail if this is set and not met by the target document. + Precondition current_document = 2; +} + +// The request for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments]. +message BatchGetDocumentsRequest { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + string database = 1; + + // The names of the documents to retrieve. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // The request will fail if any of the document is not a child resource of the + // given `database`. Duplicate names will be elided. + repeated string documents = 2; + + // The fields to return. If not set, returns all fields. + // + // If a document has a field that is not present in this mask, that field will + // not be returned in the response. + DocumentMask mask = 3; + + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + oneof consistency_selector { + // Reads documents in a transaction. + bytes transaction = 4; + + // Starts a new transaction and reads the documents. + // Defaults to a read-only transaction. + // The new transaction ID will be returned as the first response in the + // stream. + TransactionOptions new_transaction = 5; + + // Reads documents as they were at the given time. + // This may not be older than 60 seconds. + google.protobuf.Timestamp read_time = 7; + } +} + +// The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments]. +message BatchGetDocumentsResponse { + // A single result. + // This can be empty if the server is just returning a transaction. + oneof result { + // A document that was requested. + Document found = 1; + + // A document name that was requested but does not exist. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + string missing = 2; + } + + // The transaction that was started as part of this request. + // Will only be set in the first response, and only if + // [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request. + bytes transaction = 3; + + // The time at which the document was read. + // This may be monotically increasing, in this case the previous documents in + // the result stream are guaranteed not to have changed between their + // read_time and this one. + google.protobuf.Timestamp read_time = 4; +} + +// The request for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction]. +message BeginTransactionRequest { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + string database = 1; + + // The options for the transaction. + // Defaults to a read-write transaction. + TransactionOptions options = 2; +} + +// The response for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction]. +message BeginTransactionResponse { + // The transaction that was started. + bytes transaction = 1; +} + +// The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit]. +message CommitRequest { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + string database = 1; + + // The writes to apply. + // + // Always executed atomically and in order. + repeated Write writes = 2; + + // If set, applies all writes in this transaction, and commits it. + bytes transaction = 3; +} + +// The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit]. +message CommitResponse { + // The result of applying the writes. + // + // This i-th write result corresponds to the i-th write in the + // request. + repeated WriteResult write_results = 1; + + // The time at which the commit occurred. + google.protobuf.Timestamp commit_time = 2; +} + +// The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback]. +message RollbackRequest { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + string database = 1; + + // The transaction to roll back. + bytes transaction = 2; +} + +// The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery]. +message RunQueryRequest { + // The parent resource name. In the format: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents` or + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + string parent = 1; + + // The query to run. + oneof query_type { + // A structured query. + StructuredQuery structured_query = 2; + } + + // The consistency mode for this transaction. + // If not set, defaults to strong consistency. + oneof consistency_selector { + // Reads documents in a transaction. + bytes transaction = 5; + + // Starts a new transaction and reads the documents. + // Defaults to a read-only transaction. + // The new transaction ID will be returned as the first response in the + // stream. + TransactionOptions new_transaction = 6; + + // Reads documents as they were at the given time. + // This may not be older than 60 seconds. + google.protobuf.Timestamp read_time = 7; + } +} + +// The response for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery]. +message RunQueryResponse { + // The transaction that was started as part of this request. + // Can only be set in the first response, and only if + // [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request. + // If set, no other fields will be set in this response. + bytes transaction = 2; + + // A query result. + // Not set when reporting partial progress. + Document document = 1; + + // The time at which the document was read. This may be monotonically + // increasing; in this case, the previous documents in the result stream are + // guaranteed not to have changed between their `read_time` and this one. + // + // If the query returns no results, a response with `read_time` and no + // `document` will be sent, and this represents the time at which the query + // was run. + google.protobuf.Timestamp read_time = 3; + + // The number of results that have been skipped due to an offset between + // the last response and the current response. + int32 skipped_results = 4; +} + +// The request for [Firestore.Write][google.firestore.v1.Firestore.Write]. +// +// The first request creates a stream, or resumes an existing one from a token. +// +// When creating a new stream, the server replies with a response containing +// only an ID and a token, to use in the next request. +// +// When resuming a stream, the server first streams any responses later than the +// given token, then a response containing only an up-to-date token, to use in +// the next request. +message WriteRequest { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + // This is only required in the first message. + string database = 1; + + // The ID of the write stream to resume. + // This may only be set in the first message. When left empty, a new write + // stream will be created. + string stream_id = 2; + + // The writes to apply. + // + // Always executed atomically and in order. + // This must be empty on the first request. + // This may be empty on the last request. + // This must not be empty on all other requests. + repeated Write writes = 3; + + // A stream token that was previously sent by the server. + // + // The client should set this field to the token from the most recent + // [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has + // received responses up to this token. After sending this token, earlier + // tokens may not be used anymore. + // + // The server may close the stream if there are too many unacknowledged + // responses. + // + // Leave this field unset when creating a new stream. To resume a stream at + // a specific point, set this field and the `stream_id` field. + // + // Leave this field unset when creating a new stream. + bytes stream_token = 4; + + // Labels associated with this write request. + map labels = 5; +} + +// The response for [Firestore.Write][google.firestore.v1.Firestore.Write]. +message WriteResponse { + // The ID of the stream. + // Only set on the first message, when a new stream was created. + string stream_id = 1; + + // A token that represents the position of this response in the stream. + // This can be used by a client to resume the stream at this point. + // + // This field is always set. + bytes stream_token = 2; + + // The result of applying the writes. + // + // This i-th write result corresponds to the i-th write in the + // request. + repeated WriteResult write_results = 3; + + // The time at which the commit occurred. + google.protobuf.Timestamp commit_time = 4; +} + +// A request for [Firestore.Listen][google.firestore.v1.Firestore.Listen] +message ListenRequest { + // The database name. In the format: + // `projects/{project_id}/databases/{database_id}`. + string database = 1; + + // The supported target changes. + oneof target_change { + // A target to add to this stream. + Target add_target = 2; + + // The ID of a target to remove from this stream. + int32 remove_target = 3; + } + + // Labels associated with this target change. + map labels = 4; +} + +// The response for [Firestore.Listen][google.firestore.v1.Firestore.Listen]. +message ListenResponse { + // The supported responses. + oneof response_type { + // Targets have changed. + TargetChange target_change = 2; + + // A [Document][google.firestore.v1.Document] has changed. + DocumentChange document_change = 3; + + // A [Document][google.firestore.v1.Document] has been deleted. + DocumentDelete document_delete = 4; + + // A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer + // relevant to that target). + DocumentRemove document_remove = 6; + + // A filter to apply to the set of documents previously returned for the + // given target. + // + // Returned when documents may have been removed from the given target, but + // the exact documents are unknown. + ExistenceFilter filter = 5; + } +} + +// A specification of a set of documents to listen to. +message Target { + // A target specified by a set of documents names. + message DocumentsTarget { + // The names of the documents to retrieve. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // The request will fail if any of the document is not a child resource of + // the given `database`. Duplicate names will be elided. + repeated string documents = 2; + } + + // A target specified by a query. + message QueryTarget { + // The parent resource name. In the format: + // `projects/{project_id}/databases/{database_id}/documents` or + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents` or + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + string parent = 1; + + // The query to run. + oneof query_type { + // A structured query. + StructuredQuery structured_query = 2; + } + } + + // The type of target to listen to. + oneof target_type { + // A target specified by a query. + QueryTarget query = 2; + + // A target specified by a set of document names. + DocumentsTarget documents = 3; + } + + // When to start listening. + // + // If not specified, all matching Documents are returned before any + // subsequent changes. + oneof resume_type { + // A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target. + // + // Using a resume token with a different target is unsupported and may fail. + bytes resume_token = 4; + + // Start listening after a specific `read_time`. + // + // The client must know the state of matching documents at this time. + google.protobuf.Timestamp read_time = 11; + } + + // A client provided target ID. + // + // If not set, the server will assign an ID for the target. + // + // Used for resuming a target without changing IDs. The IDs can either be + // client-assigned or be server-assigned in a previous stream. All targets + // with client provided IDs must be added before adding a target that needs + // a server-assigned id. + int32 target_id = 5; + + // If the target should be removed once it is current and consistent. + bool once = 6; +} + +// Targets being watched have changed. +message TargetChange { + // The type of change. + enum TargetChangeType { + // No change has occurred. Used only to send an updated `resume_token`. + NO_CHANGE = 0; + + // The targets have been added. + ADD = 1; + + // The targets have been removed. + REMOVE = 2; + + // The targets reflect all changes committed before the targets were added + // to the stream. + // + // This will be sent after or with a `read_time` that is greater than or + // equal to the time at which the targets were added. + // + // Listeners can wait for this change if read-after-write semantics + // are desired. + CURRENT = 3; + + // The targets have been reset, and a new initial state for the targets + // will be returned in subsequent changes. + // + // After the initial state is complete, `CURRENT` will be returned even + // if the target was previously indicated to be `CURRENT`. + RESET = 4; + } + + // The type of change that occurred. + TargetChangeType target_change_type = 1; + + // The target IDs of targets that have changed. + // + // If empty, the change applies to all targets. + // + // For `target_change_type=ADD`, the order of the target IDs matches the order + // of the requests to add the targets. This allows clients to unambiguously + // associate server-assigned target IDs with added targets. + // + // For other states, the order of the target IDs is not defined. + repeated int32 target_ids = 2; + + // The error that resulted in this change, if applicable. + google.rpc.Status cause = 3; + + // A token that can be used to resume the stream for the given `target_ids`, + // or all targets if `target_ids` is empty. + // + // Not set on every target change. + bytes resume_token = 4; + + // The consistent `read_time` for the given `target_ids` (omitted when the + // target_ids are not at a consistent snapshot). + // + // The stream is guaranteed to send a `read_time` with `target_ids` empty + // whenever the entire stream reaches a new consistent snapshot. ADD, + // CURRENT, and RESET messages are guaranteed to (eventually) result in a + // new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + // + // For a given stream, `read_time` is guaranteed to be monotonically + // increasing. + google.protobuf.Timestamp read_time = 6; +} + +// The request for [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds]. +message ListCollectionIdsRequest { + // The parent document. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + // For example: + // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + string parent = 1; + + // The maximum number of results to return. + int32 page_size = 2; + + // A page token. Must be a value from + // [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. + string page_token = 3; +} + +// The response from [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds]. +message ListCollectionIdsResponse { + // The collection ids. + repeated string collection_ids = 1; + + // A page token that may be used to continue the list. + string next_page_token = 2; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query.proto b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query.proto new file mode 100644 index 000000000000..dd89ef5132c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query.proto @@ -0,0 +1,236 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/api/annotations.proto"; +import "google/firestore/v1/document.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore"; +option java_multiple_files = true; +option java_outer_classname = "QueryProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; + + +// A Firestore query. +message StructuredQuery { + // A selection of a collection, such as `messages as m1`. + message CollectionSelector { + // The collection ID. + // When set, selects only collections with this ID. + string collection_id = 2; + + // When false, selects only collections that are immediate children of + // the `parent` specified in the containing `RunQueryRequest`. + // When true, selects all descendant collections. + bool all_descendants = 3; + } + + // A filter. + message Filter { + // The type of filter. + oneof filter_type { + // A composite filter. + CompositeFilter composite_filter = 1; + + // A filter on a document field. + FieldFilter field_filter = 2; + + // A filter that takes exactly one argument. + UnaryFilter unary_filter = 3; + } + } + + // A filter that merges multiple other filters using the given operator. + message CompositeFilter { + // A composite filter operator. + enum Operator { + // Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0; + + // The results are required to satisfy each of the combined filters. + AND = 1; + } + + // The operator for combining multiple filters. + Operator op = 1; + + // The list of filters to combine. + // Must contain at least one filter. + repeated Filter filters = 2; + } + + // A filter on a specific field. + message FieldFilter { + // A field filter operator. + enum Operator { + // Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0; + + // Less than. Requires that the field come first in `order_by`. + LESS_THAN = 1; + + // Less than or equal. Requires that the field come first in `order_by`. + LESS_THAN_OR_EQUAL = 2; + + // Greater than. Requires that the field come first in `order_by`. + GREATER_THAN = 3; + + // Greater than or equal. Requires that the field come first in + // `order_by`. + GREATER_THAN_OR_EQUAL = 4; + + // Equal. + EQUAL = 5; + + // Contains. Requires that the field is an array. + ARRAY_CONTAINS = 7; + } + + // The field to filter by. + FieldReference field = 1; + + // The operator to filter by. + Operator op = 2; + + // The value to compare to. + Value value = 3; + } + + // A filter with a single operand. + message UnaryFilter { + // A unary operator. + enum Operator { + // Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0; + + // Test if a field is equal to NaN. + IS_NAN = 2; + + // Test if an exprestion evaluates to Null. + IS_NULL = 3; + } + + // The unary operator to apply. + Operator op = 1; + + // The argument to the filter. + oneof operand_type { + // The field to which to apply the operator. + FieldReference field = 2; + } + } + + // An order on a field. + message Order { + // The field to order by. + FieldReference field = 1; + + // The direction to order by. Defaults to `ASCENDING`. + Direction direction = 2; + } + + // A reference to a field, such as `max(messages.time) as max_time`. + message FieldReference { + string field_path = 2; + } + + // The projection of document's fields to return. + message Projection { + // The fields to return. + // + // If empty, all fields are returned. To only return the name + // of the document, use `['__name__']`. + repeated FieldReference fields = 2; + } + + // A sort direction. + enum Direction { + // Unspecified. + DIRECTION_UNSPECIFIED = 0; + + // Ascending. + ASCENDING = 1; + + // Descending. + DESCENDING = 2; + } + + // The projection to return. + Projection select = 1; + + // The collections to query. + repeated CollectionSelector from = 2; + + // The filter to apply. + Filter where = 3; + + // The order to apply to the query results. + // + // Firestore guarantees a stable ordering through the following rules: + // + // * Any field required to appear in `order_by`, that is not already + // specified in `order_by`, is appended to the order in field name order + // by default. + // * If an order on `__name__` is not specified, it is appended by default. + // + // Fields are appended with the same sort direction as the last order + // specified, or 'ASCENDING' if no order was specified. For example: + // + // * `SELECT * FROM Foo ORDER BY A` becomes + // `SELECT * FROM Foo ORDER BY A, __name__` + // * `SELECT * FROM Foo ORDER BY A DESC` becomes + // `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` + // * `SELECT * FROM Foo WHERE A > 1` becomes + // `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + repeated Order order_by = 4; + + // A starting point for the query results. + Cursor start_at = 7; + + // A end point for the query results. + Cursor end_at = 8; + + // The number of results to skip. + // + // Applies before limit, but after all other constraints. Must be >= 0 if + // specified. + int32 offset = 6; + + // The maximum number of results to return. + // + // Applies after all other constraints. + // Must be >= 0 if specified. + google.protobuf.Int32Value limit = 5; +} + +// A position in a query result set. +message Cursor { + // The values that represent a position, in the order they appear in + // the order by clause of a query. + // + // Can contain fewer values than specified in the order by clause. + repeated Value values = 1; + + // If the position is just before or just after the given values, relative + // to the sort order defined by the query. + bool before = 2; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/write.proto b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/write.proto new file mode 100644 index 000000000000..bffd0790997b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/write.proto @@ -0,0 +1,255 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/api/annotations.proto"; +import "google/firestore/v1/common.proto"; +import "google/firestore/v1/document.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore"; +option java_multiple_files = true; +option java_outer_classname = "WriteProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; + + +// A write on a document. +message Write { + // The operation to execute. + oneof operation { + // A document to write. + Document update = 1; + + // A document name to delete. In the format: + // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + string delete = 2; + + // Applies a tranformation to a document. + // At most one `transform` per document is allowed in a given request. + // An `update` cannot follow a `transform` on the same document in a given + // request. + DocumentTransform transform = 6; + } + + // The fields to update in this write. + // + // This field can be set only when the operation is `update`. + // If the mask is not set for an `update` and the document exists, any + // existing data will be overwritten. + // If the mask is set and the document on the server has fields not covered by + // the mask, they are left unchanged. + // Fields referenced in the mask, but not present in the input document, are + // deleted from the document on the server. + // The field paths in this mask must not contain a reserved field name. + DocumentMask update_mask = 3; + + // An optional precondition on the document. + // + // The write will fail if this is set and not met by the target document. + Precondition current_document = 4; +} + +// A transformation of a document. +message DocumentTransform { + // A transformation of a field of the document. + message FieldTransform { + // A value that is calculated by the server. + enum ServerValue { + // Unspecified. This value must not be used. + SERVER_VALUE_UNSPECIFIED = 0; + + // The time at which the server processed the request, with millisecond + // precision. + REQUEST_TIME = 1; + } + + // The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax + // reference. + string field_path = 1; + + // The transformation to apply on the field. + oneof transform_type { + // Sets the field to the given server value. + ServerValue set_to_server_value = 2; + + // Adds the given value to the field's current value. + // + // This must be an integer or a double value. + // If the field is not an integer or double, or if the field does not yet + // exist, the transformation will set the field to the given value. + // If either of the given value or the current field value are doubles, + // both values will be interpreted as doubles. Double arithmetic and + // representation of double values follow IEEE 754 semantics. + // If there is positive/negative integer overflow, the field is resolved + // to the largest magnitude positive/negative integer. + Value increment = 3; + + // Sets the field to the maximum of its current value and the given value. + // + // This must be an integer or a double value. + // If the field is not an integer or double, or if the field does not yet + // exist, the transformation will set the field to the given value. + // If a maximum operation is applied where the field and the input value + // are of mixed types (that is - one is an integer and one is a double) + // the field takes on the type of the larger operand. If the operands are + // equivalent (e.g. 3 and 3.0), the field does not change. + // 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + // zero input value is always the stored value. + // The maximum of any numeric value x and NaN is NaN. + Value maximum = 4; + + // Sets the field to the minimum of its current value and the given value. + // + // This must be an integer or a double value. + // If the field is not an integer or double, or if the field does not yet + // exist, the transformation will set the field to the input value. + // If a minimum operation is applied where the field and the input value + // are of mixed types (that is - one is an integer and one is a double) + // the field takes on the type of the smaller operand. If the operands are + // equivalent (e.g. 3 and 3.0), the field does not change. + // 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and + // zero input value is always the stored value. + // The minimum of any numeric value x and NaN is NaN. + Value minimum = 5; + + // Append the given elements in order if they are not already present in + // the current field value. + // If the field is not an array, or if the field does not yet exist, it is + // first set to the empty array. + // + // Equivalent numbers of different types (e.g. 3L and 3.0) are + // considered equal when checking if a value is missing. + // NaN is equal to NaN, and Null is equal to Null. + // If the input contains multiple equivalent values, only the first will + // be considered. + // + // The corresponding transform_result will be the null value. + ArrayValue append_missing_elements = 6; + + // Remove all of the given elements from the array in the field. + // If the field is not an array, or if the field does not yet exist, it is + // set to the empty array. + // + // Equivalent numbers of the different types (e.g. 3L and 3.0) are + // considered equal when deciding whether an element should be removed. + // NaN is equal to NaN, and Null is equal to Null. + // This will remove all equivalent values if there are duplicates. + // + // The corresponding transform_result will be the null value. + ArrayValue remove_all_from_array = 7; + } + } + + // The name of the document to transform. + string document = 1; + + // The list of transformations to apply to the fields of the document, in + // order. + // This must not be empty. + repeated FieldTransform field_transforms = 2; +} + +// The result of applying a write. +message WriteResult { + // The last update time of the document after applying the write. Not set + // after a `delete`. + // + // If the write did not actually change the document, this will be the + // previous update_time. + google.protobuf.Timestamp update_time = 1; + + // The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the + // same order. + repeated Value transform_results = 2; +} + +// A [Document][google.firestore.v1.Document] has changed. +// +// May be the result of multiple [writes][google.firestore.v1.Write], including deletes, that +// ultimately resulted in a new value for the [Document][google.firestore.v1.Document]. +// +// Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical +// change, if multiple targets are affected. +message DocumentChange { + // The new state of the [Document][google.firestore.v1.Document]. + // + // If `mask` is set, contains only fields that were updated or added. + Document document = 1; + + // A set of target IDs of targets that match this document. + repeated int32 target_ids = 5; + + // A set of target IDs for targets that no longer match this document. + repeated int32 removed_target_ids = 6; +} + +// A [Document][google.firestore.v1.Document] has been deleted. +// +// May be the result of multiple [writes][google.firestore.v1.Write], including updates, the +// last of which deleted the [Document][google.firestore.v1.Document]. +// +// Multiple [DocumentDelete][google.firestore.v1.DocumentDelete] messages may be returned for the same logical +// delete, if multiple targets are affected. +message DocumentDelete { + // The resource name of the [Document][google.firestore.v1.Document] that was deleted. + string document = 1; + + // A set of target IDs for targets that previously matched this entity. + repeated int32 removed_target_ids = 6; + + // The read timestamp at which the delete was observed. + // + // Greater or equal to the `commit_time` of the delete. + google.protobuf.Timestamp read_time = 4; +} + +// A [Document][google.firestore.v1.Document] has been removed from the view of the targets. +// +// Sent if the document is no longer relevant to a target and is out of view. +// Can be sent instead of a DocumentDelete or a DocumentChange if the server +// can not send the new value of the document. +// +// Multiple [DocumentRemove][google.firestore.v1.DocumentRemove] messages may be returned for the same logical +// write or delete, if multiple targets are affected. +message DocumentRemove { + // The resource name of the [Document][google.firestore.v1.Document] that has gone out of view. + string document = 1; + + // A set of target IDs for targets that previously matched this document. + repeated int32 removed_target_ids = 2; + + // The read timestamp at which the remove was observed. + // + // Greater or equal to the `commit_time` of the change/delete/remove. + google.protobuf.Timestamp read_time = 4; +} + +// A digest of all the documents that match a given target. +message ExistenceFilter { + // The target ID to which this filter applies. + int32 target_id = 1; + + // The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id]. + // + // If different from the count of documents in the client that match, the + // client must manually determine which documents no longer match the target. + int32 count = 2; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java index 6472c0292658..06581b27b1a1 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java @@ -162,6 +162,183 @@ public interface FieldTransformOrBuilder */ com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue getSetToServerValue(); + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + boolean hasIncrement(); + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + com.google.firestore.v1beta1.Value getIncrement(); + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + com.google.firestore.v1beta1.ValueOrBuilder getIncrementOrBuilder(); + + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + boolean hasMaximum(); + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + com.google.firestore.v1beta1.Value getMaximum(); + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + com.google.firestore.v1beta1.ValueOrBuilder getMaximumOrBuilder(); + + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + boolean hasMinimum(); + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + com.google.firestore.v1beta1.Value getMinimum(); + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + com.google.firestore.v1beta1.ValueOrBuilder getMinimumOrBuilder(); + /** * * @@ -336,6 +513,54 @@ private FieldTransform( transformType_ = rawValue; break; } + case 26: + { + com.google.firestore.v1beta1.Value.Builder subBuilder = null; + if (transformTypeCase_ == 3) { + subBuilder = ((com.google.firestore.v1beta1.Value) transformType_).toBuilder(); + } + transformType_ = + input.readMessage( + com.google.firestore.v1beta1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1beta1.Value) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 3; + break; + } + case 34: + { + com.google.firestore.v1beta1.Value.Builder subBuilder = null; + if (transformTypeCase_ == 4) { + subBuilder = ((com.google.firestore.v1beta1.Value) transformType_).toBuilder(); + } + transformType_ = + input.readMessage( + com.google.firestore.v1beta1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1beta1.Value) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 4; + break; + } + case 42: + { + com.google.firestore.v1beta1.Value.Builder subBuilder = null; + if (transformTypeCase_ == 5) { + subBuilder = ((com.google.firestore.v1beta1.Value) transformType_).toBuilder(); + } + transformType_ = + input.readMessage( + com.google.firestore.v1beta1.Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1beta1.Value) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 5; + break; + } case 50: { com.google.firestore.v1beta1.ArrayValue.Builder subBuilder = null; @@ -536,6 +761,9 @@ private ServerValue(int value) { public enum TransformTypeCase implements com.google.protobuf.Internal.EnumLite { SET_TO_SERVER_VALUE(2), + INCREMENT(3), + MAXIMUM(4), + MINIMUM(5), APPEND_MISSING_ELEMENTS(6), REMOVE_ALL_FROM_ARRAY(7), TRANSFORMTYPE_NOT_SET(0); @@ -554,6 +782,12 @@ public static TransformTypeCase forNumber(int value) { switch (value) { case 2: return SET_TO_SERVER_VALUE; + case 3: + return INCREMENT; + case 4: + return MAXIMUM; + case 5: + return MINIMUM; case 6: return APPEND_MISSING_ELEMENTS; case 7: @@ -663,6 +897,222 @@ public int getSetToServerValueValue() { .SERVER_VALUE_UNSPECIFIED; } + public static final int INCREMENT_FIELD_NUMBER = 3; + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public boolean hasIncrement() { + return transformTypeCase_ == 3; + } + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public com.google.firestore.v1beta1.Value getIncrement() { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Adds the given value to the field's current value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If either of the given value or the current field value are doubles,
+     * both values will be interpreted as doubles. Double arithmetic and
+     * representation of double values follow IEEE 754 semantics.
+     * If there is positive/negative integer overflow, the field is resolved
+     * to the largest magnitude positive/negative integer.
+     * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public com.google.firestore.v1beta1.ValueOrBuilder getIncrementOrBuilder() { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + + public static final int MAXIMUM_FIELD_NUMBER = 4; + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public boolean hasMaximum() { + return transformTypeCase_ == 4; + } + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public com.google.firestore.v1beta1.Value getMaximum() { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Sets the field to the maximum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the given value.
+     * If a maximum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the larger operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+     * zero input value is always the stored value.
+     * The maximum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public com.google.firestore.v1beta1.ValueOrBuilder getMaximumOrBuilder() { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + + public static final int MINIMUM_FIELD_NUMBER = 5; + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public boolean hasMinimum() { + return transformTypeCase_ == 5; + } + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public com.google.firestore.v1beta1.Value getMinimum() { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Sets the field to the minimum of its current value and the given value.
+     * This must be an integer or a double value.
+     * If the field is not an integer or double, or if the field does not yet
+     * exist, the transformation will set the field to the input value.
+     * If a minimum operation is applied where the field and the input value
+     * are of mixed types (that is - one is an integer and one is a double)
+     * the field takes on the type of the smaller operand. If the operands are
+     * equivalent (e.g. 3 and 3.0), the field does not change.
+     * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+     * zero input value is always the stored value.
+     * The minimum of any numeric value x and NaN is NaN.
+     * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public com.google.firestore.v1beta1.ValueOrBuilder getMinimumOrBuilder() { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + public static final int APPEND_MISSING_ELEMENTS_FIELD_NUMBER = 6; /** * @@ -819,6 +1269,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (transformTypeCase_ == 2) { output.writeEnum(2, ((java.lang.Integer) transformType_)); } + if (transformTypeCase_ == 3) { + output.writeMessage(3, (com.google.firestore.v1beta1.Value) transformType_); + } + if (transformTypeCase_ == 4) { + output.writeMessage(4, (com.google.firestore.v1beta1.Value) transformType_); + } + if (transformTypeCase_ == 5) { + output.writeMessage(5, (com.google.firestore.v1beta1.Value) transformType_); + } if (transformTypeCase_ == 6) { output.writeMessage(6, (com.google.firestore.v1beta1.ArrayValue) transformType_); } @@ -842,6 +1301,21 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeEnumSize( 2, ((java.lang.Integer) transformType_)); } + if (transformTypeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.firestore.v1beta1.Value) transformType_); + } + if (transformTypeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.firestore.v1beta1.Value) transformType_); + } + if (transformTypeCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.firestore.v1beta1.Value) transformType_); + } if (transformTypeCase_ == 6) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -876,6 +1350,15 @@ public boolean equals(final java.lang.Object obj) { case 2: result = result && getSetToServerValueValue() == other.getSetToServerValueValue(); break; + case 3: + result = result && getIncrement().equals(other.getIncrement()); + break; + case 4: + result = result && getMaximum().equals(other.getMaximum()); + break; + case 5: + result = result && getMinimum().equals(other.getMinimum()); + break; case 6: result = result && getAppendMissingElements().equals(other.getAppendMissingElements()); break; @@ -903,6 +1386,18 @@ public int hashCode() { hash = (37 * hash) + SET_TO_SERVER_VALUE_FIELD_NUMBER; hash = (53 * hash) + getSetToServerValueValue(); break; + case 3: + hash = (37 * hash) + INCREMENT_FIELD_NUMBER; + hash = (53 * hash) + getIncrement().hashCode(); + break; + case 4: + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = (53 * hash) + getMaximum().hashCode(); + break; + case 5: + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = (53 * hash) + getMinimum().hashCode(); + break; case 6: hash = (37 * hash) + APPEND_MISSING_ELEMENTS_FIELD_NUMBER; hash = (53 * hash) + getAppendMissingElements().hashCode(); @@ -1098,6 +1593,27 @@ public com.google.firestore.v1beta1.DocumentTransform.FieldTransform buildPartia if (transformTypeCase_ == 2) { result.transformType_ = transformType_; } + if (transformTypeCase_ == 3) { + if (incrementBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = incrementBuilder_.build(); + } + } + if (transformTypeCase_ == 4) { + if (maximumBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = maximumBuilder_.build(); + } + } + if (transformTypeCase_ == 5) { + if (minimumBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = minimumBuilder_.build(); + } + } if (transformTypeCase_ == 6) { if (appendMissingElementsBuilder_ == null) { result.transformType_ = transformType_; @@ -1177,6 +1693,21 @@ public Builder mergeFrom( setSetToServerValueValue(other.getSetToServerValueValue()); break; } + case INCREMENT: + { + mergeIncrement(other.getIncrement()); + break; + } + case MAXIMUM: + { + mergeMaximum(other.getMaximum()); + break; + } + case MINIMUM: + { + mergeMinimum(other.getMinimum()); + break; + } case APPEND_MISSING_ELEMENTS: { mergeAppendMissingElements(other.getAppendMissingElements()); @@ -1437,6 +1968,861 @@ public Builder clearSetToServerValue() { return this; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder> + incrementBuilder_; + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public boolean hasIncrement() { + return transformTypeCase_ == 3; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public com.google.firestore.v1beta1.Value getIncrement() { + if (incrementBuilder_ == null) { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } else { + if (transformTypeCase_ == 3) { + return incrementBuilder_.getMessage(); + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public Builder setIncrement(com.google.firestore.v1beta1.Value value) { + if (incrementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + incrementBuilder_.setMessage(value); + } + transformTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public Builder setIncrement(com.google.firestore.v1beta1.Value.Builder builderForValue) { + if (incrementBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + incrementBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public Builder mergeIncrement(com.google.firestore.v1beta1.Value value) { + if (incrementBuilder_ == null) { + if (transformTypeCase_ == 3 + && transformType_ != com.google.firestore.v1beta1.Value.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1beta1.Value.newBuilder( + (com.google.firestore.v1beta1.Value) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 3) { + incrementBuilder_.mergeFrom(value); + } + incrementBuilder_.setMessage(value); + } + transformTypeCase_ = 3; + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public Builder clearIncrement() { + if (incrementBuilder_ == null) { + if (transformTypeCase_ == 3) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 3) { + transformTypeCase_ = 0; + transformType_ = null; + } + incrementBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public com.google.firestore.v1beta1.Value.Builder getIncrementBuilder() { + return getIncrementFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + public com.google.firestore.v1beta1.ValueOrBuilder getIncrementOrBuilder() { + if ((transformTypeCase_ == 3) && (incrementBuilder_ != null)) { + return incrementBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 3) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Adds the given value to the field's current value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If either of the given value or the current field value are doubles,
+       * both values will be interpreted as doubles. Double arithmetic and
+       * representation of double values follow IEEE 754 semantics.
+       * If there is positive/negative integer overflow, the field is resolved
+       * to the largest magnitude positive/negative integer.
+       * 
+ * + * .google.firestore.v1beta1.Value increment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder> + getIncrementFieldBuilder() { + if (incrementBuilder_ == null) { + if (!(transformTypeCase_ == 3)) { + transformType_ = com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + incrementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder>( + (com.google.firestore.v1beta1.Value) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 3; + onChanged(); + ; + return incrementBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder> + maximumBuilder_; + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public boolean hasMaximum() { + return transformTypeCase_ == 4; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public com.google.firestore.v1beta1.Value getMaximum() { + if (maximumBuilder_ == null) { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } else { + if (transformTypeCase_ == 4) { + return maximumBuilder_.getMessage(); + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public Builder setMaximum(com.google.firestore.v1beta1.Value value) { + if (maximumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + maximumBuilder_.setMessage(value); + } + transformTypeCase_ = 4; + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public Builder setMaximum(com.google.firestore.v1beta1.Value.Builder builderForValue) { + if (maximumBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + maximumBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 4; + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public Builder mergeMaximum(com.google.firestore.v1beta1.Value value) { + if (maximumBuilder_ == null) { + if (transformTypeCase_ == 4 + && transformType_ != com.google.firestore.v1beta1.Value.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1beta1.Value.newBuilder( + (com.google.firestore.v1beta1.Value) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 4) { + maximumBuilder_.mergeFrom(value); + } + maximumBuilder_.setMessage(value); + } + transformTypeCase_ = 4; + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public Builder clearMaximum() { + if (maximumBuilder_ == null) { + if (transformTypeCase_ == 4) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 4) { + transformTypeCase_ = 0; + transformType_ = null; + } + maximumBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public com.google.firestore.v1beta1.Value.Builder getMaximumBuilder() { + return getMaximumFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + public com.google.firestore.v1beta1.ValueOrBuilder getMaximumOrBuilder() { + if ((transformTypeCase_ == 4) && (maximumBuilder_ != null)) { + return maximumBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 4) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the maximum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the given value.
+       * If a maximum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the larger operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
+       * zero input value is always the stored value.
+       * The maximum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value maximum = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder> + getMaximumFieldBuilder() { + if (maximumBuilder_ == null) { + if (!(transformTypeCase_ == 4)) { + transformType_ = com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + maximumBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder>( + (com.google.firestore.v1beta1.Value) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 4; + onChanged(); + ; + return maximumBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder> + minimumBuilder_; + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public boolean hasMinimum() { + return transformTypeCase_ == 5; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public com.google.firestore.v1beta1.Value getMinimum() { + if (minimumBuilder_ == null) { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } else { + if (transformTypeCase_ == 5) { + return minimumBuilder_.getMessage(); + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public Builder setMinimum(com.google.firestore.v1beta1.Value value) { + if (minimumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + minimumBuilder_.setMessage(value); + } + transformTypeCase_ = 5; + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public Builder setMinimum(com.google.firestore.v1beta1.Value.Builder builderForValue) { + if (minimumBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + minimumBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 5; + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public Builder mergeMinimum(com.google.firestore.v1beta1.Value value) { + if (minimumBuilder_ == null) { + if (transformTypeCase_ == 5 + && transformType_ != com.google.firestore.v1beta1.Value.getDefaultInstance()) { + transformType_ = + com.google.firestore.v1beta1.Value.newBuilder( + (com.google.firestore.v1beta1.Value) transformType_) + .mergeFrom(value) + .buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 5) { + minimumBuilder_.mergeFrom(value); + } + minimumBuilder_.setMessage(value); + } + transformTypeCase_ = 5; + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public Builder clearMinimum() { + if (minimumBuilder_ == null) { + if (transformTypeCase_ == 5) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 5) { + transformTypeCase_ = 0; + transformType_ = null; + } + minimumBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public com.google.firestore.v1beta1.Value.Builder getMinimumBuilder() { + return getMinimumFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + public com.google.firestore.v1beta1.ValueOrBuilder getMinimumOrBuilder() { + if ((transformTypeCase_ == 5) && (minimumBuilder_ != null)) { + return minimumBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 5) { + return (com.google.firestore.v1beta1.Value) transformType_; + } + return com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Sets the field to the minimum of its current value and the given value.
+       * This must be an integer or a double value.
+       * If the field is not an integer or double, or if the field does not yet
+       * exist, the transformation will set the field to the input value.
+       * If a minimum operation is applied where the field and the input value
+       * are of mixed types (that is - one is an integer and one is a double)
+       * the field takes on the type of the smaller operand. If the operands are
+       * equivalent (e.g. 3 and 3.0), the field does not change.
+       * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
+       * zero input value is always the stored value.
+       * The minimum of any numeric value x and NaN is NaN.
+       * 
+ * + * .google.firestore.v1beta1.Value minimum = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder> + getMinimumFieldBuilder() { + if (minimumBuilder_ == null) { + if (!(transformTypeCase_ == 5)) { + transformType_ = com.google.firestore.v1beta1.Value.getDefaultInstance(); + } + minimumBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.Value, + com.google.firestore.v1beta1.Value.Builder, + com.google.firestore.v1beta1.ValueOrBuilder>( + (com.google.firestore.v1beta1.Value) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 5; + onChanged(); + ; + return minimumBuilder_; + } + private com.google.protobuf.SingleFieldBuilderV3< com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java index 43cc167d8e5f..3cbc5d2b0cea 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java @@ -65,37 +65,41 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pdate_mask\030\003 \001(\0132&.google.firestore.v1be" + "ta1.DocumentMask\022@\n\020current_document\030\004 \001" + "(\0132&.google.firestore.v1beta1.Preconditi" - + "onB\013\n\toperation\"\352\003\n\021DocumentTransform\022\020\n" + + "onB\013\n\toperation\"\210\005\n\021DocumentTransform\022\020\n" + "\010document\030\001 \001(\t\022T\n\020field_transforms\030\002 \003(" + "\0132:.google.firestore.v1beta1.DocumentTra" - + "nsform.FieldTransform\032\354\002\n\016FieldTransform" + + "nsform.FieldTransform\032\212\004\n\016FieldTransform" + "\022\022\n\nfield_path\030\001 \001(\t\022e\n\023set_to_server_va" + "lue\030\002 \001(\0162F.google.firestore.v1beta1.Doc" + "umentTransform.FieldTransform.ServerValu" - + "eH\000\022G\n\027append_missing_elements\030\006 \001(\0132$.g" - + "oogle.firestore.v1beta1.ArrayValueH\000\022E\n\025" - + "remove_all_from_array\030\007 \001(\0132$.google.fir" - + "estore.v1beta1.ArrayValueH\000\"=\n\013ServerVal" - + "ue\022\034\n\030SERVER_VALUE_UNSPECIFIED\020\000\022\020\n\014REQU" - + "EST_TIME\020\001B\020\n\016transform_type\"z\n\013WriteRes" - + "ult\022/\n\013update_time\030\001 \001(\0132\032.google.protob" - + "uf.Timestamp\022:\n\021transform_results\030\002 \003(\0132" - + "\037.google.firestore.v1beta1.Value\"v\n\016Docu" - + "mentChange\0224\n\010document\030\001 \001(\0132\".google.fi" - + "restore.v1beta1.Document\022\022\n\ntarget_ids\030\005" - + " \003(\005\022\032\n\022removed_target_ids\030\006 \003(\005\"m\n\016Docu" - + "mentDelete\022\020\n\010document\030\001 \001(\t\022\032\n\022removed_" - + "target_ids\030\006 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\"m\n\016DocumentRemov" - + "e\022\020\n\010document\030\001 \001(\t\022\032\n\022removed_target_id" - + "s\030\002 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.google.prot" - + "obuf.Timestamp\"3\n\017ExistenceFilter\022\021\n\ttar" - + "get_id\030\001 \001(\005\022\r\n\005count\030\002 \001(\005B\270\001\n\034com.goog" - + "le.firestore.v1beta1B\nWriteProtoP\001ZAgoog" - + "le.golang.org/genproto/googleapis/firest" - + "ore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cl" - + "oud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Fir" - + "estore\\V1beta1b\006proto3" + + "eH\000\0224\n\tincrement\030\003 \001(\0132\037.google.firestor" + + "e.v1beta1.ValueH\000\0222\n\007maximum\030\004 \001(\0132\037.goo" + + "gle.firestore.v1beta1.ValueH\000\0222\n\007minimum" + + "\030\005 \001(\0132\037.google.firestore.v1beta1.ValueH" + + "\000\022G\n\027append_missing_elements\030\006 \001(\0132$.goo" + + "gle.firestore.v1beta1.ArrayValueH\000\022E\n\025re" + + "move_all_from_array\030\007 \001(\0132$.google.fires" + + "tore.v1beta1.ArrayValueH\000\"=\n\013ServerValue" + + "\022\034\n\030SERVER_VALUE_UNSPECIFIED\020\000\022\020\n\014REQUES" + + "T_TIME\020\001B\020\n\016transform_type\"z\n\013WriteResul" + + "t\022/\n\013update_time\030\001 \001(\0132\032.google.protobuf" + + ".Timestamp\022:\n\021transform_results\030\002 \003(\0132\037." + + "google.firestore.v1beta1.Value\"v\n\016Docume" + + "ntChange\0224\n\010document\030\001 \001(\0132\".google.fire" + + "store.v1beta1.Document\022\022\n\ntarget_ids\030\005 \003" + + "(\005\022\032\n\022removed_target_ids\030\006 \003(\005\"m\n\016Docume" + + "ntDelete\022\020\n\010document\030\001 \001(\t\022\032\n\022removed_ta" + + "rget_ids\030\006 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.goog" + + "le.protobuf.Timestamp\"m\n\016DocumentRemove\022" + + "\020\n\010document\030\001 \001(\t\022\032\n\022removed_target_ids\030" + + "\002 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.google.protob" + + "uf.Timestamp\"3\n\017ExistenceFilter\022\021\n\ttarge" + + "t_id\030\001 \001(\005\022\r\n\005count\030\002 \001(\005B\270\001\n\034com.google" + + ".firestore.v1beta1B\nWriteProtoP\001ZAgoogle" + + ".golang.org/genproto/googleapis/firestor" + + "e/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Clou" + + "d.Firestore.V1Beta1\312\002\036Google\\Cloud\\Fires" + + "tore\\V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -140,6 +144,9 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new java.lang.String[] { "FieldPath", "SetToServerValue", + "Increment", + "Maximum", + "Minimum", "AppendMissingElements", "RemoveAllFromArray", "TransformType", diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto index d6b3dce03f1b..4046a0d6743c 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto index aaa90516cd0c..beb525a4eec6 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto index 7b6c8914b4c7..39ea90e2a7b5 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto index 02d0aaaabd89..17e930213b37 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto index 9901e31010a2..98cd6cbbcff9 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; @@ -89,6 +90,46 @@ message DocumentTransform { // Sets the field to the given server value. ServerValue set_to_server_value = 2; + // Adds the given value to the field's current value. + // + // This must be an integer or a double value. + // If the field is not an integer or double, or if the field does not yet + // exist, the transformation will set the field to the given value. + // If either of the given value or the current field value are doubles, + // both values will be interpreted as doubles. Double arithmetic and + // representation of double values follow IEEE 754 semantics. + // If there is positive/negative integer overflow, the field is resolved + // to the largest magnitude positive/negative integer. + Value increment = 3; + + // Sets the field to the maximum of its current value and the given value. + // + // This must be an integer or a double value. + // If the field is not an integer or double, or if the field does not yet + // exist, the transformation will set the field to the given value. + // If a maximum operation is applied where the field and the input value + // are of mixed types (that is - one is an integer and one is a double) + // the field takes on the type of the larger operand. If the operands are + // equivalent (e.g. 3 and 3.0), the field does not change. + // 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + // zero input value is always the stored value. + // The maximum of any numeric value x and NaN is NaN. + Value maximum = 4; + + // Sets the field to the minimum of its current value and the given value. + // + // This must be an integer or a double value. + // If the field is not an integer or double, or if the field does not yet + // exist, the transformation will set the field to the input value. + // If a minimum operation is applied where the field and the input value + // are of mixed types (that is - one is an integer and one is a double) + // the field takes on the type of the smaller operand. If the operands are + // equivalent (e.g. 3 and 3.0), the field does not change. + // 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and + // zero input value is always the stored value. + // The minimum of any numeric value x and NaN is NaN. + Value minimum = 5; + // Append the given elements in order if they are not already present in // the current field value. // If the field is not an array, or if the field does not yet exist, it is diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index ccdfca220098..8d6d9c62361d 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -449,11 +449,21 @@ google-cloud-firestore 0.79.1-beta-SNAPSHOT
+ + com.google.api.grpc + proto-google-cloud-firestore-v1 + 0.44.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-firestore-v1beta1 0.44.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-firestore-v1 + 0.44.1-SNAPSHOT + com.google.api.grpc grpc-google-cloud-firestore-v1beta1 diff --git a/google-cloud-clients/google-cloud-firestore/pom.xml b/google-cloud-clients/google-cloud-firestore/pom.xml index a1a729b5f3a2..36b4eabe15ec 100644 --- a/google-cloud-clients/google-cloud-firestore/pom.xml +++ b/google-cloud-clients/google-cloud-firestore/pom.xml @@ -37,6 +37,10 @@ com.google.api api-common + + com.google.api.grpc + proto-google-cloud-firestore-v1 + com.google.api.grpc proto-google-cloud-firestore-v1beta1 @@ -46,6 +50,11 @@ auto-value provided + + com.google.api.grpc + grpc-google-cloud-firestore-v1 + test + com.google.api.grpc grpc-google-cloud-firestore-v1beta1 diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java new file mode 100644 index 000000000000..857ce007cb94 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java @@ -0,0 +1,1286 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.firestore.v1.stub.FirestoreStub; +import com.google.cloud.firestore.v1.stub.FirestoreStubSettings; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.CreateDocumentRequest; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.DocumentMask; +import com.google.firestore.v1.GetDocumentRequest; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListDocumentsRequest; +import com.google.firestore.v1.ListDocumentsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.Write; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The Cloud Firestore service. + * + *

This service exposes several types of comparable timestamps: + * + *

* `create_time` - The time at which a document was created. Changes only when a document + * is deleted, then re-created. Increases in a strict monotonic fashion. * `update_time` - The + * time at which a document was last updated. Changes every time a document is modified. Does not + * change when a write results in no modifications. Increases in a strict monotonic fashion. * + * `read_time` - The time at which a particular state was observed. Used to denote a consistent + * snapshot of the database or the time at which a Document was observed to not exist. * + * `commit_time` - The time at which the writes in a transaction were committed. Any read with an + * equal or greater `read_time` is guaranteed to see the effects of the transaction. + * + *

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

+ * 
+ * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+ *   Document document = Document.newBuilder().build();
+ *   DocumentMask updateMask = DocumentMask.newBuilder().build();
+ *   Document response = firestoreClient.updateDocument(document, updateMask);
+ * }
+ * 
+ * 
+ * + *

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

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

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

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

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

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

To customize credentials: + * + *

+ * 
+ * FirestoreSettings firestoreSettings =
+ *     FirestoreSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * FirestoreClient firestoreClient =
+ *     FirestoreClient.create(firestoreSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * FirestoreSettings firestoreSettings =
+ *     FirestoreSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FirestoreClient firestoreClient =
+ *     FirestoreClient.create(firestoreSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FirestoreClient implements BackgroundResource { + private final FirestoreSettings settings; + private final FirestoreStub stub; + + private static final PathTemplate DATABASE_ROOT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/databases/{database}"); + + private static final PathTemplate DOCUMENT_ROOT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/databases/{database}/documents"); + + private static final PathTemplate DOCUMENT_PATH_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/documents/{document_path=**}"); + + private static final PathTemplate ANY_PATH_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/documents/{document}/{any_path=**}"); + + /** Formats a string containing the fully-qualified path to represent a database_root resource. */ + public static final String formatDatabaseRootName(String project, String database) { + return DATABASE_ROOT_PATH_TEMPLATE.instantiate( + "project", project, + "database", database); + } + + /** Formats a string containing the fully-qualified path to represent a document_root resource. */ + public static final String formatDocumentRootName(String project, String database) { + return DOCUMENT_ROOT_PATH_TEMPLATE.instantiate( + "project", project, + "database", database); + } + + /** Formats a string containing the fully-qualified path to represent a document_path resource. */ + public static final String formatDocumentPathName( + String project, String database, String documentPath) { + return DOCUMENT_PATH_PATH_TEMPLATE.instantiate( + "project", project, + "database", database, + "document_path", documentPath); + } + + /** Formats a string containing the fully-qualified path to represent a any_path resource. */ + public static final String formatAnyPathName( + String project, String database, String document, String anyPath) { + return ANY_PATH_PATH_TEMPLATE.instantiate( + "project", project, + "database", database, + "document", document, + "any_path", anyPath); + } + + /** + * Parses the project from the given fully-qualified path which represents a database_root + * resource. + */ + public static final String parseProjectFromDatabaseRootName(String databaseRootName) { + return DATABASE_ROOT_PATH_TEMPLATE.parse(databaseRootName).get("project"); + } + + /** + * Parses the database from the given fully-qualified path which represents a database_root + * resource. + */ + public static final String parseDatabaseFromDatabaseRootName(String databaseRootName) { + return DATABASE_ROOT_PATH_TEMPLATE.parse(databaseRootName).get("database"); + } + + /** + * Parses the project from the given fully-qualified path which represents a document_root + * resource. + */ + public static final String parseProjectFromDocumentRootName(String documentRootName) { + return DOCUMENT_ROOT_PATH_TEMPLATE.parse(documentRootName).get("project"); + } + + /** + * Parses the database from the given fully-qualified path which represents a document_root + * resource. + */ + public static final String parseDatabaseFromDocumentRootName(String documentRootName) { + return DOCUMENT_ROOT_PATH_TEMPLATE.parse(documentRootName).get("database"); + } + + /** + * Parses the project from the given fully-qualified path which represents a document_path + * resource. + */ + public static final String parseProjectFromDocumentPathName(String documentPathName) { + return DOCUMENT_PATH_PATH_TEMPLATE.parse(documentPathName).get("project"); + } + + /** + * Parses the database from the given fully-qualified path which represents a document_path + * resource. + */ + public static final String parseDatabaseFromDocumentPathName(String documentPathName) { + return DOCUMENT_PATH_PATH_TEMPLATE.parse(documentPathName).get("database"); + } + + /** + * Parses the document_path from the given fully-qualified path which represents a document_path + * resource. + */ + public static final String parseDocumentPathFromDocumentPathName(String documentPathName) { + return DOCUMENT_PATH_PATH_TEMPLATE.parse(documentPathName).get("document_path"); + } + + /** + * Parses the project from the given fully-qualified path which represents a any_path resource. + */ + public static final String parseProjectFromAnyPathName(String anyPathName) { + return ANY_PATH_PATH_TEMPLATE.parse(anyPathName).get("project"); + } + + /** + * Parses the database from the given fully-qualified path which represents a any_path resource. + */ + public static final String parseDatabaseFromAnyPathName(String anyPathName) { + return ANY_PATH_PATH_TEMPLATE.parse(anyPathName).get("database"); + } + + /** + * Parses the document from the given fully-qualified path which represents a any_path resource. + */ + public static final String parseDocumentFromAnyPathName(String anyPathName) { + return ANY_PATH_PATH_TEMPLATE.parse(anyPathName).get("document"); + } + + /** + * Parses the any_path from the given fully-qualified path which represents a any_path resource. + */ + public static final String parseAnyPathFromAnyPathName(String anyPathName) { + return ANY_PATH_PATH_TEMPLATE.parse(anyPathName).get("any_path"); + } + + /** Constructs an instance of FirestoreClient with default settings. */ + public static final FirestoreClient create() throws IOException { + return create(FirestoreSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FirestoreClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final FirestoreClient create(FirestoreSettings settings) throws IOException { + return new FirestoreClient(settings); + } + + /** + * Constructs an instance of FirestoreClient, using the given stub for making calls. This is for + * advanced usage - prefer to use FirestoreSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final FirestoreClient create(FirestoreStub stub) { + return new FirestoreClient(stub); + } + + /** + * Constructs an instance of FirestoreClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected FirestoreClient(FirestoreSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FirestoreStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected FirestoreClient(FirestoreStub stub) { + this.settings = null; + this.stub = stub; + } + + public final FirestoreSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FirestoreStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a single document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   GetDocumentRequest request = GetDocumentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Document response = firestoreClient.getDocument(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Document getDocument(GetDocumentRequest request) { + return getDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a single document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   GetDocumentRequest request = GetDocumentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Document> future = firestoreClient.getDocumentCallable().futureCall(request);
+   *   // Do something
+   *   Document response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getDocumentCallable() { + return stub.getDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists documents. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   String collectionId = "";
+   *   ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCollectionId(collectionId)
+   *     .build();
+   *   for (Document element : firestoreClient.listDocuments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest request) { + return listDocumentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists documents. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   String collectionId = "";
+   *   ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCollectionId(collectionId)
+   *     .build();
+   *   ApiFuture<ListDocumentsPagedResponse> future = firestoreClient.listDocumentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Document element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDocumentsPagedCallable() { + return stub.listDocumentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists documents. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   String collectionId = "";
+   *   ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCollectionId(collectionId)
+   *     .build();
+   *   while (true) {
+   *     ListDocumentsResponse response = firestoreClient.listDocumentsCallable().call(request);
+   *     for (Document element : response.getDocumentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listDocumentsCallable() { + return stub.listDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   String collectionId = "";
+   *   String documentId = "";
+   *   Document document = Document.newBuilder().build();
+   *   CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCollectionId(collectionId)
+   *     .setDocumentId(documentId)
+   *     .setDocument(document)
+   *     .build();
+   *   Document response = firestoreClient.createDocument(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Document createDocument(CreateDocumentRequest request) { + return createDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   String collectionId = "";
+   *   String documentId = "";
+   *   Document document = Document.newBuilder().build();
+   *   CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setCollectionId(collectionId)
+   *     .setDocumentId(documentId)
+   *     .setDocument(document)
+   *     .build();
+   *   ApiFuture<Document> future = firestoreClient.createDocumentCallable().futureCall(request);
+   *   // Do something
+   *   Document response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createDocumentCallable() { + return stub.createDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates or inserts a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   Document document = Document.newBuilder().build();
+   *   DocumentMask updateMask = DocumentMask.newBuilder().build();
+   *   Document response = firestoreClient.updateDocument(document, updateMask);
+   * }
+   * 
+ * + * @param document The updated document. Creates the document if it does not already exist. + * @param updateMask The fields to update. None of the field paths in the mask may contain a + * reserved name. + *

If the document exists on the server and has fields not referenced in the mask, they are + * left unchanged. Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Document updateDocument(Document document, DocumentMask updateMask) { + + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder().setDocument(document).setUpdateMask(updateMask).build(); + return updateDocument(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates or inserts a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   Document document = Document.newBuilder().build();
+   *   DocumentMask updateMask = DocumentMask.newBuilder().build();
+   *   UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder()
+   *     .setDocument(document)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Document response = firestoreClient.updateDocument(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Document updateDocument(UpdateDocumentRequest request) { + return updateDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates or inserts a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   Document document = Document.newBuilder().build();
+   *   DocumentMask updateMask = DocumentMask.newBuilder().build();
+   *   UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder()
+   *     .setDocument(document)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Document> future = firestoreClient.updateDocumentCallable().futureCall(request);
+   *   // Do something
+   *   Document response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateDocumentCallable() { + return stub.updateDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   firestoreClient.deleteDocument(formattedName);
+   * }
+   * 
+ * + * @param name The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDocument(String name) { + ANY_PATH_PATH_TEMPLATE.validate(name, "deleteDocument"); + DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build(); + deleteDocument(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   firestoreClient.deleteDocument(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDocument(DeleteDocumentRequest request) { + deleteDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = firestoreClient.deleteDocumentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteDocumentCallable() { + return stub.deleteDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets multiple documents. + * + *

Documents returned by this method are not guaranteed to be returned in the same order that + * they were requested. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   List<String> documents = new ArrayList<>();
+   *   BatchGetDocumentsRequest request = BatchGetDocumentsRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .addAllDocuments(documents)
+   *     .build();
+   *
+   *   ServerStream<BatchGetDocumentsResponse> stream = firestoreClient.batchGetDocumentsCallable().call(request);
+   *   for (BatchGetDocumentsResponse response : stream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final ServerStreamingCallable + batchGetDocumentsCallable() { + return stub.batchGetDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts a new transaction. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   BeginTransactionResponse response = firestoreClient.beginTransaction(formattedDatabase);
+   * }
+   * 
+ * + * @param database The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BeginTransactionResponse beginTransaction(String database) { + DATABASE_ROOT_PATH_TEMPLATE.validate(database, "beginTransaction"); + BeginTransactionRequest request = + BeginTransactionRequest.newBuilder().setDatabase(database).build(); + return beginTransaction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts a new transaction. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   BeginTransactionRequest request = BeginTransactionRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .build();
+   *   BeginTransactionResponse response = firestoreClient.beginTransaction(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BeginTransactionResponse beginTransaction(BeginTransactionRequest request) { + return beginTransactionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts a new transaction. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   BeginTransactionRequest request = BeginTransactionRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .build();
+   *   ApiFuture<BeginTransactionResponse> future = firestoreClient.beginTransactionCallable().futureCall(request);
+   *   // Do something
+   *   BeginTransactionResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + beginTransactionCallable() { + return stub.beginTransactionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits a transaction, while optionally updating documents. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   List<Write> writes = new ArrayList<>();
+   *   CommitResponse response = firestoreClient.commit(formattedDatabase, writes);
+   * }
+   * 
+ * + * @param database The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param writes The writes to apply. + *

Always executed atomically and in order. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CommitResponse commit(String database, List writes) { + DATABASE_ROOT_PATH_TEMPLATE.validate(database, "commit"); + CommitRequest request = + CommitRequest.newBuilder().setDatabase(database).addAllWrites(writes).build(); + return commit(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits a transaction, while optionally updating documents. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   List<Write> writes = new ArrayList<>();
+   *   CommitRequest request = CommitRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .addAllWrites(writes)
+   *     .build();
+   *   CommitResponse response = firestoreClient.commit(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CommitResponse commit(CommitRequest request) { + return commitCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits a transaction, while optionally updating documents. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   List<Write> writes = new ArrayList<>();
+   *   CommitRequest request = CommitRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .addAllWrites(writes)
+   *     .build();
+   *   ApiFuture<CommitResponse> future = firestoreClient.commitCallable().futureCall(request);
+   *   // Do something
+   *   CommitResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable commitCallable() { + return stub.commitCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back a transaction. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   ByteString transaction = ByteString.copyFromUtf8("");
+   *   firestoreClient.rollback(formattedDatabase, transaction);
+   * }
+   * 
+ * + * @param database The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param transaction The transaction to roll back. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void rollback(String database, ByteString transaction) { + DATABASE_ROOT_PATH_TEMPLATE.validate(database, "rollback"); + RollbackRequest request = + RollbackRequest.newBuilder().setDatabase(database).setTransaction(transaction).build(); + rollback(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back a transaction. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   ByteString transaction = ByteString.copyFromUtf8("");
+   *   RollbackRequest request = RollbackRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .setTransaction(transaction)
+   *     .build();
+   *   firestoreClient.rollback(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void rollback(RollbackRequest request) { + rollbackCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back a transaction. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   ByteString transaction = ByteString.copyFromUtf8("");
+   *   RollbackRequest request = RollbackRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .setTransaction(transaction)
+   *     .build();
+   *   ApiFuture<Void> future = firestoreClient.rollbackCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable rollbackCallable() { + return stub.rollbackCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs a query. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   RunQueryRequest request = RunQueryRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *
+   *   ServerStream<RunQueryResponse> stream = firestoreClient.runQueryCallable().call(request);
+   *   for (RunQueryResponse response : stream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final ServerStreamingCallable runQueryCallable() { + return stub.runQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Streams batches of document updates and deletes, in order. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   BidiStream<WriteRequest, WriteResponse> bidiStream =
+   *       firestoreClient.writeCallable().call();
+   *
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   WriteRequest request = WriteRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .build();
+   *   bidiStream.send(request);
+   *   for (WriteResponse response : bidiStream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final BidiStreamingCallable writeCallable() { + return stub.writeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Listens to changes. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   BidiStream<ListenRequest, ListenResponse> bidiStream =
+   *       firestoreClient.listenCallable().call();
+   *
+   *   String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]");
+   *   ListenRequest request = ListenRequest.newBuilder()
+   *     .setDatabase(formattedDatabase)
+   *     .build();
+   *   bidiStream.send(request);
+   *   for (ListenResponse response : bidiStream) {
+   *     // Do something when receive a response
+   *   }
+   * }
+   * 
+ */ + public final BidiStreamingCallable listenCallable() { + return stub.listenCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the collection IDs underneath a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   for (String element : firestoreClient.listCollectionIds(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCollectionIdsPagedResponse listCollectionIds(String parent) { + ANY_PATH_PATH_TEMPLATE.validate(parent, "listCollectionIds"); + ListCollectionIdsRequest request = + ListCollectionIdsRequest.newBuilder().setParent(parent).build(); + return listCollectionIds(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the collection IDs underneath a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   ListCollectionIdsRequest request = ListCollectionIdsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (String element : firestoreClient.listCollectionIds(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCollectionIdsPagedResponse listCollectionIds(ListCollectionIdsRequest request) { + return listCollectionIdsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the collection IDs underneath a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   ListCollectionIdsRequest request = ListCollectionIdsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListCollectionIdsPagedResponse> future = firestoreClient.listCollectionIdsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (String element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCollectionIdsPagedCallable() { + return stub.listCollectionIdsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the collection IDs underneath a document. + * + *

Sample code: + * + *


+   * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+   *   String formattedParent = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+   *   ListCollectionIdsRequest request = ListCollectionIdsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListCollectionIdsResponse response = firestoreClient.listCollectionIdsCallable().call(request);
+   *     for (String element : response.getCollectionIdsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCollectionIdsCallable() { + return stub.listCollectionIdsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListDocumentsPagedResponse + extends AbstractPagedListResponse< + ListDocumentsRequest, + ListDocumentsResponse, + Document, + ListDocumentsPage, + ListDocumentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDocumentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListDocumentsPagedResponse apply(ListDocumentsPage input) { + return new ListDocumentsPagedResponse(input); + } + }); + } + + private ListDocumentsPagedResponse(ListDocumentsPage page) { + super(page, ListDocumentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDocumentsPage + extends AbstractPage< + ListDocumentsRequest, ListDocumentsResponse, Document, ListDocumentsPage> { + + private ListDocumentsPage( + PageContext context, + ListDocumentsResponse response) { + super(context, response); + } + + private static ListDocumentsPage createEmptyPage() { + return new ListDocumentsPage(null, null); + } + + @Override + protected ListDocumentsPage createPage( + PageContext context, + ListDocumentsResponse response) { + return new ListDocumentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDocumentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDocumentsRequest, + ListDocumentsResponse, + Document, + ListDocumentsPage, + ListDocumentsFixedSizeCollection> { + + private ListDocumentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDocumentsFixedSizeCollection createEmptyCollection() { + return new ListDocumentsFixedSizeCollection(null, 0); + } + + @Override + protected ListDocumentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDocumentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCollectionIdsPagedResponse + extends AbstractPagedListResponse< + ListCollectionIdsRequest, + ListCollectionIdsResponse, + String, + ListCollectionIdsPage, + ListCollectionIdsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCollectionIdsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListCollectionIdsPagedResponse apply(ListCollectionIdsPage input) { + return new ListCollectionIdsPagedResponse(input); + } + }); + } + + private ListCollectionIdsPagedResponse(ListCollectionIdsPage page) { + super(page, ListCollectionIdsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCollectionIdsPage + extends AbstractPage< + ListCollectionIdsRequest, ListCollectionIdsResponse, String, ListCollectionIdsPage> { + + private ListCollectionIdsPage( + PageContext context, + ListCollectionIdsResponse response) { + super(context, response); + } + + private static ListCollectionIdsPage createEmptyPage() { + return new ListCollectionIdsPage(null, null); + } + + @Override + protected ListCollectionIdsPage createPage( + PageContext context, + ListCollectionIdsResponse response) { + return new ListCollectionIdsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCollectionIdsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCollectionIdsRequest, + ListCollectionIdsResponse, + String, + ListCollectionIdsPage, + ListCollectionIdsFixedSizeCollection> { + + private ListCollectionIdsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCollectionIdsFixedSizeCollection createEmptyCollection() { + return new ListCollectionIdsFixedSizeCollection(null, 0); + } + + @Override + protected ListCollectionIdsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCollectionIdsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreSettings.java new file mode 100644 index 000000000000..d8e2230087e1 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreSettings.java @@ -0,0 +1,334 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1; + +import static com.google.cloud.firestore.v1.FirestoreClient.ListCollectionIdsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreClient.ListDocumentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.firestore.v1.stub.FirestoreStubSettings; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.CreateDocumentRequest; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.GetDocumentRequest; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListDocumentsRequest; +import com.google.firestore.v1.ListDocumentsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link FirestoreClient}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of updateDocument to 30 seconds: + * + *

+ * 
+ * FirestoreSettings.Builder firestoreSettingsBuilder =
+ *     FirestoreSettings.newBuilder();
+ * firestoreSettingsBuilder.updateDocumentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * FirestoreSettings firestoreSettings = firestoreSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FirestoreSettings extends ClientSettings { + /** Returns the object with the settings used for calls to getDocument. */ + public UnaryCallSettings getDocumentSettings() { + return ((FirestoreStubSettings) getStubSettings()).getDocumentSettings(); + } + + /** Returns the object with the settings used for calls to listDocuments. */ + public PagedCallSettings + listDocumentsSettings() { + return ((FirestoreStubSettings) getStubSettings()).listDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to createDocument. */ + public UnaryCallSettings createDocumentSettings() { + return ((FirestoreStubSettings) getStubSettings()).createDocumentSettings(); + } + + /** Returns the object with the settings used for calls to updateDocument. */ + public UnaryCallSettings updateDocumentSettings() { + return ((FirestoreStubSettings) getStubSettings()).updateDocumentSettings(); + } + + /** Returns the object with the settings used for calls to deleteDocument. */ + public UnaryCallSettings deleteDocumentSettings() { + return ((FirestoreStubSettings) getStubSettings()).deleteDocumentSettings(); + } + + /** Returns the object with the settings used for calls to batchGetDocuments. */ + public ServerStreamingCallSettings + batchGetDocumentsSettings() { + return ((FirestoreStubSettings) getStubSettings()).batchGetDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to beginTransaction. */ + public UnaryCallSettings + beginTransactionSettings() { + return ((FirestoreStubSettings) getStubSettings()).beginTransactionSettings(); + } + + /** Returns the object with the settings used for calls to commit. */ + public UnaryCallSettings commitSettings() { + return ((FirestoreStubSettings) getStubSettings()).commitSettings(); + } + + /** Returns the object with the settings used for calls to rollback. */ + public UnaryCallSettings rollbackSettings() { + return ((FirestoreStubSettings) getStubSettings()).rollbackSettings(); + } + + /** Returns the object with the settings used for calls to runQuery. */ + public ServerStreamingCallSettings runQuerySettings() { + return ((FirestoreStubSettings) getStubSettings()).runQuerySettings(); + } + + /** Returns the object with the settings used for calls to write. */ + public StreamingCallSettings writeSettings() { + return ((FirestoreStubSettings) getStubSettings()).writeSettings(); + } + + /** Returns the object with the settings used for calls to listen. */ + public StreamingCallSettings listenSettings() { + return ((FirestoreStubSettings) getStubSettings()).listenSettings(); + } + + /** Returns the object with the settings used for calls to listCollectionIds. */ + public PagedCallSettings< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + listCollectionIdsSettings() { + return ((FirestoreStubSettings) getStubSettings()).listCollectionIdsSettings(); + } + + public static final FirestoreSettings create(FirestoreStubSettings stub) throws IOException { + return new FirestoreSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FirestoreStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FirestoreStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FirestoreStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FirestoreStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FirestoreStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FirestoreStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FirestoreStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FirestoreSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FirestoreSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(FirestoreStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(FirestoreStubSettings.newBuilder()); + } + + protected Builder(FirestoreSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FirestoreStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public FirestoreStubSettings.Builder getStubSettingsBuilder() { + return ((FirestoreStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getDocument. */ + public UnaryCallSettings.Builder getDocumentSettings() { + return getStubSettingsBuilder().getDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to listDocuments. */ + public PagedCallSettings.Builder< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings() { + return getStubSettingsBuilder().listDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to createDocument. */ + public UnaryCallSettings.Builder createDocumentSettings() { + return getStubSettingsBuilder().createDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to updateDocument. */ + public UnaryCallSettings.Builder updateDocumentSettings() { + return getStubSettingsBuilder().updateDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDocument. */ + public UnaryCallSettings.Builder deleteDocumentSettings() { + return getStubSettingsBuilder().deleteDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to batchGetDocuments. */ + public ServerStreamingCallSettings.Builder + batchGetDocumentsSettings() { + return getStubSettingsBuilder().batchGetDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to beginTransaction. */ + public UnaryCallSettings.Builder + beginTransactionSettings() { + return getStubSettingsBuilder().beginTransactionSettings(); + } + + /** Returns the builder for the settings used for calls to commit. */ + public UnaryCallSettings.Builder commitSettings() { + return getStubSettingsBuilder().commitSettings(); + } + + /** Returns the builder for the settings used for calls to rollback. */ + public UnaryCallSettings.Builder rollbackSettings() { + return getStubSettingsBuilder().rollbackSettings(); + } + + /** Returns the builder for the settings used for calls to runQuery. */ + public ServerStreamingCallSettings.Builder + runQuerySettings() { + return getStubSettingsBuilder().runQuerySettings(); + } + + /** Returns the builder for the settings used for calls to write. */ + public StreamingCallSettings.Builder writeSettings() { + return getStubSettingsBuilder().writeSettings(); + } + + /** Returns the builder for the settings used for calls to listen. */ + public StreamingCallSettings.Builder listenSettings() { + return getStubSettingsBuilder().listenSettings(); + } + + /** Returns the builder for the settings used for calls to listCollectionIds. */ + public PagedCallSettings.Builder< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + listCollectionIdsSettings() { + return getStubSettingsBuilder().listCollectionIdsSettings(); + } + + @Override + public FirestoreSettings build() throws IOException { + return new FirestoreSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/package-info.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/package-info.java new file mode 100644 index 000000000000..c52cb4c02565 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/package-info.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + +/** + * A client to Google Cloud Firestore API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

=============== FirestoreClient =============== + * + *

Service Description: The Cloud Firestore service. + * + *

This service exposes several types of comparable timestamps: + * + *

* `create_time` - The time at which a document was created. Changes only when a document + * is deleted, then re-created. Increases in a strict monotonic fashion. * `update_time` - The + * time at which a document was last updated. Changes every time a document is modified. Does not + * change when a write results in no modifications. Increases in a strict monotonic fashion. * + * `read_time` - The time at which a particular state was observed. Used to denote a consistent + * snapshot of the database or the time at which a Document was observed to not exist. * + * `commit_time` - The time at which the writes in a transaction were committed. Any read with an + * equal or greater `read_time` is guaranteed to see the effects of the transaction. + * + *

Sample for FirestoreClient: + * + *

+ * 
+ * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
+ *   Document document = Document.newBuilder().build();
+ *   DocumentMask updateMask = DocumentMask.newBuilder().build();
+ *   Document response = firestoreClient.updateDocument(document, updateMask);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.firestore.v1; diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStub.java new file mode 100644 index 000000000000..f694cd9e4463 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStub.java @@ -0,0 +1,128 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1.stub; + +import static com.google.cloud.firestore.v1.FirestoreClient.ListCollectionIdsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreClient.ListDocumentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.CreateDocumentRequest; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.GetDocumentRequest; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListDocumentsRequest; +import com.google.firestore.v1.ListDocumentsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Cloud Firestore API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class FirestoreStub implements BackgroundResource { + + public UnaryCallable getDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: getDocumentCallable()"); + } + + public UnaryCallable + listDocumentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDocumentsPagedCallable()"); + } + + public UnaryCallable listDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: listDocumentsCallable()"); + } + + public UnaryCallable createDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: createDocumentCallable()"); + } + + public UnaryCallable updateDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: updateDocumentCallable()"); + } + + public UnaryCallable deleteDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDocumentCallable()"); + } + + public ServerStreamingCallable + batchGetDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: batchGetDocumentsCallable()"); + } + + public UnaryCallable + beginTransactionCallable() { + throw new UnsupportedOperationException("Not implemented: beginTransactionCallable()"); + } + + public UnaryCallable commitCallable() { + throw new UnsupportedOperationException("Not implemented: commitCallable()"); + } + + public UnaryCallable rollbackCallable() { + throw new UnsupportedOperationException("Not implemented: rollbackCallable()"); + } + + public ServerStreamingCallable runQueryCallable() { + throw new UnsupportedOperationException("Not implemented: runQueryCallable()"); + } + + public BidiStreamingCallable writeCallable() { + throw new UnsupportedOperationException("Not implemented: writeCallable()"); + } + + public BidiStreamingCallable listenCallable() { + throw new UnsupportedOperationException("Not implemented: listenCallable()"); + } + + public UnaryCallable + listCollectionIdsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCollectionIdsPagedCallable()"); + } + + public UnaryCallable + listCollectionIdsCallable() { + throw new UnsupportedOperationException("Not implemented: listCollectionIdsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java new file mode 100644 index 000000000000..ca5e47a0b981 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java @@ -0,0 +1,707 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1.stub; + +import static com.google.cloud.firestore.v1.FirestoreClient.ListCollectionIdsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreClient.ListDocumentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.CreateDocumentRequest; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.GetDocumentRequest; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListDocumentsRequest; +import com.google.firestore.v1.ListDocumentsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link FirestoreStub}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of updateDocument to 30 seconds: + * + *

+ * 
+ * FirestoreStubSettings.Builder firestoreSettingsBuilder =
+ *     FirestoreStubSettings.newBuilder();
+ * firestoreSettingsBuilder.updateDocumentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * FirestoreStubSettings firestoreSettings = firestoreSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FirestoreStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/datastore") + .build(); + + private final UnaryCallSettings getDocumentSettings; + private final PagedCallSettings< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings; + private final UnaryCallSettings createDocumentSettings; + private final UnaryCallSettings updateDocumentSettings; + private final UnaryCallSettings deleteDocumentSettings; + private final ServerStreamingCallSettings + batchGetDocumentsSettings; + private final UnaryCallSettings + beginTransactionSettings; + private final UnaryCallSettings commitSettings; + private final UnaryCallSettings rollbackSettings; + private final ServerStreamingCallSettings runQuerySettings; + private final StreamingCallSettings writeSettings; + private final StreamingCallSettings listenSettings; + private final PagedCallSettings< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + listCollectionIdsSettings; + + /** Returns the object with the settings used for calls to getDocument. */ + public UnaryCallSettings getDocumentSettings() { + return getDocumentSettings; + } + + /** Returns the object with the settings used for calls to listDocuments. */ + public PagedCallSettings + listDocumentsSettings() { + return listDocumentsSettings; + } + + /** Returns the object with the settings used for calls to createDocument. */ + public UnaryCallSettings createDocumentSettings() { + return createDocumentSettings; + } + + /** Returns the object with the settings used for calls to updateDocument. */ + public UnaryCallSettings updateDocumentSettings() { + return updateDocumentSettings; + } + + /** Returns the object with the settings used for calls to deleteDocument. */ + public UnaryCallSettings deleteDocumentSettings() { + return deleteDocumentSettings; + } + + /** Returns the object with the settings used for calls to batchGetDocuments. */ + public ServerStreamingCallSettings + batchGetDocumentsSettings() { + return batchGetDocumentsSettings; + } + + /** Returns the object with the settings used for calls to beginTransaction. */ + public UnaryCallSettings + beginTransactionSettings() { + return beginTransactionSettings; + } + + /** Returns the object with the settings used for calls to commit. */ + public UnaryCallSettings commitSettings() { + return commitSettings; + } + + /** Returns the object with the settings used for calls to rollback. */ + public UnaryCallSettings rollbackSettings() { + return rollbackSettings; + } + + /** Returns the object with the settings used for calls to runQuery. */ + public ServerStreamingCallSettings runQuerySettings() { + return runQuerySettings; + } + + /** Returns the object with the settings used for calls to write. */ + public StreamingCallSettings writeSettings() { + return writeSettings; + } + + /** Returns the object with the settings used for calls to listen. */ + public StreamingCallSettings listenSettings() { + return listenSettings; + } + + /** Returns the object with the settings used for calls to listCollectionIds. */ + public PagedCallSettings< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + listCollectionIdsSettings() { + return listCollectionIdsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FirestoreStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFirestoreStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "firestore.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(FirestoreStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FirestoreStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getDocumentSettings = settingsBuilder.getDocumentSettings().build(); + listDocumentsSettings = settingsBuilder.listDocumentsSettings().build(); + createDocumentSettings = settingsBuilder.createDocumentSettings().build(); + updateDocumentSettings = settingsBuilder.updateDocumentSettings().build(); + deleteDocumentSettings = settingsBuilder.deleteDocumentSettings().build(); + batchGetDocumentsSettings = settingsBuilder.batchGetDocumentsSettings().build(); + beginTransactionSettings = settingsBuilder.beginTransactionSettings().build(); + commitSettings = settingsBuilder.commitSettings().build(); + rollbackSettings = settingsBuilder.rollbackSettings().build(); + runQuerySettings = settingsBuilder.runQuerySettings().build(); + writeSettings = settingsBuilder.writeSettings().build(); + listenSettings = settingsBuilder.listenSettings().build(); + listCollectionIdsSettings = settingsBuilder.listCollectionIdsSettings().build(); + } + + private static final PagedListDescriptor + LIST_DOCUMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDocumentsRequest injectToken(ListDocumentsRequest payload, String token) { + return ListDocumentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDocumentsRequest injectPageSize(ListDocumentsRequest payload, int pageSize) { + return ListDocumentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDocumentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDocumentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDocumentsResponse payload) { + return payload.getDocumentsList() != null + ? payload.getDocumentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListCollectionIdsRequest, ListCollectionIdsResponse, String> + LIST_COLLECTION_IDS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCollectionIdsRequest injectToken( + ListCollectionIdsRequest payload, String token) { + return ListCollectionIdsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCollectionIdsRequest injectPageSize( + ListCollectionIdsRequest payload, int pageSize) { + return ListCollectionIdsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCollectionIdsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCollectionIdsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCollectionIdsResponse payload) { + return payload.getCollectionIdsList() != null + ? payload.getCollectionIdsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + LIST_DOCUMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDocumentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DOCUMENTS_PAGE_STR_DESC, request, context); + return ListDocumentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + LIST_COLLECTION_IDS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCollectionIdsRequest, + ListCollectionIdsResponse, + ListCollectionIdsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCollectionIdsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_COLLECTION_IDS_PAGE_STR_DESC, request, context); + return ListCollectionIdsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for FirestoreStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getDocumentSettings; + private final PagedCallSettings.Builder< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings; + private final UnaryCallSettings.Builder createDocumentSettings; + private final UnaryCallSettings.Builder updateDocumentSettings; + private final UnaryCallSettings.Builder deleteDocumentSettings; + private final ServerStreamingCallSettings.Builder< + BatchGetDocumentsRequest, BatchGetDocumentsResponse> + batchGetDocumentsSettings; + private final UnaryCallSettings.Builder + beginTransactionSettings; + private final UnaryCallSettings.Builder commitSettings; + private final UnaryCallSettings.Builder rollbackSettings; + private final ServerStreamingCallSettings.Builder + runQuerySettings; + private final StreamingCallSettings.Builder writeSettings; + private final StreamingCallSettings.Builder listenSettings; + private final PagedCallSettings.Builder< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + listCollectionIdsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("streaming", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listDocumentsSettings = PagedCallSettings.newBuilder(LIST_DOCUMENTS_PAGE_STR_FACT); + + createDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + batchGetDocumentsSettings = ServerStreamingCallSettings.newBuilder(); + + beginTransactionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + commitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + rollbackSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + runQuerySettings = ServerStreamingCallSettings.newBuilder(); + + writeSettings = StreamingCallSettings.newBuilder(); + + listenSettings = StreamingCallSettings.newBuilder(); + + listCollectionIdsSettings = PagedCallSettings.newBuilder(LIST_COLLECTION_IDS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getDocumentSettings, + listDocumentsSettings, + createDocumentSettings, + updateDocumentSettings, + deleteDocumentSettings, + beginTransactionSettings, + commitSettings, + rollbackSettings, + listCollectionIdsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .getDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .batchGetDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming")); + + builder + .beginTransactionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .commitSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .rollbackSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .runQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming")); + + builder + .listCollectionIdsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(FirestoreStubSettings settings) { + super(settings); + + getDocumentSettings = settings.getDocumentSettings.toBuilder(); + listDocumentsSettings = settings.listDocumentsSettings.toBuilder(); + createDocumentSettings = settings.createDocumentSettings.toBuilder(); + updateDocumentSettings = settings.updateDocumentSettings.toBuilder(); + deleteDocumentSettings = settings.deleteDocumentSettings.toBuilder(); + batchGetDocumentsSettings = settings.batchGetDocumentsSettings.toBuilder(); + beginTransactionSettings = settings.beginTransactionSettings.toBuilder(); + commitSettings = settings.commitSettings.toBuilder(); + rollbackSettings = settings.rollbackSettings.toBuilder(); + runQuerySettings = settings.runQuerySettings.toBuilder(); + writeSettings = settings.writeSettings.toBuilder(); + listenSettings = settings.listenSettings.toBuilder(); + listCollectionIdsSettings = settings.listCollectionIdsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getDocumentSettings, + listDocumentsSettings, + createDocumentSettings, + updateDocumentSettings, + deleteDocumentSettings, + beginTransactionSettings, + commitSettings, + rollbackSettings, + listCollectionIdsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getDocument. */ + public UnaryCallSettings.Builder getDocumentSettings() { + return getDocumentSettings; + } + + /** Returns the builder for the settings used for calls to listDocuments. */ + public PagedCallSettings.Builder< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings() { + return listDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to createDocument. */ + public UnaryCallSettings.Builder createDocumentSettings() { + return createDocumentSettings; + } + + /** Returns the builder for the settings used for calls to updateDocument. */ + public UnaryCallSettings.Builder updateDocumentSettings() { + return updateDocumentSettings; + } + + /** Returns the builder for the settings used for calls to deleteDocument. */ + public UnaryCallSettings.Builder deleteDocumentSettings() { + return deleteDocumentSettings; + } + + /** Returns the builder for the settings used for calls to batchGetDocuments. */ + public ServerStreamingCallSettings.Builder + batchGetDocumentsSettings() { + return batchGetDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to beginTransaction. */ + public UnaryCallSettings.Builder + beginTransactionSettings() { + return beginTransactionSettings; + } + + /** Returns the builder for the settings used for calls to commit. */ + public UnaryCallSettings.Builder commitSettings() { + return commitSettings; + } + + /** Returns the builder for the settings used for calls to rollback. */ + public UnaryCallSettings.Builder rollbackSettings() { + return rollbackSettings; + } + + /** Returns the builder for the settings used for calls to runQuery. */ + public ServerStreamingCallSettings.Builder + runQuerySettings() { + return runQuerySettings; + } + + /** Returns the builder for the settings used for calls to write. */ + public StreamingCallSettings.Builder writeSettings() { + return writeSettings; + } + + /** Returns the builder for the settings used for calls to listen. */ + public StreamingCallSettings.Builder listenSettings() { + return listenSettings; + } + + /** Returns the builder for the settings used for calls to listCollectionIds. */ + public PagedCallSettings.Builder< + ListCollectionIdsRequest, ListCollectionIdsResponse, ListCollectionIdsPagedResponse> + listCollectionIdsSettings() { + return listCollectionIdsSettings; + } + + @Override + public FirestoreStubSettings build() throws IOException { + return new FirestoreStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreCallableFactory.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreCallableFactory.java new file mode 100644 index 000000000000..da23496c10d7 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Google Cloud Firestore API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcFirestoreCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java new file mode 100644 index 000000000000..db590d114028 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreStub.java @@ -0,0 +1,446 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1.stub; + +import static com.google.cloud.firestore.v1.FirestoreClient.ListCollectionIdsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreClient.ListDocumentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.CreateDocumentRequest; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.GetDocumentRequest; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListDocumentsRequest; +import com.google.firestore.v1.ListDocumentsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Google Cloud Firestore API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcFirestoreStub extends FirestoreStub { + + private static final MethodDescriptor getDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/GetDocument") + .setRequestMarshaller(ProtoUtils.marshaller(GetDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/ListDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDocumentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/CreateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/UpdateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/DeleteDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + batchGetDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.firestore.v1.Firestore/BatchGetDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchGetDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchGetDocumentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + beginTransactionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/BeginTransaction") + .setRequestMarshaller( + ProtoUtils.marshaller(BeginTransactionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BeginTransactionResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor commitMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/Commit") + .setRequestMarshaller(ProtoUtils.marshaller(CommitRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CommitResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor rollbackMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/Rollback") + .setRequestMarshaller(ProtoUtils.marshaller(RollbackRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + runQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.firestore.v1.Firestore/RunQuery") + .setRequestMarshaller(ProtoUtils.marshaller(RunQueryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RunQueryResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor writeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.firestore.v1.Firestore/Write") + .setRequestMarshaller(ProtoUtils.marshaller(WriteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(WriteResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor listenMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.firestore.v1.Firestore/Listen") + .setRequestMarshaller(ProtoUtils.marshaller(ListenRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListenResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listCollectionIdsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.v1.Firestore/ListCollectionIds") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCollectionIdsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCollectionIdsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable getDocumentCallable; + private final UnaryCallable listDocumentsCallable; + private final UnaryCallable + listDocumentsPagedCallable; + private final UnaryCallable createDocumentCallable; + private final UnaryCallable updateDocumentCallable; + private final UnaryCallable deleteDocumentCallable; + private final ServerStreamingCallable + batchGetDocumentsCallable; + private final UnaryCallable + beginTransactionCallable; + private final UnaryCallable commitCallable; + private final UnaryCallable rollbackCallable; + private final ServerStreamingCallable runQueryCallable; + private final BidiStreamingCallable writeCallable; + private final BidiStreamingCallable listenCallable; + private final UnaryCallable + listCollectionIdsCallable; + private final UnaryCallable + listCollectionIdsPagedCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFirestoreStub create(FirestoreStubSettings settings) throws IOException { + return new GrpcFirestoreStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFirestoreStub create(ClientContext clientContext) throws IOException { + return new GrpcFirestoreStub(FirestoreStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFirestoreStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFirestoreStub( + FirestoreStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFirestoreStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcFirestoreStub(FirestoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcFirestoreCallableFactory()); + } + + /** + * Constructs an instance of GrpcFirestoreStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcFirestoreStub( + FirestoreStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings getDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDocumentMethodDescriptor) + .build(); + GrpcCallSettings listDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDocumentsMethodDescriptor) + .build(); + GrpcCallSettings createDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDocumentMethodDescriptor) + .build(); + GrpcCallSettings updateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentMethodDescriptor) + .build(); + GrpcCallSettings deleteDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentMethodDescriptor) + .build(); + GrpcCallSettings + batchGetDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchGetDocumentsMethodDescriptor) + .build(); + GrpcCallSettings + beginTransactionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(beginTransactionMethodDescriptor) + .build(); + GrpcCallSettings commitTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(commitMethodDescriptor) + .build(); + GrpcCallSettings rollbackTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rollbackMethodDescriptor) + .build(); + GrpcCallSettings runQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(runQueryMethodDescriptor) + .build(); + GrpcCallSettings writeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeMethodDescriptor) + .build(); + GrpcCallSettings listenTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listenMethodDescriptor) + .build(); + GrpcCallSettings + listCollectionIdsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCollectionIdsMethodDescriptor) + .build(); + + this.getDocumentCallable = + callableFactory.createUnaryCallable( + getDocumentTransportSettings, settings.getDocumentSettings(), clientContext); + this.listDocumentsCallable = + callableFactory.createUnaryCallable( + listDocumentsTransportSettings, settings.listDocumentsSettings(), clientContext); + this.listDocumentsPagedCallable = + callableFactory.createPagedCallable( + listDocumentsTransportSettings, settings.listDocumentsSettings(), clientContext); + this.createDocumentCallable = + callableFactory.createUnaryCallable( + createDocumentTransportSettings, settings.createDocumentSettings(), clientContext); + this.updateDocumentCallable = + callableFactory.createUnaryCallable( + updateDocumentTransportSettings, settings.updateDocumentSettings(), clientContext); + this.deleteDocumentCallable = + callableFactory.createUnaryCallable( + deleteDocumentTransportSettings, settings.deleteDocumentSettings(), clientContext); + this.batchGetDocumentsCallable = + callableFactory.createServerStreamingCallable( + batchGetDocumentsTransportSettings, + settings.batchGetDocumentsSettings(), + clientContext); + this.beginTransactionCallable = + callableFactory.createUnaryCallable( + beginTransactionTransportSettings, settings.beginTransactionSettings(), clientContext); + this.commitCallable = + callableFactory.createUnaryCallable( + commitTransportSettings, settings.commitSettings(), clientContext); + this.rollbackCallable = + callableFactory.createUnaryCallable( + rollbackTransportSettings, settings.rollbackSettings(), clientContext); + this.runQueryCallable = + callableFactory.createServerStreamingCallable( + runQueryTransportSettings, settings.runQuerySettings(), clientContext); + this.writeCallable = + callableFactory.createBidiStreamingCallable( + writeTransportSettings, settings.writeSettings(), clientContext); + this.listenCallable = + callableFactory.createBidiStreamingCallable( + listenTransportSettings, settings.listenSettings(), clientContext); + this.listCollectionIdsCallable = + callableFactory.createUnaryCallable( + listCollectionIdsTransportSettings, + settings.listCollectionIdsSettings(), + clientContext); + this.listCollectionIdsPagedCallable = + callableFactory.createPagedCallable( + listCollectionIdsTransportSettings, + settings.listCollectionIdsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable getDocumentCallable() { + return getDocumentCallable; + } + + public UnaryCallable + listDocumentsPagedCallable() { + return listDocumentsPagedCallable; + } + + public UnaryCallable listDocumentsCallable() { + return listDocumentsCallable; + } + + public UnaryCallable createDocumentCallable() { + return createDocumentCallable; + } + + public UnaryCallable updateDocumentCallable() { + return updateDocumentCallable; + } + + public UnaryCallable deleteDocumentCallable() { + return deleteDocumentCallable; + } + + public ServerStreamingCallable + batchGetDocumentsCallable() { + return batchGetDocumentsCallable; + } + + public UnaryCallable + beginTransactionCallable() { + return beginTransactionCallable; + } + + public UnaryCallable commitCallable() { + return commitCallable; + } + + public UnaryCallable rollbackCallable() { + return rollbackCallable; + } + + public ServerStreamingCallable runQueryCallable() { + return runQueryCallable; + } + + public BidiStreamingCallable writeCallable() { + return writeCallable; + } + + public BidiStreamingCallable listenCallable() { + return listenCallable; + } + + public UnaryCallable + listCollectionIdsPagedCallable() { + return listCollectionIdsPagedCallable; + } + + public UnaryCallable + listCollectionIdsCallable() { + return listCollectionIdsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java index 92a33b869b74..ce92bacdefb1 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java index 515086cc14a4..8c86d5837a36 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/FirestoreSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java index 4e93462f8892..def10566323a 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java index 55c699922b47..18fb6c73562d 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java index f268f755f881..95aabe47f306 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java index 7b6f475d801b..9dcce3a5cb64 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java index c53974584755..9df708eae781 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/GrpcFirestoreStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java new file mode 100644 index 000000000000..209551659f01 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java @@ -0,0 +1,561 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1; + +import static com.google.cloud.firestore.v1.FirestoreClient.ListCollectionIdsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.DocumentMask; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.Write; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class FirestoreClientTest { + private static MockFirestore mockFirestore; + private static MockServiceHelper serviceHelper; + private FirestoreClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockFirestore = new MockFirestore(); + serviceHelper = + new MockServiceHelper("in-process-1", Arrays.asList(mockFirestore)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + FirestoreSettings settings = + FirestoreSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FirestoreClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void updateDocumentTest() { + String name = "name3373707"; + Document expectedResponse = Document.newBuilder().setName(name).build(); + mockFirestore.addResponse(expectedResponse); + + Document document = Document.newBuilder().build(); + DocumentMask updateMask = DocumentMask.newBuilder().build(); + + Document actualResponse = client.updateDocument(document, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDocumentRequest actualRequest = (UpdateDocumentRequest) actualRequests.get(0); + + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + Document document = Document.newBuilder().build(); + DocumentMask updateMask = DocumentMask.newBuilder().build(); + + client.updateDocument(document, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteDocumentTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestore.addResponse(expectedResponse); + + String formattedName = + FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + + client.deleteDocument(formattedName); + + List actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentRequest actualRequest = (DeleteDocumentRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedName = + FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + + client.deleteDocument(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void batchGetDocumentsTest() throws Exception { + String missing = "missing1069449574"; + ByteString transaction = ByteString.copyFromUtf8("-34"); + BatchGetDocumentsResponse expectedResponse = + BatchGetDocumentsResponse.newBuilder() + .setMissing(missing) + .setTransaction(transaction) + .build(); + mockFirestore.addResponse(expectedResponse); + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + List documents = new ArrayList<>(); + BatchGetDocumentsRequest request = + BatchGetDocumentsRequest.newBuilder() + .setDatabase(formattedDatabase) + .addAllDocuments(documents) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.batchGetDocumentsCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void batchGetDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + List documents = new ArrayList<>(); + BatchGetDocumentsRequest request = + BatchGetDocumentsRequest.newBuilder() + .setDatabase(formattedDatabase) + .addAllDocuments(documents) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.batchGetDocumentsCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void beginTransactionTest() { + ByteString transaction = ByteString.copyFromUtf8("-34"); + BeginTransactionResponse expectedResponse = + BeginTransactionResponse.newBuilder().setTransaction(transaction).build(); + mockFirestore.addResponse(expectedResponse); + + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + + BeginTransactionResponse actualResponse = client.beginTransaction(formattedDatabase); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BeginTransactionRequest actualRequest = (BeginTransactionRequest) actualRequests.get(0); + + Assert.assertEquals(formattedDatabase, actualRequest.getDatabase()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void beginTransactionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + + client.beginTransaction(formattedDatabase); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void commitTest() { + CommitResponse expectedResponse = CommitResponse.newBuilder().build(); + mockFirestore.addResponse(expectedResponse); + + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + List writes = new ArrayList<>(); + + CommitResponse actualResponse = client.commit(formattedDatabase, writes); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CommitRequest actualRequest = (CommitRequest) actualRequests.get(0); + + Assert.assertEquals(formattedDatabase, actualRequest.getDatabase()); + Assert.assertEquals(writes, actualRequest.getWritesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void commitExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + List writes = new ArrayList<>(); + + client.commit(formattedDatabase, writes); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void rollbackTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestore.addResponse(expectedResponse); + + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + ByteString transaction = ByteString.copyFromUtf8("-34"); + + client.rollback(formattedDatabase, transaction); + + List actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RollbackRequest actualRequest = (RollbackRequest) actualRequests.get(0); + + Assert.assertEquals(formattedDatabase, actualRequest.getDatabase()); + Assert.assertEquals(transaction, actualRequest.getTransaction()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void rollbackExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + ByteString transaction = ByteString.copyFromUtf8("-34"); + + client.rollback(formattedDatabase, transaction); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void runQueryTest() throws Exception { + ByteString transaction = ByteString.copyFromUtf8("-34"); + int skippedResults = 880286183; + RunQueryResponse expectedResponse = + RunQueryResponse.newBuilder() + .setTransaction(transaction) + .setSkippedResults(skippedResults) + .build(); + mockFirestore.addResponse(expectedResponse); + String formattedParent = + FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + RunQueryRequest request = RunQueryRequest.newBuilder().setParent(formattedParent).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.runQueryCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void runQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + String formattedParent = + FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + RunQueryRequest request = RunQueryRequest.newBuilder().setParent(formattedParent).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.runQueryCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void writeTest() throws Exception { + String streamId = "streamId-315624902"; + ByteString streamToken = ByteString.copyFromUtf8("122"); + WriteResponse expectedResponse = + WriteResponse.newBuilder().setStreamId(streamId).setStreamToken(streamToken).build(); + mockFirestore.addResponse(expectedResponse); + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + WriteRequest request = WriteRequest.newBuilder().setDatabase(formattedDatabase).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.writeCallable(); + ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void writeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + WriteRequest request = WriteRequest.newBuilder().setDatabase(formattedDatabase).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.writeCallable(); + ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void listenTest() throws Exception { + ListenResponse expectedResponse = ListenResponse.newBuilder().build(); + mockFirestore.addResponse(expectedResponse); + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + ListenRequest request = ListenRequest.newBuilder().setDatabase(formattedDatabase).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.listenCallable(); + ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + @SuppressWarnings("all") + public void listenExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + String formattedDatabase = FirestoreClient.formatDatabaseRootName("[PROJECT]", "[DATABASE]"); + ListenRequest request = ListenRequest.newBuilder().setDatabase(formattedDatabase).build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.listenCallable(); + ApiStreamObserver requestObserver = callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void listCollectionIdsTest() { + String nextPageToken = ""; + String collectionIdsElement = "collectionIdsElement1368994900"; + List collectionIds = Arrays.asList(collectionIdsElement); + ListCollectionIdsResponse expectedResponse = + ListCollectionIdsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllCollectionIds(collectionIds) + .build(); + mockFirestore.addResponse(expectedResponse); + + String formattedParent = + FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + + ListCollectionIdsPagedResponse pagedListResponse = client.listCollectionIds(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCollectionIdsList().get(0), resources.get(0)); + + List actualRequests = mockFirestore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCollectionIdsRequest actualRequest = (ListCollectionIdsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listCollectionIdsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestore.addException(exception); + + try { + String formattedParent = + FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); + + client.listCollectionIds(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestore.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestore.java new file mode 100644 index 000000000000..9ba9ada0648a --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestore.java @@ -0,0 +1,57 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockFirestore implements MockGrpcService { + private final MockFirestoreImpl serviceImpl; + + public MockFirestore() { + serviceImpl = new MockFirestoreImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreImpl.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreImpl.java new file mode 100644 index 000000000000..3579eae07437 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreImpl.java @@ -0,0 +1,303 @@ +/* + * 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. + */ +package com.google.cloud.firestore.v1; + +import com.google.api.core.BetaApi; +import com.google.firestore.v1.BatchGetDocumentsRequest; +import com.google.firestore.v1.BatchGetDocumentsResponse; +import com.google.firestore.v1.BeginTransactionRequest; +import com.google.firestore.v1.BeginTransactionResponse; +import com.google.firestore.v1.CommitRequest; +import com.google.firestore.v1.CommitResponse; +import com.google.firestore.v1.CreateDocumentRequest; +import com.google.firestore.v1.DeleteDocumentRequest; +import com.google.firestore.v1.Document; +import com.google.firestore.v1.FirestoreGrpc.FirestoreImplBase; +import com.google.firestore.v1.GetDocumentRequest; +import com.google.firestore.v1.ListCollectionIdsRequest; +import com.google.firestore.v1.ListCollectionIdsResponse; +import com.google.firestore.v1.ListDocumentsRequest; +import com.google.firestore.v1.ListDocumentsResponse; +import com.google.firestore.v1.ListenRequest; +import com.google.firestore.v1.ListenResponse; +import com.google.firestore.v1.RollbackRequest; +import com.google.firestore.v1.RunQueryRequest; +import com.google.firestore.v1.RunQueryResponse; +import com.google.firestore.v1.UpdateDocumentRequest; +import com.google.firestore.v1.WriteRequest; +import com.google.firestore.v1.WriteResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockFirestoreImpl extends FirestoreImplBase { + private ArrayList requests; + private Queue responses; + + public MockFirestoreImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getDocument(GetDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext((Document) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listDocuments( + ListDocumentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListDocumentsResponse) { + requests.add(request); + responseObserver.onNext((ListDocumentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createDocument( + CreateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext((Document) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateDocument( + UpdateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext((Document) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteDocument( + DeleteDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void batchGetDocuments( + BatchGetDocumentsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BatchGetDocumentsResponse) { + requests.add(request); + responseObserver.onNext((BatchGetDocumentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void beginTransaction( + BeginTransactionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BeginTransactionResponse) { + requests.add(request); + responseObserver.onNext((BeginTransactionResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void commit(CommitRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CommitResponse) { + requests.add(request); + responseObserver.onNext((CommitResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void rollback(RollbackRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void runQuery(RunQueryRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof RunQueryResponse) { + requests.add(request); + responseObserver.onNext((RunQueryResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public StreamObserver write(final StreamObserver responseObserver) { + final Object response = responses.remove(); + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(WriteRequest value) { + if (response instanceof WriteResponse) { + responseObserver.onNext((WriteResponse) response); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver listen( + final StreamObserver responseObserver) { + final Object response = responses.remove(); + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(ListenRequest value) { + if (response instanceof ListenResponse) { + responseObserver.onNext((ListenResponse) response); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void listCollectionIds( + ListCollectionIdsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListCollectionIdsResponse) { + requests.add(request); + responseObserver.onNext((ListCollectionIdsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java index bccb45372718..192c4f271da2 100644 --- a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/FirestoreClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java index 5a06b34af2b9..bf2b9f821b67 100644 --- a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestore.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java index 4f3c3c27f415..e5c097e93730 100644 --- a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1beta1/MockFirestoreImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. diff --git a/google-cloud-clients/google-cloud-firestore/synth.py b/google-cloud-clients/google-cloud-firestore/synth.py index d110596733dc..9ba8a5ea2ae3 100644 --- a/google-cloud-clients/google-cloud-firestore/synth.py +++ b/google-cloud-clients/google-cloud-firestore/synth.py @@ -21,20 +21,33 @@ gapic = gcp.GAPICGenerator() service = 'firestore' -versions = ['v1beta1'] -config_pattern = '/google/firestore/artman_firestore.yaml' - -for version in versions: - library = gapic.java_library( - service=service, - version=version, - config_path=config_pattern.format(version=version), - artman_output_name='') - - s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') - s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') - s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') - - java.format_code('./src') - java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') - java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') +version='v1beta1' + +library = gapic.java_library( + service=service, + version='v1beta1', + config_path=f'/google/firestore/artman_firestore.yaml', + artman_output_name='') + +s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') +s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') +s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + +java.format_code('./src') +java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') +java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + +version='v1' +library = gapic.java_library( + service=service, + version='v1', + config_path=f'/google/firestore/artman_firestore_v1.yaml', + artman_output_name='') + +s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') +s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') +s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + +java.format_code('./src') +java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') +java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') \ No newline at end of file diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index 595bac9eafcb..4663faa0c1a3 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -792,7 +792,7 @@ Stub packages - com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner-admin-database.v1.stub:com.google.cloud.spanner-admin-instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner-admin-database.v1.stub:com.google.cloud.spanner-admin-instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages