Skip to content

Commit b7c9d05

Browse files
Google APIscopybara-github
authored andcommitted
feat: update client libraries to support Database operations
PiperOrigin-RevId: 419710013
1 parent 73da669 commit b7c9d05

8 files changed

Lines changed: 275 additions & 35 deletions

File tree

google/firestore/admin/v1/BUILD.bazel

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -12,6 +21,7 @@ load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
1221
proto_library(
1322
name = "admin_proto",
1423
srcs = [
24+
"database.proto",
1525
"field.proto",
1626
"firestore_admin.proto",
1727
"index.proto",
@@ -25,6 +35,7 @@ proto_library(
2535
"//google/api:resource_proto",
2636
"//google/longrunning:operations_proto",
2737
"//google/type:latlng_proto",
38+
"@com_google_protobuf//:duration_proto",
2839
"@com_google_protobuf//:empty_proto",
2940
"@com_google_protobuf//:field_mask_proto",
3041
"@com_google_protobuf//:timestamp_proto",
@@ -67,11 +78,13 @@ java_gapic_library(
6778
srcs = [":admin_proto_with_info"],
6879
gapic_yaml = "firestore_gapic.yaml",
6980
grpc_service_config = "firestore_admin_grpc_service_config.json",
81+
service_yaml = "firestore_v1.yaml",
7082
test_deps = [
7183
":admin_java_grpc",
7284
],
7385
deps = [
7486
":admin_java_proto",
87+
"//google/api:api_java_proto",
7588
],
7689
)
7790

@@ -121,28 +134,31 @@ go_gapic_library(
121134
name = "admin_go_gapic",
122135
srcs = [":admin_proto_with_info"],
123136
grpc_service_config = "firestore_admin_grpc_service_config.json",
124-
importpath = "cloud.google.com/go/firestore/apiv1/admin;admin",
125-
service_yaml = "//google/firestore/admin:firestore_admin_v1.yaml",
137+
importpath = "cloud.google.com/go/firestore/admin/apiv1;admin",
138+
metadata = True,
139+
service_yaml = "firestore_v1.yaml",
126140
deps = [
127141
":admin_go_proto",
128142
"//google/longrunning:longrunning_go_proto",
129143
"@com_google_cloud_go//longrunning:go_default_library",
130144
"@com_google_cloud_go//longrunning/autogen:go_default_library",
145+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
131146
],
132147
)
133148

134149
go_test(
135150
name = "admin_go_gapic_test",
136151
srcs = [":admin_go_gapic_srcjar_test"],
137152
embed = [":admin_go_gapic"],
138-
importpath = "cloud.google.com/go/firestore/apiv1/admin",
153+
importpath = "cloud.google.com/go/firestore/admin/apiv1",
139154
)
140155

141156
# Open Source Packages
142157
go_gapic_assembly_pkg(
143158
name = "gapi-cloud-firestore-admin-v1-go",
144159
deps = [
145160
":admin_go_gapic",
161+
":admin_go_gapic_srcjar-metadata.srcjar",
146162
":admin_go_gapic_srcjar-test.srcjar",
147163
":admin_go_proto",
148164
],
@@ -158,7 +174,7 @@ load(
158174
)
159175

160176
py_gapic_library(
161-
name = "firestore_admin_py_gapic",
177+
name = "admin_py_gapic",
162178
srcs = [":admin_proto"],
163179
grpc_service_config = "firestore_admin_grpc_service_config.json",
164180
opt_args = [
@@ -167,10 +183,11 @@ py_gapic_library(
167183
],
168184
)
169185

186+
# Open Source Packages
170187
py_gapic_assembly_pkg(
171188
name = "firestore-admin-v1-py",
172189
deps = [
173-
":firestore_admin_py_gapic",
190+
":admin_py_gapic",
174191
],
175192
)
176193

@@ -199,6 +216,8 @@ php_grpc_library(
199216
php_gapic_library(
200217
name = "admin_php_gapic",
201218
srcs = [":admin_proto_with_info"],
219+
grpc_service_config = "firestore_admin_grpc_service_config.json",
220+
service_yaml = "firestore_v1.yaml",
202221
deps = [
203222
":admin_php_grpc",
204223
":admin_php_proto",
@@ -226,11 +245,12 @@ load(
226245

227246
nodejs_gapic_library(
228247
name = "admin_nodejs_gapic",
248+
package_name = "@google-cloud/firestore-admin",
229249
src = ":admin_proto_with_info",
230250
extra_protoc_parameters = ["metadata"],
231251
grpc_service_config = "firestore_admin_grpc_service_config.json",
232252
package = "google.firestore.admin.v1",
233-
service_yaml = "//google/firestore/admin:firestore_admin_v1.yaml",
253+
service_yaml = "firestore_v1.yaml",
234254
deps = [],
235255
)
236256

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+
}

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)