google-cloud-firestore-v1 2.2.1 → 2.4.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.
@@ -49,9 +49,13 @@ module Google
49
49
  # app_profile_id: profiles/prof_qux
50
50
  # }
51
51
  #
52
- # The routing header consists of one or multiple key-value pairs. Every key
53
- # and value must be percent-encoded, and joined together in the format of
54
- # `key1=value1&key2=value2`.
52
+ # The routing header consists of one or multiple key-value pairs. The order of
53
+ # the key-value pairs is undefined, the order of the `routing_parameters` in
54
+ # the `RoutingRule` only matters for the evaluation order of the path
55
+ # templates when `field` is the same. See the examples below for more details.
56
+ #
57
+ # Every key and value in the routing header must be percent-encoded,
58
+ # and joined together in the following format: `key1=value1&key2=value2`.
55
59
  # The examples below skip the percent-encoding for readability.
56
60
  #
57
61
  # Example 1
@@ -71,12 +71,19 @@ module Google
71
71
  extend ::Google::Protobuf::MessageExts::ClassMethods
72
72
 
73
73
  # Options for a transaction that can be used to read and write documents.
74
- #
75
- # Firestore does not allow 3rd party auth requests to create read-write.
76
- # transactions.
77
74
  # @!attribute [rw] retry_transaction
78
75
  # @return [::String]
79
76
  # An optional transaction to retry.
77
+ # @!attribute [rw] concurrency_mode
78
+ # @return [::Google::Cloud::Firestore::V1::TransactionOptions::ConcurrencyMode]
79
+ # Optional. The concurrency control mode to use for this transaction.
80
+ #
81
+ # A database is able to use different concurrency modes for different
82
+ # transactions simultaneously.
83
+ #
84
+ # 3rd party auth requests are only allowed to create optimistic
85
+ # read-write transactions and must specify that here even if the
86
+ # database-level setting is already configured to optimistic.
80
87
  class ReadWrite
81
88
  include ::Google::Protobuf::MessageExts
82
89
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -94,6 +101,18 @@ module Google
94
101
  include ::Google::Protobuf::MessageExts
95
102
  extend ::Google::Protobuf::MessageExts::ClassMethods
96
103
  end
104
+
105
+ # The type of concurrency control mode for transactions.
106
+ module ConcurrencyMode
107
+ # Start the transaction with the database-level default concurrency mode.
108
+ CONCURRENCY_MODE_UNSPECIFIED = 0
109
+
110
+ # Use optimistic concurrency control for the new transaction.
111
+ OPTIMISTIC = 1
112
+
113
+ # Use pessimistic concurrency control for the new transaction.
114
+ PESSIMISTIC = 2
115
+ end
97
116
  end
98
117
  end
99
118
  end
@@ -87,22 +87,22 @@ module Google
87
87
  # @return [::Google::Protobuf::NullValue]
88
88
  # A null value.
89
89
  #
90
- # Note: The following fields are mutually exclusive: `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
90
+ # Note: The following fields are mutually exclusive: `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
91
91
  # @!attribute [rw] boolean_value
92
92
  # @return [::Boolean]
93
93
  # A boolean value.
94
94
  #
95
- # Note: The following fields are mutually exclusive: `boolean_value`, `null_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
95
+ # Note: The following fields are mutually exclusive: `boolean_value`, `null_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
96
96
  # @!attribute [rw] integer_value
97
97
  # @return [::Integer]
98
98
  # An integer value.
99
99
  #
100
- # Note: The following fields are mutually exclusive: `integer_value`, `null_value`, `boolean_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
100
+ # Note: The following fields are mutually exclusive: `integer_value`, `null_value`, `boolean_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
101
101
  # @!attribute [rw] double_value
102
102
  # @return [::Float]
103
103
  # A double value.
104
104
  #
105
- # Note: The following fields are mutually exclusive: `double_value`, `null_value`, `boolean_value`, `integer_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
105
+ # Note: The following fields are mutually exclusive: `double_value`, `null_value`, `boolean_value`, `integer_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
106
106
  # @!attribute [rw] timestamp_value
107
107
  # @return [::Google::Protobuf::Timestamp]
108
108
  # A timestamp value.
@@ -110,7 +110,7 @@ module Google
110
110
  # Precise only to microseconds. When stored, any additional precision is
111
111
  # rounded down.
112
112
  #
113
- # Note: The following fields are mutually exclusive: `timestamp_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
113
+ # Note: The following fields are mutually exclusive: `timestamp_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
114
114
  # @!attribute [rw] string_value
115
115
  # @return [::String]
116
116
  # A string value.
@@ -119,7 +119,7 @@ module Google
119
119
  # Only the first 1,500 bytes of the UTF-8 representation are considered by
120
120
  # queries.
121
121
  #
122
- # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
122
+ # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
123
123
  # @!attribute [rw] bytes_value
124
124
  # @return [::String]
125
125
  # A bytes value.
@@ -127,18 +127,18 @@ module Google
127
127
  # Must not exceed 1 MiB - 89 bytes.
128
128
  # Only the first 1,500 bytes are considered by queries.
129
129
  #
130
- # Note: The following fields are mutually exclusive: `bytes_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
130
+ # Note: The following fields are mutually exclusive: `bytes_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
131
131
  # @!attribute [rw] reference_value
132
132
  # @return [::String]
133
133
  # A reference to a document. For example:
134
134
  # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
135
135
  #
136
- # Note: The following fields are mutually exclusive: `reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `geo_point_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
136
+ # Note: The following fields are mutually exclusive: `reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
137
137
  # @!attribute [rw] geo_point_value
138
138
  # @return [::Google::Type::LatLng]
139
139
  # A geo point value representing a point on the surface of Earth.
140
140
  #
141
- # Note: The following fields are mutually exclusive: `geo_point_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `array_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
141
+ # Note: The following fields are mutually exclusive: `geo_point_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
142
142
  # @!attribute [rw] array_value
143
143
  # @return [::Google::Cloud::Firestore::V1::ArrayValue]
144
144
  # An array value.
@@ -146,12 +146,53 @@ module Google
146
146
  # Cannot directly contain another array value, though can contain a
147
147
  # map which contains another array.
148
148
  #
149
- # Note: The following fields are mutually exclusive: `array_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `map_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
149
+ # Note: The following fields are mutually exclusive: `array_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
150
150
  # @!attribute [rw] map_value
151
151
  # @return [::Google::Cloud::Firestore::V1::MapValue]
152
152
  # A map value.
153
153
  #
154
- # Note: The following fields are mutually exclusive: `map_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
154
+ # Note: The following fields are mutually exclusive: `map_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
155
+ # @!attribute [rw] field_reference_value
156
+ # @return [::String]
157
+ # Value which references a field.
158
+ #
159
+ # This is considered relative (vs absolute) since it only refers to a field
160
+ # and not a field within a particular document.
161
+ #
162
+ # **Requires:**
163
+ #
164
+ # * Must follow [field reference][FieldReference.field_path] limitations.
165
+ #
166
+ # * Not allowed to be used when writing documents.
167
+ #
168
+ # Note: The following fields are mutually exclusive: `field_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
169
+ # @!attribute [rw] variable_reference_value
170
+ # @return [::String]
171
+ # Pointer to a variable defined elsewhere in a pipeline.
172
+ #
173
+ # Unlike `field_reference_value` which references a field within a
174
+ # document, this refers to a variable, defined in a separate namespace than
175
+ # the fields of a document.
176
+ #
177
+ # Note: The following fields are mutually exclusive: `variable_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
178
+ # @!attribute [rw] function_value
179
+ # @return [::Google::Cloud::Firestore::V1::Function]
180
+ # A value that represents an unevaluated expression.
181
+ #
182
+ # **Requires:**
183
+ #
184
+ # * Not allowed to be used when writing documents.
185
+ #
186
+ # Note: The following fields are mutually exclusive: `function_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
187
+ # @!attribute [rw] pipeline_value
188
+ # @return [::Google::Cloud::Firestore::V1::Pipeline]
189
+ # A value that represents an unevaluated pipeline.
190
+ #
191
+ # **Requires:**
192
+ #
193
+ # * Not allowed to be used when writing documents.
194
+ #
195
+ # Note: The following fields are mutually exclusive: `pipeline_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
155
196
  class Value
156
197
  include ::Google::Protobuf::MessageExts
157
198
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -188,6 +229,97 @@ module Google
188
229
  extend ::Google::Protobuf::MessageExts::ClassMethods
189
230
  end
190
231
  end
232
+
233
+ # Represents an unevaluated scalar expression.
234
+ #
235
+ # For example, the expression `like(user_name, "%alice%")` is represented as:
236
+ #
237
+ # ```
238
+ # name: "like"
239
+ # args { field_reference: "user_name" }
240
+ # args { string_value: "%alice%" }
241
+ # ```
242
+ # @!attribute [rw] name
243
+ # @return [::String]
244
+ # Required. The name of the function to evaluate.
245
+ #
246
+ # **Requires:**
247
+ #
248
+ # * must be in snake case (lower case with underscore separator).
249
+ # @!attribute [rw] args
250
+ # @return [::Array<::Google::Cloud::Firestore::V1::Value>]
251
+ # Optional. Ordered list of arguments the given function expects.
252
+ # @!attribute [rw] options
253
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}]
254
+ # Optional. Optional named arguments that certain functions may support.
255
+ class Function
256
+ include ::Google::Protobuf::MessageExts
257
+ extend ::Google::Protobuf::MessageExts::ClassMethods
258
+
259
+ # @!attribute [rw] key
260
+ # @return [::String]
261
+ # @!attribute [rw] value
262
+ # @return [::Google::Cloud::Firestore::V1::Value]
263
+ class OptionsEntry
264
+ include ::Google::Protobuf::MessageExts
265
+ extend ::Google::Protobuf::MessageExts::ClassMethods
266
+ end
267
+ end
268
+
269
+ # A Firestore query represented as an ordered list of operations / stages.
270
+ # @!attribute [rw] stages
271
+ # @return [::Array<::Google::Cloud::Firestore::V1::Pipeline::Stage>]
272
+ # Required. Ordered list of stages to evaluate.
273
+ class Pipeline
274
+ include ::Google::Protobuf::MessageExts
275
+ extend ::Google::Protobuf::MessageExts::ClassMethods
276
+
277
+ # A single operation within a pipeline.
278
+ #
279
+ # A stage is made up of a unique name, and a list of arguments. The exact
280
+ # number of arguments & types is dependent on the stage type.
281
+ #
282
+ # To give an example, the stage `filter(state = "MD")` would be encoded as:
283
+ #
284
+ # ```
285
+ # name: "filter"
286
+ # args {
287
+ # function_value {
288
+ # name: "eq"
289
+ # args { field_reference_value: "state" }
290
+ # args { string_value: "MD" }
291
+ # }
292
+ # }
293
+ # ```
294
+ #
295
+ # See public documentation for the full list.
296
+ # @!attribute [rw] name
297
+ # @return [::String]
298
+ # Required. The name of the stage to evaluate.
299
+ #
300
+ # **Requires:**
301
+ #
302
+ # * must be in snake case (lower case with underscore separator).
303
+ # @!attribute [rw] args
304
+ # @return [::Array<::Google::Cloud::Firestore::V1::Value>]
305
+ # Optional. Ordered list of arguments the given stage expects.
306
+ # @!attribute [rw] options
307
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}]
308
+ # Optional. Optional named arguments that certain functions may support.
309
+ class Stage
310
+ include ::Google::Protobuf::MessageExts
311
+ extend ::Google::Protobuf::MessageExts::ClassMethods
312
+
313
+ # @!attribute [rw] key
314
+ # @return [::String]
315
+ # @!attribute [rw] value
316
+ # @return [::Google::Cloud::Firestore::V1::Value]
317
+ class OptionsEntry
318
+ include ::Google::Protobuf::MessageExts
319
+ extend ::Google::Protobuf::MessageExts::ClassMethods
320
+ end
321
+ end
322
+ end
191
323
  end
192
324
  end
193
325
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Firestore
23
+ module V1
24
+ # Pipeline explain stats.
25
+ #
26
+ # Depending on the explain options in the original request, this can contain
27
+ # the optimized plan and / or execution stats.
28
+ # @!attribute [rw] data
29
+ # @return [::Google::Protobuf::Any]
30
+ # The format depends on the `output_format` options in the request.
31
+ #
32
+ # Currently there are two supported options: `TEXT` and `JSON`.
33
+ # Both supply a `google.protobuf.StringValue`.
34
+ class ExplainStats
35
+ include ::Google::Protobuf::MessageExts
36
+ extend ::Google::Protobuf::MessageExts::ClassMethods
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -449,6 +449,97 @@ module Google
449
449
  extend ::Google::Protobuf::MessageExts::ClassMethods
450
450
  end
451
451
 
452
+ # The request for
453
+ # {::Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline Firestore.ExecutePipeline}.
454
+ # @!attribute [rw] database
455
+ # @return [::String]
456
+ # Required. Database identifier, in the form
457
+ # `projects/{project}/databases/{database}`.
458
+ # @!attribute [rw] structured_pipeline
459
+ # @return [::Google::Cloud::Firestore::V1::StructuredPipeline]
460
+ # A pipelined operation.
461
+ # @!attribute [rw] transaction
462
+ # @return [::String]
463
+ # Run the query within an already active transaction.
464
+ #
465
+ # The value here is the opaque transaction ID to execute the query in.
466
+ #
467
+ # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared.
468
+ # @!attribute [rw] new_transaction
469
+ # @return [::Google::Cloud::Firestore::V1::TransactionOptions]
470
+ # Execute the pipeline in a new transaction.
471
+ #
472
+ # The identifier of the newly created transaction will be returned in the
473
+ # first response on the stream. This defaults to a read-only transaction.
474
+ #
475
+ # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared.
476
+ # @!attribute [rw] read_time
477
+ # @return [::Google::Protobuf::Timestamp]
478
+ # Execute the pipeline in a snapshot transaction at the given time.
479
+ #
480
+ # This must be a microsecond precision timestamp within the past one hour,
481
+ # or if Point-in-Time Recovery is enabled, can additionally be a whole
482
+ # minute timestamp within the past 7 days.
483
+ #
484
+ # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared.
485
+ # @!attribute [rw] auto_commit_transaction
486
+ # @return [::Boolean]
487
+ # Optional. Automatically commits the transaction after the pipeline has been
488
+ # executed. Only permitted in combination with `transaction` or
489
+ # `new_transaction`.
490
+ class ExecutePipelineRequest
491
+ include ::Google::Protobuf::MessageExts
492
+ extend ::Google::Protobuf::MessageExts::ClassMethods
493
+ end
494
+
495
+ # The response for [Firestore.Execute][].
496
+ # @!attribute [rw] transaction
497
+ # @return [::String]
498
+ # Newly created transaction identifier.
499
+ #
500
+ # This field is only specified as part of the first response from the server,
501
+ # alongside the `results` field when the original request specified
502
+ # [ExecuteRequest.new_transaction][].
503
+ # @!attribute [rw] results
504
+ # @return [::Array<::Google::Cloud::Firestore::V1::Document>]
505
+ # An ordered batch of results returned executing a pipeline.
506
+ #
507
+ # The batch size is variable, and can even be zero for when only a partial
508
+ # progress message is returned.
509
+ #
510
+ # The fields present in the returned documents are only those that were
511
+ # explicitly requested in the pipeline, this includes those like
512
+ # {::Google::Cloud::Firestore::V1::Document#name `__name__`} and
513
+ # {::Google::Cloud::Firestore::V1::Document#update_time `__update_time__`}. This is
514
+ # explicitly a divergence from `Firestore.RunQuery` / `Firestore.GetDocument`
515
+ # RPCs which always return such fields even when they are not specified in
516
+ # the {::Google::Cloud::Firestore::V1::DocumentMask `mask`}.
517
+ # @!attribute [rw] execution_time
518
+ # @return [::Google::Protobuf::Timestamp]
519
+ # The time at which the results are valid.
520
+ #
521
+ # This is a (not strictly) monotonically increasing value across multiple
522
+ # responses in the same stream. The API guarantees that all previously
523
+ # returned results are still valid at the latest `execution_time`. This
524
+ # allows the API consumer to treat the query if it ran at the latest
525
+ # `execution_time` returned.
526
+ #
527
+ # If the query returns no results, a response with `execution_time` and no
528
+ # `results` will be sent, and this represents the time at which the operation
529
+ # was run.
530
+ # @!attribute [rw] explain_stats
531
+ # @return [::Google::Cloud::Firestore::V1::ExplainStats]
532
+ # Query explain stats.
533
+ #
534
+ # This is present on the **last** response if the request configured explain
535
+ # to run in 'analyze' or 'explain' mode in the pipeline options. If the query
536
+ # does not return any results, a response with `explain_stats` and no
537
+ # `results` will still be sent.
538
+ class ExecutePipelineResponse
539
+ include ::Google::Protobuf::MessageExts
540
+ extend ::Google::Protobuf::MessageExts::ClassMethods
541
+ end
542
+
452
543
  # The request for
453
544
  # {::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query Firestore.RunAggregationQuery}.
454
545
  # @!attribute [rw] parent
@@ -813,7 +904,7 @@ module Google
813
904
  # will immediately send a response with a `TargetChange::Remove` event.
814
905
  #
815
906
  # Note that if the client sends multiple `AddTarget` requests
816
- # without an ID, the order of IDs returned in `TargetChage.target_ids` are
907
+ # without an ID, the order of IDs returned in `TargetChange.target_ids` are
817
908
  # undefined. Therefore, clients should provide a target ID instead of relying
818
909
  # on the server to assign one.
819
910
  #
@@ -938,6 +1029,9 @@ module Google
938
1029
  # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
939
1030
  # For example:
940
1031
  # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
1032
+ #
1033
+ # Use `projects/{project_id}/databases/{database_id}/documents` to list
1034
+ # top-level collections.
941
1035
  # @!attribute [rw] page_size
942
1036
  # @return [::Integer]
943
1037
  # The maximum number of results to return.
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Firestore
23
+ module V1
24
+ # A Firestore query represented as an ordered list of operations / stages.
25
+ #
26
+ # This is considered the top-level function which plans and executes a query.
27
+ # It is logically equivalent to `query(stages, options)`, but prevents the
28
+ # client from having to build a function wrapper.
29
+ # @!attribute [rw] pipeline
30
+ # @return [::Google::Cloud::Firestore::V1::Pipeline]
31
+ # Required. The pipeline query to execute.
32
+ # @!attribute [rw] options
33
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}]
34
+ # Optional. Optional query-level arguments.
35
+ class StructuredPipeline
36
+ include ::Google::Protobuf::MessageExts
37
+ extend ::Google::Protobuf::MessageExts::ClassMethods
38
+
39
+ # @!attribute [rw] key
40
+ # @return [::String]
41
+ # @!attribute [rw] value
42
+ # @return [::Google::Cloud::Firestore::V1::Value]
43
+ class OptionsEntry
44
+ include ::Google::Protobuf::MessageExts
45
+ extend ::Google::Protobuf::MessageExts::ClassMethods
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -48,9 +48,12 @@ module Google
48
48
  # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Order>]
49
49
  # The order to apply to the query results.
50
50
  #
51
- # Firestore allows callers to provide a full ordering, a partial ordering, or
52
- # no ordering at all. In all cases, Firestore guarantees a stable ordering
53
- # through the following rules:
51
+ # Callers can provide a full ordering, a partial ordering, or no ordering at
52
+ # all. While Firestore will always respect the provided order, the behavior
53
+ # for queries without a full ordering is different per database edition:
54
+ #
55
+ # In Standard edition, Firestore guarantees a stable ordering through the
56
+ # following rules:
54
57
  #
55
58
  # * The `order_by` is required to reference all fields used with an
56
59
  # inequality filter.
@@ -66,6 +69,13 @@ module Google
66
69
  # * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC`
67
70
  # * `WHERE __name__ > ... AND a > 1` becomes
68
71
  # `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC`
72
+ #
73
+ # In Enterprise edition, Firestore does not guarantee a stable ordering.
74
+ # Instead it will pick the most efficient ordering based on the indexes
75
+ # available at the time of query execution. This will result in a different
76
+ # ordering for queries that are otherwise identical. To ensure a stable
77
+ # ordering, always include a unique field in the `order_by` clause, such as
78
+ # `__name__`.
69
79
  # @!attribute [rw] start_at
70
80
  # @return [::Google::Cloud::Firestore::V1::Cursor]
71
81
  # A potential prefix of a position in the result set to start the query at.
@@ -409,8 +419,8 @@ module Google
409
419
  # Since DOT_PRODUCT distances increase when the vectors are more similar,
410
420
  # the comparison is inverted.
411
421
  #
412
- # * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
413
- # * For DOT_PRODUCT: WHERE distance >= distance_threshold
422
+ # * For EUCLIDEAN, COSINE: `WHERE distance <= distance_threshold`
423
+ # * For DOT_PRODUCT: `WHERE distance >= distance_threshold`
414
424
  class FindNearest
415
425
  include ::Google::Protobuf::MessageExts
416
426
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -22,6 +22,9 @@ module Google
22
22
  # Wrapper message for `double`.
23
23
  #
24
24
  # The JSON representation for `DoubleValue` is JSON number.
25
+ #
26
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
27
+ # has no plan to be removed.
25
28
  # @!attribute [rw] value
26
29
  # @return [::Float]
27
30
  # The double value.
@@ -33,6 +36,9 @@ module Google
33
36
  # Wrapper message for `float`.
34
37
  #
35
38
  # The JSON representation for `FloatValue` is JSON number.
39
+ #
40
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
41
+ # has no plan to be removed.
36
42
  # @!attribute [rw] value
37
43
  # @return [::Float]
38
44
  # The float value.
@@ -44,6 +50,9 @@ module Google
44
50
  # Wrapper message for `int64`.
45
51
  #
46
52
  # The JSON representation for `Int64Value` is JSON string.
53
+ #
54
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
55
+ # has no plan to be removed.
47
56
  # @!attribute [rw] value
48
57
  # @return [::Integer]
49
58
  # The int64 value.
@@ -55,6 +64,9 @@ module Google
55
64
  # Wrapper message for `uint64`.
56
65
  #
57
66
  # The JSON representation for `UInt64Value` is JSON string.
67
+ #
68
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
69
+ # has no plan to be removed.
58
70
  # @!attribute [rw] value
59
71
  # @return [::Integer]
60
72
  # The uint64 value.
@@ -66,6 +78,9 @@ module Google
66
78
  # Wrapper message for `int32`.
67
79
  #
68
80
  # The JSON representation for `Int32Value` is JSON number.
81
+ #
82
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
83
+ # has no plan to be removed.
69
84
  # @!attribute [rw] value
70
85
  # @return [::Integer]
71
86
  # The int32 value.
@@ -77,6 +92,9 @@ module Google
77
92
  # Wrapper message for `uint32`.
78
93
  #
79
94
  # The JSON representation for `UInt32Value` is JSON number.
95
+ #
96
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
97
+ # has no plan to be removed.
80
98
  # @!attribute [rw] value
81
99
  # @return [::Integer]
82
100
  # The uint32 value.
@@ -88,6 +106,9 @@ module Google
88
106
  # Wrapper message for `bool`.
89
107
  #
90
108
  # The JSON representation for `BoolValue` is JSON `true` and `false`.
109
+ #
110
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
111
+ # has no plan to be removed.
91
112
  # @!attribute [rw] value
92
113
  # @return [::Boolean]
93
114
  # The bool value.
@@ -99,6 +120,9 @@ module Google
99
120
  # Wrapper message for `string`.
100
121
  #
101
122
  # The JSON representation for `StringValue` is JSON string.
123
+ #
124
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
125
+ # has no plan to be removed.
102
126
  # @!attribute [rw] value
103
127
  # @return [::String]
104
128
  # The string value.
@@ -110,6 +134,9 @@ module Google
110
134
  # Wrapper message for `bytes`.
111
135
  #
112
136
  # The JSON representation for `BytesValue` is JSON string.
137
+ #
138
+ # Not recommended for use in new APIs, but still useful for legacy APIs and
139
+ # has no plan to be removed.
113
140
  # @!attribute [rw] value
114
141
  # @return [::String]
115
142
  # The bytes value.
@@ -21,9 +21,9 @@ module Google
21
21
  module Type
22
22
  # An object that represents a latitude/longitude pair. This is expressed as a
23
23
  # pair of doubles to represent degrees latitude and degrees longitude. Unless
24
- # specified otherwise, this must conform to the
25
- # <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
26
- # standard</a>. Values must be within normalized ranges.
24
+ # specified otherwise, this object must conform to the
25
+ # <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
26
+ # WGS84 standard</a>. Values must be within normalized ranges.
27
27
  # @!attribute [rw] latitude
28
28
  # @return [::Float]
29
29
  # The latitude in degrees. It must be in the range [-90.0, +90.0].