Skip to content

Commit a8c6c7c

Browse files
Google APIscopybara-github
authored andcommitted
feat: add firestore aggregation query apis to the stable googleapis branch
PiperOrigin-RevId: 473753776
1 parent b174c58 commit a8c6c7c

5 files changed

Lines changed: 319 additions & 20 deletions

File tree

google/firestore/admin/v1/BUILD.bazel

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ proto_library(
3434
"//google/api:field_behavior_proto",
3535
"//google/api:resource_proto",
3636
"//google/longrunning:operations_proto",
37-
"//google/type:latlng_proto",
38-
"@com_google_protobuf//:duration_proto",
3937
"@com_google_protobuf//:empty_proto",
4038
"@com_google_protobuf//:field_mask_proto",
4139
"@com_google_protobuf//:timestamp_proto",
@@ -47,6 +45,7 @@ proto_library_with_info(
4745
deps = [
4846
":admin_proto",
4947
"//google/cloud:common_resources_proto",
48+
"//google/cloud/location:location_proto",
5049
],
5150
)
5251

@@ -78,14 +77,17 @@ java_gapic_library(
7877
srcs = [":admin_proto_with_info"],
7978
gapic_yaml = "firestore_gapic.yaml",
8079
grpc_service_config = "firestore_admin_grpc_service_config.json",
80+
rest_numeric_enums = False,
8181
service_yaml = "firestore_v1.yaml",
8282
test_deps = [
8383
":admin_java_grpc",
84+
"//google/cloud/location:location_java_grpc",
8485
],
8586
transport = "grpc+rest",
8687
deps = [
8788
":admin_java_proto",
8889
"//google/api:api_java_proto",
90+
"//google/cloud/location:location_java_proto",
8991
],
9092
)
9193

@@ -101,6 +103,7 @@ java_gapic_test(
101103
# Open Source Packages
102104
java_gapic_assembly_gradle_pkg(
103105
name = "google-cloud-firestore-admin-v1-java",
106+
include_samples = True,
104107
transport = "grpc+rest",
105108
deps = [
106109
":admin_java_gapic",
@@ -129,7 +132,6 @@ go_proto_library(
129132
deps = [
130133
"//google/api:annotations_go_proto",
131134
"//google/longrunning:longrunning_go_proto",
132-
"//google/type:latlng_go_proto",
133135
],
134136
)
135137

@@ -139,14 +141,15 @@ go_gapic_library(
139141
grpc_service_config = "firestore_admin_grpc_service_config.json",
140142
importpath = "cloud.google.com/go/firestore/admin/apiv1;admin",
141143
metadata = True,
144+
rest_numeric_enums = False,
142145
service_yaml = "firestore_v1.yaml",
143146
transport = "grpc+rest",
144147
deps = [
145148
":admin_go_proto",
149+
"//google/cloud/location:location_go_proto",
146150
"//google/longrunning:longrunning_go_proto",
147151
"@com_google_cloud_go//longrunning:go_default_library",
148152
"@com_google_cloud_go//longrunning/autogen:go_default_library",
149-
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
150153
],
151154
)
152155

@@ -183,8 +186,12 @@ py_gapic_library(
183186
srcs = [":admin_proto"],
184187
grpc_service_config = "firestore_admin_grpc_service_config.json",
185188
opt_args = [
186-
"python-gapic-namespace=google.cloud",
187189
"python-gapic-name=firestore_admin",
190+
"python-gapic-namespace=google.cloud",
191+
],
192+
rest_numeric_enums = False,
193+
service_yaml = "firestore_v1.yaml",
194+
deps = [
188195
],
189196
)
190197

@@ -232,6 +239,7 @@ php_gapic_library(
232239
name = "admin_php_gapic",
233240
srcs = [":admin_proto_with_info"],
234241
grpc_service_config = "firestore_admin_grpc_service_config.json",
242+
rest_numeric_enums = False,
235243
service_yaml = "firestore_v1.yaml",
236244
deps = [
237245
":admin_php_grpc",
@@ -265,6 +273,7 @@ nodejs_gapic_library(
265273
extra_protoc_parameters = ["metadata"],
266274
grpc_service_config = "firestore_admin_grpc_service_config.json",
267275
package = "google.firestore.admin.v1",
276+
rest_numeric_enums = False,
268277
service_yaml = "firestore_v1.yaml",
269278
deps = [],
270279
)
@@ -303,16 +312,18 @@ ruby_cloud_gapic_library(
303312
name = "admin_ruby_gapic",
304313
srcs = [":admin_proto_with_info"],
305314
extra_protoc_parameters = [
306-
"ruby-cloud-gem-name=google-cloud-firestore-admin-v1",
307-
"ruby-cloud-env-prefix=FIRESTORE",
308-
"ruby-cloud-product-url=https://cloud.google.com/firestore",
309315
"ruby-cloud-api-id=firestore.googleapis.com",
310316
"ruby-cloud-api-shortname=firestore",
317+
"ruby-cloud-env-prefix=FIRESTORE",
318+
"ruby-cloud-gem-name=google-cloud-firestore-admin-v1",
319+
"ruby-cloud-product-url=https://cloud.google.com/firestore",
311320
"ruby-cloud-wrapper-gem-override=google-cloud-firestore",
312321
],
313322
grpc_service_config = "firestore_admin_grpc_service_config.json",
323+
rest_numeric_enums = False,
314324
ruby_cloud_description = "Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development.",
315325
ruby_cloud_title = "Cloud Firestore Admin V1",
326+
service_yaml = "firestore_v1.yaml",
316327
deps = [
317328
":admin_ruby_grpc",
318329
":admin_ruby_proto",
@@ -356,6 +367,7 @@ csharp_gapic_library(
356367
srcs = [":admin_proto_with_info"],
357368
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
358369
grpc_service_config = "firestore_admin_grpc_service_config.json",
370+
rest_numeric_enums = False,
359371
service_yaml = "firestore_v1.yaml",
360372
deps = [
361373
":admin_csharp_grpc",

google/firestore/v1/BUILD.bazel

Lines changed: 37 additions & 5 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 = "firestore_proto",
1423
srcs = [
24+
"aggregation_result.proto",
1525
"common.proto",
1626
"document.proto",
1727
"firestore.proto",
@@ -36,6 +46,7 @@ proto_library_with_info(
3646
deps = [
3747
":firestore_proto",
3848
"//google/cloud:common_resources_proto",
49+
"//google/cloud/location:location_proto",
3950
],
4051
)
4152

@@ -67,12 +78,17 @@ java_gapic_library(
6778
srcs = [":firestore_proto_with_info"],
6879
gapic_yaml = "firestore_gapic.yaml",
6980
grpc_service_config = "firestore_grpc_service_config.json",
81+
rest_numeric_enums = False,
82+
service_yaml = "firestore_v1.yaml",
7083
test_deps = [
7184
":firestore_java_grpc",
85+
"//google/cloud/location:location_java_grpc",
7286
],
7387
transport = "grpc+rest",
7488
deps = [
7589
":firestore_java_proto",
90+
"//google/api:api_java_proto",
91+
"//google/cloud/location:location_java_proto",
7692
],
7793
)
7894

@@ -88,6 +104,7 @@ java_gapic_test(
88104
# Open Source Packages
89105
java_gapic_assembly_gradle_pkg(
90106
name = "google-cloud-firestore-v1-java",
107+
include_samples = True,
91108
transport = "grpc+rest",
92109
deps = [
93110
":firestore_java_gapic",
@@ -115,7 +132,6 @@ go_proto_library(
115132
protos = [":firestore_proto"],
116133
deps = [
117134
"//google/api:annotations_go_proto",
118-
"//google/longrunning:longrunning_go_proto",
119135
"//google/rpc:status_go_proto",
120136
"//google/type:latlng_go_proto",
121137
],
@@ -126,14 +142,17 @@ go_gapic_library(
126142
srcs = [":firestore_proto_with_info"],
127143
grpc_service_config = "firestore_grpc_service_config.json",
128144
importpath = "cloud.google.com/go/firestore/apiv1;firestore",
145+
metadata = True,
146+
rest_numeric_enums = False,
129147
service_yaml = "firestore_v1.yaml",
130148
transport = "grpc+rest",
131149
deps = [
132150
":firestore_go_proto",
151+
"//google/cloud/location:location_go_proto",
152+
"//google/longrunning:longrunning_go_gapic",
133153
"//google/longrunning:longrunning_go_proto",
134154
"@com_google_cloud_go//longrunning:go_default_library",
135155
"@com_google_cloud_go//longrunning/autogen:go_default_library",
136-
"@io_bazel_rules_go//proto/wkt:any_go_proto",
137156
],
138157
)
139158

@@ -149,6 +168,7 @@ go_gapic_assembly_pkg(
149168
name = "gapi-cloud-firestore-v1-go",
150169
deps = [
151170
":firestore_go_gapic",
171+
":firestore_go_gapic_srcjar-metadata.srcjar",
152172
":firestore_go_gapic_srcjar-test.srcjar",
153173
":firestore_go_proto",
154174
],
@@ -169,6 +189,10 @@ py_gapic_library(
169189
srcs = [":firestore_proto"],
170190
grpc_service_config = "firestore_grpc_service_config.json",
171191
opt_args = ["python-gapic-namespace=google.cloud"],
192+
rest_numeric_enums = False,
193+
service_yaml = "firestore_v1.yaml",
194+
deps = [
195+
],
172196
)
173197

174198
py_test(
@@ -181,6 +205,7 @@ py_test(
181205
deps = [":firestore_py_gapic"],
182206
)
183207

208+
# Open Source Packages
184209
py_gapic_assembly_pkg(
185210
name = "firestore-v1-py",
186211
deps = [
@@ -213,6 +238,9 @@ php_grpc_library(
213238
php_gapic_library(
214239
name = "firestore_php_gapic",
215240
srcs = [":firestore_proto_with_info"],
241+
grpc_service_config = "firestore_grpc_service_config.json",
242+
rest_numeric_enums = False,
243+
service_yaml = "firestore_v1.yaml",
216244
deps = [
217245
":firestore_php_grpc",
218246
":firestore_php_proto",
@@ -245,6 +273,7 @@ nodejs_gapic_library(
245273
extra_protoc_parameters = ["metadata"],
246274
grpc_service_config = "firestore_grpc_service_config.json",
247275
package = "google.firestore.v1",
276+
rest_numeric_enums = False,
248277
service_yaml = "firestore_v1.yaml",
249278
deps = [],
250279
)
@@ -283,15 +312,17 @@ ruby_cloud_gapic_library(
283312
name = "firestore_ruby_gapic",
284313
srcs = [":firestore_proto_with_info"],
285314
extra_protoc_parameters = [
286-
"ruby-cloud-gem-name=google-cloud-firestore-v1",
287-
"ruby-cloud-env-prefix=FIRESTORE",
288-
"ruby-cloud-product-url=https://cloud.google.com/firestore",
289315
"ruby-cloud-api-id=firestore.googleapis.com",
290316
"ruby-cloud-api-shortname=firestore",
317+
"ruby-cloud-env-prefix=FIRESTORE",
318+
"ruby-cloud-gem-name=google-cloud-firestore-v1",
319+
"ruby-cloud-product-url=https://cloud.google.com/firestore",
291320
],
292321
grpc_service_config = "firestore_grpc_service_config.json",
322+
rest_numeric_enums = False,
293323
ruby_cloud_description = "Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development.",
294324
ruby_cloud_title = "Cloud Firestore V1",
325+
service_yaml = "firestore_v1.yaml",
295326
deps = [
296327
":firestore_ruby_grpc",
297328
":firestore_ruby_proto",
@@ -335,6 +366,7 @@ csharp_gapic_library(
335366
srcs = [":firestore_proto_with_info"],
336367
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
337368
grpc_service_config = "firestore_grpc_service_config.json",
369+
rest_numeric_enums = False,
338370
service_yaml = "firestore_v1.yaml",
339371
deps = [
340372
":firestore_csharp_grpc",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2022 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.v1;
18+
19+
import "google/firestore/v1/document.proto";
20+
21+
option csharp_namespace = "Google.Cloud.Firestore.V1";
22+
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "AggregationResultProto";
25+
option java_package = "com.google.firestore.v1";
26+
option objc_class_prefix = "GCFS";
27+
option php_namespace = "Google\\Cloud\\Firestore\\V1";
28+
option ruby_package = "Google::Cloud::Firestore::V1";
29+
30+
// The result of a single bucket from a Firestore aggregation query.
31+
//
32+
// The keys of `aggregate_fields` are the same for all results in an aggregation
33+
// query, unlike document queries which can have different fields present for
34+
// each result.
35+
message AggregationResult {
36+
// The result of the aggregation functions, ex: `COUNT(*) AS total_docs`.
37+
//
38+
// The key is the [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias]
39+
// assigned to the aggregation function on input and the size of this map
40+
// equals the number of aggregation functions in the query.
41+
map<string, Value> aggregate_fields = 2;
42+
}

0 commit comments

Comments
 (0)