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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/CHANGELOG.md +47 -0
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google-cloud-firestore.rb +14 -21
- data/lib/google/cloud/firestore.rb +12 -23
- data/lib/google/cloud/firestore/client.rb +12 -14
- data/lib/google/cloud/firestore/collection_reference.rb +1 -0
- data/lib/google/cloud/firestore/collection_reference_list.rb +137 -0
- data/lib/google/cloud/firestore/convert.rb +39 -39
- data/lib/google/cloud/firestore/credentials.rb +2 -2
- data/lib/google/cloud/firestore/document_reference.rb +8 -8
- data/lib/google/cloud/firestore/document_reference/list.rb +2 -2
- data/lib/google/cloud/firestore/document_snapshot.rb +4 -4
- data/lib/google/cloud/firestore/query.rb +114 -22
- data/lib/google/cloud/firestore/service.rb +63 -104
- data/lib/google/cloud/firestore/transaction.rb +2 -2
- data/lib/google/cloud/firestore/version.rb +1 -1
- data/lib/google/cloud/firestore/watch/inventory.rb +2 -0
- data/lib/google/cloud/firestore/watch/listener.rb +9 -9
- data/lib/google/cloud/firestore/watch/order.rb +1 -1
- metadata +11 -109
- data/lib/google/cloud/firestore/admin.rb +0 -144
- data/lib/google/cloud/firestore/admin/v1.rb +0 -151
- data/lib/google/cloud/firestore/admin/v1/credentials.rb +0 -44
- data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/field.rb +0 -86
- data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/firestore_admin.rb +0 -161
- data/lib/google/cloud/firestore/admin/v1/doc/google/firestore/admin/v1/index.rb +0 -142
- data/lib/google/cloud/firestore/admin/v1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/firestore/admin/v1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/firestore/admin/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/firestore/admin/v1/firestore_admin_client.rb +0 -902
- data/lib/google/cloud/firestore/admin/v1/firestore_admin_client_config.json +0 -71
- data/lib/google/cloud/firestore/v1.rb +0 -152
- data/lib/google/cloud/firestore/v1/credentials.rb +0 -42
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/common.rb +0 -64
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/document.rb +0 -136
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/firestore.rb +0 -566
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/query.rb +0 -227
- data/lib/google/cloud/firestore/v1/doc/google/firestore/v1/write.rb +0 -241
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/firestore/v1/doc/google/protobuf/wrappers.rb +0 -26
- data/lib/google/cloud/firestore/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/firestore/v1/firestore_client.rb +0 -1011
- data/lib/google/cloud/firestore/v1/firestore_client_config.json +0 -100
- data/lib/google/cloud/firestore/v1beta1.rb +0 -160
- data/lib/google/cloud/firestore/v1beta1/credentials.rb +0 -42
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/common.rb +0 -64
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/document.rb +0 -136
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/firestore.rb +0 -564
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/query.rb +0 -227
- data/lib/google/cloud/firestore/v1beta1/doc/google/firestore/v1beta1/write.rb +0 -237
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/firestore/v1beta1/doc/google/protobuf/wrappers.rb +0 -26
- data/lib/google/cloud/firestore/v1beta1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/firestore/v1beta1/firestore_client.rb +0 -1019
- data/lib/google/cloud/firestore/v1beta1/firestore_client_config.json +0 -100
- data/lib/google/firestore/admin/v1/field_pb.rb +0 -32
- data/lib/google/firestore/admin/v1/firestore_admin_pb.rb +0 -84
- data/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb +0 -94
- data/lib/google/firestore/admin/v1/index_pb.rb +0 -58
- data/lib/google/firestore/admin/v1/location_pb.rb +0 -22
- data/lib/google/firestore/admin/v1/operation_pb.rb +0 -90
- data/lib/google/firestore/v1/common_pb.rb +0 -45
- data/lib/google/firestore/v1/document_pb.rb +0 -50
- data/lib/google/firestore/v1/firestore_pb.rb +0 -222
- data/lib/google/firestore/v1/firestore_services_pb.rb +0 -80
- data/lib/google/firestore/v1/query_pb.rb +0 -107
- data/lib/google/firestore/v1/write_pb.rb +0 -80
- data/lib/google/firestore/v1beta1/common_pb.rb +0 -45
- data/lib/google/firestore/v1beta1/document_pb.rb +0 -50
- data/lib/google/firestore/v1beta1/firestore_pb.rb +0 -222
- data/lib/google/firestore/v1beta1/firestore_services_pb.rb +0 -89
- data/lib/google/firestore/v1beta1/query_pb.rb +0 -107
- data/lib/google/firestore/v1beta1/write_pb.rb +0 -79
@@ -1,564 +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 V1beta1
|
19
|
-
# The request for {Google::Firestore::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::Document#create_time Document#create_time},
|
79
|
-
# or {Google::Firestore::V1beta1::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::V1beta1::Firestore::ListDocuments Firestore::ListDocuments}.
|
86
|
-
# @!attribute [rw] documents
|
87
|
-
# @return [Array<Google::Firestore::V1beta1::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::V1beta1::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::V1beta1::Document]
|
110
|
-
# Required. The document to create. `name` must not be set.
|
111
|
-
# @!attribute [rw] mask
|
112
|
-
# @return [Google::Firestore::V1beta1::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::V1beta1::Firestore::UpdateDocument Firestore::UpdateDocument}.
|
120
|
-
# @!attribute [rw] document
|
121
|
-
# @return [Google::Firestore::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::Firestore::BatchGetDocuments Firestore::BatchGetDocuments}.
|
189
|
-
# @!attribute [rw] found
|
190
|
-
# @return [Google::Firestore::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::Firestore::Commit Firestore::Commit}.
|
242
|
-
# @!attribute [rw] write_results
|
243
|
-
# @return [Array<Google::Firestore::V1beta1::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.
|
251
|
-
class CommitResponse; end
|
252
|
-
|
253
|
-
# The request for {Google::Firestore::V1beta1::Firestore::Rollback Firestore::Rollback}.
|
254
|
-
# @!attribute [rw] database
|
255
|
-
# @return [String]
|
256
|
-
# Required. The database name. In the format:
|
257
|
-
# `projects/{project_id}/databases/{database_id}`.
|
258
|
-
# @!attribute [rw] transaction
|
259
|
-
# @return [String]
|
260
|
-
# Required. The transaction to roll back.
|
261
|
-
class RollbackRequest; end
|
262
|
-
|
263
|
-
# The request for {Google::Firestore::V1beta1::Firestore::RunQuery Firestore::RunQuery}.
|
264
|
-
# @!attribute [rw] parent
|
265
|
-
# @return [String]
|
266
|
-
# Required. The parent resource name. In the format:
|
267
|
-
# `projects/{project_id}/databases/{database_id}/documents` or
|
268
|
-
# `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
269
|
-
# For example:
|
270
|
-
# `projects/my-project/databases/my-database/documents` or
|
271
|
-
# `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
272
|
-
# @!attribute [rw] structured_query
|
273
|
-
# @return [Google::Firestore::V1beta1::StructuredQuery]
|
274
|
-
# A structured query.
|
275
|
-
# @!attribute [rw] transaction
|
276
|
-
# @return [String]
|
277
|
-
# Reads documents in a transaction.
|
278
|
-
# @!attribute [rw] new_transaction
|
279
|
-
# @return [Google::Firestore::V1beta1::TransactionOptions]
|
280
|
-
# Starts a new transaction and reads the documents.
|
281
|
-
# Defaults to a read-only transaction.
|
282
|
-
# The new transaction ID will be returned as the first response in the
|
283
|
-
# stream.
|
284
|
-
# @!attribute [rw] read_time
|
285
|
-
# @return [Google::Protobuf::Timestamp]
|
286
|
-
# Reads documents as they were at the given time.
|
287
|
-
# This may not be older than 60 seconds.
|
288
|
-
class RunQueryRequest; end
|
289
|
-
|
290
|
-
# The response for {Google::Firestore::V1beta1::Firestore::RunQuery Firestore::RunQuery}.
|
291
|
-
# @!attribute [rw] transaction
|
292
|
-
# @return [String]
|
293
|
-
# The transaction that was started as part of this request.
|
294
|
-
# Can only be set in the first response, and only if
|
295
|
-
# {Google::Firestore::V1beta1::RunQueryRequest#new_transaction RunQueryRequest#new_transaction} was set in the request.
|
296
|
-
# If set, no other fields will be set in this response.
|
297
|
-
# @!attribute [rw] document
|
298
|
-
# @return [Google::Firestore::V1beta1::Document]
|
299
|
-
# A query result.
|
300
|
-
# Not set when reporting partial progress.
|
301
|
-
# @!attribute [rw] read_time
|
302
|
-
# @return [Google::Protobuf::Timestamp]
|
303
|
-
# The time at which the document was read. This may be monotonically
|
304
|
-
# increasing; in this case, the previous documents in the result stream are
|
305
|
-
# guaranteed not to have changed between their `read_time` and this one.
|
306
|
-
#
|
307
|
-
# If the query returns no results, a response with `read_time` and no
|
308
|
-
# `document` will be sent, and this represents the time at which the query
|
309
|
-
# was run.
|
310
|
-
# @!attribute [rw] skipped_results
|
311
|
-
# @return [Integer]
|
312
|
-
# The number of results that have been skipped due to an offset between
|
313
|
-
# the last response and the current response.
|
314
|
-
class RunQueryResponse; end
|
315
|
-
|
316
|
-
# The request for {Google::Firestore::V1beta1::Firestore::Write Firestore::Write}.
|
317
|
-
#
|
318
|
-
# The first request creates a stream, or resumes an existing one from a token.
|
319
|
-
#
|
320
|
-
# When creating a new stream, the server replies with a response containing
|
321
|
-
# only an ID and a token, to use in the next request.
|
322
|
-
#
|
323
|
-
# When resuming a stream, the server first streams any responses later than the
|
324
|
-
# given token, then a response containing only an up-to-date token, to use in
|
325
|
-
# the next request.
|
326
|
-
# @!attribute [rw] database
|
327
|
-
# @return [String]
|
328
|
-
# Required. The database name. In the format:
|
329
|
-
# `projects/{project_id}/databases/{database_id}`.
|
330
|
-
# This is only required in the first message.
|
331
|
-
# @!attribute [rw] stream_id
|
332
|
-
# @return [String]
|
333
|
-
# The ID of the write stream to resume.
|
334
|
-
# This may only be set in the first message. When left empty, a new write
|
335
|
-
# stream will be created.
|
336
|
-
# @!attribute [rw] writes
|
337
|
-
# @return [Array<Google::Firestore::V1beta1::Write>]
|
338
|
-
# The writes to apply.
|
339
|
-
#
|
340
|
-
# Always executed atomically and in order.
|
341
|
-
# This must be empty on the first request.
|
342
|
-
# This may be empty on the last request.
|
343
|
-
# This must not be empty on all other requests.
|
344
|
-
# @!attribute [rw] stream_token
|
345
|
-
# @return [String]
|
346
|
-
# A stream token that was previously sent by the server.
|
347
|
-
#
|
348
|
-
# The client should set this field to the token from the most recent
|
349
|
-
# {Google::Firestore::V1beta1::WriteResponse WriteResponse} it has received. This acknowledges that the client has
|
350
|
-
# received responses up to this token. After sending this token, earlier
|
351
|
-
# tokens may not be used anymore.
|
352
|
-
#
|
353
|
-
# The server may close the stream if there are too many unacknowledged
|
354
|
-
# responses.
|
355
|
-
#
|
356
|
-
# Leave this field unset when creating a new stream. To resume a stream at
|
357
|
-
# a specific point, set this field and the `stream_id` field.
|
358
|
-
#
|
359
|
-
# Leave this field unset when creating a new stream.
|
360
|
-
# @!attribute [rw] labels
|
361
|
-
# @return [Hash{String => String}]
|
362
|
-
# Labels associated with this write request.
|
363
|
-
class WriteRequest; end
|
364
|
-
|
365
|
-
# The response for {Google::Firestore::V1beta1::Firestore::Write Firestore::Write}.
|
366
|
-
# @!attribute [rw] stream_id
|
367
|
-
# @return [String]
|
368
|
-
# The ID of the stream.
|
369
|
-
# Only set on the first message, when a new stream was created.
|
370
|
-
# @!attribute [rw] stream_token
|
371
|
-
# @return [String]
|
372
|
-
# A token that represents the position of this response in the stream.
|
373
|
-
# This can be used by a client to resume the stream at this point.
|
374
|
-
#
|
375
|
-
# This field is always set.
|
376
|
-
# @!attribute [rw] write_results
|
377
|
-
# @return [Array<Google::Firestore::V1beta1::WriteResult>]
|
378
|
-
# The result of applying the writes.
|
379
|
-
#
|
380
|
-
# This i-th write result corresponds to the i-th write in the
|
381
|
-
# request.
|
382
|
-
# @!attribute [rw] commit_time
|
383
|
-
# @return [Google::Protobuf::Timestamp]
|
384
|
-
# The time at which the commit occurred.
|
385
|
-
class WriteResponse; end
|
386
|
-
|
387
|
-
# A request for {Google::Firestore::V1beta1::Firestore::Listen Firestore::Listen}
|
388
|
-
# @!attribute [rw] database
|
389
|
-
# @return [String]
|
390
|
-
# Required. The database name. In the format:
|
391
|
-
# `projects/{project_id}/databases/{database_id}`.
|
392
|
-
# @!attribute [rw] add_target
|
393
|
-
# @return [Google::Firestore::V1beta1::Target]
|
394
|
-
# A target to add to this stream.
|
395
|
-
# @!attribute [rw] remove_target
|
396
|
-
# @return [Integer]
|
397
|
-
# The ID of a target to remove from this stream.
|
398
|
-
# @!attribute [rw] labels
|
399
|
-
# @return [Hash{String => String}]
|
400
|
-
# Labels associated with this target change.
|
401
|
-
class ListenRequest; end
|
402
|
-
|
403
|
-
# The response for {Google::Firestore::V1beta1::Firestore::Listen Firestore::Listen}.
|
404
|
-
# @!attribute [rw] target_change
|
405
|
-
# @return [Google::Firestore::V1beta1::TargetChange]
|
406
|
-
# Targets have changed.
|
407
|
-
# @!attribute [rw] document_change
|
408
|
-
# @return [Google::Firestore::V1beta1::DocumentChange]
|
409
|
-
# A {Google::Firestore::V1beta1::Document Document} has changed.
|
410
|
-
# @!attribute [rw] document_delete
|
411
|
-
# @return [Google::Firestore::V1beta1::DocumentDelete]
|
412
|
-
# A {Google::Firestore::V1beta1::Document Document} has been deleted.
|
413
|
-
# @!attribute [rw] document_remove
|
414
|
-
# @return [Google::Firestore::V1beta1::DocumentRemove]
|
415
|
-
# A {Google::Firestore::V1beta1::Document Document} has been removed from a target (because it is no longer
|
416
|
-
# relevant to that target).
|
417
|
-
# @!attribute [rw] filter
|
418
|
-
# @return [Google::Firestore::V1beta1::ExistenceFilter]
|
419
|
-
# A filter to apply to the set of documents previously returned for the
|
420
|
-
# given target.
|
421
|
-
#
|
422
|
-
# Returned when documents may have been removed from the given target, but
|
423
|
-
# the exact documents are unknown.
|
424
|
-
class ListenResponse; end
|
425
|
-
|
426
|
-
# A specification of a set of documents to listen to.
|
427
|
-
# @!attribute [rw] query
|
428
|
-
# @return [Google::Firestore::V1beta1::Target::QueryTarget]
|
429
|
-
# A target specified by a query.
|
430
|
-
# @!attribute [rw] documents
|
431
|
-
# @return [Google::Firestore::V1beta1::Target::DocumentsTarget]
|
432
|
-
# A target specified by a set of document names.
|
433
|
-
# @!attribute [rw] resume_token
|
434
|
-
# @return [String]
|
435
|
-
# A resume token from a prior {Google::Firestore::V1beta1::TargetChange TargetChange} for an identical target.
|
436
|
-
#
|
437
|
-
# Using a resume token with a different target is unsupported and may fail.
|
438
|
-
# @!attribute [rw] read_time
|
439
|
-
# @return [Google::Protobuf::Timestamp]
|
440
|
-
# Start listening after a specific `read_time`.
|
441
|
-
#
|
442
|
-
# The client must know the state of matching documents at this time.
|
443
|
-
# @!attribute [rw] target_id
|
444
|
-
# @return [Integer]
|
445
|
-
# The target ID that identifies the target on the stream. Must be a positive
|
446
|
-
# number and non-zero.
|
447
|
-
# @!attribute [rw] once
|
448
|
-
# @return [true, false]
|
449
|
-
# If the target should be removed once it is current and consistent.
|
450
|
-
class Target
|
451
|
-
# A target specified by a set of documents names.
|
452
|
-
# @!attribute [rw] documents
|
453
|
-
# @return [Array<String>]
|
454
|
-
# The names of the documents to retrieve. In the format:
|
455
|
-
# `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
456
|
-
# The request will fail if any of the document is not a child resource of
|
457
|
-
# the given `database`. Duplicate names will be elided.
|
458
|
-
class DocumentsTarget; end
|
459
|
-
|
460
|
-
# A target specified by a query.
|
461
|
-
# @!attribute [rw] parent
|
462
|
-
# @return [String]
|
463
|
-
# The parent resource name. In the format:
|
464
|
-
# `projects/{project_id}/databases/{database_id}/documents` or
|
465
|
-
# `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
466
|
-
# For example:
|
467
|
-
# `projects/my-project/databases/my-database/documents` or
|
468
|
-
# `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
469
|
-
# @!attribute [rw] structured_query
|
470
|
-
# @return [Google::Firestore::V1beta1::StructuredQuery]
|
471
|
-
# A structured query.
|
472
|
-
class QueryTarget; end
|
473
|
-
end
|
474
|
-
|
475
|
-
# Targets being watched have changed.
|
476
|
-
# @!attribute [rw] target_change_type
|
477
|
-
# @return [Google::Firestore::V1beta1::TargetChange::TargetChangeType]
|
478
|
-
# The type of change that occurred.
|
479
|
-
# @!attribute [rw] target_ids
|
480
|
-
# @return [Array<Integer>]
|
481
|
-
# The target IDs of targets that have changed.
|
482
|
-
#
|
483
|
-
# If empty, the change applies to all targets.
|
484
|
-
#
|
485
|
-
# The order of the target IDs is not defined.
|
486
|
-
# @!attribute [rw] cause
|
487
|
-
# @return [Google::Rpc::Status]
|
488
|
-
# The error that resulted in this change, if applicable.
|
489
|
-
# @!attribute [rw] resume_token
|
490
|
-
# @return [String]
|
491
|
-
# A token that can be used to resume the stream for the given `target_ids`,
|
492
|
-
# or all targets if `target_ids` is empty.
|
493
|
-
#
|
494
|
-
# Not set on every target change.
|
495
|
-
# @!attribute [rw] read_time
|
496
|
-
# @return [Google::Protobuf::Timestamp]
|
497
|
-
# The consistent `read_time` for the given `target_ids` (omitted when the
|
498
|
-
# target_ids are not at a consistent snapshot).
|
499
|
-
#
|
500
|
-
# The stream is guaranteed to send a `read_time` with `target_ids` empty
|
501
|
-
# whenever the entire stream reaches a new consistent snapshot. ADD,
|
502
|
-
# CURRENT, and RESET messages are guaranteed to (eventually) result in a
|
503
|
-
# new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
|
504
|
-
#
|
505
|
-
# For a given stream, `read_time` is guaranteed to be monotonically
|
506
|
-
# increasing.
|
507
|
-
class TargetChange
|
508
|
-
# The type of change.
|
509
|
-
module TargetChangeType
|
510
|
-
# No change has occurred. Used only to send an updated `resume_token`.
|
511
|
-
NO_CHANGE = 0
|
512
|
-
|
513
|
-
# The targets have been added.
|
514
|
-
ADD = 1
|
515
|
-
|
516
|
-
# The targets have been removed.
|
517
|
-
REMOVE = 2
|
518
|
-
|
519
|
-
# The targets reflect all changes committed before the targets were added
|
520
|
-
# to the stream.
|
521
|
-
#
|
522
|
-
# This will be sent after or with a `read_time` that is greater than or
|
523
|
-
# equal to the time at which the targets were added.
|
524
|
-
#
|
525
|
-
# Listeners can wait for this change if read-after-write semantics
|
526
|
-
# are desired.
|
527
|
-
CURRENT = 3
|
528
|
-
|
529
|
-
# The targets have been reset, and a new initial state for the targets
|
530
|
-
# will be returned in subsequent changes.
|
531
|
-
#
|
532
|
-
# After the initial state is complete, `CURRENT` will be returned even
|
533
|
-
# if the target was previously indicated to be `CURRENT`.
|
534
|
-
RESET = 4
|
535
|
-
end
|
536
|
-
end
|
537
|
-
|
538
|
-
# The request for {Google::Firestore::V1beta1::Firestore::ListCollectionIds Firestore::ListCollectionIds}.
|
539
|
-
# @!attribute [rw] parent
|
540
|
-
# @return [String]
|
541
|
-
# Required. The parent document. In the format:
|
542
|
-
# `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
|
543
|
-
# For example:
|
544
|
-
# `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
|
545
|
-
# @!attribute [rw] page_size
|
546
|
-
# @return [Integer]
|
547
|
-
# The maximum number of results to return.
|
548
|
-
# @!attribute [rw] page_token
|
549
|
-
# @return [String]
|
550
|
-
# A page token. Must be a value from
|
551
|
-
# {Google::Firestore::V1beta1::ListCollectionIdsResponse ListCollectionIdsResponse}.
|
552
|
-
class ListCollectionIdsRequest; end
|
553
|
-
|
554
|
-
# The response from {Google::Firestore::V1beta1::Firestore::ListCollectionIds Firestore::ListCollectionIds}.
|
555
|
-
# @!attribute [rw] collection_ids
|
556
|
-
# @return [Array<String>]
|
557
|
-
# The collection ids.
|
558
|
-
# @!attribute [rw] next_page_token
|
559
|
-
# @return [String]
|
560
|
-
# A page token that may be used to continue the list.
|
561
|
-
class ListCollectionIdsResponse; end
|
562
|
-
end
|
563
|
-
end
|
564
|
-
end
|