Skip to content

Commit 6185f13

Browse files
fix: change REST binding for ListDocuments to support root collection (#1695)
1 parent 9797fe5 commit 6185f13

File tree

6 files changed

+29
-27
lines changed

6 files changed

+29
-27
lines changed

dev/protos/google/firestore/v1/common.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@ syntax = "proto3";
1717
package google.firestore.v1;
1818

1919
import "google/protobuf/timestamp.proto";
20-
import "google/api/annotations.proto";
2120

2221
option csharp_namespace = "Google.Cloud.Firestore.V1";
2322
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
@@ -48,7 +47,7 @@ message Precondition {
4847
bool exists = 1;
4948

5049
// When set, the target document must exist and have been last updated at
51-
// that time.
50+
// that time. Timestamp must be microsecond aligned.
5251
google.protobuf.Timestamp update_time = 2;
5352
}
5453
}

dev/protos/google/firestore/v1/document.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@ package google.firestore.v1;
1919
import "google/protobuf/struct.proto";
2020
import "google/protobuf/timestamp.proto";
2121
import "google/type/latlng.proto";
22-
import "google/api/annotations.proto";
2322

2423
option csharp_namespace = "Google.Cloud.Firestore.V1";
2524
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";

dev/protos/google/firestore/v1/firestore.proto

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestor
3232
option java_multiple_files = true;
3333
option java_outer_classname = "FirestoreProto";
3434
option java_package = "com.google.firestore.v1";
35-
option objc_class_prefix = "GCFS";
3635
option php_namespace = "Google\\Cloud\\Firestore\\V1";
3736
option ruby_package = "Google::Cloud::Firestore::V1";
3837

@@ -63,6 +62,9 @@ service Firestore {
6362
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
6463
option (google.api.http) = {
6564
get: "/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}"
65+
additional_bindings {
66+
get: "/v1/{parent=projects/*/databases/*/documents}/{collection_id}"
67+
}
6668
};
6769
}
6870

@@ -481,7 +483,9 @@ message RunQueryRequest {
481483
// The consistency mode for this transaction.
482484
// If not set, defaults to strong consistency.
483485
oneof consistency_selector {
484-
// Reads documents in a transaction.
486+
// Run the query within an already active transaction.
487+
//
488+
// The value here is the opaque transaction ID to execute the query in.
485489
bytes transaction = 5;
486490

487491
// Starts a new transaction and reads the documents.
@@ -504,8 +508,7 @@ message RunQueryResponse {
504508
// If set, no other fields will be set in this response.
505509
bytes transaction = 2;
506510

507-
// A query result.
508-
// Not set when reporting partial progress.
511+
// A query result, not set when reporting partial progress.
509512
Document document = 1;
510513

511514
// The time at which the document was read. This may be monotonically

dev/protos/google/firestore/v1/query.proto

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@ syntax = "proto3";
1616

1717
package google.firestore.v1;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/firestore/v1/document.proto";
2021
import "google/protobuf/wrappers.proto";
21-
import "google/api/annotations.proto";
2222

2323
option csharp_namespace = "Google.Cloud.Firestore.V1";
2424
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
@@ -213,6 +213,18 @@ message StructuredQuery {
213213
Direction direction = 2;
214214
}
215215

216+
// A sort direction.
217+
enum Direction {
218+
// Unspecified.
219+
DIRECTION_UNSPECIFIED = 0;
220+
221+
// Ascending.
222+
ASCENDING = 1;
223+
224+
// Descending.
225+
DESCENDING = 2;
226+
}
227+
216228
// A reference to a field, such as `max(messages.time) as max_time`.
217229
message FieldReference {
218230
string field_path = 2;
@@ -227,18 +239,6 @@ message StructuredQuery {
227239
repeated FieldReference fields = 2;
228240
}
229241

230-
// A sort direction.
231-
enum Direction {
232-
// Unspecified.
233-
DIRECTION_UNSPECIFIED = 0;
234-
235-
// Ascending.
236-
ASCENDING = 1;
237-
238-
// Descending.
239-
DESCENDING = 2;
240-
}
241-
242242
// The projection to return.
243243
Projection select = 1;
244244

dev/protos/google/firestore/v1/write.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@ package google.firestore.v1;
1919
import "google/firestore/v1/common.proto";
2020
import "google/firestore/v1/document.proto";
2121
import "google/protobuf/timestamp.proto";
22-
import "google/api/annotations.proto";
2322

2423
option csharp_namespace = "Google.Cloud.Firestore.V1";
2524
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";

dev/src/v1/firestore_client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,9 @@ export class FirestoreClient {
11861186
* @param {google.firestore.v1.StructuredQuery} request.structuredQuery
11871187
* A structured query.
11881188
* @param {Buffer} request.transaction
1189-
* Reads documents in a transaction.
1189+
* Run the query within an already active transaction.
1190+
*
1191+
* The value here is the opaque transaction ID to execute the query in.
11901192
* @param {google.firestore.v1.TransactionOptions} request.newTransaction
11911193
* Starts a new transaction and reads the documents.
11921194
* Defaults to a read-only transaction.

0 commit comments

Comments
 (0)