From f275b1603225895e2673131191b4c15927e3bdcd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:32:16 +0000 Subject: [PATCH] feat: add new types ExplainOptions, ExplainMetrics, PlanSummary, ExecutionStats (#1608) - [ ] Regenerate this pull request now. feat: add ExplainOptions field to RunQueryRequest feat: add ExplainMetrics field to RunQueryResponse feat: add ExplainOptions field to RunAggregationQueryRequest feat: add ExplainMetrics field to RunAggregationQueryResponse PiperOrigin-RevId: 615158086 Source-Link: https://togithub.com/googleapis/googleapis/commit/dbd2d6de9fd7942c1d3507979eff666e37470e18 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/a1d5d019300d206989746addda921e21d1b02e82 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTFkNWQwMTkzMDBkMjA2OTg5NzQ2YWRkZGE5MjFlMjFkMWIwMmU4MiJ9 --- .../cloud/firestore/v1/FirestoreClient.java | 11 +- .../reflect-config.json | 72 + .../firestore/v1/FirestoreClientTest.java | 26 +- .../clirr-ignored-differences.xml | 30 + .../google/firestore/v1/ExecutionStats.java | 1305 +++++++++++++++++ .../firestore/v1/ExecutionStatsOrBuilder.java | 156 ++ .../google/firestore/v1/ExplainMetrics.java | 1014 +++++++++++++ .../firestore/v1/ExplainMetricsOrBuilder.java | 102 ++ .../google/firestore/v1/ExplainOptions.java | 557 +++++++ .../firestore/v1/ExplainOptionsOrBuilder.java | 45 + .../google/firestore/v1/FirestoreProto.java | 482 +++--- .../com/google/firestore/v1/PlanSummary.java | 1019 +++++++++++++ .../firestore/v1/PlanSummaryOrBuilder.java | 97 ++ .../firestore/v1/QueryProfileProto.java | 128 ++ .../v1/RunAggregationQueryRequest.java | 319 +++- .../RunAggregationQueryRequestOrBuilder.java | 44 + .../v1/RunAggregationQueryResponse.java | 294 ++++ .../RunAggregationQueryResponseOrBuilder.java | 41 + .../google/firestore/v1/RunQueryRequest.java | 319 +++- .../v1/RunQueryRequestOrBuilder.java | 44 + .../google/firestore/v1/RunQueryResponse.java | 294 ++++ .../v1/RunQueryResponseOrBuilder.java | 41 + .../proto/google/firestore/v1/firestore.proto | 19 + .../google/firestore/v1/query_profile.proto | 92 ++ 24 files changed, 6308 insertions(+), 243 deletions(-) create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummary.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java create mode 100644 proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java create mode 100644 proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java index ddc68f89d..95130776c 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java @@ -1107,7 +1107,11 @@ public final UnaryCallable rollbackCallable() { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (FirestoreClient firestoreClient = FirestoreClient.create()) { - * RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + * RunQueryRequest request = + * RunQueryRequest.newBuilder() + * .setParent("parent-995424086") + * .setExplainOptions(ExplainOptions.newBuilder().build()) + * .build(); * ServerStream stream = firestoreClient.runQueryCallable().call(request); * for (RunQueryResponse response : stream) { * // Do something when a response is received. @@ -1143,7 +1147,10 @@ public final ServerStreamingCallable runQuery * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (FirestoreClient firestoreClient = FirestoreClient.create()) { * RunAggregationQueryRequest request = - * RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + * RunAggregationQueryRequest.newBuilder() + * .setParent("parent-995424086") + * .setExplainOptions(ExplainOptions.newBuilder().build()) + * .build(); * ServerStream stream = * firestoreClient.runAggregationQueryCallable().call(request); * for (RunAggregationQueryResponse response : stream) { diff --git a/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json b/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json index 3ac840905..0fa7fcc55 100644 --- a/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json +++ b/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json @@ -854,6 +854,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.ExecutionStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExecutionStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.ExistenceFilter", "queryAllDeclaredConstructors": true, @@ -872,6 +890,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.ExplainMetrics", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExplainMetrics$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExplainOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ExplainOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.GetDocumentRequest", "queryAllDeclaredConstructors": true, @@ -1052,6 +1106,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.PlanSummary", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.PlanSummary$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.Precondition", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java index d89844502..885ebc7b9 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java @@ -47,6 +47,8 @@ import com.google.firestore.v1.DeleteDocumentRequest; import com.google.firestore.v1.Document; import com.google.firestore.v1.DocumentMask; +import com.google.firestore.v1.ExplainMetrics; +import com.google.firestore.v1.ExplainOptions; import com.google.firestore.v1.GetDocumentRequest; import com.google.firestore.v1.ListCollectionIdsRequest; import com.google.firestore.v1.ListCollectionIdsResponse; @@ -505,9 +507,14 @@ public void runQueryTest() throws Exception { .setDocument(Document.newBuilder().build()) .setReadTime(Timestamp.newBuilder().build()) .setSkippedResults(880286183) + .setExplainMetrics(ExplainMetrics.newBuilder().build()) .build(); mockFirestore.addResponse(expectedResponse); - RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunQueryRequest request = + RunQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -523,7 +530,11 @@ public void runQueryTest() throws Exception { public void runQueryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFirestore.addException(exception); - RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunQueryRequest request = + RunQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -547,10 +558,14 @@ public void runAggregationQueryTest() throws Exception { .setResult(AggregationResult.newBuilder().build()) .setTransaction(ByteString.EMPTY) .setReadTime(Timestamp.newBuilder().build()) + .setExplainMetrics(ExplainMetrics.newBuilder().build()) .build(); mockFirestore.addResponse(expectedResponse); RunAggregationQueryRequest request = - RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunAggregationQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -568,7 +583,10 @@ public void runAggregationQueryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFirestore.addException(exception); RunAggregationQueryRequest request = - RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunAggregationQueryRequest.newBuilder() + .setParent("parent-995424086") + .setExplainOptions(ExplainOptions.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); diff --git a/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml b/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml index c161a07f0..c060e41ba 100644 --- a/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml +++ b/proto-google-cloud-firestore-v1/clirr-ignored-differences.xml @@ -91,4 +91,34 @@ com/google/firestore/v1/Run*QueryResponse$Builder * mergeStats(*) + + 7012 + com/google/firestore/v1/Run*QueryRequestOrBuilder + com.google.firestore.v1.ExplainOptions getExplainOptions() + + + 7012 + com/google/firestore/v1/Run*QueryRequestOrBuilder + com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() + + + 7012 + com/google/firestore/v1/Run*QueryRequestOrBuilder + boolean hasExplainOptions() + + + 7012 + com/google/firestore/v1/Run*QueryResponseOrBuilder + com.google.firestore.v1.ExplainMetrics getExplainMetrics() + + + 7012 + com/google/firestore/v1/Run*QueryResponseOrBuilder + com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() + + + 7012 + com/google/firestore/v1/Run*QueryResponseOrBuilder + boolean hasExplainMetrics() + diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java new file mode 100644 index 000000000..3c3fd0a97 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStats.java @@ -0,0 +1,1305 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +/** + * + * + *
+ * Execution statistics for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExecutionStats} + */ +public final class ExecutionStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExecutionStats) + ExecutionStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecutionStats.newBuilder() to construct. + private ExecutionStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExecutionStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExecutionStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExecutionStats.class, + com.google.firestore.v1.ExecutionStats.Builder.class); + } + + private int bitField0_; + public static final int RESULTS_RETURNED_FIELD_NUMBER = 1; + private long resultsReturned_ = 0L; + /** + * + * + *
+   * Total number of results returned, including documents, projections,
+   * aggregation results, keys.
+   * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + @java.lang.Override + public long getResultsReturned() { + return resultsReturned_; + } + + public static final int EXECUTION_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration executionDuration_; + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + @java.lang.Override + public boolean hasExecutionDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getExecutionDuration() { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder() { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + + public static final int READ_OPERATIONS_FIELD_NUMBER = 4; + private long readOperations_ = 0L; + /** + * + * + *
+   * Total billable read operations.
+   * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + @java.lang.Override + public long getReadOperations() { + return readOperations_; + } + + public static final int DEBUG_STATS_FIELD_NUMBER = 5; + private com.google.protobuf.Struct debugStats_; + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + @java.lang.Override + public boolean hasDebugStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + @java.lang.Override + public com.google.protobuf.Struct getDebugStats() { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder() { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + + 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 (resultsReturned_ != 0L) { + output.writeInt64(1, resultsReturned_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getExecutionDuration()); + } + if (readOperations_ != 0L) { + output.writeInt64(4, readOperations_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getDebugStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resultsReturned_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, resultsReturned_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExecutionDuration()); + } + if (readOperations_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, readOperations_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDebugStats()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ExecutionStats)) { + return super.equals(obj); + } + com.google.firestore.v1.ExecutionStats other = (com.google.firestore.v1.ExecutionStats) obj; + + if (getResultsReturned() != other.getResultsReturned()) return false; + if (hasExecutionDuration() != other.hasExecutionDuration()) return false; + if (hasExecutionDuration()) { + if (!getExecutionDuration().equals(other.getExecutionDuration())) return false; + } + if (getReadOperations() != other.getReadOperations()) return false; + if (hasDebugStats() != other.hasDebugStats()) return false; + if (hasDebugStats()) { + if (!getDebugStats().equals(other.getDebugStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESULTS_RETURNED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResultsReturned()); + if (hasExecutionDuration()) { + hash = (37 * hash) + EXECUTION_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getExecutionDuration().hashCode(); + } + hash = (37 * hash) + READ_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadOperations()); + if (hasDebugStats()) { + hash = (37 * hash) + DEBUG_STATS_FIELD_NUMBER; + hash = (53 * hash) + getDebugStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExecutionStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExecutionStats 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.ExecutionStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExecutionStats 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.ExecutionStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExecutionStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExecutionStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExecutionStats 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.ExecutionStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExecutionStats 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.ExecutionStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExecutionStats 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.ExecutionStats 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; + } + /** + * + * + *
+   * Execution statistics for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExecutionStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExecutionStats) + com.google.firestore.v1.ExecutionStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExecutionStats.class, + com.google.firestore.v1.ExecutionStats.Builder.class); + } + + // Construct using com.google.firestore.v1.ExecutionStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExecutionDurationFieldBuilder(); + getDebugStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resultsReturned_ = 0L; + executionDuration_ = null; + if (executionDurationBuilder_ != null) { + executionDurationBuilder_.dispose(); + executionDurationBuilder_ = null; + } + readOperations_ = 0L; + debugStats_ = null; + if (debugStatsBuilder_ != null) { + debugStatsBuilder_.dispose(); + debugStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats getDefaultInstanceForType() { + return com.google.firestore.v1.ExecutionStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats build() { + com.google.firestore.v1.ExecutionStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats buildPartial() { + com.google.firestore.v1.ExecutionStats result = + new com.google.firestore.v1.ExecutionStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ExecutionStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resultsReturned_ = resultsReturned_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executionDuration_ = + executionDurationBuilder_ == null + ? executionDuration_ + : executionDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readOperations_ = readOperations_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.debugStats_ = debugStatsBuilder_ == null ? debugStats_ : debugStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ExecutionStats) { + return mergeFrom((com.google.firestore.v1.ExecutionStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExecutionStats other) { + if (other == com.google.firestore.v1.ExecutionStats.getDefaultInstance()) return this; + if (other.getResultsReturned() != 0L) { + setResultsReturned(other.getResultsReturned()); + } + if (other.hasExecutionDuration()) { + mergeExecutionDuration(other.getExecutionDuration()); + } + if (other.getReadOperations() != 0L) { + setReadOperations(other.getReadOperations()); + } + if (other.hasDebugStats()) { + mergeDebugStats(other.getDebugStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + resultsReturned_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage( + getExecutionDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + readOperations_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + input.readMessage(getDebugStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long resultsReturned_; + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + @java.lang.Override + public long getResultsReturned() { + return resultsReturned_; + } + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @param value The resultsReturned to set. + * @return This builder for chaining. + */ + public Builder setResultsReturned(long value) { + + resultsReturned_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @return This builder for chaining. + */ + public Builder clearResultsReturned() { + bitField0_ = (bitField0_ & ~0x00000001); + resultsReturned_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Duration executionDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + executionDurationBuilder_; + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + public boolean hasExecutionDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + public com.google.protobuf.Duration getExecutionDuration() { + if (executionDurationBuilder_ == null) { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } else { + return executionDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder setExecutionDuration(com.google.protobuf.Duration value) { + if (executionDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionDuration_ = value; + } else { + executionDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder setExecutionDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (executionDurationBuilder_ == null) { + executionDuration_ = builderForValue.build(); + } else { + executionDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder mergeExecutionDuration(com.google.protobuf.Duration value) { + if (executionDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && executionDuration_ != null + && executionDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getExecutionDurationBuilder().mergeFrom(value); + } else { + executionDuration_ = value; + } + } else { + executionDurationBuilder_.mergeFrom(value); + } + if (executionDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder clearExecutionDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + executionDuration_ = null; + if (executionDurationBuilder_ != null) { + executionDurationBuilder_.dispose(); + executionDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public com.google.protobuf.Duration.Builder getExecutionDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExecutionDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder() { + if (executionDurationBuilder_ != null) { + return executionDurationBuilder_.getMessageOrBuilder(); + } else { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getExecutionDurationFieldBuilder() { + if (executionDurationBuilder_ == null) { + executionDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getExecutionDuration(), getParentForChildren(), isClean()); + executionDuration_ = null; + } + return executionDurationBuilder_; + } + + private long readOperations_; + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + @java.lang.Override + public long getReadOperations() { + return readOperations_; + } + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @param value The readOperations to set. + * @return This builder for chaining. + */ + public Builder setReadOperations(long value) { + + readOperations_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @return This builder for chaining. + */ + public Builder clearReadOperations() { + bitField0_ = (bitField0_ & ~0x00000004); + readOperations_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Struct debugStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + debugStatsBuilder_; + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + public boolean hasDebugStats() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + public com.google.protobuf.Struct getDebugStats() { + if (debugStatsBuilder_ == null) { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } else { + return debugStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder setDebugStats(com.google.protobuf.Struct value) { + if (debugStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + debugStats_ = value; + } else { + debugStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder setDebugStats(com.google.protobuf.Struct.Builder builderForValue) { + if (debugStatsBuilder_ == null) { + debugStats_ = builderForValue.build(); + } else { + debugStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder mergeDebugStats(com.google.protobuf.Struct value) { + if (debugStatsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && debugStats_ != null + && debugStats_ != com.google.protobuf.Struct.getDefaultInstance()) { + getDebugStatsBuilder().mergeFrom(value); + } else { + debugStats_ = value; + } + } else { + debugStatsBuilder_.mergeFrom(value); + } + if (debugStats_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder clearDebugStats() { + bitField0_ = (bitField0_ & ~0x00000008); + debugStats_ = null; + if (debugStatsBuilder_ != null) { + debugStatsBuilder_.dispose(); + debugStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public com.google.protobuf.Struct.Builder getDebugStatsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDebugStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder() { + if (debugStatsBuilder_ != null) { + return debugStatsBuilder_.getMessageOrBuilder(); + } else { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDebugStatsFieldBuilder() { + if (debugStatsBuilder_ == null) { + debugStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getDebugStats(), getParentForChildren(), isClean()); + debugStats_ = null; + } + return debugStatsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ExecutionStats) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExecutionStats) + private static final com.google.firestore.v1.ExecutionStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExecutionStats(); + } + + public static com.google.firestore.v1.ExecutionStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecutionStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.v1.ExecutionStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java new file mode 100644 index 000000000..1694bea5f --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExecutionStatsOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface ExecutionStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExecutionStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Total number of results returned, including documents, projections,
+   * aggregation results, keys.
+   * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + long getResultsReturned(); + + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + boolean hasExecutionDuration(); + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + com.google.protobuf.Duration getExecutionDuration(); + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder(); + + /** + * + * + *
+   * Total billable read operations.
+   * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + long getReadOperations(); + + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + boolean hasDebugStats(); + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + com.google.protobuf.Struct getDebugStats(); + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java new file mode 100644 index 000000000..9f862e933 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetrics.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +/** + * + * + *
+ * Explain metrics for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainMetrics} + */ +public final class ExplainMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExplainMetrics) + ExplainMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainMetrics.newBuilder() to construct. + private ExplainMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainMetrics(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainMetrics.class, + com.google.firestore.v1.ExplainMetrics.Builder.class); + } + + private int bitField0_; + public static final int PLAN_SUMMARY_FIELD_NUMBER = 1; + private com.google.firestore.v1.PlanSummary planSummary_; + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + @java.lang.Override + public boolean hasPlanSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + @java.lang.Override + public com.google.firestore.v1.PlanSummary getPlanSummary() { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + @java.lang.Override + public com.google.firestore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder() { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + + public static final int EXECUTION_STATS_FIELD_NUMBER = 2; + private com.google.firestore.v1.ExecutionStats executionStats_; + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + @java.lang.Override + public boolean hasExecutionStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + @java.lang.Override + public com.google.firestore.v1.ExecutionStats getExecutionStats() { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + @java.lang.Override + public com.google.firestore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder() { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPlanSummary()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getExecutionStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPlanSummary()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExecutionStats()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ExplainMetrics)) { + return super.equals(obj); + } + com.google.firestore.v1.ExplainMetrics other = (com.google.firestore.v1.ExplainMetrics) obj; + + if (hasPlanSummary() != other.hasPlanSummary()) return false; + if (hasPlanSummary()) { + if (!getPlanSummary().equals(other.getPlanSummary())) return false; + } + if (hasExecutionStats() != other.hasExecutionStats()) return false; + if (hasExecutionStats()) { + if (!getExecutionStats().equals(other.getExecutionStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPlanSummary()) { + hash = (37 * hash) + PLAN_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getPlanSummary().hashCode(); + } + if (hasExecutionStats()) { + hash = (37 * hash) + EXECUTION_STATS_FIELD_NUMBER; + hash = (53 * hash) + getExecutionStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainMetrics 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.ExplainMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainMetrics 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.ExplainMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExplainMetrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainMetrics 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.ExplainMetrics parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainMetrics 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.ExplainMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainMetrics 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.ExplainMetrics 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; + } + /** + * + * + *
+   * Explain metrics for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExplainMetrics) + com.google.firestore.v1.ExplainMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainMetrics.class, + com.google.firestore.v1.ExplainMetrics.Builder.class); + } + + // Construct using com.google.firestore.v1.ExplainMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPlanSummaryFieldBuilder(); + getExecutionStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + planSummary_ = null; + if (planSummaryBuilder_ != null) { + planSummaryBuilder_.dispose(); + planSummaryBuilder_ = null; + } + executionStats_ = null; + if (executionStatsBuilder_ != null) { + executionStatsBuilder_.dispose(); + executionStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getDefaultInstanceForType() { + return com.google.firestore.v1.ExplainMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics build() { + com.google.firestore.v1.ExplainMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics buildPartial() { + com.google.firestore.v1.ExplainMetrics result = + new com.google.firestore.v1.ExplainMetrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ExplainMetrics result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.planSummary_ = + planSummaryBuilder_ == null ? planSummary_ : planSummaryBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executionStats_ = + executionStatsBuilder_ == null ? executionStats_ : executionStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ExplainMetrics) { + return mergeFrom((com.google.firestore.v1.ExplainMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExplainMetrics other) { + if (other == com.google.firestore.v1.ExplainMetrics.getDefaultInstance()) return this; + if (other.hasPlanSummary()) { + mergePlanSummary(other.getPlanSummary()); + } + if (other.hasExecutionStats()) { + mergeExecutionStats(other.getExecutionStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPlanSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExecutionStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.firestore.v1.PlanSummary planSummary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.PlanSummary, + com.google.firestore.v1.PlanSummary.Builder, + com.google.firestore.v1.PlanSummaryOrBuilder> + planSummaryBuilder_; + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + public boolean hasPlanSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + public com.google.firestore.v1.PlanSummary getPlanSummary() { + if (planSummaryBuilder_ == null) { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } else { + return planSummaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder setPlanSummary(com.google.firestore.v1.PlanSummary value) { + if (planSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + planSummary_ = value; + } else { + planSummaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder setPlanSummary(com.google.firestore.v1.PlanSummary.Builder builderForValue) { + if (planSummaryBuilder_ == null) { + planSummary_ = builderForValue.build(); + } else { + planSummaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder mergePlanSummary(com.google.firestore.v1.PlanSummary value) { + if (planSummaryBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && planSummary_ != null + && planSummary_ != com.google.firestore.v1.PlanSummary.getDefaultInstance()) { + getPlanSummaryBuilder().mergeFrom(value); + } else { + planSummary_ = value; + } + } else { + planSummaryBuilder_.mergeFrom(value); + } + if (planSummary_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public Builder clearPlanSummary() { + bitField0_ = (bitField0_ & ~0x00000001); + planSummary_ = null; + if (planSummaryBuilder_ != null) { + planSummaryBuilder_.dispose(); + planSummaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public com.google.firestore.v1.PlanSummary.Builder getPlanSummaryBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPlanSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + public com.google.firestore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder() { + if (planSummaryBuilder_ != null) { + return planSummaryBuilder_.getMessageOrBuilder(); + } else { + return planSummary_ == null + ? com.google.firestore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.PlanSummary, + com.google.firestore.v1.PlanSummary.Builder, + com.google.firestore.v1.PlanSummaryOrBuilder> + getPlanSummaryFieldBuilder() { + if (planSummaryBuilder_ == null) { + planSummaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.PlanSummary, + com.google.firestore.v1.PlanSummary.Builder, + com.google.firestore.v1.PlanSummaryOrBuilder>( + getPlanSummary(), getParentForChildren(), isClean()); + planSummary_ = null; + } + return planSummaryBuilder_; + } + + private com.google.firestore.v1.ExecutionStats executionStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExecutionStats, + com.google.firestore.v1.ExecutionStats.Builder, + com.google.firestore.v1.ExecutionStatsOrBuilder> + executionStatsBuilder_; + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + public boolean hasExecutionStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + public com.google.firestore.v1.ExecutionStats getExecutionStats() { + if (executionStatsBuilder_ == null) { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } else { + return executionStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder setExecutionStats(com.google.firestore.v1.ExecutionStats value) { + if (executionStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionStats_ = value; + } else { + executionStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder setExecutionStats( + com.google.firestore.v1.ExecutionStats.Builder builderForValue) { + if (executionStatsBuilder_ == null) { + executionStats_ = builderForValue.build(); + } else { + executionStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder mergeExecutionStats(com.google.firestore.v1.ExecutionStats value) { + if (executionStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && executionStats_ != null + && executionStats_ != com.google.firestore.v1.ExecutionStats.getDefaultInstance()) { + getExecutionStatsBuilder().mergeFrom(value); + } else { + executionStats_ = value; + } + } else { + executionStatsBuilder_.mergeFrom(value); + } + if (executionStats_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public Builder clearExecutionStats() { + bitField0_ = (bitField0_ & ~0x00000002); + executionStats_ = null; + if (executionStatsBuilder_ != null) { + executionStatsBuilder_.dispose(); + executionStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public com.google.firestore.v1.ExecutionStats.Builder getExecutionStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExecutionStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + public com.google.firestore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder() { + if (executionStatsBuilder_ != null) { + return executionStatsBuilder_.getMessageOrBuilder(); + } else { + return executionStats_ == null + ? com.google.firestore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExecutionStats, + com.google.firestore.v1.ExecutionStats.Builder, + com.google.firestore.v1.ExecutionStatsOrBuilder> + getExecutionStatsFieldBuilder() { + if (executionStatsBuilder_ == null) { + executionStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExecutionStats, + com.google.firestore.v1.ExecutionStats.Builder, + com.google.firestore.v1.ExecutionStatsOrBuilder>( + getExecutionStats(), getParentForChildren(), isClean()); + executionStats_ = null; + } + return executionStatsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ExplainMetrics) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExplainMetrics) + private static final com.google.firestore.v1.ExplainMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExplainMetrics(); + } + + public static com.google.firestore.v1.ExplainMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainMetrics parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java new file mode 100644 index 000000000..ba5a87f0f --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainMetricsOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface ExplainMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExplainMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + boolean hasPlanSummary(); + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + com.google.firestore.v1.PlanSummary getPlanSummary(); + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.firestore.v1.PlanSummary plan_summary = 1; + */ + com.google.firestore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder(); + + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + boolean hasExecutionStats(); + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + com.google.firestore.v1.ExecutionStats getExecutionStats(); + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + com.google.firestore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java new file mode 100644 index 000000000..82c242b89 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptions.java @@ -0,0 +1,557 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +/** + * + * + *
+ * Explain options for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainOptions} + */ +public final class ExplainOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ExplainOptions) + ExplainOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainOptions.newBuilder() to construct. + private ExplainOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainOptions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainOptions.class, + com.google.firestore.v1.ExplainOptions.Builder.class); + } + + public static final int ANALYZE_FIELD_NUMBER = 1; + private boolean analyze_ = false; + /** + * + * + *
+   * Optional. Whether to execute this query.
+   *
+   * When false (the default), the query will be planned, returning only
+   * metrics from the planning stages.
+   *
+   * When true, the query will be planned and executed, returning the full
+   * query results along with both planning and execution stage metrics.
+   * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + @java.lang.Override + public boolean getAnalyze() { + return analyze_; + } + + 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 (analyze_ != false) { + output.writeBool(1, analyze_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (analyze_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, analyze_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ExplainOptions)) { + return super.equals(obj); + } + com.google.firestore.v1.ExplainOptions other = (com.google.firestore.v1.ExplainOptions) obj; + + if (getAnalyze() != other.getAnalyze()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANALYZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAnalyze()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ExplainOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainOptions 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.ExplainOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainOptions 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.ExplainOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ExplainOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ExplainOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainOptions 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.ExplainOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainOptions 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.ExplainOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ExplainOptions 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.ExplainOptions 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; + } + /** + * + * + *
+   * Explain options for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ExplainOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ExplainOptions) + com.google.firestore.v1.ExplainOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ExplainOptions.class, + com.google.firestore.v1.ExplainOptions.Builder.class); + } + + // Construct using com.google.firestore.v1.ExplainOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + analyze_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getDefaultInstanceForType() { + return com.google.firestore.v1.ExplainOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions build() { + com.google.firestore.v1.ExplainOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions buildPartial() { + com.google.firestore.v1.ExplainOptions result = + new com.google.firestore.v1.ExplainOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ExplainOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.analyze_ = analyze_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ExplainOptions) { + return mergeFrom((com.google.firestore.v1.ExplainOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ExplainOptions other) { + if (other == com.google.firestore.v1.ExplainOptions.getDefaultInstance()) return this; + if (other.getAnalyze() != false) { + setAnalyze(other.getAnalyze()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + analyze_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean analyze_; + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + @java.lang.Override + public boolean getAnalyze() { + return analyze_; + } + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The analyze to set. + * @return This builder for chaining. + */ + public Builder setAnalyze(boolean value) { + + analyze_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAnalyze() { + bitField0_ = (bitField0_ & ~0x00000001); + analyze_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ExplainOptions) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ExplainOptions) + private static final com.google.firestore.v1.ExplainOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ExplainOptions(); + } + + public static com.google.firestore.v1.ExplainOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java new file mode 100644 index 000000000..2acb95c56 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ExplainOptionsOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface ExplainOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ExplainOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Whether to execute this query.
+   *
+   * When false (the default), the query will be planned, returning only
+   * metrics from the planning stages.
+   *
+   * When true, the query will be planned and executed, returning the full
+   * query results along with both planning and execution stage metrics.
+   * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + boolean getAnalyze(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java index 8c94b976f..ca42c2a2c 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java @@ -180,241 +180,248 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "tore/v1/aggregation_result.proto\032 google" + "/firestore/v1/common.proto\032\"google/fires" + "tore/v1/document.proto\032\037google/firestore" - + "/v1/query.proto\032\037google/firestore/v1/wri" - + "te.proto\032\033google/protobuf/empty.proto\032\037g" - + "oogle/protobuf/timestamp.proto\032\036google/p" - + "rotobuf/wrappers.proto\032\027google/rpc/statu" - + "s.proto\"\270\001\n\022GetDocumentRequest\022\021\n\004name\030\001" - + " \001(\tB\003\340A\002\022/\n\004mask\030\002 \001(\0132!.google.firesto" - + "re.v1.DocumentMask\022\025\n\013transaction\030\003 \001(\014H" - + "\000\022/\n\tread_time\030\005 \001(\0132\032.google.protobuf.T" - + "imestampH\000B\026\n\024consistency_selector\"\273\002\n\024L" - + "istDocumentsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002" - + "\022\032\n\rcollection_id\030\002 \001(\tB\003\340A\001\022\026\n\tpage_siz" - + "e\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\022\025\n" - + "\010order_by\030\006 \001(\tB\003\340A\001\0224\n\004mask\030\007 \001(\0132!.goo" - + "gle.firestore.v1.DocumentMaskB\003\340A\001\022\025\n\013tr" - + "ansaction\030\010 \001(\014H\000\022/\n\tread_time\030\n \001(\0132\032.g" - + "oogle.protobuf.TimestampH\000\022\024\n\014show_missi" - + "ng\030\014 \001(\010B\026\n\024consistency_selector\"b\n\025List" - + "DocumentsResponse\0220\n\tdocuments\030\001 \003(\0132\035.g" - + "oogle.firestore.v1.Document\022\027\n\017next_page" - + "_token\030\002 \001(\t\"\304\001\n\025CreateDocumentRequest\022\023" - + "\n\006parent\030\001 \001(\tB\003\340A\002\022\032\n\rcollection_id\030\002 \001" - + "(\tB\003\340A\002\022\023\n\013document_id\030\003 \001(\t\0224\n\010document" - + "\030\004 \001(\0132\035.google.firestore.v1.DocumentB\003\340" - + "A\002\022/\n\004mask\030\005 \001(\0132!.google.firestore.v1.D" - + "ocumentMask\"\363\001\n\025UpdateDocumentRequest\0224\n" - + "\010document\030\001 \001(\0132\035.google.firestore.v1.Do" - + "cumentB\003\340A\002\0226\n\013update_mask\030\002 \001(\0132!.googl" - + "e.firestore.v1.DocumentMask\022/\n\004mask\030\003 \001(" - + "\0132!.google.firestore.v1.DocumentMask\022;\n\020" - + "current_document\030\004 \001(\0132!.google.firestor" - + "e.v1.Precondition\"g\n\025DeleteDocumentReque" - + "st\022\021\n\004name\030\001 \001(\tB\003\340A\002\022;\n\020current_documen" - + "t\030\002 \001(\0132!.google.firestore.v1.Preconditi" - + "on\"\231\002\n\030BatchGetDocumentsRequest\022\025\n\010datab" - + "ase\030\001 \001(\tB\003\340A\002\022\021\n\tdocuments\030\002 \003(\t\022/\n\004mas" - + "k\030\003 \001(\0132!.google.firestore.v1.DocumentMa" - + "sk\022\025\n\013transaction\030\004 \001(\014H\000\022B\n\017new_transac" - + "tion\030\005 \001(\0132\'.google.firestore.v1.Transac" - + "tionOptionsH\000\022/\n\tread_time\030\007 \001(\0132\032.googl" - + "e.protobuf.TimestampH\000B\026\n\024consistency_se" - + "lector\"\254\001\n\031BatchGetDocumentsResponse\022.\n\005" - + "found\030\001 \001(\0132\035.google.firestore.v1.Docume" - + "ntH\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.protobu" - + "f.TimestampB\010\n\006result\"j\n\027BeginTransactio" - + "nRequest\022\025\n\010database\030\001 \001(\tB\003\340A\002\0228\n\007optio" - + "ns\030\002 \001(\0132\'.google.firestore.v1.Transacti" - + "onOptions\"/\n\030BeginTransactionResponse\022\023\n" - + "\013transaction\030\001 \001(\014\"g\n\rCommitRequest\022\025\n\010d" - + "atabase\030\001 \001(\tB\003\340A\002\022*\n\006writes\030\002 \003(\0132\032.goo" - + "gle.firestore.v1.Write\022\023\n\013transaction\030\003 " - + "\001(\014\"z\n\016CommitResponse\0227\n\rwrite_results\030\001" - + " \003(\0132 .google.firestore.v1.WriteResult\022/" - + "\n\013commit_time\030\002 \001(\0132\032.google.protobuf.Ti" - + "mestamp\"B\n\017RollbackRequest\022\025\n\010database\030\001" - + " \001(\tB\003\340A\002\022\030\n\013transaction\030\002 \001(\014B\003\340A\002\"\232\002\n\017" - + "RunQueryRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022@\n\020" - + "structured_query\030\002 \001(\0132$.google.firestor" - + "e.v1.StructuredQueryH\000\022\025\n\013transaction\030\005 " - + "\001(\014H\001\022B\n\017new_transaction\030\006 \001(\0132\'.google." - + "firestore.v1.TransactionOptionsH\001\022/\n\trea" - + "d_time\030\007 \001(\0132\032.google.protobuf.Timestamp" - + "H\001B\014\n\nquery_typeB\026\n\024consistency_selector" - + "\"\311\001\n\020RunQueryResponse\022\023\n\013transaction\030\002 \001" - + "(\014\022/\n\010document\030\001 \001(\0132\035.google.firestore." - + "v1.Document\022-\n\tread_time\030\003 \001(\0132\032.google." - + "protobuf.Timestamp\022\027\n\017skipped_results\030\004 " - + "\001(\005\022\016\n\004done\030\006 \001(\010H\000B\027\n\025continuation_sele" - + "ctor\"\274\002\n\032RunAggregationQueryRequest\022\023\n\006p" - + "arent\030\001 \001(\tB\003\340A\002\022W\n\034structured_aggregati" - + "on_query\030\002 \001(\0132/.google.firestore.v1.Str" - + "ucturedAggregationQueryH\000\022\025\n\013transaction" - + "\030\004 \001(\014H\001\022B\n\017new_transaction\030\005 \001(\0132\'.goog" - + "le.firestore.v1.TransactionOptionsH\001\022/\n\t" - + "read_time\030\006 \001(\0132\032.google.protobuf.Timest" - + "ampH\001B\014\n\nquery_typeB\026\n\024consistency_selec" - + "tor\"\231\001\n\033RunAggregationQueryResponse\0226\n\006r" - + "esult\030\001 \001(\0132&.google.firestore.v1.Aggreg" - + "ationResult\022\023\n\013transaction\030\002 \001(\014\022-\n\tread" - + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" - + "\205\002\n\025PartitionQueryRequest\022\023\n\006parent\030\001 \001(" - + "\tB\003\340A\002\022@\n\020structured_query\030\002 \001(\0132$.googl" - + "e.firestore.v1.StructuredQueryH\000\022\027\n\017part" - + "ition_count\030\003 \001(\003\022\022\n\npage_token\030\004 \001(\t\022\021\n" - + "\tpage_size\030\005 \001(\005\022/\n\tread_time\030\006 \001(\0132\032.go" - + "ogle.protobuf.TimestampH\001B\014\n\nquery_typeB" - + "\026\n\024consistency_selector\"b\n\026PartitionQuer" - + "yResponse\022/\n\npartitions\030\001 \003(\0132\033.google.f" - + "irestore.v1.Cursor\022\027\n\017next_page_token\030\002 " - + "\001(\t\"\350\001\n\014WriteRequest\022\025\n\010database\030\001 \001(\tB\003" - + "\340A\002\022\021\n\tstream_id\030\002 \001(\t\022*\n\006writes\030\003 \003(\0132\032" - + ".google.firestore.v1.Write\022\024\n\014stream_tok" - + "en\030\004 \001(\014\022=\n\006labels\030\005 \003(\0132-.google.firest" - + "ore.v1.WriteRequest.LabelsEntry\032-\n\013Label" - + "sEntry\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\014s" - + "tream_token\030\002 \001(\014\0227\n\rwrite_results\030\003 \003(\013" - + "2 .google.firestore.v1.WriteResult\022/\n\013co" - + "mmit_time\030\004 \001(\0132\032.google.protobuf.Timest" - + "amp\"\362\001\n\rListenRequest\022\025\n\010database\030\001 \001(\tB" - + "\003\340A\002\0221\n\nadd_target\030\002 \001(\0132\033.google.firest" - + "ore.v1.TargetH\000\022\027\n\rremove_target\030\003 \001(\005H\000" - + "\022>\n\006labels\030\004 \003(\0132..google.firestore.v1.L" - + "istenRequest.LabelsEntry\032-\n\013LabelsEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\017\n\rtarge" - + "t_change\"\325\002\n\016ListenResponse\022:\n\rtarget_ch" - + "ange\030\002 \001(\0132!.google.firestore.v1.TargetC" - + "hangeH\000\022>\n\017document_change\030\003 \001(\0132#.googl" - + "e.firestore.v1.DocumentChangeH\000\022>\n\017docum" - + "ent_delete\030\004 \001(\0132#.google.firestore.v1.D" - + "ocumentDeleteH\000\022>\n\017document_remove\030\006 \001(\013" - + "2#.google.firestore.v1.DocumentRemoveH\000\022" - + "6\n\006filter\030\005 \001(\0132$.google.firestore.v1.Ex" - + "istenceFilterH\000B\017\n\rresponse_type\"\326\003\n\006Tar" - + "get\0228\n\005query\030\002 \001(\0132\'.google.firestore.v1" - + ".Target.QueryTargetH\000\022@\n\tdocuments\030\003 \001(\013" - + "2+.google.firestore.v1.Target.DocumentsT" - + "argetH\000\022\026\n\014resume_token\030\004 \001(\014H\001\022/\n\tread_" - + "time\030\013 \001(\0132\032.google.protobuf.TimestampH\001" - + "\022\021\n\ttarget_id\030\005 \001(\005\022\014\n\004once\030\006 \001(\010\0223\n\016exp" - + "ected_count\030\014 \001(\0132\033.google.protobuf.Int3" - + "2Value\032$\n\017DocumentsTarget\022\021\n\tdocuments\030\002" - + " \003(\t\032m\n\013QueryTarget\022\016\n\006parent\030\001 \001(\t\022@\n\020s" - + "tructured_query\030\002 \001(\0132$.google.firestore" - + ".v1.StructuredQueryH\000B\014\n\nquery_typeB\r\n\013t" - + "arget_typeB\r\n\013resume_type\"\252\002\n\014TargetChan" - + "ge\022N\n\022target_change_type\030\001 \001(\01622.google." - + "firestore.v1.TargetChange.TargetChangeTy" - + "pe\022\022\n\ntarget_ids\030\002 \003(\005\022!\n\005cause\030\003 \001(\0132\022." - + "google.rpc.Status\022\024\n\014resume_token\030\004 \001(\014\022" - + "-\n\tread_time\030\006 \001(\0132\032.google.protobuf.Tim" - + "estamp\"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\005R" - + "ESET\020\004\"\237\001\n\030ListCollectionIdsRequest\022\023\n\006p" - + "arent\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" - + "age_token\030\003 \001(\t\022/\n\tread_time\030\004 \001(\0132\032.goo" - + "gle.protobuf.TimestampH\000B\026\n\024consistency_" - + "selector\"L\n\031ListCollectionIdsResponse\022\026\n" - + "\016collection_ids\030\001 \003(\t\022\027\n\017next_page_token" - + "\030\002 \001(\t\"\311\001\n\021BatchWriteRequest\022\025\n\010database" - + "\030\001 \001(\tB\003\340A\002\022*\n\006writes\030\002 \003(\0132\032.google.fir" - + "estore.v1.Write\022B\n\006labels\030\003 \003(\01322.google" - + ".firestore.v1.BatchWriteRequest.LabelsEn" + + "/v1/query.proto\032\'google/firestore/v1/que" + + "ry_profile.proto\032\037google/firestore/v1/wr" + + "ite.proto\032\033google/protobuf/empty.proto\032\037" + + "google/protobuf/timestamp.proto\032\036google/" + + "protobuf/wrappers.proto\032\027google/rpc/stat" + + "us.proto\"\270\001\n\022GetDocumentRequest\022\021\n\004name\030" + + "\001 \001(\tB\003\340A\002\022/\n\004mask\030\002 \001(\0132!.google.firest" + + "ore.v1.DocumentMask\022\025\n\013transaction\030\003 \001(\014" + + "H\000\022/\n\tread_time\030\005 \001(\0132\032.google.protobuf." + + "TimestampH\000B\026\n\024consistency_selector\"\273\002\n\024" + + "ListDocumentsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A" + + "\002\022\032\n\rcollection_id\030\002 \001(\tB\003\340A\001\022\026\n\tpage_si" + + "ze\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\022\025" + + "\n\010order_by\030\006 \001(\tB\003\340A\001\0224\n\004mask\030\007 \001(\0132!.go" + + "ogle.firestore.v1.DocumentMaskB\003\340A\001\022\025\n\013t" + + "ransaction\030\010 \001(\014H\000\022/\n\tread_time\030\n \001(\0132\032." + + "google.protobuf.TimestampH\000\022\024\n\014show_miss" + + "ing\030\014 \001(\010B\026\n\024consistency_selector\"b\n\025Lis" + + "tDocumentsResponse\0220\n\tdocuments\030\001 \003(\0132\035." + + "google.firestore.v1.Document\022\027\n\017next_pag" + + "e_token\030\002 \001(\t\"\304\001\n\025CreateDocumentRequest\022" + + "\023\n\006parent\030\001 \001(\tB\003\340A\002\022\032\n\rcollection_id\030\002 " + + "\001(\tB\003\340A\002\022\023\n\013document_id\030\003 \001(\t\0224\n\010documen" + + "t\030\004 \001(\0132\035.google.firestore.v1.DocumentB\003" + + "\340A\002\022/\n\004mask\030\005 \001(\0132!.google.firestore.v1." + + "DocumentMask\"\363\001\n\025UpdateDocumentRequest\0224" + + "\n\010document\030\001 \001(\0132\035.google.firestore.v1.D" + + "ocumentB\003\340A\002\0226\n\013update_mask\030\002 \001(\0132!.goog" + + "le.firestore.v1.DocumentMask\022/\n\004mask\030\003 \001" + + "(\0132!.google.firestore.v1.DocumentMask\022;\n" + + "\020current_document\030\004 \001(\0132!.google.firesto" + + "re.v1.Precondition\"g\n\025DeleteDocumentRequ" + + "est\022\021\n\004name\030\001 \001(\tB\003\340A\002\022;\n\020current_docume" + + "nt\030\002 \001(\0132!.google.firestore.v1.Precondit" + + "ion\"\231\002\n\030BatchGetDocumentsRequest\022\025\n\010data" + + "base\030\001 \001(\tB\003\340A\002\022\021\n\tdocuments\030\002 \003(\t\022/\n\004ma" + + "sk\030\003 \001(\0132!.google.firestore.v1.DocumentM" + + "ask\022\025\n\013transaction\030\004 \001(\014H\000\022B\n\017new_transa" + + "ction\030\005 \001(\0132\'.google.firestore.v1.Transa" + + "ctionOptionsH\000\022/\n\tread_time\030\007 \001(\0132\032.goog" + + "le.protobuf.TimestampH\000B\026\n\024consistency_s" + + "elector\"\254\001\n\031BatchGetDocumentsResponse\022.\n" + + "\005found\030\001 \001(\0132\035.google.firestore.v1.Docum" + + "entH\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.protob" + + "uf.TimestampB\010\n\006result\"j\n\027BeginTransacti" + + "onRequest\022\025\n\010database\030\001 \001(\tB\003\340A\002\0228\n\007opti" + + "ons\030\002 \001(\0132\'.google.firestore.v1.Transact" + + "ionOptions\"/\n\030BeginTransactionResponse\022\023" + + "\n\013transaction\030\001 \001(\014\"g\n\rCommitRequest\022\025\n\010" + + "database\030\001 \001(\tB\003\340A\002\022*\n\006writes\030\002 \003(\0132\032.go" + + "ogle.firestore.v1.Write\022\023\n\013transaction\030\003" + + " \001(\014\"z\n\016CommitResponse\0227\n\rwrite_results\030" + + "\001 \003(\0132 .google.firestore.v1.WriteResult\022" + + "/\n\013commit_time\030\002 \001(\0132\032.google.protobuf.T" + + "imestamp\"B\n\017RollbackRequest\022\025\n\010database\030" + + "\001 \001(\tB\003\340A\002\022\030\n\013transaction\030\002 \001(\014B\003\340A\002\"\335\002\n" + + "\017RunQueryRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022@\n" + + "\020structured_query\030\002 \001(\0132$.google.firesto" + + "re.v1.StructuredQueryH\000\022\025\n\013transaction\030\005" + + " \001(\014H\001\022B\n\017new_transaction\030\006 \001(\0132\'.google" + + ".firestore.v1.TransactionOptionsH\001\022/\n\tre" + + "ad_time\030\007 \001(\0132\032.google.protobuf.Timestam" + + "pH\001\022A\n\017explain_options\030\n \001(\0132#.google.fi" + + "restore.v1.ExplainOptionsB\003\340A\001B\014\n\nquery_" + + "typeB\026\n\024consistency_selector\"\207\002\n\020RunQuer" + + "yResponse\022\023\n\013transaction\030\002 \001(\014\022/\n\010docume" + + "nt\030\001 \001(\0132\035.google.firestore.v1.Document\022" + + "-\n\tread_time\030\003 \001(\0132\032.google.protobuf.Tim" + + "estamp\022\027\n\017skipped_results\030\004 \001(\005\022\016\n\004done\030" + + "\006 \001(\010H\000\022<\n\017explain_metrics\030\013 \001(\0132#.googl" + + "e.firestore.v1.ExplainMetricsB\027\n\025continu" + + "ation_selector\"\377\002\n\032RunAggregationQueryRe" + + "quest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022W\n\034structured" + + "_aggregation_query\030\002 \001(\0132/.google.firest" + + "ore.v1.StructuredAggregationQueryH\000\022\025\n\013t" + + "ransaction\030\004 \001(\014H\001\022B\n\017new_transaction\030\005 " + + "\001(\0132\'.google.firestore.v1.TransactionOpt" + + "ionsH\001\022/\n\tread_time\030\006 \001(\0132\032.google.proto" + + "buf.TimestampH\001\022A\n\017explain_options\030\010 \001(\013" + + "2#.google.firestore.v1.ExplainOptionsB\003\340" + + "A\001B\014\n\nquery_typeB\026\n\024consistency_selector" + + "\"\327\001\n\033RunAggregationQueryResponse\0226\n\006resu" + + "lt\030\001 \001(\0132&.google.firestore.v1.Aggregati" + + "onResult\022\023\n\013transaction\030\002 \001(\014\022-\n\tread_ti" + + "me\030\003 \001(\0132\032.google.protobuf.Timestamp\022<\n\017" + + "explain_metrics\030\n \001(\0132#.google.firestore" + + ".v1.ExplainMetrics\"\205\002\n\025PartitionQueryReq" + + "uest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022@\n\020structured_" + + "query\030\002 \001(\0132$.google.firestore.v1.Struct" + + "uredQueryH\000\022\027\n\017partition_count\030\003 \001(\003\022\022\n\n" + + "page_token\030\004 \001(\t\022\021\n\tpage_size\030\005 \001(\005\022/\n\tr" + + "ead_time\030\006 \001(\0132\032.google.protobuf.Timesta" + + "mpH\001B\014\n\nquery_typeB\026\n\024consistency_select" + + "or\"b\n\026PartitionQueryResponse\022/\n\npartitio" + + "ns\030\001 \003(\0132\033.google.firestore.v1.Cursor\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\350\001\n\014WriteRequest\022" + + "\025\n\010database\030\001 \001(\tB\003\340A\002\022\021\n\tstream_id\030\002 \001(" + + "\t\022*\n\006writes\030\003 \003(\0132\032.google.firestore.v1." + + "Write\022\024\n\014stream_token\030\004 \001(\014\022=\n\006labels\030\005 " + + "\003(\0132-.google.firestore.v1.WriteRequest.L" + + "abelsEntry\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\ts" + + "tream_id\030\001 \001(\t\022\024\n\014stream_token\030\002 \001(\014\0227\n\r" + + "write_results\030\003 \003(\0132 .google.firestore.v" + + "1.WriteResult\022/\n\013commit_time\030\004 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\"\362\001\n\rListenRequest" + + "\022\025\n\010database\030\001 \001(\tB\003\340A\002\0221\n\nadd_target\030\002 " + + "\001(\0132\033.google.firestore.v1.TargetH\000\022\027\n\rre" + + "move_target\030\003 \001(\005H\000\022>\n\006labels\030\004 \003(\0132..go" + + "ogle.firestore.v1.ListenRequest.LabelsEn" + "try\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001\"q\n\022BatchWriteResponse\0227\n\rwrit" - + "e_results\030\001 \003(\0132 .google.firestore.v1.Wr" - + "iteResult\022\"\n\006status\030\002 \003(\0132\022.google.rpc.S" - + "tatus2\332\031\n\tFirestore\022\217\001\n\013GetDocument\022\'.go" - + "ogle.firestore.v1.GetDocumentRequest\032\035.g" - + "oogle.firestore.v1.Document\"8\202\323\344\223\0022\0220/v1" - + "/{name=projects/*/databases/*/documents/" - + "*/**}\022\365\001\n\rListDocuments\022).google.firesto" - + "re.v1.ListDocumentsRequest\032*.google.fire" - + "store.v1.ListDocumentsResponse\"\214\001\202\323\344\223\002\205\001" - + "\022B/v1/{parent=projects/*/databases/*/doc" - + "uments/*/**}/{collection_id}Z?\022=/v1/{par" - + "ent=projects/*/databases/*/documents}/{c" - + "ollection_id}\022\277\001\n\016UpdateDocument\022*.googl" - + "e.firestore.v1.UpdateDocumentRequest\032\035.g" - + "oogle.firestore.v1.Document\"b\332A\024document" - + ",update_mask\202\323\344\223\002E29/v1/{document.name=p" - + "rojects/*/databases/*/documents/*/**}:\010d" - + "ocument\022\225\001\n\016DeleteDocument\022*.google.fire" - + "store.v1.DeleteDocumentRequest\032\026.google." - + "protobuf.Empty\"?\332A\004name\202\323\344\223\0022*0/v1/{name" - + "=projects/*/databases/*/documents/*/**}\022" - + "\271\001\n\021BatchGetDocuments\022-.google.firestore" - + ".v1.BatchGetDocumentsRequest\032..google.fi" - + "restore.v1.BatchGetDocumentsResponse\"C\202\323" - + "\344\223\002=\"8/v1/{database=projects/*/databases" - + "/*}/documents:batchGet:\001*0\001\022\307\001\n\020BeginTra" - + "nsaction\022,.google.firestore.v1.BeginTran" - + "sactionRequest\032-.google.firestore.v1.Beg" - + "inTransactionResponse\"V\332A\010database\202\323\344\223\002E" - + "\"@/v1/{database=projects/*/databases/*}/" - + "documents:beginTransaction:\001*\022\246\001\n\006Commit" - + "\022\".google.firestore.v1.CommitRequest\032#.g" - + "oogle.firestore.v1.CommitResponse\"S\332A\017da" - + "tabase,writes\202\323\344\223\002;\"6/v1/{database=proje" - + "cts/*/databases/*}/documents:commit:\001*\022\244" - + "\001\n\010Rollback\022$.google.firestore.v1.Rollba" - + "ckRequest\032\026.google.protobuf.Empty\"Z\332A\024da" - + "tabase,transaction\202\323\344\223\002=\"8/v1/{database=" - + "projects/*/databases/*}/documents:rollba" - + "ck:\001*\022\337\001\n\010RunQuery\022$.google.firestore.v1" - + ".RunQueryRequest\032%.google.firestore.v1.R" - + "unQueryResponse\"\203\001\202\323\344\223\002}\"6/v1/{parent=pr" - + "ojects/*/databases/*/documents}:runQuery" - + ":\001*Z@\";/v1/{parent=projects/*/databases/" - + "*/documents/*/**}:runQuery:\001*0\001\022\227\002\n\023RunA" - + "ggregationQuery\022/.google.firestore.v1.Ru" - + "nAggregationQueryRequest\0320.google.firest" - + "ore.v1.RunAggregationQueryResponse\"\232\001\202\323\344" - + "\223\002\223\001\"A/v1/{parent=projects/*/databases/*" - + "/documents}:runAggregationQuery:\001*ZK\"F/v" - + "1/{parent=projects/*/databases/*/documen" - + "ts/*/**}:runAggregationQuery:\001*0\001\022\374\001\n\016Pa" - + "rtitionQuery\022*.google.firestore.v1.Parti" - + "tionQueryRequest\032+.google.firestore.v1.P" - + "artitionQueryResponse\"\220\001\202\323\344\223\002\211\001\"\n\017document_c" + + "hange\030\003 \001(\0132#.google.firestore.v1.Docume" + + "ntChangeH\000\022>\n\017document_delete\030\004 \001(\0132#.go" + + "ogle.firestore.v1.DocumentDeleteH\000\022>\n\017do" + + "cument_remove\030\006 \001(\0132#.google.firestore.v" + + "1.DocumentRemoveH\000\0226\n\006filter\030\005 \001(\0132$.goo" + + "gle.firestore.v1.ExistenceFilterH\000B\017\n\rre" + + "sponse_type\"\326\003\n\006Target\0228\n\005query\030\002 \001(\0132\'." + + "google.firestore.v1.Target.QueryTargetH\000" + + "\022@\n\tdocuments\030\003 \001(\0132+.google.firestore.v" + + "1.Target.DocumentsTargetH\000\022\026\n\014resume_tok" + + "en\030\004 \001(\014H\001\022/\n\tread_time\030\013 \001(\0132\032.google.p" + + "rotobuf.TimestampH\001\022\021\n\ttarget_id\030\005 \001(\005\022\014" + + "\n\004once\030\006 \001(\010\0223\n\016expected_count\030\014 \001(\0132\033.g" + + "oogle.protobuf.Int32Value\032$\n\017DocumentsTa" + + "rget\022\021\n\tdocuments\030\002 \003(\t\032m\n\013QueryTarget\022\016" + + "\n\006parent\030\001 \001(\t\022@\n\020structured_query\030\002 \001(\013" + + "2$.google.firestore.v1.StructuredQueryH\000" + + "B\014\n\nquery_typeB\r\n\013target_typeB\r\n\013resume_" + + "type\"\252\002\n\014TargetChange\022N\n\022target_change_t" + + "ype\030\001 \001(\01622.google.firestore.v1.TargetCh" + + "ange.TargetChangeType\022\022\n\ntarget_ids\030\002 \003(" + + "\005\022!\n\005cause\030\003 \001(\0132\022.google.rpc.Status\022\024\n\014" + + "resume_token\030\004 \001(\014\022-\n\tread_time\030\006 \001(\0132\032." + + "google.protobuf.Timestamp\"N\n\020TargetChang" + + "eType\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\"\237\001\n\030ListCollec" + + "tionIdsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\021\n\tp" + + "age_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022/\n\tre" + + "ad_time\030\004 \001(\0132\032.google.protobuf.Timestam" + + "pH\000B\026\n\024consistency_selector\"L\n\031ListColle" + + "ctionIdsResponse\022\026\n\016collection_ids\030\001 \003(\t" + + "\022\027\n\017next_page_token\030\002 \001(\t\"\311\001\n\021BatchWrite" + + "Request\022\025\n\010database\030\001 \001(\tB\003\340A\002\022*\n\006writes" + + "\030\002 \003(\0132\032.google.firestore.v1.Write\022B\n\006la" + + "bels\030\003 \003(\01322.google.firestore.v1.BatchWr" + + "iteRequest.LabelsEntry\032-\n\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"q\n\022BatchWr" + + "iteResponse\0227\n\rwrite_results\030\001 \003(\0132 .goo" + + "gle.firestore.v1.WriteResult\022\"\n\006status\030\002" + + " \003(\0132\022.google.rpc.Status2\332\031\n\tFirestore\022\217" + + "\001\n\013GetDocument\022\'.google.firestore.v1.Get" + + "DocumentRequest\032\035.google.firestore.v1.Do" + + "cument\"8\202\323\344\223\0022\0220/v1/{name=projects/*/dat" + + "abases/*/documents/*/**}\022\365\001\n\rListDocumen" + + "ts\022).google.firestore.v1.ListDocumentsRe" + + "quest\032*.google.firestore.v1.ListDocument" + + "sResponse\"\214\001\202\323\344\223\002\205\001\022B/v1/{parent=project" + + "s/*/databases/*/documents/*/**}/{collect" + + "ion_id}Z?\022=/v1/{parent=projects/*/databa" + + "ses/*/documents}/{collection_id}\022\277\001\n\016Upd" + + "ateDocument\022*.google.firestore.v1.Update" + + "DocumentRequest\032\035.google.firestore.v1.Do" + + "cument\"b\332A\024document,update_mask\202\323\344\223\002E29/" + + "v1/{document.name=projects/*/databases/*" + + "/documents/*/**}:\010document\022\225\001\n\016DeleteDoc" + + "ument\022*.google.firestore.v1.DeleteDocume" + + "ntRequest\032\026.google.protobuf.Empty\"?\332A\004na" + + "me\202\323\344\223\0022*0/v1/{name=projects/*/databases" + + "/*/documents/*/**}\022\271\001\n\021BatchGetDocuments" + + "\022-.google.firestore.v1.BatchGetDocuments" + + "Request\032..google.firestore.v1.BatchGetDo" + + "cumentsResponse\"C\202\323\344\223\002=\"8/v1/{database=p" + + "rojects/*/databases/*}/documents:batchGe" + + "t:\001*0\001\022\307\001\n\020BeginTransaction\022,.google.fir" + + "estore.v1.BeginTransactionRequest\032-.goog" + + "le.firestore.v1.BeginTransactionResponse" + + "\"V\332A\010database\202\323\344\223\002E\"@/v1/{database=proje" + + "cts/*/databases/*}/documents:beginTransa" + + "ction:\001*\022\246\001\n\006Commit\022\".google.firestore.v" + + "1.CommitRequest\032#.google.firestore.v1.Co" + + "mmitResponse\"S\332A\017database,writes\202\323\344\223\002;\"6" + + "/v1/{database=projects/*/databases/*}/do" + + "cuments:commit:\001*\022\244\001\n\010Rollback\022$.google." + + "firestore.v1.RollbackRequest\032\026.google.pr" + + "otobuf.Empty\"Z\332A\024database,transaction\202\323\344" + + "\223\002=\"8/v1/{database=projects/*/databases/" + + "*}/documents:rollback:\001*\022\337\001\n\010RunQuery\022$." + + "google.firestore.v1.RunQueryRequest\032%.go" + + "ogle.firestore.v1.RunQueryResponse\"\203\001\202\323\344" + + "\223\002}\"6/v1/{parent=projects/*/databases/*/" + + "documents}:runQuery:\001*Z@\";/v1/{parent=pr" + + "ojects/*/databases/*/documents/*/**}:run" + + "Query:\001*0\001\022\227\002\n\023RunAggregationQuery\022/.goo" + + "gle.firestore.v1.RunAggregationQueryRequ" + + "est\0320.google.firestore.v1.RunAggregation" + + "QueryResponse\"\232\001\202\323\344\223\002\223\001\"A/v1/{parent=pro" + + "jects/*/databases/*/documents}:runAggreg" + + "ationQuery:\001*ZK\"F/v1/{parent=projects/*/" + + "databases/*/documents/*/**}:runAggregati" + + "onQuery:\001*0\001\022\374\001\n\016PartitionQuery\022*.google" + + ".firestore.v1.PartitionQueryRequest\032+.go" + + "ogle.firestore.v1.PartitionQueryResponse" + + "\"\220\001\202\323\344\223\002\211\001\" + * Planning phase information for the query. + * + * + * Protobuf type {@code google.firestore.v1.PlanSummary} + */ +public final class PlanSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.PlanSummary) + PlanSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use PlanSummary.newBuilder() to construct. + private PlanSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PlanSummary() { + indexesUsed_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PlanSummary(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.PlanSummary.class, + com.google.firestore.v1.PlanSummary.Builder.class); + } + + public static final int INDEXES_USED_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List indexesUsed_; + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public java.util.List getIndexesUsedList() { + return indexesUsed_; + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public java.util.List + getIndexesUsedOrBuilderList() { + return indexesUsed_; + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public int getIndexesUsedCount() { + return indexesUsed_.size(); + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public com.google.protobuf.Struct getIndexesUsed(int index) { + return indexesUsed_.get(index); + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index) { + return indexesUsed_.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 < indexesUsed_.size(); i++) { + output.writeMessage(1, indexesUsed_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < indexesUsed_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, indexesUsed_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.PlanSummary)) { + return super.equals(obj); + } + com.google.firestore.v1.PlanSummary other = (com.google.firestore.v1.PlanSummary) obj; + + if (!getIndexesUsedList().equals(other.getIndexesUsedList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIndexesUsedCount() > 0) { + hash = (37 * hash) + INDEXES_USED_FIELD_NUMBER; + hash = (53 * hash) + getIndexesUsedList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.PlanSummary parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.PlanSummary 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.PlanSummary parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.PlanSummary 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.PlanSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.PlanSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.PlanSummary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.PlanSummary 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.PlanSummary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.PlanSummary 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.PlanSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.PlanSummary 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.PlanSummary 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; + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.PlanSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.PlanSummary) + com.google.firestore.v1.PlanSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.PlanSummary.class, + com.google.firestore.v1.PlanSummary.Builder.class); + } + + // Construct using com.google.firestore.v1.PlanSummary.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (indexesUsedBuilder_ == null) { + indexesUsed_ = java.util.Collections.emptyList(); + } else { + indexesUsed_ = null; + indexesUsedBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary getDefaultInstanceForType() { + return com.google.firestore.v1.PlanSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary build() { + com.google.firestore.v1.PlanSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary buildPartial() { + com.google.firestore.v1.PlanSummary result = new com.google.firestore.v1.PlanSummary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.firestore.v1.PlanSummary result) { + if (indexesUsedBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + indexesUsed_ = java.util.Collections.unmodifiableList(indexesUsed_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexesUsed_ = indexesUsed_; + } else { + result.indexesUsed_ = indexesUsedBuilder_.build(); + } + } + + private void buildPartial0(com.google.firestore.v1.PlanSummary result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.PlanSummary) { + return mergeFrom((com.google.firestore.v1.PlanSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.PlanSummary other) { + if (other == com.google.firestore.v1.PlanSummary.getDefaultInstance()) return this; + if (indexesUsedBuilder_ == null) { + if (!other.indexesUsed_.isEmpty()) { + if (indexesUsed_.isEmpty()) { + indexesUsed_ = other.indexesUsed_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIndexesUsedIsMutable(); + indexesUsed_.addAll(other.indexesUsed_); + } + onChanged(); + } + } else { + if (!other.indexesUsed_.isEmpty()) { + if (indexesUsedBuilder_.isEmpty()) { + indexesUsedBuilder_.dispose(); + indexesUsedBuilder_ = null; + indexesUsed_ = other.indexesUsed_; + bitField0_ = (bitField0_ & ~0x00000001); + indexesUsedBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexesUsedFieldBuilder() + : null; + } else { + indexesUsedBuilder_.addAllMessages(other.indexesUsed_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Struct m = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(m); + } else { + indexesUsedBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List indexesUsed_ = + java.util.Collections.emptyList(); + + private void ensureIndexesUsedIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + indexesUsed_ = new java.util.ArrayList(indexesUsed_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + indexesUsedBuilder_; + + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List getIndexesUsedList() { + if (indexesUsedBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexesUsed_); + } else { + return indexesUsedBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public int getIndexesUsedCount() { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.size(); + } else { + return indexesUsedBuilder_.getCount(); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct getIndexesUsed(int index) { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.get(index); + } else { + return indexesUsedBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder setIndexesUsed(int index, com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.set(index, value); + onChanged(); + } else { + indexesUsedBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder setIndexesUsed(int index, com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.set(index, builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.add(value); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(int index, com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.add(index, value); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(int index, com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(index, builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addAllIndexesUsed( + java.lang.Iterable values) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexesUsed_); + onChanged(); + } else { + indexesUsedBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder clearIndexesUsed() { + if (indexesUsedBuilder_ == null) { + indexesUsed_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + indexesUsedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder removeIndexesUsed(int index) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.remove(index); + onChanged(); + } else { + indexesUsedBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder getIndexesUsedBuilder(int index) { + return getIndexesUsedFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index) { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.get(index); + } else { + return indexesUsedBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List + getIndexesUsedOrBuilderList() { + if (indexesUsedBuilder_ != null) { + return indexesUsedBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexesUsed_); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder addIndexesUsedBuilder() { + return getIndexesUsedFieldBuilder() + .addBuilder(com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder addIndexesUsedBuilder(int index) { + return getIndexesUsedFieldBuilder() + .addBuilder(index, com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List getIndexesUsedBuilderList() { + return getIndexesUsedFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getIndexesUsedFieldBuilder() { + if (indexesUsedBuilder_ == null) { + indexesUsedBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + indexesUsed_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + indexesUsed_ = null; + } + return indexesUsedBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.PlanSummary) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.PlanSummary) + private static final com.google.firestore.v1.PlanSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.PlanSummary(); + } + + public static com.google.firestore.v1.PlanSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlanSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.v1.PlanSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java new file mode 100644 index 000000000..4f3c0d8f3 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/PlanSummaryOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public interface PlanSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.PlanSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + java.util.List getIndexesUsedList(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + com.google.protobuf.Struct getIndexesUsed(int index); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + int getIndexesUsedCount(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + java.util.List getIndexesUsedOrBuilderList(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java new file mode 100644 index 000000000..e1195e5d7 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.firestore.v1; + +public final class QueryProfileProto { + private QueryProfileProto() {} + + 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_ExplainOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ExplainMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_PlanSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ExecutionStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ExecutionStats_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/query_profile.prot" + + "o\022\023google.firestore.v1\032\037google/api/field" + + "_behavior.proto\032\036google/protobuf/duratio" + + "n.proto\032\034google/protobuf/struct.proto\"&\n" + + "\016ExplainOptions\022\024\n\007analyze\030\001 \001(\010B\003\340A\001\"\206\001" + + "\n\016ExplainMetrics\0226\n\014plan_summary\030\001 \001(\0132 " + + ".google.firestore.v1.PlanSummary\022<\n\017exec" + + "ution_stats\030\002 \001(\0132#.google.firestore.v1." + + "ExecutionStats\"<\n\013PlanSummary\022-\n\014indexes" + + "_used\030\001 \003(\0132\027.google.protobuf.Struct\"\250\001\n" + + "\016ExecutionStats\022\030\n\020results_returned\030\001 \001(" + + "\003\0225\n\022execution_duration\030\003 \001(\0132\031.google.p" + + "rotobuf.Duration\022\027\n\017read_operations\030\004 \001(" + + "\003\022,\n\013debug_stats\030\005 \001(\0132\027.google.protobuf" + + ".StructB\311\001\n\027com.google.firestore.v1B\021Que" + + "ryProfileProtoP\001Z;cloud.google.com/go/fi" + + "restore/apiv1/firestorepb;firestorepb\242\002\004" + + "GCFS\252\002\031Google.Cloud.Firestore.V1\312\002\031Googl" + + "e\\Cloud\\Firestore\\V1\352\002\034Google::Cloud::Fi" + + "restore::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_firestore_v1_ExplainOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_v1_ExplainOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ExplainOptions_descriptor, + new java.lang.String[] { + "Analyze", + }); + internal_static_google_firestore_v1_ExplainMetrics_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_v1_ExplainMetrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ExplainMetrics_descriptor, + new java.lang.String[] { + "PlanSummary", "ExecutionStats", + }); + internal_static_google_firestore_v1_PlanSummary_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_firestore_v1_PlanSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_PlanSummary_descriptor, + new java.lang.String[] { + "IndexesUsed", + }); + internal_static_google_firestore_v1_ExecutionStats_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_firestore_v1_ExecutionStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ExecutionStats_descriptor, + new java.lang.String[] { + "ResultsReturned", "ExecutionDuration", "ReadOperations", "DebugStats", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java index 33f177901..8e64caeff 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java @@ -64,6 +64,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.firestore.v1.RunAggregationQueryRequest.Builder.class); } + private int bitField0_; private int queryTypeCase_ = 0; @SuppressWarnings("serial") @@ -437,6 +438,65 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 8; + private com.google.firestore.v1.ExplainOptions explainOptions_; + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + @java.lang.Override + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -466,6 +526,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistencySelectorCase_ == 6) { output.writeMessage(6, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getExplainOptions()); + } getUnknownFields().writeTo(output); } @@ -498,6 +561,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 6, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getExplainOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -515,6 +581,10 @@ public boolean equals(final java.lang.Object obj) { (com.google.firestore.v1.RunAggregationQueryRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (hasExplainOptions() != other.hasExplainOptions()) return false; + if (hasExplainOptions()) { + if (!getExplainOptions().equals(other.getExplainOptions())) return false; + } if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 2: @@ -551,6 +621,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + if (hasExplainOptions()) { + hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplainOptions().hashCode(); + } switch (queryTypeCase_) { case 2: hash = (37 * hash) + STRUCTURED_AGGREGATION_QUERY_FIELD_NUMBER; @@ -705,10 +779,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.firestore.v1.RunAggregationQueryRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExplainOptionsFieldBuilder(); + } } @java.lang.Override @@ -725,6 +808,11 @@ public Builder clear() { if (readTimeBuilder_ != null) { readTimeBuilder_.clear(); } + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } queryTypeCase_ = 0; queryType_ = null; consistencySelectorCase_ = 0; @@ -769,6 +857,13 @@ private void buildPartial0(com.google.firestore.v1.RunAggregationQueryRequest re if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.explainOptions_ = + explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.firestore.v1.RunAggregationQueryRequest result) { @@ -838,6 +933,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunAggregationQueryRequest othe bitField0_ |= 0x00000001; onChanged(); } + if (other.hasExplainOptions()) { + mergeExplainOptions(other.getExplainOptions()); + } switch (other.getQueryTypeCase()) { case STRUCTURED_AGGREGATION_QUERY: { @@ -927,6 +1025,12 @@ public Builder mergeFrom( consistencySelectorCase_ = 6; break; } // case 50 + case 66: + { + input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1889,6 +1993,219 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ExplainOptions explainOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + explainOptionsBuilder_; + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + if (explainOptionsBuilder_ == null) { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } else { + return explainOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainOptions_ = value; + } else { + explainOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions( + com.google.firestore.v1.ExplainOptions.Builder builderForValue) { + if (explainOptionsBuilder_ == null) { + explainOptions_ = builderForValue.build(); + } else { + explainOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && explainOptions_ != null + && explainOptions_ != com.google.firestore.v1.ExplainOptions.getDefaultInstance()) { + getExplainOptionsBuilder().mergeFrom(value); + } else { + explainOptions_ = value; + } + } else { + explainOptionsBuilder_.mergeFrom(value); + } + if (explainOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExplainOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExplainOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + if (explainOptionsBuilder_ != null) { + return explainOptionsBuilder_.getMessageOrBuilder(); + } else { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + getExplainOptionsFieldBuilder() { + if (explainOptionsBuilder_ == null) { + explainOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder>( + getExplainOptions(), getParentForChildren(), isClean()); + explainOptions_ = null; + } + return explainOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java index a9a00c499..b8a106b0b 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java @@ -215,6 +215,50 @@ public interface RunAggregationQueryRequestOrBuilder */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + boolean hasExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + com.google.firestore.v1.ExplainOptions getExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder(); + com.google.firestore.v1.RunAggregationQueryRequest.QueryTypeCase getQueryTypeCase(); com.google.firestore.v1.RunAggregationQueryRequest.ConsistencySelectorCase diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java index 72f44e889..7c34c1e21 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java @@ -209,6 +209,62 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; } + public static final int EXPLAIN_METRICS_FIELD_NUMBER = 10; + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return Whether the explainMetrics field is set. + */ + @java.lang.Override + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return The explainMetrics. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -232,6 +288,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getReadTime()); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getExplainMetrics()); + } getUnknownFields().writeTo(output); } @@ -250,6 +309,9 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReadTime()); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getExplainMetrics()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -275,6 +337,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadTime()) { if (!getReadTime().equals(other.getReadTime())) return false; } + if (hasExplainMetrics() != other.hasExplainMetrics()) return false; + if (hasExplainMetrics()) { + if (!getExplainMetrics().equals(other.getExplainMetrics())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -296,6 +362,10 @@ public int hashCode() { hash = (37 * hash) + READ_TIME_FIELD_NUMBER; hash = (53 * hash) + getReadTime().hashCode(); } + if (hasExplainMetrics()) { + hash = (37 * hash) + EXPLAIN_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getExplainMetrics().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -439,6 +509,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getResultFieldBuilder(); getReadTimeFieldBuilder(); + getExplainMetricsFieldBuilder(); } } @@ -457,6 +528,11 @@ public Builder clear() { readTimeBuilder_.dispose(); readTimeBuilder_ = null; } + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } return this; } @@ -505,6 +581,11 @@ private void buildPartial0(com.google.firestore.v1.RunAggregationQueryResponse r result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.explainMetrics_ = + explainMetricsBuilder_ == null ? explainMetrics_ : explainMetricsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -563,6 +644,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunAggregationQueryResponse oth if (other.hasReadTime()) { mergeReadTime(other.getReadTime()); } + if (other.hasExplainMetrics()) { + mergeExplainMetrics(other.getExplainMetrics()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -607,6 +691,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 26 + case 82: + { + input.readMessage(getExplainMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1137,6 +1227,210 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + explainMetricsBuilder_; + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return Whether the explainMetrics field is set. + */ + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return The explainMetrics. + */ + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + if (explainMetricsBuilder_ == null) { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } else { + return explainMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder setExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainMetrics_ = value; + } else { + explainMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder setExplainMetrics( + com.google.firestore.v1.ExplainMetrics.Builder builderForValue) { + if (explainMetricsBuilder_ == null) { + explainMetrics_ = builderForValue.build(); + } else { + explainMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder mergeExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && explainMetrics_ != null + && explainMetrics_ != com.google.firestore.v1.ExplainMetrics.getDefaultInstance()) { + getExplainMetricsBuilder().mergeFrom(value); + } else { + explainMetrics_ = value; + } + } else { + explainMetricsBuilder_.mergeFrom(value); + } + if (explainMetrics_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public Builder clearExplainMetrics() { + bitField0_ = (bitField0_ & ~0x00000008); + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public com.google.firestore.v1.ExplainMetrics.Builder getExplainMetricsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getExplainMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + if (explainMetricsBuilder_ != null) { + return explainMetricsBuilder_.getMessageOrBuilder(); + } else { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + getExplainMetricsFieldBuilder() { + if (explainMetricsBuilder_ == null) { + explainMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder>( + getExplainMetrics(), getParentForChildren(), isClean()); + explainMetrics_ = null; + } + return explainMetricsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java index b78c4a7f2..11481cb30 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java @@ -136,4 +136,45 @@ public interface RunAggregationQueryResponseOrBuilder * .google.protobuf.Timestamp read_time = 3; */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return Whether the explainMetrics field is set. + */ + boolean hasExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * + * @return The explainMetrics. + */ + com.google.firestore.v1.ExplainMetrics getExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder(); } diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java index 1fc41e85b..563a83190 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java @@ -63,6 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.firestore.v1.RunQueryRequest.Builder.class); } + private int bitField0_; private int queryTypeCase_ = 0; @SuppressWarnings("serial") @@ -435,6 +436,65 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 10; + private com.google.firestore.v1.ExplainOptions explainOptions_; + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + @java.lang.Override + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -464,6 +524,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistencySelectorCase_ == 7) { output.writeMessage(7, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(10, getExplainOptions()); + } getUnknownFields().writeTo(output); } @@ -496,6 +559,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 7, (com.google.protobuf.Timestamp) consistencySelector_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getExplainOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -512,6 +578,10 @@ public boolean equals(final java.lang.Object obj) { com.google.firestore.v1.RunQueryRequest other = (com.google.firestore.v1.RunQueryRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (hasExplainOptions() != other.hasExplainOptions()) return false; + if (hasExplainOptions()) { + if (!getExplainOptions().equals(other.getExplainOptions())) return false; + } if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 2: @@ -547,6 +617,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + if (hasExplainOptions()) { + hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplainOptions().hashCode(); + } switch (queryTypeCase_) { case 2: hash = (37 * hash) + STRUCTURED_QUERY_FIELD_NUMBER; @@ -700,10 +774,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.firestore.v1.RunQueryRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExplainOptionsFieldBuilder(); + } } @java.lang.Override @@ -720,6 +803,11 @@ public Builder clear() { if (readTimeBuilder_ != null) { readTimeBuilder_.clear(); } + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } queryTypeCase_ = 0; queryType_ = null; consistencySelectorCase_ = 0; @@ -764,6 +852,13 @@ private void buildPartial0(com.google.firestore.v1.RunQueryRequest result) { if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.explainOptions_ = + explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.firestore.v1.RunQueryRequest result) { @@ -832,6 +927,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunQueryRequest other) { bitField0_ |= 0x00000001; onChanged(); } + if (other.hasExplainOptions()) { + mergeExplainOptions(other.getExplainOptions()); + } switch (other.getQueryTypeCase()) { case STRUCTURED_QUERY: { @@ -920,6 +1018,12 @@ public Builder mergeFrom( consistencySelectorCase_ = 7; break; } // case 58 + case 82: + { + input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1868,6 +1972,219 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ExplainOptions explainOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + explainOptionsBuilder_; + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + public com.google.firestore.v1.ExplainOptions getExplainOptions() { + if (explainOptionsBuilder_ == null) { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } else { + return explainOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainOptions_ = value; + } else { + explainOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions( + com.google.firestore.v1.ExplainOptions.Builder builderForValue) { + if (explainOptionsBuilder_ == null) { + explainOptions_ = builderForValue.build(); + } else { + explainOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExplainOptions(com.google.firestore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && explainOptions_ != null + && explainOptions_ != com.google.firestore.v1.ExplainOptions.getDefaultInstance()) { + getExplainOptionsBuilder().mergeFrom(value); + } else { + explainOptions_ = value; + } + } else { + explainOptionsBuilder_.mergeFrom(value); + } + if (explainOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExplainOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExplainOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + if (explainOptionsBuilder_ != null) { + return explainOptionsBuilder_.getMessageOrBuilder(); + } else { + return explainOptions_ == null + ? com.google.firestore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder> + getExplainOptionsFieldBuilder() { + if (explainOptionsBuilder_ == null) { + explainOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainOptions, + com.google.firestore.v1.ExplainOptions.Builder, + com.google.firestore.v1.ExplainOptionsOrBuilder>( + getExplainOptions(), getParentForChildren(), isClean()); + explainOptions_ = null; + } + return explainOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java index 1402e9c46..d104c6d18 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java @@ -214,6 +214,50 @@ public interface RunQueryRequestOrBuilder */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + boolean hasExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + com.google.firestore.v1.ExplainOptions getExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.firestore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder(); + com.google.firestore.v1.RunQueryRequest.QueryTypeCase getQueryTypeCase(); com.google.firestore.v1.RunQueryRequest.ConsistencySelectorCase getConsistencySelectorCase(); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java index 3a4d4d1a5..dc16b5f5a 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java @@ -299,6 +299,62 @@ public boolean getDone() { return false; } + public static final int EXPLAIN_METRICS_FIELD_NUMBER = 11; + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return Whether the explainMetrics field is set. + */ + @java.lang.Override + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return The explainMetrics. + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + @java.lang.Override + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -328,6 +384,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (continuationSelectorCase_ == 6) { output.writeBool(6, (boolean) ((java.lang.Boolean) continuationSelector_)); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(11, getExplainMetrics()); + } getUnknownFields().writeTo(output); } @@ -354,6 +413,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 6, (boolean) ((java.lang.Boolean) continuationSelector_)); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExplainMetrics()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -379,6 +441,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReadTime().equals(other.getReadTime())) return false; } if (getSkippedResults() != other.getSkippedResults()) return false; + if (hasExplainMetrics() != other.hasExplainMetrics()) return false; + if (hasExplainMetrics()) { + if (!getExplainMetrics().equals(other.getExplainMetrics())) return false; + } if (!getContinuationSelectorCase().equals(other.getContinuationSelectorCase())) return false; switch (continuationSelectorCase_) { case 6: @@ -410,6 +476,10 @@ public int hashCode() { } hash = (37 * hash) + SKIPPED_RESULTS_FIELD_NUMBER; hash = (53 * hash) + getSkippedResults(); + if (hasExplainMetrics()) { + hash = (37 * hash) + EXPLAIN_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getExplainMetrics().hashCode(); + } switch (continuationSelectorCase_) { case 6: hash = (37 * hash) + DONE_FIELD_NUMBER; @@ -561,6 +631,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getDocumentFieldBuilder(); getReadTimeFieldBuilder(); + getExplainMetricsFieldBuilder(); } } @@ -580,6 +651,11 @@ public Builder clear() { readTimeBuilder_ = null; } skippedResults_ = 0; + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } continuationSelectorCase_ = 0; continuationSelector_ = null; return this; @@ -634,6 +710,11 @@ private void buildPartial0(com.google.firestore.v1.RunQueryResponse result) { if (((from_bitField0_ & 0x00000008) != 0)) { result.skippedResults_ = skippedResults_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.explainMetrics_ = + explainMetricsBuilder_ == null ? explainMetrics_ : explainMetricsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -699,6 +780,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunQueryResponse other) { if (other.getSkippedResults() != 0) { setSkippedResults(other.getSkippedResults()); } + if (other.hasExplainMetrics()) { + mergeExplainMetrics(other.getExplainMetrics()); + } switch (other.getContinuationSelectorCase()) { case DONE: { @@ -766,6 +850,12 @@ public Builder mergeFrom( continuationSelectorCase_ = 6; break; } // case 48 + case 90: + { + input.readMessage(getExplainMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1416,6 +1506,210 @@ public Builder clearDone() { return this; } + private com.google.firestore.v1.ExplainMetrics explainMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + explainMetricsBuilder_; + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return Whether the explainMetrics field is set. + */ + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return The explainMetrics. + */ + public com.google.firestore.v1.ExplainMetrics getExplainMetrics() { + if (explainMetricsBuilder_ == null) { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } else { + return explainMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder setExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainMetrics_ = value; + } else { + explainMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder setExplainMetrics( + com.google.firestore.v1.ExplainMetrics.Builder builderForValue) { + if (explainMetricsBuilder_ == null) { + explainMetrics_ = builderForValue.build(); + } else { + explainMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder mergeExplainMetrics(com.google.firestore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && explainMetrics_ != null + && explainMetrics_ != com.google.firestore.v1.ExplainMetrics.getDefaultInstance()) { + getExplainMetricsBuilder().mergeFrom(value); + } else { + explainMetrics_ = value; + } + } else { + explainMetricsBuilder_.mergeFrom(value); + } + if (explainMetrics_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public Builder clearExplainMetrics() { + bitField0_ = (bitField0_ & ~0x00000020); + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public com.google.firestore.v1.ExplainMetrics.Builder getExplainMetricsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExplainMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + public com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + if (explainMetricsBuilder_ != null) { + return explainMetricsBuilder_.getMessageOrBuilder(); + } else { + return explainMetrics_ == null + ? com.google.firestore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder> + getExplainMetricsFieldBuilder() { + if (explainMetricsBuilder_ == null) { + explainMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ExplainMetrics, + com.google.firestore.v1.ExplainMetrics.Builder, + com.google.firestore.v1.ExplainMetricsOrBuilder>( + getExplainMetrics(), getParentForChildren(), isClean()); + explainMetrics_ = null; + } + return explainMetricsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java index f5c0f202a..2c37bf046 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java @@ -170,5 +170,46 @@ public interface RunQueryResponseOrBuilder */ boolean getDone(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return Whether the explainMetrics field is set. + */ + boolean hasExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * + * @return The explainMetrics. + */ + com.google.firestore.v1.ExplainMetrics getExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + com.google.firestore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder(); + com.google.firestore.v1.RunQueryResponse.ContinuationSelectorCase getContinuationSelectorCase(); } diff --git a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto index 3b843eed5..8d78ce4f4 100644 --- a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto +++ b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto @@ -23,6 +23,7 @@ import "google/firestore/v1/aggregation_result.proto"; import "google/firestore/v1/common.proto"; import "google/firestore/v1/document.proto"; import "google/firestore/v1/query.proto"; +import "google/firestore/v1/query_profile.proto"; import "google/firestore/v1/write.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -576,6 +577,10 @@ message RunQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 7; } + + // Optional. Explain options for the query. If set, additional query + // statistics will be returned. If not, only query results will be returned. + ExplainOptions explain_options = 10 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -612,6 +617,11 @@ message RunQueryResponse { // documents will be returned. bool done = 6; } + + // Query explain metrics. This is only present when the + // [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] + // is provided, and it is sent only once with the last response in the stream. + ExplainMetrics explain_metrics = 11; } // The request for @@ -651,6 +661,10 @@ message RunAggregationQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 6; } + + // Optional. Explain options for the query. If set, additional query + // statistics will be returned. If not, only query results will be returned. + ExplainOptions explain_options = 8 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -676,6 +690,11 @@ message RunAggregationQueryResponse { // `result` will be sent, and this represents the time at which the query // was run. google.protobuf.Timestamp read_time = 3; + + // Query explain metrics. This is only present when the + // [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] + // is provided, and it is sent only once with the last response in the stream. + ExplainMetrics explain_metrics = 10; } // The request for diff --git a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto new file mode 100644 index 000000000..931e083b0 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto @@ -0,0 +1,92 @@ +// Copyright 2023 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/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb"; +option java_multiple_files = true; +option java_outer_classname = "QueryProfileProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; + +// Specification of the Firestore Query Profile fields. + +// Explain options for the query. +message ExplainOptions { + // Optional. Whether to execute this query. + // + // When false (the default), the query will be planned, returning only + // metrics from the planning stages. + // + // When true, the query will be planned and executed, returning the full + // query results along with both planning and execution stage metrics. + bool analyze = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Explain metrics for the query. +message ExplainMetrics { + // Planning phase information for the query. + PlanSummary plan_summary = 1; + + // Aggregated stats from the execution of the query. Only present when + // [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + // to true. + ExecutionStats execution_stats = 2; +} + +// Planning phase information for the query. +message PlanSummary { + // The indexes selected for the query. For example: + // [ + // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + // ] + repeated google.protobuf.Struct indexes_used = 1; +} + +// Execution statistics for the query. +message ExecutionStats { + // Total number of results returned, including documents, projections, + // aggregation results, keys. + int64 results_returned = 1; + + // Total time to execute the query in the backend. + google.protobuf.Duration execution_duration = 3; + + // Total billable read operations. + int64 read_operations = 4; + + // Debugging statistics from the execution of the query. Note that the + // debugging stats are subject to change as Firestore evolves. It could + // include: + // { + // "indexes_entries_scanned": "1000", + // "documents_scanned": "20", + // "billing_details" : { + // "documents_billable": "20", + // "index_entries_billable": "1000", + // "min_query_cost": "0" + // } + // } + google.protobuf.Struct debug_stats = 5; +}