Skip to content

Commit f3729cf

Browse files
fix: split v1 and v1beta1 protos to improve startup time (#1664)
1 parent 1518ec7 commit f3729cf

28 files changed

+11042
-5717
lines changed

.jsdoc.js

Lines changed: 2 additions & 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.
@@ -40,7 +40,7 @@ module.exports = {
4040
includePattern: '\\.js$'
4141
},
4242
templates: {
43-
copyright: 'Copyright 2021 Google LLC',
43+
copyright: 'Copyright 2022 Google LLC',
4444
includeDate: false,
4545
sourceFiles: false,
4646
systemName: '@google-cloud/firestore',

dev/protos/firestore_admin_v1_proto_api.d.ts

Lines changed: 348 additions & 4 deletions
Large diffs are not rendered by default.

dev/protos/firestore_admin_v1_proto_api.js

Lines changed: 756 additions & 26 deletions
Large diffs are not rendered by default.

dev/protos/google/api/resource.proto

Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,15 @@ extend google.protobuf.MessageOptions {
5757
// // For Kubernetes resources, the format is {api group}/{kind}.
5858
// option (google.api.resource) = {
5959
// type: "pubsub.googleapis.com/Topic"
60-
// name_descriptor: {
61-
// pattern: "projects/{project}/topics/{topic}"
62-
// parent_type: "cloudresourcemanager.googleapis.com/Project"
63-
// parent_name_extractor: "projects/{project}"
64-
// }
60+
// pattern: "projects/{project}/topics/{topic}"
6561
// };
6662
// }
6763
//
6864
// The ResourceDescriptor Yaml config will look like:
6965
//
7066
// resources:
7167
// - type: "pubsub.googleapis.com/Topic"
72-
// name_descriptor:
73-
// - pattern: "projects/{project}/topics/{topic}"
74-
// parent_type: "cloudresourcemanager.googleapis.com/Project"
75-
// parent_name_extractor: "projects/{project}"
68+
// pattern: "projects/{project}/topics/{topic}"
7669
//
7770
// Sometimes, resources have multiple patterns, typically because they can
7871
// live under multiple parents.
@@ -82,75 +75,21 @@ extend google.protobuf.MessageOptions {
8275
// message LogEntry {
8376
// option (google.api.resource) = {
8477
// type: "logging.googleapis.com/LogEntry"
85-
// name_descriptor: {
86-
// pattern: "projects/{project}/logs/{log}"
87-
// parent_type: "cloudresourcemanager.googleapis.com/Project"
88-
// parent_name_extractor: "projects/{project}"
89-
// }
90-
// name_descriptor: {
91-
// pattern: "folders/{folder}/logs/{log}"
92-
// parent_type: "cloudresourcemanager.googleapis.com/Folder"
93-
// parent_name_extractor: "folders/{folder}"
94-
// }
95-
// name_descriptor: {
96-
// pattern: "organizations/{organization}/logs/{log}"
97-
// parent_type: "cloudresourcemanager.googleapis.com/Organization"
98-
// parent_name_extractor: "organizations/{organization}"
99-
// }
100-
// name_descriptor: {
101-
// pattern: "billingAccounts/{billing_account}/logs/{log}"
102-
// parent_type: "billing.googleapis.com/BillingAccount"
103-
// parent_name_extractor: "billingAccounts/{billing_account}"
104-
// }
78+
// pattern: "projects/{project}/logs/{log}"
79+
// pattern: "folders/{folder}/logs/{log}"
80+
// pattern: "organizations/{organization}/logs/{log}"
81+
// pattern: "billingAccounts/{billing_account}/logs/{log}"
10582
// };
10683
// }
10784
//
10885
// The ResourceDescriptor Yaml config will look like:
10986
//
11087
// resources:
11188
// - type: 'logging.googleapis.com/LogEntry'
112-
// name_descriptor:
113-
// - pattern: "projects/{project}/logs/{log}"
114-
// parent_type: "cloudresourcemanager.googleapis.com/Project"
115-
// parent_name_extractor: "projects/{project}"
116-
// - pattern: "folders/{folder}/logs/{log}"
117-
// parent_type: "cloudresourcemanager.googleapis.com/Folder"
118-
// parent_name_extractor: "folders/{folder}"
119-
// - pattern: "organizations/{organization}/logs/{log}"
120-
// parent_type: "cloudresourcemanager.googleapis.com/Organization"
121-
// parent_name_extractor: "organizations/{organization}"
122-
// - pattern: "billingAccounts/{billing_account}/logs/{log}"
123-
// parent_type: "billing.googleapis.com/BillingAccount"
124-
// parent_name_extractor: "billingAccounts/{billing_account}"
125-
//
126-
// For flexible resources, the resource name doesn't contain parent names, but
127-
// the resource itself has parents for policy evaluation.
128-
//
129-
// Example:
130-
//
131-
// message Shelf {
132-
// option (google.api.resource) = {
133-
// type: "library.googleapis.com/Shelf"
134-
// name_descriptor: {
135-
// pattern: "shelves/{shelf}"
136-
// parent_type: "cloudresourcemanager.googleapis.com/Project"
137-
// }
138-
// name_descriptor: {
139-
// pattern: "shelves/{shelf}"
140-
// parent_type: "cloudresourcemanager.googleapis.com/Folder"
141-
// }
142-
// };
143-
// }
144-
//
145-
// The ResourceDescriptor Yaml config will look like:
146-
//
147-
// resources:
148-
// - type: 'library.googleapis.com/Shelf'
149-
// name_descriptor:
150-
// - pattern: "shelves/{shelf}"
151-
// parent_type: "cloudresourcemanager.googleapis.com/Project"
152-
// - pattern: "shelves/{shelf}"
153-
// parent_type: "cloudresourcemanager.googleapis.com/Folder"
89+
// pattern: "projects/{project}/logs/{log}"
90+
// pattern: "folders/{folder}/logs/{log}"
91+
// pattern: "organizations/{organization}/logs/{log}"
92+
// pattern: "billingAccounts/{billing_account}/logs/{log}"
15493
message ResourceDescriptor {
15594
// A description of the historical or future-looking state of the
15695
// resource pattern.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.firestore.admin.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/protobuf/duration.proto";
22+
import "google/protobuf/timestamp.proto";
23+
import "google/api/annotations.proto";
24+
25+
option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
26+
option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin";
27+
option java_multiple_files = true;
28+
option java_outer_classname = "DatabaseProto";
29+
option java_package = "com.google.firestore.admin.v1";
30+
option objc_class_prefix = "GCFS";
31+
option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
32+
option ruby_package = "Google::Cloud::Firestore::Admin::V1";
33+
34+
// A Cloud Firestore Database.
35+
// Currently only one database is allowed per cloud project; this database
36+
// must have a `database_id` of '(default)'.
37+
message Database {
38+
option (google.api.resource) = {
39+
type: "firestore.googleapis.com/Database"
40+
pattern: "projects/{project}/databases/{database}"
41+
style: DECLARATIVE_FRIENDLY
42+
};
43+
44+
// The type of the database.
45+
// See https://cloud.google.com/datastore/docs/firestore-or-datastore for
46+
// information about how to choose.
47+
enum DatabaseType {
48+
// The default value. This value is used if the database type is omitted.
49+
DATABASE_TYPE_UNSPECIFIED = 0;
50+
51+
// Firestore Native Mode
52+
FIRESTORE_NATIVE = 1;
53+
54+
// Firestore in Datastore Mode.
55+
DATASTORE_MODE = 2;
56+
}
57+
58+
// The type of concurrency control mode for transactions.
59+
enum ConcurrencyMode {
60+
// Not used.
61+
CONCURRENCY_MODE_UNSPECIFIED = 0;
62+
63+
// Use optimistic concurrency control by default. This setting is available
64+
// for Cloud Firestore customers.
65+
OPTIMISTIC = 1;
66+
67+
// Use pessimistic concurrency control by default. This setting is available
68+
// for Cloud Firestore customers.
69+
// This is the default setting for Cloud Firestore.
70+
PESSIMISTIC = 2;
71+
72+
// Use optimistic concurrency control with entity groups by default. This is
73+
// the only available setting for Cloud Datastore customers.
74+
// This is the default setting for Cloud Datastore.
75+
OPTIMISTIC_WITH_ENTITY_GROUPS = 3;
76+
}
77+
78+
// The resource name of the Database.
79+
// Format: `projects/{project}/databases/{database}`
80+
string name = 1;
81+
82+
// The location of the database. Available databases are listed at
83+
// https://cloud.google.com/firestore/docs/locations.
84+
string location_id = 9;
85+
86+
// The type of the database.
87+
// See https://cloud.google.com/datastore/docs/firestore-or-datastore for
88+
// information about how to choose.
89+
DatabaseType type = 10;
90+
91+
// The concurrency control mode to use for this database.
92+
ConcurrencyMode concurrency_mode = 15;
93+
94+
// This checksum is computed by the server based on the value of other
95+
// fields, and may be sent on update and delete requests to ensure the
96+
// client has an up-to-date value before proceeding.
97+
string etag = 99;
98+
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2021 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.
@@ -11,12 +11,12 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
//
1514

1615
syntax = "proto3";
1716

1817
package google.firestore.admin.v1;
1918

19+
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
2121
import "google/firestore/admin/v1/index.proto";
2222
import "google/api/annotations.proto";
@@ -64,7 +64,7 @@ message Field {
6464
bool reverting = 4;
6565
}
6666

67-
// A field name of the form
67+
// Required. A field name of the form
6868
// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
6969
//
7070
// A field path may be a simple field name, e.g. `address` or a path to fields
@@ -90,7 +90,7 @@ message Field {
9090
// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
9191
// Indexes defined on this `Field` will be applied to all fields which do not
9292
// have their own `Field` index configuration.
93-
string name = 1;
93+
string name = 1 [(google.api.field_behavior) = REQUIRED];
9494

9595
// The index configuration for this field. If unset, field indexing will
9696
// revert to the configuration defined by the `ancestor_field`. To

0 commit comments

Comments
 (0)