google-apis-firestore_v1 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79d75ca07bcd222ba237216101d18b9f778697f585548f89436e52a96cfdab10
4
- data.tar.gz: d2604ab85f02d3464673b1eb98c89eb073646160a5358749f88b47e92ac01f49
3
+ metadata.gz: 56754b1259d90ecbc12eae2441505aaabf0aabbddc39c7cbd8ecb1d2c7851e41
4
+ data.tar.gz: e87dffa8f484e736ae95702a9d9704e5feb66f82ef4bd173474d30986e101b12
5
5
  SHA512:
6
- metadata.gz: 74258461056606d52df568677be6aaf876a79804b034a63a026a053992aa53e55235d906d1b7909308052c008084f3d9ca7fdbe48407efcf508cec562c2cb833
7
- data.tar.gz: 1ef0f1969d2f4fe28c00e516f69267e8f8cfca1487fc419b1fdcbf3f859cd14b1c0bde73bb9e8e440b645a55584b2ec7369cf9d792277f43f17e9525c73fec3f
6
+ metadata.gz: 7a55df4a172bf30a5924ce4c277f640ae39bf5b075e67b48f1e7291d1fec3c297df1886e1c014274e90c3b0863508abd851d46fcfb95bccf0a5a2449126747e6
7
+ data.tar.gz: 2d0c4b0f9f1715769f528db02013ac2a50ee49f9557f135331f0d46c9abc3e41d19a6bbc480cc00f43a97ecfa1091bc529068f04e76d3ff4e932c0f721b5fe20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release history for google-apis-firestore_v1
2
2
 
3
+ ### v0.28.0 (2022-09-28)
4
+
5
+ * Regenerated from discovery document revision 20220915
6
+
7
+ ### v0.27.0 (2022-09-21)
8
+
9
+ * Regenerated using generator version 0.10.0
10
+
3
11
  ### v0.26.0 (2022-09-16)
4
12
 
5
13
  * Unspecified changes
@@ -22,6 +22,62 @@ module Google
22
22
  module Apis
23
23
  module FirestoreV1
24
24
 
25
+ # Defines a aggregation that produces a single result.
26
+ class Aggregation
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # Optional. Optional name of the field to store the result of the aggregation
30
+ # into. If not provided, Firestore will pick a default name following the format
31
+ # `field_`. For example: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1,
32
+ # COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) OVER ( ... ); `
33
+ # `` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS
34
+ # field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) AS field_2 OVER ( ...
35
+ # ); ``` Requires: * Must be unique across all aggregation aliases. * Conform to
36
+ # document field name limitations.
37
+ # Corresponds to the JSON property `alias`
38
+ # @return [String]
39
+ attr_accessor :alias
40
+
41
+ # Count of documents that match the query. The `COUNT(*)` aggregation function
42
+ # operates on the entire document so it does not require a field reference.
43
+ # Corresponds to the JSON property `count`
44
+ # @return [Google::Apis::FirestoreV1::Count]
45
+ attr_accessor :count
46
+
47
+ def initialize(**args)
48
+ update!(**args)
49
+ end
50
+
51
+ # Update properties of this object
52
+ def update!(**args)
53
+ @alias = args[:alias] if args.key?(:alias)
54
+ @count = args[:count] if args.key?(:count)
55
+ end
56
+ end
57
+
58
+ # The result of a single bucket from a Firestore aggregation query. The keys of `
59
+ # aggregate_fields` are the same for all results in an aggregation query, unlike
60
+ # document queries which can have different fields present for each result.
61
+ class AggregationResult
62
+ include Google::Apis::Core::Hashable
63
+
64
+ # The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. The key
65
+ # is the alias assigned to the aggregation function on input and the size of
66
+ # this map equals the number of aggregation functions in the query.
67
+ # Corresponds to the JSON property `aggregateFields`
68
+ # @return [Hash<String,Google::Apis::FirestoreV1::Value>]
69
+ attr_accessor :aggregate_fields
70
+
71
+ def initialize(**args)
72
+ update!(**args)
73
+ end
74
+
75
+ # Update properties of this object
76
+ def update!(**args)
77
+ @aggregate_fields = args[:aggregate_fields] if args.key?(:aggregate_fields)
78
+ end
79
+ end
80
+
25
81
  # An array value.
26
82
  class ArrayValue
27
83
  include Google::Apis::Core::Hashable
@@ -334,6 +390,30 @@ module Google
334
390
  end
335
391
  end
336
392
 
393
+ # Count of documents that match the query. The `COUNT(*)` aggregation function
394
+ # operates on the entire document so it does not require a field reference.
395
+ class Count
396
+ include Google::Apis::Core::Hashable
397
+
398
+ # Optional. Optional constraint on the maximum number of documents to count.
399
+ # This provides a way to set an upper bound on the number of documents to scan,
400
+ # limiting latency and cost. Unspecified is interpreted as no bound. High-Level
401
+ # Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); ```
402
+ # Requires: * Must be greater than zero when present.
403
+ # Corresponds to the JSON property `upTo`
404
+ # @return [Fixnum]
405
+ attr_accessor :up_to
406
+
407
+ def initialize(**args)
408
+ update!(**args)
409
+ end
410
+
411
+ # Update properties of this object
412
+ def update!(**args)
413
+ @up_to = args[:up_to] if args.key?(:up_to)
414
+ end
415
+ end
416
+
337
417
  # A position in a query result set.
338
418
  class Cursor
339
419
  include Google::Apis::Core::Hashable
@@ -2185,6 +2265,81 @@ module Google
2185
2265
  end
2186
2266
  end
2187
2267
 
2268
+ # The request for Firestore.RunAggregationQuery.
2269
+ class RunAggregationQueryRequest
2270
+ include Google::Apis::Core::Hashable
2271
+
2272
+ # Options for creating a new transaction.
2273
+ # Corresponds to the JSON property `newTransaction`
2274
+ # @return [Google::Apis::FirestoreV1::TransactionOptions]
2275
+ attr_accessor :new_transaction
2276
+
2277
+ # Executes the query at the given timestamp. Requires: * Cannot be more than 270
2278
+ # seconds in the past.
2279
+ # Corresponds to the JSON property `readTime`
2280
+ # @return [String]
2281
+ attr_accessor :read_time
2282
+
2283
+ # Firestore query for running an aggregation over a StructuredQuery.
2284
+ # Corresponds to the JSON property `structuredAggregationQuery`
2285
+ # @return [Google::Apis::FirestoreV1::StructuredAggregationQuery]
2286
+ attr_accessor :structured_aggregation_query
2287
+
2288
+ # Run the aggregation within an already active transaction. The value here is
2289
+ # the opaque transaction ID to execute the query in.
2290
+ # Corresponds to the JSON property `transaction`
2291
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
2292
+ # @return [String]
2293
+ attr_accessor :transaction
2294
+
2295
+ def initialize(**args)
2296
+ update!(**args)
2297
+ end
2298
+
2299
+ # Update properties of this object
2300
+ def update!(**args)
2301
+ @new_transaction = args[:new_transaction] if args.key?(:new_transaction)
2302
+ @read_time = args[:read_time] if args.key?(:read_time)
2303
+ @structured_aggregation_query = args[:structured_aggregation_query] if args.key?(:structured_aggregation_query)
2304
+ @transaction = args[:transaction] if args.key?(:transaction)
2305
+ end
2306
+ end
2307
+
2308
+ # The response for Firestore.RunAggregationQuery.
2309
+ class RunAggregationQueryResponse
2310
+ include Google::Apis::Core::Hashable
2311
+
2312
+ # The time at which the aggregate value is valid for.
2313
+ # Corresponds to the JSON property `readTime`
2314
+ # @return [String]
2315
+ attr_accessor :read_time
2316
+
2317
+ # The result of a single bucket from a Firestore aggregation query. The keys of `
2318
+ # aggregate_fields` are the same for all results in an aggregation query, unlike
2319
+ # document queries which can have different fields present for each result.
2320
+ # Corresponds to the JSON property `result`
2321
+ # @return [Google::Apis::FirestoreV1::AggregationResult]
2322
+ attr_accessor :result
2323
+
2324
+ # The transaction that was started as part of this request. Only present on the
2325
+ # first response when the request requested to start a new transaction.
2326
+ # Corresponds to the JSON property `transaction`
2327
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
2328
+ # @return [String]
2329
+ attr_accessor :transaction
2330
+
2331
+ def initialize(**args)
2332
+ update!(**args)
2333
+ end
2334
+
2335
+ # Update properties of this object
2336
+ def update!(**args)
2337
+ @read_time = args[:read_time] if args.key?(:read_time)
2338
+ @result = args[:result] if args.key?(:result)
2339
+ @transaction = args[:transaction] if args.key?(:transaction)
2340
+ end
2341
+ end
2342
+
2188
2343
  # The request for Firestore.RunQuery.
2189
2344
  class RunQueryRequest
2190
2345
  include Google::Apis::Core::Hashable
@@ -2317,6 +2472,33 @@ module Google
2317
2472
  end
2318
2473
  end
2319
2474
 
2475
+ # Firestore query for running an aggregation over a StructuredQuery.
2476
+ class StructuredAggregationQuery
2477
+ include Google::Apis::Core::Hashable
2478
+
2479
+ # Optional. Series of aggregations to apply over the results of the `
2480
+ # structured_query`. Requires: * A minimum of one and maximum of five
2481
+ # aggregations per query.
2482
+ # Corresponds to the JSON property `aggregations`
2483
+ # @return [Array<Google::Apis::FirestoreV1::Aggregation>]
2484
+ attr_accessor :aggregations
2485
+
2486
+ # A Firestore query.
2487
+ # Corresponds to the JSON property `structuredQuery`
2488
+ # @return [Google::Apis::FirestoreV1::StructuredQuery]
2489
+ attr_accessor :structured_query
2490
+
2491
+ def initialize(**args)
2492
+ update!(**args)
2493
+ end
2494
+
2495
+ # Update properties of this object
2496
+ def update!(**args)
2497
+ @aggregations = args[:aggregations] if args.key?(:aggregations)
2498
+ @structured_query = args[:structured_query] if args.key?(:structured_query)
2499
+ end
2500
+ end
2501
+
2320
2502
  # A Firestore query.
2321
2503
  class StructuredQuery
2322
2504
  include Google::Apis::Core::Hashable
@@ -16,13 +16,13 @@ module Google
16
16
  module Apis
17
17
  module FirestoreV1
18
18
  # Version of the google-apis-firestore_v1 gem
19
- GEM_VERSION = "0.26.0"
19
+ GEM_VERSION = "0.28.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
- GENERATOR_VERSION = "0.9.0"
22
+ GENERATOR_VERSION = "0.10.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20220831"
25
+ REVISION = "20220915"
26
26
  end
27
27
  end
28
28
  end
@@ -22,6 +22,18 @@ module Google
22
22
  module Apis
23
23
  module FirestoreV1
24
24
 
25
+ class Aggregation
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AggregationResult
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
25
37
  class ArrayValue
26
38
  class Representation < Google::Apis::Core::JsonRepresentation; end
27
39
 
@@ -88,6 +100,12 @@ module Google
88
100
  include Google::Apis::Core::JsonObjectSupport
89
101
  end
90
102
 
103
+ class Count
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
91
109
  class Cursor
92
110
  class Representation < Google::Apis::Core::JsonRepresentation; end
93
111
 
@@ -424,6 +442,18 @@ module Google
424
442
  include Google::Apis::Core::JsonObjectSupport
425
443
  end
426
444
 
445
+ class RunAggregationQueryRequest
446
+ class Representation < Google::Apis::Core::JsonRepresentation; end
447
+
448
+ include Google::Apis::Core::JsonObjectSupport
449
+ end
450
+
451
+ class RunAggregationQueryResponse
452
+ class Representation < Google::Apis::Core::JsonRepresentation; end
453
+
454
+ include Google::Apis::Core::JsonObjectSupport
455
+ end
456
+
427
457
  class RunQueryRequest
428
458
  class Representation < Google::Apis::Core::JsonRepresentation; end
429
459
 
@@ -442,6 +472,12 @@ module Google
442
472
  include Google::Apis::Core::JsonObjectSupport
443
473
  end
444
474
 
475
+ class StructuredAggregationQuery
476
+ class Representation < Google::Apis::Core::JsonRepresentation; end
477
+
478
+ include Google::Apis::Core::JsonObjectSupport
479
+ end
480
+
445
481
  class StructuredQuery
446
482
  class Representation < Google::Apis::Core::JsonRepresentation; end
447
483
 
@@ -502,6 +538,23 @@ module Google
502
538
  include Google::Apis::Core::JsonObjectSupport
503
539
  end
504
540
 
541
+ class Aggregation
542
+ # @private
543
+ class Representation < Google::Apis::Core::JsonRepresentation
544
+ property :alias, as: 'alias'
545
+ property :count, as: 'count', class: Google::Apis::FirestoreV1::Count, decorator: Google::Apis::FirestoreV1::Count::Representation
546
+
547
+ end
548
+ end
549
+
550
+ class AggregationResult
551
+ # @private
552
+ class Representation < Google::Apis::Core::JsonRepresentation
553
+ hash :aggregate_fields, as: 'aggregateFields', class: Google::Apis::FirestoreV1::Value, decorator: Google::Apis::FirestoreV1::Value::Representation
554
+
555
+ end
556
+ end
557
+
505
558
  class ArrayValue
506
559
  # @private
507
560
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -603,6 +656,13 @@ module Google
603
656
  end
604
657
  end
605
658
 
659
+ class Count
660
+ # @private
661
+ class Representation < Google::Apis::Core::JsonRepresentation
662
+ property :up_to, :numeric_string => true, as: 'upTo'
663
+ end
664
+ end
665
+
606
666
  class Cursor
607
667
  # @private
608
668
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -1136,6 +1196,28 @@ module Google
1136
1196
  end
1137
1197
  end
1138
1198
 
1199
+ class RunAggregationQueryRequest
1200
+ # @private
1201
+ class Representation < Google::Apis::Core::JsonRepresentation
1202
+ property :new_transaction, as: 'newTransaction', class: Google::Apis::FirestoreV1::TransactionOptions, decorator: Google::Apis::FirestoreV1::TransactionOptions::Representation
1203
+
1204
+ property :read_time, as: 'readTime'
1205
+ property :structured_aggregation_query, as: 'structuredAggregationQuery', class: Google::Apis::FirestoreV1::StructuredAggregationQuery, decorator: Google::Apis::FirestoreV1::StructuredAggregationQuery::Representation
1206
+
1207
+ property :transaction, :base64 => true, as: 'transaction'
1208
+ end
1209
+ end
1210
+
1211
+ class RunAggregationQueryResponse
1212
+ # @private
1213
+ class Representation < Google::Apis::Core::JsonRepresentation
1214
+ property :read_time, as: 'readTime'
1215
+ property :result, as: 'result', class: Google::Apis::FirestoreV1::AggregationResult, decorator: Google::Apis::FirestoreV1::AggregationResult::Representation
1216
+
1217
+ property :transaction, :base64 => true, as: 'transaction'
1218
+ end
1219
+ end
1220
+
1139
1221
  class RunQueryRequest
1140
1222
  # @private
1141
1223
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -1169,6 +1251,16 @@ module Google
1169
1251
  end
1170
1252
  end
1171
1253
 
1254
+ class StructuredAggregationQuery
1255
+ # @private
1256
+ class Representation < Google::Apis::Core::JsonRepresentation
1257
+ collection :aggregations, as: 'aggregations', class: Google::Apis::FirestoreV1::Aggregation, decorator: Google::Apis::FirestoreV1::Aggregation::Representation
1258
+
1259
+ property :structured_query, as: 'structuredQuery', class: Google::Apis::FirestoreV1::StructuredQuery, decorator: Google::Apis::FirestoreV1::StructuredQuery::Representation
1260
+
1261
+ end
1262
+ end
1263
+
1172
1264
  class StructuredQuery
1173
1265
  # @private
1174
1266
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -1134,6 +1134,47 @@ module Google
1134
1134
  execute_or_queue_command(command, &block)
1135
1135
  end
1136
1136
 
1137
+ # Runs an aggregation query. Rather than producing Document results like
1138
+ # Firestore.RunQuery, this API allows running an aggregation to produce a series
1139
+ # of AggregationResult server-side. High-Level Example: ``` -- Return the number
1140
+ # of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k
1141
+ # where a = true ); ```
1142
+ # @param [String] parent
1143
+ # Required. The parent resource name. In the format: `projects/`project_id`/
1144
+ # databases/`database_id`/documents` or `projects/`project_id`/databases/`
1145
+ # database_id`/documents/`document_path``. For example: `projects/my-project/
1146
+ # databases/my-database/documents` or `projects/my-project/databases/my-database/
1147
+ # documents/chatrooms/my-chatroom`
1148
+ # @param [Google::Apis::FirestoreV1::RunAggregationQueryRequest] run_aggregation_query_request_object
1149
+ # @param [String] fields
1150
+ # Selector specifying which fields to include in a partial response.
1151
+ # @param [String] quota_user
1152
+ # Available to use for quota purposes for server-side applications. Can be any
1153
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1154
+ # @param [Google::Apis::RequestOptions] options
1155
+ # Request-specific options
1156
+ #
1157
+ # @yield [result, err] Result & error if block supplied
1158
+ # @yieldparam result [Google::Apis::FirestoreV1::RunAggregationQueryResponse] parsed result object
1159
+ # @yieldparam err [StandardError] error object if request failed
1160
+ #
1161
+ # @return [Google::Apis::FirestoreV1::RunAggregationQueryResponse]
1162
+ #
1163
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1164
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1165
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1166
+ def run_document_aggregation_query(parent, run_aggregation_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1167
+ command = make_simple_command(:post, 'v1/{+parent}:runAggregationQuery', options)
1168
+ command.request_representation = Google::Apis::FirestoreV1::RunAggregationQueryRequest::Representation
1169
+ command.request_object = run_aggregation_query_request_object
1170
+ command.response_representation = Google::Apis::FirestoreV1::RunAggregationQueryResponse::Representation
1171
+ command.response_class = Google::Apis::FirestoreV1::RunAggregationQueryResponse
1172
+ command.params['parent'] = parent unless parent.nil?
1173
+ command.query['fields'] = fields unless fields.nil?
1174
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1175
+ execute_or_queue_command(command, &block)
1176
+ end
1177
+
1137
1178
  # Runs a query.
1138
1179
  # @param [String] parent
1139
1180
  # Required. The parent resource name. In the format: `projects/`project_id`/
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-firestore_v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2022-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-apis-core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.2
19
+ version: 0.9.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.7.2
29
+ version: 0.9.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -58,7 +58,7 @@ licenses:
58
58
  metadata:
59
59
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
60
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-firestore_v1/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-firestore_v1/v0.26.0
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-firestore_v1/v0.28.0
62
62
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-firestore_v1
63
63
  post_install_message:
64
64
  rdoc_options: []