google-apis-firestore_v1beta1 0.20.0 → 0.21.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: a965c08f5271e30bdb8848359387af64fcbbfada9598c4d9f333db03a0dd42ac
4
- data.tar.gz: b160d815fb1143384a5ab23a4881f69bc17b40b2bdfec6ef013e1515c36d3038
3
+ metadata.gz: 1954a96f973cfce28e51638052d6a7090b5bdef4a24b90e311e55866daea4013
4
+ data.tar.gz: df33636af2eeb0bae963286ed9df23095efac3f76f49a3a064b8313f2ca57ab3
5
5
  SHA512:
6
- metadata.gz: fae237aaf6521534f40a5be6d7102f6e2c506c6efed19a4783bcbe40883b1ed57d4cd62b3964386cf4b7ee3e495a2d3cb391cf8eb060e77b52f78653f4c69769
7
- data.tar.gz: 2d5dedebea489c4269e780f5ffb39b14e54bf346b82878f78a30afd44371b3f02e0796bd8cfa6618eafb351238479acd1707deeea5b034fe64290e0bd883f44d
6
+ metadata.gz: 5f889d8ca25c59e1fea3a16c9bf8d8f7d73bba4dae976e342dadc7a6a04446d52a380f12343d8f9cfc6642e454061a04682b016d9f4411a5d257b8894a102925
7
+ data.tar.gz: 6cce54f7bf4bec90ba770f257d87fff6932ffcf37d5c5bffbc9cf3a330b3335d396718244b852f34b3374d2d7877c0b5fc1694a57059cc4ba9069aeba64d55b5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release history for google-apis-firestore_v1beta1
2
2
 
3
+ ### v0.21.0 (2022-09-22)
4
+
5
+ * Regenerated from discovery document revision 20220915
6
+ * Regenerated using generator version 0.10.0
7
+
3
8
  ### v0.20.0 (2022-09-10)
4
9
 
5
10
  * Regenerated from discovery document revision 20220831
@@ -22,6 +22,62 @@ module Google
22
22
  module Apis
23
23
  module FirestoreV1beta1
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::FirestoreV1beta1::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::FirestoreV1beta1::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
@@ -1700,6 +1780,81 @@ module Google
1700
1780
  end
1701
1781
  end
1702
1782
 
1783
+ # The request for Firestore.RunAggregationQuery.
1784
+ class RunAggregationQueryRequest
1785
+ include Google::Apis::Core::Hashable
1786
+
1787
+ # Options for creating a new transaction.
1788
+ # Corresponds to the JSON property `newTransaction`
1789
+ # @return [Google::Apis::FirestoreV1beta1::TransactionOptions]
1790
+ attr_accessor :new_transaction
1791
+
1792
+ # Executes the query at the given timestamp. Requires: * Cannot be more than 270
1793
+ # seconds in the past.
1794
+ # Corresponds to the JSON property `readTime`
1795
+ # @return [String]
1796
+ attr_accessor :read_time
1797
+
1798
+ # Firestore query for running an aggregation over a StructuredQuery.
1799
+ # Corresponds to the JSON property `structuredAggregationQuery`
1800
+ # @return [Google::Apis::FirestoreV1beta1::StructuredAggregationQuery]
1801
+ attr_accessor :structured_aggregation_query
1802
+
1803
+ # Run the aggregation within an already active transaction. The value here is
1804
+ # the opaque transaction ID to execute the query in.
1805
+ # Corresponds to the JSON property `transaction`
1806
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
1807
+ # @return [String]
1808
+ attr_accessor :transaction
1809
+
1810
+ def initialize(**args)
1811
+ update!(**args)
1812
+ end
1813
+
1814
+ # Update properties of this object
1815
+ def update!(**args)
1816
+ @new_transaction = args[:new_transaction] if args.key?(:new_transaction)
1817
+ @read_time = args[:read_time] if args.key?(:read_time)
1818
+ @structured_aggregation_query = args[:structured_aggregation_query] if args.key?(:structured_aggregation_query)
1819
+ @transaction = args[:transaction] if args.key?(:transaction)
1820
+ end
1821
+ end
1822
+
1823
+ # The response for Firestore.RunAggregationQuery.
1824
+ class RunAggregationQueryResponse
1825
+ include Google::Apis::Core::Hashable
1826
+
1827
+ # The time at which the aggregate value is valid for.
1828
+ # Corresponds to the JSON property `readTime`
1829
+ # @return [String]
1830
+ attr_accessor :read_time
1831
+
1832
+ # The result of a single bucket from a Firestore aggregation query. The keys of `
1833
+ # aggregate_fields` are the same for all results in an aggregation query, unlike
1834
+ # document queries which can have different fields present for each result.
1835
+ # Corresponds to the JSON property `result`
1836
+ # @return [Google::Apis::FirestoreV1beta1::AggregationResult]
1837
+ attr_accessor :result
1838
+
1839
+ # The transaction that was started as part of this request. Only present on the
1840
+ # first response when the request requested to start a new transaction.
1841
+ # Corresponds to the JSON property `transaction`
1842
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
1843
+ # @return [String]
1844
+ attr_accessor :transaction
1845
+
1846
+ def initialize(**args)
1847
+ update!(**args)
1848
+ end
1849
+
1850
+ # Update properties of this object
1851
+ def update!(**args)
1852
+ @read_time = args[:read_time] if args.key?(:read_time)
1853
+ @result = args[:result] if args.key?(:result)
1854
+ @transaction = args[:transaction] if args.key?(:transaction)
1855
+ end
1856
+ end
1857
+
1703
1858
  # The request for Firestore.RunQuery.
1704
1859
  class RunQueryRequest
1705
1860
  include Google::Apis::Core::Hashable
@@ -1832,6 +1987,33 @@ module Google
1832
1987
  end
1833
1988
  end
1834
1989
 
1990
+ # Firestore query for running an aggregation over a StructuredQuery.
1991
+ class StructuredAggregationQuery
1992
+ include Google::Apis::Core::Hashable
1993
+
1994
+ # Optional. Series of aggregations to apply over the results of the `
1995
+ # structured_query`. Requires: * A minimum of one and maximum of five
1996
+ # aggregations per query.
1997
+ # Corresponds to the JSON property `aggregations`
1998
+ # @return [Array<Google::Apis::FirestoreV1beta1::Aggregation>]
1999
+ attr_accessor :aggregations
2000
+
2001
+ # A Firestore query.
2002
+ # Corresponds to the JSON property `structuredQuery`
2003
+ # @return [Google::Apis::FirestoreV1beta1::StructuredQuery]
2004
+ attr_accessor :structured_query
2005
+
2006
+ def initialize(**args)
2007
+ update!(**args)
2008
+ end
2009
+
2010
+ # Update properties of this object
2011
+ def update!(**args)
2012
+ @aggregations = args[:aggregations] if args.key?(:aggregations)
2013
+ @structured_query = args[:structured_query] if args.key?(:structured_query)
2014
+ end
2015
+ end
2016
+
1835
2017
  # A Firestore query.
1836
2018
  class StructuredQuery
1837
2019
  include Google::Apis::Core::Hashable
@@ -16,13 +16,13 @@ module Google
16
16
  module Apis
17
17
  module FirestoreV1beta1
18
18
  # Version of the google-apis-firestore_v1beta1 gem
19
- GEM_VERSION = "0.20.0"
19
+ GEM_VERSION = "0.21.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 FirestoreV1beta1
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
 
@@ -346,6 +364,18 @@ module Google
346
364
  include Google::Apis::Core::JsonObjectSupport
347
365
  end
348
366
 
367
+ class RunAggregationQueryRequest
368
+ class Representation < Google::Apis::Core::JsonRepresentation; end
369
+
370
+ include Google::Apis::Core::JsonObjectSupport
371
+ end
372
+
373
+ class RunAggregationQueryResponse
374
+ class Representation < Google::Apis::Core::JsonRepresentation; end
375
+
376
+ include Google::Apis::Core::JsonObjectSupport
377
+ end
378
+
349
379
  class RunQueryRequest
350
380
  class Representation < Google::Apis::Core::JsonRepresentation; end
351
381
 
@@ -364,6 +394,12 @@ module Google
364
394
  include Google::Apis::Core::JsonObjectSupport
365
395
  end
366
396
 
397
+ class StructuredAggregationQuery
398
+ class Representation < Google::Apis::Core::JsonRepresentation; end
399
+
400
+ include Google::Apis::Core::JsonObjectSupport
401
+ end
402
+
367
403
  class StructuredQuery
368
404
  class Representation < Google::Apis::Core::JsonRepresentation; end
369
405
 
@@ -424,6 +460,23 @@ module Google
424
460
  include Google::Apis::Core::JsonObjectSupport
425
461
  end
426
462
 
463
+ class Aggregation
464
+ # @private
465
+ class Representation < Google::Apis::Core::JsonRepresentation
466
+ property :alias, as: 'alias'
467
+ property :count, as: 'count', class: Google::Apis::FirestoreV1beta1::Count, decorator: Google::Apis::FirestoreV1beta1::Count::Representation
468
+
469
+ end
470
+ end
471
+
472
+ class AggregationResult
473
+ # @private
474
+ class Representation < Google::Apis::Core::JsonRepresentation
475
+ hash :aggregate_fields, as: 'aggregateFields', class: Google::Apis::FirestoreV1beta1::Value, decorator: Google::Apis::FirestoreV1beta1::Value::Representation
476
+
477
+ end
478
+ end
479
+
427
480
  class ArrayValue
428
481
  # @private
429
482
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -525,6 +578,13 @@ module Google
525
578
  end
526
579
  end
527
580
 
581
+ class Count
582
+ # @private
583
+ class Representation < Google::Apis::Core::JsonRepresentation
584
+ property :up_to, :numeric_string => true, as: 'upTo'
585
+ end
586
+ end
587
+
528
588
  class Cursor
529
589
  # @private
530
590
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -928,6 +988,28 @@ module Google
928
988
  end
929
989
  end
930
990
 
991
+ class RunAggregationQueryRequest
992
+ # @private
993
+ class Representation < Google::Apis::Core::JsonRepresentation
994
+ property :new_transaction, as: 'newTransaction', class: Google::Apis::FirestoreV1beta1::TransactionOptions, decorator: Google::Apis::FirestoreV1beta1::TransactionOptions::Representation
995
+
996
+ property :read_time, as: 'readTime'
997
+ property :structured_aggregation_query, as: 'structuredAggregationQuery', class: Google::Apis::FirestoreV1beta1::StructuredAggregationQuery, decorator: Google::Apis::FirestoreV1beta1::StructuredAggregationQuery::Representation
998
+
999
+ property :transaction, :base64 => true, as: 'transaction'
1000
+ end
1001
+ end
1002
+
1003
+ class RunAggregationQueryResponse
1004
+ # @private
1005
+ class Representation < Google::Apis::Core::JsonRepresentation
1006
+ property :read_time, as: 'readTime'
1007
+ property :result, as: 'result', class: Google::Apis::FirestoreV1beta1::AggregationResult, decorator: Google::Apis::FirestoreV1beta1::AggregationResult::Representation
1008
+
1009
+ property :transaction, :base64 => true, as: 'transaction'
1010
+ end
1011
+ end
1012
+
931
1013
  class RunQueryRequest
932
1014
  # @private
933
1015
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -961,6 +1043,16 @@ module Google
961
1043
  end
962
1044
  end
963
1045
 
1046
+ class StructuredAggregationQuery
1047
+ # @private
1048
+ class Representation < Google::Apis::Core::JsonRepresentation
1049
+ collection :aggregations, as: 'aggregations', class: Google::Apis::FirestoreV1beta1::Aggregation, decorator: Google::Apis::FirestoreV1beta1::Aggregation::Representation
1050
+
1051
+ property :structured_query, as: 'structuredQuery', class: Google::Apis::FirestoreV1beta1::StructuredQuery, decorator: Google::Apis::FirestoreV1beta1::StructuredQuery::Representation
1052
+
1053
+ end
1054
+ end
1055
+
964
1056
  class StructuredQuery
965
1057
  # @private
966
1058
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -717,6 +717,47 @@ module Google
717
717
  execute_or_queue_command(command, &block)
718
718
  end
719
719
 
720
+ # Runs an aggregation query. Rather than producing Document results like
721
+ # Firestore.RunQuery, this API allows running an aggregation to produce a series
722
+ # of AggregationResult server-side. High-Level Example: ``` -- Return the number
723
+ # of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k
724
+ # where a = true ); ```
725
+ # @param [String] parent
726
+ # Required. The parent resource name. In the format: `projects/`project_id`/
727
+ # databases/`database_id`/documents` or `projects/`project_id`/databases/`
728
+ # database_id`/documents/`document_path``. For example: `projects/my-project/
729
+ # databases/my-database/documents` or `projects/my-project/databases/my-database/
730
+ # documents/chatrooms/my-chatroom`
731
+ # @param [Google::Apis::FirestoreV1beta1::RunAggregationQueryRequest] run_aggregation_query_request_object
732
+ # @param [String] fields
733
+ # Selector specifying which fields to include in a partial response.
734
+ # @param [String] quota_user
735
+ # Available to use for quota purposes for server-side applications. Can be any
736
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
737
+ # @param [Google::Apis::RequestOptions] options
738
+ # Request-specific options
739
+ #
740
+ # @yield [result, err] Result & error if block supplied
741
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::RunAggregationQueryResponse] parsed result object
742
+ # @yieldparam err [StandardError] error object if request failed
743
+ #
744
+ # @return [Google::Apis::FirestoreV1beta1::RunAggregationQueryResponse]
745
+ #
746
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
747
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
748
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
749
+ def run_document_aggregation_query(parent, run_aggregation_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
750
+ command = make_simple_command(:post, 'v1beta1/{+parent}:runAggregationQuery', options)
751
+ command.request_representation = Google::Apis::FirestoreV1beta1::RunAggregationQueryRequest::Representation
752
+ command.request_object = run_aggregation_query_request_object
753
+ command.response_representation = Google::Apis::FirestoreV1beta1::RunAggregationQueryResponse::Representation
754
+ command.response_class = Google::Apis::FirestoreV1beta1::RunAggregationQueryResponse
755
+ command.params['parent'] = parent unless parent.nil?
756
+ command.query['fields'] = fields unless fields.nil?
757
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
758
+ execute_or_queue_command(command, &block)
759
+ end
760
+
720
761
  # Runs a query.
721
762
  # @param [String] parent
722
763
  # 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_v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.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-12 00:00:00.000000000 Z
11
+ date: 2022-09-26 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'
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'
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_v1beta1/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-firestore_v1beta1/v0.20.0
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-firestore_v1beta1/v0.21.0
62
62
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-firestore_v1beta1
63
63
  post_install_message:
64
64
  rdoc_options: []