Skip to content

Commit

Permalink
feat: ability to specify the Collection Group query scope in the V1 A…
Browse files Browse the repository at this point in the history
…dmin API (#762)

* [CHANGE ME] Re-generated  to pick up changes in the API or client library generator.

* removed protos.d.ts, ran synthtool

* one more synthtool run
  • Loading branch information
yoshi-automation authored and alexander-fenster committed Sep 30, 2019
1 parent a425b8b commit b16cd40
Show file tree
Hide file tree
Showing 26 changed files with 199 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/{{metadata['repo']['name']}}/issues) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-firestore/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
Expand Down
7 changes: 2 additions & 5 deletions dev/protos/google/firestore/admin/v1/field.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ option java_package = "com.google.firestore.admin.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";


// Represents a single field in the database.
//
// Fields are grouped by their "Collection Group", which represent all
Expand All @@ -39,14 +38,12 @@ message Field {
// The indexes supported for this field.
repeated Index indexes = 1;

// Output only.
// When true, the `Field`'s index configuration is set from the
// Output only. When true, the `Field`'s index configuration is set from the
// configuration specified by the `ancestor_field`.
// When false, the `Field`'s index configuration is defined explicitly.
bool uses_ancestor_config = 2;

// Output only.
// Specifies the resource name of the `Field` from which this field's
// Output only. Specifies the resource name of the `Field` from which this field's
// index configuration is set (when `uses_ancestor_config` is true),
// or from which it *would* be set if this field had no index configuration
// (when `uses_ancestor_config` is false).
Expand Down
7 changes: 6 additions & 1 deletion dev/protos/google/firestore/admin/v1/firestore_admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "google/firestore/admin/v1/index.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/api/client.proto";

option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin";
Expand All @@ -32,10 +33,14 @@ option java_package = "com.google.firestore.admin.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";


// Operations are created by service `FirestoreAdmin`, but are accessed via
// service `google.longrunning.Operations`.
service FirestoreAdmin {
option (google.api.default_host) = "firestore.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/datastore";

// Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
// which may be used to track the status of the creation. The metadata for
// the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
Expand Down
12 changes: 7 additions & 5 deletions dev/protos/google/firestore/admin/v1/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ option java_package = "com.google.firestore.admin.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";


// Cloud Firestore indexes enable simple and complex queries against
// documents in a database.
message Index {
Expand Down Expand Up @@ -82,6 +81,11 @@ message Index {
// against a collection that is the child of a specific document, specified
// at query time, and that has the collection id specified by the index.
COLLECTION = 1;

// Indexes with a collection group query scope specified allow queries
// against all collections that has the collection id specified by the
// index.
COLLECTION_GROUP = 2;
}

// The state of an index. During index creation, an index will be in the
Expand Down Expand Up @@ -114,8 +118,7 @@ message Index {
NEEDS_REPAIR = 3;
}

// Output only.
// A server defined name for this index.
// Output only. A server defined name for this index.
// The form of this name for composite indexes will be:
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
// For single field indexes, this field will be empty.
Expand Down Expand Up @@ -143,7 +146,6 @@ message Index {
// field path equal to the field path of the associated field.
repeated IndexField fields = 3;

// Output only.
// The serving state of the index.
// Output only. The serving state of the index.
State state = 4;
}
1 change: 0 additions & 1 deletion dev/protos/google/firestore/admin/v1/location.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ option java_package = "com.google.firestore.admin.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";


// The metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
message LocationMetadata {

Expand Down
23 changes: 11 additions & 12 deletions dev/protos/google/firestore/admin/v1/operation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ option java_package = "com.google.firestore.admin.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";


// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
message IndexOperationMetadata {
Expand Down Expand Up @@ -163,6 +162,17 @@ message ExportDocumentsResponse {
string output_uri_prefix = 1;
}

// Describes the progress of the operation.
// Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
// is used.
message Progress {
// The amount of work estimated.
int64 estimated_work = 1;

// The amount of work completed.
int64 completed_work = 2;
}

// Describes the state of the operation.
enum OperationState {
// Unspecified.
Expand Down Expand Up @@ -191,14 +201,3 @@ enum OperationState {
// google.longrunning.Operations.CancelOperation.
CANCELLED = 7;
}

// Describes the progress of the operation.
// Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
// is used.
message Progress {
// The amount of work estimated.
int64 estimated_work = 1;

// The amount of work completed.
int64 completed_work = 2;
}
1 change: 0 additions & 1 deletion dev/protos/google/firestore/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ option java_package = "com.google.firestore.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1";


// A set of field paths on a document.
// Used to restrict a get or update operation on a document to a subset of its
// fields.
Expand Down
1 change: 0 additions & 1 deletion dev/protos/google/firestore/v1/document.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ option java_package = "com.google.firestore.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1";


// A Firestore document.
//
// Must not exceed 1 MiB - 4 bytes.
Expand Down
23 changes: 10 additions & 13 deletions dev/protos/google/firestore/v1/firestore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "google/firestore/v1/write.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/api/client.proto";

option csharp_namespace = "Google.Cloud.Firestore.V1";
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
Expand All @@ -33,6 +34,7 @@ option java_outer_classname = "FirestoreProto";
option java_package = "com.google.firestore.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1";

// Specification of the Firestore API.

// The Cloud Firestore service.
Expand All @@ -52,6 +54,11 @@ option php_namespace = "Google\\Cloud\\Firestore\\V1";
// committed. Any read with an equal or greater `read_time` is guaranteed
// to see the effects of the transaction.
service Firestore {
option (google.api.default_host) = "firestore.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/datastore";

// Gets a single document.
rpc GetDocument(GetDocumentRequest) returns (Document) {
option (google.api.http) = {
Expand Down Expand Up @@ -654,14 +661,8 @@ message Target {
google.protobuf.Timestamp read_time = 11;
}

// A client provided target ID.
//
// If not set, the server will assign an ID for the target.
//
// Used for resuming a target without changing IDs. The IDs can either be
// client-assigned or be server-assigned in a previous stream. All targets
// with client provided IDs must be added before adding a target that needs
// a server-assigned id.
// The target ID that identifies the target on the stream. Must be a positive
// number and non-zero.
int32 target_id = 5;

// If the target should be removed once it is current and consistent.
Expand Down Expand Up @@ -706,11 +707,7 @@ message TargetChange {
//
// If empty, the change applies to all targets.
//
// For `target_change_type=ADD`, the order of the target IDs matches the order
// of the requests to add the targets. This allows clients to unambiguously
// associate server-assigned target IDs with added targets.
//
// For other states, the order of the target IDs is not defined.
// The order of the target IDs is not defined.
repeated int32 target_ids = 2;

// The error that resulted in this change, if applicable.
Expand Down
37 changes: 18 additions & 19 deletions dev/protos/google/firestore/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ option java_package = "com.google.firestore.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1";


// A Firestore query.
message StructuredQuery {
// A selection of a collection, such as `messages as m1`.
Expand Down Expand Up @@ -115,6 +114,18 @@ message StructuredQuery {
Value value = 3;
}

// A sort direction.
enum Direction {
// Unspecified.
DIRECTION_UNSPECIFIED = 0;

// Ascending.
ASCENDING = 1;

// Descending.
DESCENDING = 2;
}

// A filter with a single operand.
message UnaryFilter {
// A unary operator.
Expand All @@ -125,7 +136,7 @@ message StructuredQuery {
// Test if a field is equal to NaN.
IS_NAN = 2;

// Test if an exprestion evaluates to Null.
// Test if an expression evaluates to Null.
IS_NULL = 3;
}

Expand All @@ -139,11 +150,6 @@ message StructuredQuery {
}
}

// A reference to a field, such as `max(messages.time) as max_time`.
message FieldReference {
string field_path = 2;
}

// An order on a field.
message Order {
// The field to order by.
Expand All @@ -153,6 +159,11 @@ message StructuredQuery {
Direction direction = 2;
}

// A reference to a field, such as `max(messages.time) as max_time`.
message FieldReference {
string field_path = 2;
}

// The projection of document's fields to return.
message Projection {
// The fields to return.
Expand All @@ -162,18 +173,6 @@ message StructuredQuery {
repeated FieldReference fields = 2;
}

// A sort direction.
enum Direction {
// Unspecified.
DIRECTION_UNSPECIFIED = 0;

// Ascending.
ASCENDING = 1;

// Descending.
DESCENDING = 2;
}

// The projection to return.
Projection select = 1;

Expand Down
1 change: 0 additions & 1 deletion dev/protos/google/firestore/v1/write.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ option java_package = "com.google.firestore.v1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1";


// A write on a document.
message Write {
// The operation to execute.
Expand Down
1 change: 0 additions & 1 deletion dev/protos/google/firestore/v1beta1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ option java_package = "com.google.firestore.v1beta1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";


// A set of field paths on a document.
// Used to restrict a get or update operation on a document to a subset of its
// fields.
Expand Down
1 change: 0 additions & 1 deletion dev/protos/google/firestore/v1beta1/document.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ option java_package = "com.google.firestore.v1beta1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";


// A Firestore document.
//
// Must not exceed 1 MiB - 4 bytes.
Expand Down
23 changes: 10 additions & 13 deletions dev/protos/google/firestore/v1beta1/firestore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "google/firestore/v1beta1/write.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/api/client.proto";

option csharp_namespace = "Google.Cloud.Firestore.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/firestore/v1beta1;firestore";
Expand All @@ -33,6 +34,7 @@ option java_outer_classname = "FirestoreProto";
option java_package = "com.google.firestore.v1beta1";
option objc_class_prefix = "GCFS";
option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";

// Specification of the Firestore API.

// The Cloud Firestore service.
Expand All @@ -52,6 +54,11 @@ option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
// committed. Any read with an equal or greater `read_time` is guaranteed
// to see the effects of the transaction.
service Firestore {
option (google.api.default_host) = "firestore.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/datastore";

// Gets a single document.
rpc GetDocument(GetDocumentRequest) returns (Document) {
option (google.api.http) = {
Expand Down Expand Up @@ -654,14 +661,8 @@ message Target {
google.protobuf.Timestamp read_time = 11;
}

// A client provided target ID.
//
// If not set, the server will assign an ID for the target.
//
// Used for resuming a target without changing IDs. The IDs can either be
// client-assigned or be server-assigned in a previous stream. All targets
// with client provided IDs must be added before adding a target that needs
// a server-assigned id.
// The target ID that identifies the target on the stream. Must be a positive
// number and non-zero.
int32 target_id = 5;

// If the target should be removed once it is current and consistent.
Expand Down Expand Up @@ -706,11 +707,7 @@ message TargetChange {
//
// If empty, the change applies to all targets.
//
// For `target_change_type=ADD`, the order of the target IDs matches the order
// of the requests to add the targets. This allows clients to unambiguously
// associate server-assigned target IDs with added targets.
//
// For other states, the order of the target IDs is not defined.
// The order of the target IDs is not defined.
repeated int32 target_ids = 2;

// The error that resulted in this change, if applicable.
Expand Down
Loading

0 comments on commit b16cd40

Please sign in to comment.