Skip to content

Commit

Permalink
feat: add new types QueryMode, QueryPlan, ResultSetStats (#1516)
Browse files Browse the repository at this point in the history
* feat: add new types QueryMode, QueryPlan, ResultSetStats
feat: add QueryMode field to RunQueryRequest
feat: add ResultSetStats field to RunQueryResponse
feat: add QueryMode field to RunAggregationQueryRequest
feat: add ResultSetStats field to RunAggregationQueryResponse

PiperOrigin-RevId: 595771083

Source-Link: googleapis/googleapis@2027807

Source-Link: googleapis/googleapis-gen@5407e2b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTQwN2UyYjY4NjM5MjhjMjZmNTJkYjlmMzQ3YzZiNTU1NmU3MDJmMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jan 8, 2024
1 parent 866b2b4 commit 3060e86
Show file tree
Hide file tree
Showing 20 changed files with 3,847 additions and 241 deletions.
Expand Up @@ -875,7 +875,11 @@ public final UnaryCallable<RollbackRequest, Empty> 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")
* .setMode(QueryMode.forNumber(0))
* .build();
* ServerStream<RunQueryResponse> stream = firestoreClient.runQueryCallable().call(request);
* for (RunQueryResponse response : stream) {
* // Do something when a response is received.
Expand Down Expand Up @@ -911,7 +915,10 @@ public final ServerStreamingCallable<RunQueryRequest, RunQueryResponse> 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")
* .setMode(QueryMode.forNumber(0))
* .build();
* ServerStream<RunAggregationQueryResponse> stream =
* firestoreClient.runAggregationQueryCallable().call(request);
* for (RunAggregationQueryResponse response : stream) {
Expand Down
Expand Up @@ -1070,6 +1070,51 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.firestore.v1.QueryMode",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.firestore.v1.QueryPlan",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.firestore.v1.QueryPlan$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.firestore.v1.ResultSetStats",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.firestore.v1.ResultSetStats$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.firestore.v1.RollbackRequest",
"queryAllDeclaredConstructors": true,
Expand Down
Expand Up @@ -56,6 +56,8 @@
import com.google.firestore.v1.ListenResponse;
import com.google.firestore.v1.PartitionQueryRequest;
import com.google.firestore.v1.PartitionQueryResponse;
import com.google.firestore.v1.QueryMode;
import com.google.firestore.v1.ResultSetStats;
import com.google.firestore.v1.RollbackRequest;
import com.google.firestore.v1.RunAggregationQueryRequest;
import com.google.firestore.v1.RunAggregationQueryResponse;
Expand Down Expand Up @@ -505,9 +507,14 @@ public void runQueryTest() throws Exception {
.setDocument(Document.newBuilder().build())
.setReadTime(Timestamp.newBuilder().build())
.setSkippedResults(880286183)
.setStats(ResultSetStats.newBuilder().build())
.build();
mockFirestore.addResponse(expectedResponse);
RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build();
RunQueryRequest request =
RunQueryRequest.newBuilder()
.setParent("parent-995424086")
.setMode(QueryMode.forNumber(0))
.build();

MockStreamObserver<RunQueryResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -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")
.setMode(QueryMode.forNumber(0))
.build();

MockStreamObserver<RunQueryResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -547,10 +558,14 @@ public void runAggregationQueryTest() throws Exception {
.setResult(AggregationResult.newBuilder().build())
.setTransaction(ByteString.EMPTY)
.setReadTime(Timestamp.newBuilder().build())
.setStats(ResultSetStats.newBuilder().build())
.build();
mockFirestore.addResponse(expectedResponse);
RunAggregationQueryRequest request =
RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build();
RunAggregationQueryRequest.newBuilder()
.setParent("parent-995424086")
.setMode(QueryMode.forNumber(0))
.build();

MockStreamObserver<RunAggregationQueryResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -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")
.setMode(QueryMode.forNumber(0))
.build();

MockStreamObserver<RunAggregationQueryResponse> responseObserver = new MockStreamObserver<>();

Expand Down

0 comments on commit 3060e86

Please sign in to comment.