google-cloud-firestore 1.4.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/CHANGELOG.md +47 -0
  4. data/TROUBLESHOOTING.md +2 -8
  5. data/lib/google-cloud-firestore.rb +14 -21
  6. data/lib/google/cloud/firestore.rb +12 -23
  7. data/lib/google/cloud/firestore/client.rb +12 -14
  8. data/lib/google/cloud/firestore/collection_reference.rb +1 -0
  9. data/lib/google/cloud/firestore/collection_reference_list.rb +137 -0
  10. data/lib/google/cloud/firestore/convert.rb +39 -39
  11. data/lib/google/cloud/firestore/credentials.rb +2 -2
  12. data/lib/google/cloud/firestore/document_reference.rb +8 -8
  13. data/lib/google/cloud/firestore/document_reference/list.rb +2 -2
  14. data/lib/google/cloud/firestore/document_snapshot.rb +4 -4
  15. data/lib/google/cloud/firestore/query.rb +114 -22
  16. data/lib/google/cloud/firestore/service.rb +63 -104
  17. data/lib/google/cloud/firestore/transaction.rb +2 -2
  18. data/lib/google/cloud/firestore/version.rb +1 -1
  19. data/lib/google/cloud/firestore/watch/inventory.rb +2 -0
  20. data/lib/google/cloud/firestore/watch/listener.rb +9 -9
  21. data/lib/google/cloud/firestore/watch/order.rb +1 -1
  22. metadata +11 -109
  23. data/lib/google/cloud/firestore/admin.rb +0 -144
  24. data/lib/google/cloud/firestore/admin/v1.rb +0 -151
  25. data/lib/google/cloud/firestore/admin/v1/credentials.rb +0 -44
  26. data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/field.rb +0 -86
  27. data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/firestore_admin.rb +0 -161
  28. data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/index.rb +0 -142
  29. data/lib/google/cloud/firestore/admin/v1/doc/google/longrunning/operations.rb +0 -51
  30. data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/any.rb +0 -131
  31. data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/empty.rb +0 -29
  32. data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/field_mask.rb +0 -222
  33. data/lib/google/cloud/firestore/admin/v1/doc/google/rpc/status.rb +0 -39
  34. data/lib/google/cloud/firestore/admin/v1/firestore_admin_client.rb +0 -902
  35. data/lib/google/cloud/firestore/admin/v1/firestore_admin_client_config.json +0 -71
  36. data/lib/google/cloud/firestore/v1.rb +0 -152
  37. data/lib/google/cloud/firestore/v1/credentials.rb +0 -42
  38. data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/common.rb +0 -64
  39. data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/document.rb +0 -136
  40. data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/firestore.rb +0 -566
  41. data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/query.rb +0 -227
  42. data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/write.rb +0 -241
  43. data/lib/google/cloud/firestore/v1/doc/google/protobuf/any.rb +0 -131
  44. data/lib/google/cloud/firestore/v1/doc/google/protobuf/empty.rb +0 -29
  45. data/lib/google/cloud/firestore/v1/doc/google/protobuf/timestamp.rb +0 -113
  46. data/lib/google/cloud/firestore/v1/doc/google/protobuf/wrappers.rb +0 -26
  47. data/lib/google/cloud/firestore/v1/doc/google/rpc/status.rb +0 -39
  48. data/lib/google/cloud/firestore/v1/firestore_client.rb +0 -1011
  49. data/lib/google/cloud/firestore/v1/firestore_client_config.json +0 -100
  50. data/lib/google/cloud/firestore/v1beta1.rb +0 -160
  51. data/lib/google/cloud/firestore/v1beta1/credentials.rb +0 -42
  52. data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/common.rb +0 -64
  53. data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/document.rb +0 -136
  54. data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/firestore.rb +0 -564
  55. data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/query.rb +0 -227
  56. data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/write.rb +0 -237
  57. data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/any.rb +0 -131
  58. data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/empty.rb +0 -29
  59. data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
  60. data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/wrappers.rb +0 -26
  61. data/lib/google/cloud/firestore/v1beta1/doc/google/rpc/status.rb +0 -39
  62. data/lib/google/cloud/firestore/v1beta1/firestore_client.rb +0 -1019
  63. data/lib/google/cloud/firestore/v1beta1/firestore_client_config.json +0 -100
  64. data/lib/google/firestore/admin/v1/field_pb.rb +0 -32
  65. data/lib/google/firestore/admin/v1/firestore_admin_pb.rb +0 -84
  66. data/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb +0 -94
  67. data/lib/google/firestore/admin/v1/index_pb.rb +0 -58
  68. data/lib/google/firestore/admin/v1/location_pb.rb +0 -22
  69. data/lib/google/firestore/admin/v1/operation_pb.rb +0 -90
  70. data/lib/google/firestore/v1/common_pb.rb +0 -45
  71. data/lib/google/firestore/v1/document_pb.rb +0 -50
  72. data/lib/google/firestore/v1/firestore_pb.rb +0 -222
  73. data/lib/google/firestore/v1/firestore_services_pb.rb +0 -80
  74. data/lib/google/firestore/v1/query_pb.rb +0 -107
  75. data/lib/google/firestore/v1/write_pb.rb +0 -80
  76. data/lib/google/firestore/v1beta1/common_pb.rb +0 -45
  77. data/lib/google/firestore/v1beta1/document_pb.rb +0 -50
  78. data/lib/google/firestore/v1beta1/firestore_pb.rb +0 -222
  79. data/lib/google/firestore/v1beta1/firestore_services_pb.rb +0 -89
  80. data/lib/google/firestore/v1beta1/query_pb.rb +0 -107
  81. data/lib/google/firestore/v1beta1/write_pb.rb +0 -79
@@ -1,566 +0,0 @@
1
- # Copyright 2020 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
- # https://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
-
16
- module Google
17
- module Firestore
18
- module V1
19
- # The request for {Google::Firestore::V1::Firestore::GetDocument Firestore::GetDocument}.
20
- # @!attribute [rw] name
21
- # @return [String]
22
- # Required. The resource name of the Document to get. In the format:
23
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
24
- # @!attribute [rw] mask
25
- # @return [Google::Firestore::V1::DocumentMask]
26
- # The fields to return. If not set, returns all fields.
27
- #
28
- # If the document has a field that is not present in this mask, that field
29
- # will not be returned in the response.
30
- # @!attribute [rw] transaction
31
- # @return [String]
32
- # Reads the document in a transaction.
33
- # @!attribute [rw] read_time
34
- # @return [Google::Protobuf::Timestamp]
35
- # Reads the version of the document at the given time.
36
- # This may not be older than 60 seconds.
37
- class GetDocumentRequest; end
38
-
39
- # The request for {Google::Firestore::V1::Firestore::ListDocuments Firestore::ListDocuments}.
40
- # @!attribute [rw] parent
41
- # @return [String]
42
- # Required. The parent resource name. In the format:
43
- # `projects/{project_id}/databases/{database_id}/documents` or
44
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
45
- # For example:
46
- # `projects/my-project/databases/my-database/documents` or
47
- # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
48
- # @!attribute [rw] collection_id
49
- # @return [String]
50
- # Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`
51
- # or `messages`.
52
- # @!attribute [rw] page_size
53
- # @return [Integer]
54
- # The maximum number of documents to return.
55
- # @!attribute [rw] page_token
56
- # @return [String]
57
- # The `next_page_token` value returned from a previous List request, if any.
58
- # @!attribute [rw] order_by
59
- # @return [String]
60
- # The order to sort results by. For example: `priority desc, name`.
61
- # @!attribute [rw] mask
62
- # @return [Google::Firestore::V1::DocumentMask]
63
- # The fields to return. If not set, returns all fields.
64
- #
65
- # If a document has a field that is not present in this mask, that field
66
- # will not be returned in the response.
67
- # @!attribute [rw] transaction
68
- # @return [String]
69
- # Reads documents in a transaction.
70
- # @!attribute [rw] read_time
71
- # @return [Google::Protobuf::Timestamp]
72
- # Reads documents as they were at the given time.
73
- # This may not be older than 60 seconds.
74
- # @!attribute [rw] show_missing
75
- # @return [true, false]
76
- # If the list should show missing documents. A missing document is a
77
- # document that does not exist but has sub-documents. These documents will
78
- # be returned with a key but will not have fields, {Google::Firestore::V1::Document#create_time Document#create_time},
79
- # or {Google::Firestore::V1::Document#update_time Document#update_time} set.
80
- #
81
- # Requests with `show_missing` may not specify `where` or
82
- # `order_by`.
83
- class ListDocumentsRequest; end
84
-
85
- # The response for {Google::Firestore::V1::Firestore::ListDocuments Firestore::ListDocuments}.
86
- # @!attribute [rw] documents
87
- # @return [Array<Google::Firestore::V1::Document>]
88
- # The Documents found.
89
- # @!attribute [rw] next_page_token
90
- # @return [String]
91
- # The next page token.
92
- class ListDocumentsResponse; end
93
-
94
- # The request for {Google::Firestore::V1::Firestore::CreateDocument Firestore::CreateDocument}.
95
- # @!attribute [rw] parent
96
- # @return [String]
97
- # Required. The parent resource. For example:
98
- # `projects/{project_id}/databases/{database_id}/documents` or
99
- # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
100
- # @!attribute [rw] collection_id
101
- # @return [String]
102
- # Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.
103
- # @!attribute [rw] document_id
104
- # @return [String]
105
- # The client-assigned document ID to use for this document.
106
- #
107
- # Optional. If not specified, an ID will be assigned by the service.
108
- # @!attribute [rw] document
109
- # @return [Google::Firestore::V1::Document]
110
- # Required. The document to create. `name` must not be set.
111
- # @!attribute [rw] mask
112
- # @return [Google::Firestore::V1::DocumentMask]
113
- # The fields to return. If not set, returns all fields.
114
- #
115
- # If the document has a field that is not present in this mask, that field
116
- # will not be returned in the response.
117
- class CreateDocumentRequest; end
118
-
119
- # The request for {Google::Firestore::V1::Firestore::UpdateDocument Firestore::UpdateDocument}.
120
- # @!attribute [rw] document
121
- # @return [Google::Firestore::V1::Document]
122
- # Required. The updated document.
123
- # Creates the document if it does not already exist.
124
- # @!attribute [rw] update_mask
125
- # @return [Google::Firestore::V1::DocumentMask]
126
- # The fields to update.
127
- # None of the field paths in the mask may contain a reserved name.
128
- #
129
- # If the document exists on the server and has fields not referenced in the
130
- # mask, they are left unchanged.
131
- # Fields referenced in the mask, but not present in the input document, are
132
- # deleted from the document on the server.
133
- # @!attribute [rw] mask
134
- # @return [Google::Firestore::V1::DocumentMask]
135
- # The fields to return. If not set, returns all fields.
136
- #
137
- # If the document has a field that is not present in this mask, that field
138
- # will not be returned in the response.
139
- # @!attribute [rw] current_document
140
- # @return [Google::Firestore::V1::Precondition]
141
- # An optional precondition on the document.
142
- # The request will fail if this is set and not met by the target document.
143
- class UpdateDocumentRequest; end
144
-
145
- # The request for {Google::Firestore::V1::Firestore::DeleteDocument Firestore::DeleteDocument}.
146
- # @!attribute [rw] name
147
- # @return [String]
148
- # Required. The resource name of the Document to delete. In the format:
149
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
150
- # @!attribute [rw] current_document
151
- # @return [Google::Firestore::V1::Precondition]
152
- # An optional precondition on the document.
153
- # The request will fail if this is set and not met by the target document.
154
- class DeleteDocumentRequest; end
155
-
156
- # The request for {Google::Firestore::V1::Firestore::BatchGetDocuments Firestore::BatchGetDocuments}.
157
- # @!attribute [rw] database
158
- # @return [String]
159
- # Required. The database name. In the format:
160
- # `projects/{project_id}/databases/{database_id}`.
161
- # @!attribute [rw] documents
162
- # @return [Array<String>]
163
- # The names of the documents to retrieve. In the format:
164
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
165
- # The request will fail if any of the document is not a child resource of the
166
- # given `database`. Duplicate names will be elided.
167
- # @!attribute [rw] mask
168
- # @return [Google::Firestore::V1::DocumentMask]
169
- # The fields to return. If not set, returns all fields.
170
- #
171
- # If a document has a field that is not present in this mask, that field will
172
- # not be returned in the response.
173
- # @!attribute [rw] transaction
174
- # @return [String]
175
- # Reads documents in a transaction.
176
- # @!attribute [rw] new_transaction
177
- # @return [Google::Firestore::V1::TransactionOptions]
178
- # Starts a new transaction and reads the documents.
179
- # Defaults to a read-only transaction.
180
- # The new transaction ID will be returned as the first response in the
181
- # stream.
182
- # @!attribute [rw] read_time
183
- # @return [Google::Protobuf::Timestamp]
184
- # Reads documents as they were at the given time.
185
- # This may not be older than 60 seconds.
186
- class BatchGetDocumentsRequest; end
187
-
188
- # The streamed response for {Google::Firestore::V1::Firestore::BatchGetDocuments Firestore::BatchGetDocuments}.
189
- # @!attribute [rw] found
190
- # @return [Google::Firestore::V1::Document]
191
- # A document that was requested.
192
- # @!attribute [rw] missing
193
- # @return [String]
194
- # A document name that was requested but does not exist. In the format:
195
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
196
- # @!attribute [rw] transaction
197
- # @return [String]
198
- # The transaction that was started as part of this request.
199
- # Will only be set in the first response, and only if
200
- # {Google::Firestore::V1::BatchGetDocumentsRequest#new_transaction BatchGetDocumentsRequest#new_transaction} was set in the request.
201
- # @!attribute [rw] read_time
202
- # @return [Google::Protobuf::Timestamp]
203
- # The time at which the document was read.
204
- # This may be monotically increasing, in this case the previous documents in
205
- # the result stream are guaranteed not to have changed between their
206
- # read_time and this one.
207
- class BatchGetDocumentsResponse; end
208
-
209
- # The request for {Google::Firestore::V1::Firestore::BeginTransaction Firestore::BeginTransaction}.
210
- # @!attribute [rw] database
211
- # @return [String]
212
- # Required. The database name. In the format:
213
- # `projects/{project_id}/databases/{database_id}`.
214
- # @!attribute [rw] options
215
- # @return [Google::Firestore::V1::TransactionOptions]
216
- # The options for the transaction.
217
- # Defaults to a read-write transaction.
218
- class BeginTransactionRequest; end
219
-
220
- # The response for {Google::Firestore::V1::Firestore::BeginTransaction Firestore::BeginTransaction}.
221
- # @!attribute [rw] transaction
222
- # @return [String]
223
- # The transaction that was started.
224
- class BeginTransactionResponse; end
225
-
226
- # The request for {Google::Firestore::V1::Firestore::Commit Firestore::Commit}.
227
- # @!attribute [rw] database
228
- # @return [String]
229
- # Required. The database name. In the format:
230
- # `projects/{project_id}/databases/{database_id}`.
231
- # @!attribute [rw] writes
232
- # @return [Array<Google::Firestore::V1::Write>]
233
- # The writes to apply.
234
- #
235
- # Always executed atomically and in order.
236
- # @!attribute [rw] transaction
237
- # @return [String]
238
- # If set, applies all writes in this transaction, and commits it.
239
- class CommitRequest; end
240
-
241
- # The response for {Google::Firestore::V1::Firestore::Commit Firestore::Commit}.
242
- # @!attribute [rw] write_results
243
- # @return [Array<Google::Firestore::V1::WriteResult>]
244
- # The result of applying the writes.
245
- #
246
- # This i-th write result corresponds to the i-th write in the
247
- # request.
248
- # @!attribute [rw] commit_time
249
- # @return [Google::Protobuf::Timestamp]
250
- # The time at which the commit occurred. Any read with an equal or greater
251
- # `read_time` is guaranteed to see the effects of the commit.
252
- class CommitResponse; end
253
-
254
- # The request for {Google::Firestore::V1::Firestore::Rollback Firestore::Rollback}.
255
- # @!attribute [rw] database
256
- # @return [String]
257
- # Required. The database name. In the format:
258
- # `projects/{project_id}/databases/{database_id}`.
259
- # @!attribute [rw] transaction
260
- # @return [String]
261
- # Required. The transaction to roll back.
262
- class RollbackRequest; end
263
-
264
- # The request for {Google::Firestore::V1::Firestore::RunQuery Firestore::RunQuery}.
265
- # @!attribute [rw] parent
266
- # @return [String]
267
- # Required. The parent resource name. In the format:
268
- # `projects/{project_id}/databases/{database_id}/documents` or
269
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
270
- # For example:
271
- # `projects/my-project/databases/my-database/documents` or
272
- # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
273
- # @!attribute [rw] structured_query
274
- # @return [Google::Firestore::V1::StructuredQuery]
275
- # A structured query.
276
- # @!attribute [rw] transaction
277
- # @return [String]
278
- # Reads documents in a transaction.
279
- # @!attribute [rw] new_transaction
280
- # @return [Google::Firestore::V1::TransactionOptions]
281
- # Starts a new transaction and reads the documents.
282
- # Defaults to a read-only transaction.
283
- # The new transaction ID will be returned as the first response in the
284
- # stream.
285
- # @!attribute [rw] read_time
286
- # @return [Google::Protobuf::Timestamp]
287
- # Reads documents as they were at the given time.
288
- # This may not be older than 60 seconds.
289
- class RunQueryRequest; end
290
-
291
- # The response for {Google::Firestore::V1::Firestore::RunQuery Firestore::RunQuery}.
292
- # @!attribute [rw] transaction
293
- # @return [String]
294
- # The transaction that was started as part of this request.
295
- # Can only be set in the first response, and only if
296
- # {Google::Firestore::V1::RunQueryRequest#new_transaction RunQueryRequest#new_transaction} was set in the request.
297
- # If set, no other fields will be set in this response.
298
- # @!attribute [rw] document
299
- # @return [Google::Firestore::V1::Document]
300
- # A query result.
301
- # Not set when reporting partial progress.
302
- # @!attribute [rw] read_time
303
- # @return [Google::Protobuf::Timestamp]
304
- # The time at which the document was read. This may be monotonically
305
- # increasing; in this case, the previous documents in the result stream are
306
- # guaranteed not to have changed between their `read_time` and this one.
307
- #
308
- # If the query returns no results, a response with `read_time` and no
309
- # `document` will be sent, and this represents the time at which the query
310
- # was run.
311
- # @!attribute [rw] skipped_results
312
- # @return [Integer]
313
- # The number of results that have been skipped due to an offset between
314
- # the last response and the current response.
315
- class RunQueryResponse; end
316
-
317
- # The request for {Google::Firestore::V1::Firestore::Write Firestore::Write}.
318
- #
319
- # The first request creates a stream, or resumes an existing one from a token.
320
- #
321
- # When creating a new stream, the server replies with a response containing
322
- # only an ID and a token, to use in the next request.
323
- #
324
- # When resuming a stream, the server first streams any responses later than the
325
- # given token, then a response containing only an up-to-date token, to use in
326
- # the next request.
327
- # @!attribute [rw] database
328
- # @return [String]
329
- # Required. The database name. In the format:
330
- # `projects/{project_id}/databases/{database_id}`.
331
- # This is only required in the first message.
332
- # @!attribute [rw] stream_id
333
- # @return [String]
334
- # The ID of the write stream to resume.
335
- # This may only be set in the first message. When left empty, a new write
336
- # stream will be created.
337
- # @!attribute [rw] writes
338
- # @return [Array<Google::Firestore::V1::Write>]
339
- # The writes to apply.
340
- #
341
- # Always executed atomically and in order.
342
- # This must be empty on the first request.
343
- # This may be empty on the last request.
344
- # This must not be empty on all other requests.
345
- # @!attribute [rw] stream_token
346
- # @return [String]
347
- # A stream token that was previously sent by the server.
348
- #
349
- # The client should set this field to the token from the most recent
350
- # {Google::Firestore::V1::WriteResponse WriteResponse} it has received. This acknowledges that the client has
351
- # received responses up to this token. After sending this token, earlier
352
- # tokens may not be used anymore.
353
- #
354
- # The server may close the stream if there are too many unacknowledged
355
- # responses.
356
- #
357
- # Leave this field unset when creating a new stream. To resume a stream at
358
- # a specific point, set this field and the `stream_id` field.
359
- #
360
- # Leave this field unset when creating a new stream.
361
- # @!attribute [rw] labels
362
- # @return [Hash{String => String}]
363
- # Labels associated with this write request.
364
- class WriteRequest; end
365
-
366
- # The response for {Google::Firestore::V1::Firestore::Write Firestore::Write}.
367
- # @!attribute [rw] stream_id
368
- # @return [String]
369
- # The ID of the stream.
370
- # Only set on the first message, when a new stream was created.
371
- # @!attribute [rw] stream_token
372
- # @return [String]
373
- # A token that represents the position of this response in the stream.
374
- # This can be used by a client to resume the stream at this point.
375
- #
376
- # This field is always set.
377
- # @!attribute [rw] write_results
378
- # @return [Array<Google::Firestore::V1::WriteResult>]
379
- # The result of applying the writes.
380
- #
381
- # This i-th write result corresponds to the i-th write in the
382
- # request.
383
- # @!attribute [rw] commit_time
384
- # @return [Google::Protobuf::Timestamp]
385
- # The time at which the commit occurred. Any read with an equal or greater
386
- # `read_time` is guaranteed to see the effects of the write.
387
- class WriteResponse; end
388
-
389
- # A request for {Google::Firestore::V1::Firestore::Listen Firestore::Listen}
390
- # @!attribute [rw] database
391
- # @return [String]
392
- # Required. The database name. In the format:
393
- # `projects/{project_id}/databases/{database_id}`.
394
- # @!attribute [rw] add_target
395
- # @return [Google::Firestore::V1::Target]
396
- # A target to add to this stream.
397
- # @!attribute [rw] remove_target
398
- # @return [Integer]
399
- # The ID of a target to remove from this stream.
400
- # @!attribute [rw] labels
401
- # @return [Hash{String => String}]
402
- # Labels associated with this target change.
403
- class ListenRequest; end
404
-
405
- # The response for {Google::Firestore::V1::Firestore::Listen Firestore::Listen}.
406
- # @!attribute [rw] target_change
407
- # @return [Google::Firestore::V1::TargetChange]
408
- # Targets have changed.
409
- # @!attribute [rw] document_change
410
- # @return [Google::Firestore::V1::DocumentChange]
411
- # A {Google::Firestore::V1::Document Document} has changed.
412
- # @!attribute [rw] document_delete
413
- # @return [Google::Firestore::V1::DocumentDelete]
414
- # A {Google::Firestore::V1::Document Document} has been deleted.
415
- # @!attribute [rw] document_remove
416
- # @return [Google::Firestore::V1::DocumentRemove]
417
- # A {Google::Firestore::V1::Document Document} has been removed from a target (because it is no longer
418
- # relevant to that target).
419
- # @!attribute [rw] filter
420
- # @return [Google::Firestore::V1::ExistenceFilter]
421
- # A filter to apply to the set of documents previously returned for the
422
- # given target.
423
- #
424
- # Returned when documents may have been removed from the given target, but
425
- # the exact documents are unknown.
426
- class ListenResponse; end
427
-
428
- # A specification of a set of documents to listen to.
429
- # @!attribute [rw] query
430
- # @return [Google::Firestore::V1::Target::QueryTarget]
431
- # A target specified by a query.
432
- # @!attribute [rw] documents
433
- # @return [Google::Firestore::V1::Target::DocumentsTarget]
434
- # A target specified by a set of document names.
435
- # @!attribute [rw] resume_token
436
- # @return [String]
437
- # A resume token from a prior {Google::Firestore::V1::TargetChange TargetChange} for an identical target.
438
- #
439
- # Using a resume token with a different target is unsupported and may fail.
440
- # @!attribute [rw] read_time
441
- # @return [Google::Protobuf::Timestamp]
442
- # Start listening after a specific `read_time`.
443
- #
444
- # The client must know the state of matching documents at this time.
445
- # @!attribute [rw] target_id
446
- # @return [Integer]
447
- # The target ID that identifies the target on the stream. Must be a positive
448
- # number and non-zero.
449
- # @!attribute [rw] once
450
- # @return [true, false]
451
- # If the target should be removed once it is current and consistent.
452
- class Target
453
- # A target specified by a set of documents names.
454
- # @!attribute [rw] documents
455
- # @return [Array<String>]
456
- # The names of the documents to retrieve. In the format:
457
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
458
- # The request will fail if any of the document is not a child resource of
459
- # the given `database`. Duplicate names will be elided.
460
- class DocumentsTarget; end
461
-
462
- # A target specified by a query.
463
- # @!attribute [rw] parent
464
- # @return [String]
465
- # The parent resource name. In the format:
466
- # `projects/{project_id}/databases/{database_id}/documents` or
467
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
468
- # For example:
469
- # `projects/my-project/databases/my-database/documents` or
470
- # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
471
- # @!attribute [rw] structured_query
472
- # @return [Google::Firestore::V1::StructuredQuery]
473
- # A structured query.
474
- class QueryTarget; end
475
- end
476
-
477
- # Targets being watched have changed.
478
- # @!attribute [rw] target_change_type
479
- # @return [Google::Firestore::V1::TargetChange::TargetChangeType]
480
- # The type of change that occurred.
481
- # @!attribute [rw] target_ids
482
- # @return [Array<Integer>]
483
- # The target IDs of targets that have changed.
484
- #
485
- # If empty, the change applies to all targets.
486
- #
487
- # The order of the target IDs is not defined.
488
- # @!attribute [rw] cause
489
- # @return [Google::Rpc::Status]
490
- # The error that resulted in this change, if applicable.
491
- # @!attribute [rw] resume_token
492
- # @return [String]
493
- # A token that can be used to resume the stream for the given `target_ids`,
494
- # or all targets if `target_ids` is empty.
495
- #
496
- # Not set on every target change.
497
- # @!attribute [rw] read_time
498
- # @return [Google::Protobuf::Timestamp]
499
- # The consistent `read_time` for the given `target_ids` (omitted when the
500
- # target_ids are not at a consistent snapshot).
501
- #
502
- # The stream is guaranteed to send a `read_time` with `target_ids` empty
503
- # whenever the entire stream reaches a new consistent snapshot. ADD,
504
- # CURRENT, and RESET messages are guaranteed to (eventually) result in a
505
- # new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
506
- #
507
- # For a given stream, `read_time` is guaranteed to be monotonically
508
- # increasing.
509
- class TargetChange
510
- # The type of change.
511
- module TargetChangeType
512
- # No change has occurred. Used only to send an updated `resume_token`.
513
- NO_CHANGE = 0
514
-
515
- # The targets have been added.
516
- ADD = 1
517
-
518
- # The targets have been removed.
519
- REMOVE = 2
520
-
521
- # The targets reflect all changes committed before the targets were added
522
- # to the stream.
523
- #
524
- # This will be sent after or with a `read_time` that is greater than or
525
- # equal to the time at which the targets were added.
526
- #
527
- # Listeners can wait for this change if read-after-write semantics
528
- # are desired.
529
- CURRENT = 3
530
-
531
- # The targets have been reset, and a new initial state for the targets
532
- # will be returned in subsequent changes.
533
- #
534
- # After the initial state is complete, `CURRENT` will be returned even
535
- # if the target was previously indicated to be `CURRENT`.
536
- RESET = 4
537
- end
538
- end
539
-
540
- # The request for {Google::Firestore::V1::Firestore::ListCollectionIds Firestore::ListCollectionIds}.
541
- # @!attribute [rw] parent
542
- # @return [String]
543
- # Required. The parent document. In the format:
544
- # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
545
- # For example:
546
- # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
547
- # @!attribute [rw] page_size
548
- # @return [Integer]
549
- # The maximum number of results to return.
550
- # @!attribute [rw] page_token
551
- # @return [String]
552
- # A page token. Must be a value from
553
- # {Google::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}.
554
- class ListCollectionIdsRequest; end
555
-
556
- # The response from {Google::Firestore::V1::Firestore::ListCollectionIds Firestore::ListCollectionIds}.
557
- # @!attribute [rw] collection_ids
558
- # @return [Array<String>]
559
- # The collection ids.
560
- # @!attribute [rw] next_page_token
561
- # @return [String]
562
- # A page token that may be used to continue the list.
563
- class ListCollectionIdsResponse; end
564
- end
565
- end
566
- end