google-apis-firestore_v1 0.1.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.
@@ -0,0 +1,1232 @@
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
+ # http://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
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module FirestoreV1
23
+ # Cloud Firestore API
24
+ #
25
+ # Accesses the NoSQL document database built for automatic scaling, high
26
+ # performance, and ease of application development.
27
+ #
28
+ # @example
29
+ # require 'google/apis/firestore_v1'
30
+ #
31
+ # Firestore = Google::Apis::FirestoreV1 # Alias the module
32
+ # service = Firestore::FirestoreService.new
33
+ #
34
+ # @see https://cloud.google.com/firestore
35
+ class FirestoreService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://firestore.googleapis.com/', '',
48
+ client_name: 'google-apis-firestore_v1',
49
+ client_version: Google::Apis::FirestoreV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Exports a copy of all or a subset of documents from Google Cloud Firestore to
54
+ # another storage system, such as Google Cloud Storage. Recent updates to
55
+ # documents may not be reflected in the export. The export occurs in the
56
+ # background and its progress can be monitored and managed via the Operation
57
+ # resource that is created. The output of an export may only be used once the
58
+ # associated operation is done. If an export operation is cancelled before
59
+ # completion it may leave partial data behind in Google Cloud Storage.
60
+ # @param [String] name
61
+ # Required. Database to export. Should be of the form: `projects/`project_id`/
62
+ # databases/`database_id``.
63
+ # @param [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ExportDocumentsRequest] google_firestore_admin_v1_export_documents_request_object
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleLongrunningOperation] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::FirestoreV1::GoogleLongrunningOperation]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def export_project_database_documents(name, google_firestore_admin_v1_export_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v1/{+name}:exportDocuments', options)
83
+ command.request_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ExportDocumentsRequest::Representation
84
+ command.request_object = google_firestore_admin_v1_export_documents_request_object
85
+ command.response_representation = Google::Apis::FirestoreV1::GoogleLongrunningOperation::Representation
86
+ command.response_class = Google::Apis::FirestoreV1::GoogleLongrunningOperation
87
+ command.params['name'] = name unless name.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Imports documents into Google Cloud Firestore. Existing documents with the
94
+ # same name are overwritten. The import occurs in the background and its
95
+ # progress can be monitored and managed via the Operation resource that is
96
+ # created. If an ImportDocuments operation is cancelled, it is possible that a
97
+ # subset of the data has already been imported to Cloud Firestore.
98
+ # @param [String] name
99
+ # Required. Database to import into. Should be of the form: `projects/`
100
+ # project_id`/databases/`database_id``.
101
+ # @param [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ImportDocumentsRequest] google_firestore_admin_v1_import_documents_request_object
102
+ # @param [String] fields
103
+ # Selector specifying which fields to include in a partial response.
104
+ # @param [String] quota_user
105
+ # Available to use for quota purposes for server-side applications. Can be any
106
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
107
+ # @param [Google::Apis::RequestOptions] options
108
+ # Request-specific options
109
+ #
110
+ # @yield [result, err] Result & error if block supplied
111
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleLongrunningOperation] parsed result object
112
+ # @yieldparam err [StandardError] error object if request failed
113
+ #
114
+ # @return [Google::Apis::FirestoreV1::GoogleLongrunningOperation]
115
+ #
116
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
117
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
118
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
119
+ def import_project_database_documents(name, google_firestore_admin_v1_import_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
120
+ command = make_simple_command(:post, 'v1/{+name}:importDocuments', options)
121
+ command.request_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ImportDocumentsRequest::Representation
122
+ command.request_object = google_firestore_admin_v1_import_documents_request_object
123
+ command.response_representation = Google::Apis::FirestoreV1::GoogleLongrunningOperation::Representation
124
+ command.response_class = Google::Apis::FirestoreV1::GoogleLongrunningOperation
125
+ command.params['name'] = name unless name.nil?
126
+ command.query['fields'] = fields unless fields.nil?
127
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
128
+ execute_or_queue_command(command, &block)
129
+ end
130
+
131
+ # Gets the metadata and configuration for a Field.
132
+ # @param [String] name
133
+ # Required. A name of the form `projects/`project_id`/databases/`database_id`/
134
+ # collectionGroups/`collection_id`/fields/`field_id``
135
+ # @param [String] fields
136
+ # Selector specifying which fields to include in a partial response.
137
+ # @param [String] quota_user
138
+ # Available to use for quota purposes for server-side applications. Can be any
139
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
140
+ # @param [Google::Apis::RequestOptions] options
141
+ # Request-specific options
142
+ #
143
+ # @yield [result, err] Result & error if block supplied
144
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Field] parsed result object
145
+ # @yieldparam err [StandardError] error object if request failed
146
+ #
147
+ # @return [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Field]
148
+ #
149
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
150
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
151
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
152
+ def get_project_database_collection_group_field(name, fields: nil, quota_user: nil, options: nil, &block)
153
+ command = make_simple_command(:get, 'v1/{+name}', options)
154
+ command.response_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Field::Representation
155
+ command.response_class = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Field
156
+ command.params['name'] = name unless name.nil?
157
+ command.query['fields'] = fields unless fields.nil?
158
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
159
+ execute_or_queue_command(command, &block)
160
+ end
161
+
162
+ # Lists the field configuration and metadata for this database. Currently,
163
+ # FirestoreAdmin.ListFields only supports listing fields that have been
164
+ # explicitly overridden. To issue this query, call FirestoreAdmin.ListFields
165
+ # with the filter set to `indexConfig.usesAncestorConfig:false`.
166
+ # @param [String] parent
167
+ # Required. A parent name of the form `projects/`project_id`/databases/`
168
+ # database_id`/collectionGroups/`collection_id``
169
+ # @param [String] filter
170
+ # The filter to apply to list results. Currently, FirestoreAdmin.ListFields only
171
+ # supports listing fields that have been explicitly overridden. To issue this
172
+ # query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.
173
+ # usesAncestorConfig:false`.
174
+ # @param [Fixnum] page_size
175
+ # The number of results to return.
176
+ # @param [String] page_token
177
+ # A page token, returned from a previous call to FirestoreAdmin.ListFields, that
178
+ # may be used to get the next page of results.
179
+ # @param [String] fields
180
+ # Selector specifying which fields to include in a partial response.
181
+ # @param [String] quota_user
182
+ # Available to use for quota purposes for server-side applications. Can be any
183
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
184
+ # @param [Google::Apis::RequestOptions] options
185
+ # Request-specific options
186
+ #
187
+ # @yield [result, err] Result & error if block supplied
188
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListFieldsResponse] parsed result object
189
+ # @yieldparam err [StandardError] error object if request failed
190
+ #
191
+ # @return [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListFieldsResponse]
192
+ #
193
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
194
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
195
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
196
+ def list_project_database_collection_group_fields(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
197
+ command = make_simple_command(:get, 'v1/{+parent}/fields', options)
198
+ command.response_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListFieldsResponse::Representation
199
+ command.response_class = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListFieldsResponse
200
+ command.params['parent'] = parent unless parent.nil?
201
+ command.query['filter'] = filter unless filter.nil?
202
+ command.query['pageSize'] = page_size unless page_size.nil?
203
+ command.query['pageToken'] = page_token unless page_token.nil?
204
+ command.query['fields'] = fields unless fields.nil?
205
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
206
+ execute_or_queue_command(command, &block)
207
+ end
208
+
209
+ # Updates a field configuration. Currently, field updates apply only to single
210
+ # field index configuration. However, calls to FirestoreAdmin.UpdateField should
211
+ # provide a field mask to avoid changing any configuration that the caller isn't
212
+ # aware of. The field mask should be specified as: `` paths: "index_config" ``.
213
+ # This call returns a google.longrunning.Operation which may be used to track
214
+ # the status of the field update. The metadata for the operation will be the
215
+ # type FieldOperationMetadata. To configure the default field settings for the
216
+ # database, use the special `Field` with resource name: `projects/`project_id`/
217
+ # databases/`database_id`/collectionGroups/__default__/fields/*`.
218
+ # @param [String] name
219
+ # A field name of the form `projects/`project_id`/databases/`database_id`/
220
+ # collectionGroups/`collection_id`/fields/`field_path`` A field path may be a
221
+ # simple field name, e.g. `address` or a path to fields within map_value , e.g. `
222
+ # address.city`, or a special field path. The only valid special field is `*`,
223
+ # which represents any field. Field paths may be quoted using ` (backtick). The
224
+ # only character that needs to be escaped within a quoted field path is the
225
+ # backtick character itself, escaped using a backslash. Special characters in
226
+ # field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`,
227
+ # as well as any ascii symbolic characters. Examples: (Note: Comments here are
228
+ # written in markdown syntax, so there is an additional layer of backticks to
229
+ # represent a code block) `\`address.city\`` represents a field named `address.
230
+ # city`, not the map key `city` in the field `address`. `\`*\`` represents a
231
+ # field named `*`, not any field. A special `Field` contains the default
232
+ # indexing settings for all fields. This field's resource name is: `projects/`
233
+ # project_id`/databases/`database_id`/collectionGroups/__default__/fields/*`
234
+ # Indexes defined on this `Field` will be applied to all fields which do not
235
+ # have their own `Field` index configuration.
236
+ # @param [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Field] google_firestore_admin_v1_field_object
237
+ # @param [String] update_mask
238
+ # A mask, relative to the field. If specified, only configuration specified by
239
+ # this field_mask will be updated in the field.
240
+ # @param [String] fields
241
+ # Selector specifying which fields to include in a partial response.
242
+ # @param [String] quota_user
243
+ # Available to use for quota purposes for server-side applications. Can be any
244
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
245
+ # @param [Google::Apis::RequestOptions] options
246
+ # Request-specific options
247
+ #
248
+ # @yield [result, err] Result & error if block supplied
249
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleLongrunningOperation] parsed result object
250
+ # @yieldparam err [StandardError] error object if request failed
251
+ #
252
+ # @return [Google::Apis::FirestoreV1::GoogleLongrunningOperation]
253
+ #
254
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
255
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
256
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
257
+ def patch_project_database_collection_group_field(name, google_firestore_admin_v1_field_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
258
+ command = make_simple_command(:patch, 'v1/{+name}', options)
259
+ command.request_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Field::Representation
260
+ command.request_object = google_firestore_admin_v1_field_object
261
+ command.response_representation = Google::Apis::FirestoreV1::GoogleLongrunningOperation::Representation
262
+ command.response_class = Google::Apis::FirestoreV1::GoogleLongrunningOperation
263
+ command.params['name'] = name unless name.nil?
264
+ command.query['updateMask'] = update_mask unless update_mask.nil?
265
+ command.query['fields'] = fields unless fields.nil?
266
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
267
+ execute_or_queue_command(command, &block)
268
+ end
269
+
270
+ # Creates a composite index. This returns a google.longrunning.Operation which
271
+ # may be used to track the status of the creation. The metadata for the
272
+ # operation will be the type IndexOperationMetadata.
273
+ # @param [String] parent
274
+ # Required. A parent name of the form `projects/`project_id`/databases/`
275
+ # database_id`/collectionGroups/`collection_id``
276
+ # @param [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Index] google_firestore_admin_v1_index_object
277
+ # @param [String] fields
278
+ # Selector specifying which fields to include in a partial response.
279
+ # @param [String] quota_user
280
+ # Available to use for quota purposes for server-side applications. Can be any
281
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
282
+ # @param [Google::Apis::RequestOptions] options
283
+ # Request-specific options
284
+ #
285
+ # @yield [result, err] Result & error if block supplied
286
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleLongrunningOperation] parsed result object
287
+ # @yieldparam err [StandardError] error object if request failed
288
+ #
289
+ # @return [Google::Apis::FirestoreV1::GoogleLongrunningOperation]
290
+ #
291
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
292
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
293
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
294
+ def create_project_database_collection_group_index(parent, google_firestore_admin_v1_index_object = nil, fields: nil, quota_user: nil, options: nil, &block)
295
+ command = make_simple_command(:post, 'v1/{+parent}/indexes', options)
296
+ command.request_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Index::Representation
297
+ command.request_object = google_firestore_admin_v1_index_object
298
+ command.response_representation = Google::Apis::FirestoreV1::GoogleLongrunningOperation::Representation
299
+ command.response_class = Google::Apis::FirestoreV1::GoogleLongrunningOperation
300
+ command.params['parent'] = parent unless parent.nil?
301
+ command.query['fields'] = fields unless fields.nil?
302
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
303
+ execute_or_queue_command(command, &block)
304
+ end
305
+
306
+ # Deletes a composite index.
307
+ # @param [String] name
308
+ # Required. A name of the form `projects/`project_id`/databases/`database_id`/
309
+ # collectionGroups/`collection_id`/indexes/`index_id``
310
+ # @param [String] fields
311
+ # Selector specifying which fields to include in a partial response.
312
+ # @param [String] quota_user
313
+ # Available to use for quota purposes for server-side applications. Can be any
314
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
315
+ # @param [Google::Apis::RequestOptions] options
316
+ # Request-specific options
317
+ #
318
+ # @yield [result, err] Result & error if block supplied
319
+ # @yieldparam result [Google::Apis::FirestoreV1::Empty] parsed result object
320
+ # @yieldparam err [StandardError] error object if request failed
321
+ #
322
+ # @return [Google::Apis::FirestoreV1::Empty]
323
+ #
324
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
325
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
326
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
327
+ def delete_project_database_collection_group_index(name, fields: nil, quota_user: nil, options: nil, &block)
328
+ command = make_simple_command(:delete, 'v1/{+name}', options)
329
+ command.response_representation = Google::Apis::FirestoreV1::Empty::Representation
330
+ command.response_class = Google::Apis::FirestoreV1::Empty
331
+ command.params['name'] = name unless name.nil?
332
+ command.query['fields'] = fields unless fields.nil?
333
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
334
+ execute_or_queue_command(command, &block)
335
+ end
336
+
337
+ # Gets a composite index.
338
+ # @param [String] name
339
+ # Required. A name of the form `projects/`project_id`/databases/`database_id`/
340
+ # collectionGroups/`collection_id`/indexes/`index_id``
341
+ # @param [String] fields
342
+ # Selector specifying which fields to include in a partial response.
343
+ # @param [String] quota_user
344
+ # Available to use for quota purposes for server-side applications. Can be any
345
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
346
+ # @param [Google::Apis::RequestOptions] options
347
+ # Request-specific options
348
+ #
349
+ # @yield [result, err] Result & error if block supplied
350
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Index] parsed result object
351
+ # @yieldparam err [StandardError] error object if request failed
352
+ #
353
+ # @return [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Index]
354
+ #
355
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
356
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
357
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
358
+ def get_project_database_collection_group_index(name, fields: nil, quota_user: nil, options: nil, &block)
359
+ command = make_simple_command(:get, 'v1/{+name}', options)
360
+ command.response_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Index::Representation
361
+ command.response_class = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1Index
362
+ command.params['name'] = name unless name.nil?
363
+ command.query['fields'] = fields unless fields.nil?
364
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
365
+ execute_or_queue_command(command, &block)
366
+ end
367
+
368
+ # Lists composite indexes.
369
+ # @param [String] parent
370
+ # Required. A parent name of the form `projects/`project_id`/databases/`
371
+ # database_id`/collectionGroups/`collection_id``
372
+ # @param [String] filter
373
+ # The filter to apply to list results.
374
+ # @param [Fixnum] page_size
375
+ # The number of results to return.
376
+ # @param [String] page_token
377
+ # A page token, returned from a previous call to FirestoreAdmin.ListIndexes,
378
+ # that may be used to get the next page of results.
379
+ # @param [String] fields
380
+ # Selector specifying which fields to include in a partial response.
381
+ # @param [String] quota_user
382
+ # Available to use for quota purposes for server-side applications. Can be any
383
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
384
+ # @param [Google::Apis::RequestOptions] options
385
+ # Request-specific options
386
+ #
387
+ # @yield [result, err] Result & error if block supplied
388
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListIndexesResponse] parsed result object
389
+ # @yieldparam err [StandardError] error object if request failed
390
+ #
391
+ # @return [Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListIndexesResponse]
392
+ #
393
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
394
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
395
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
396
+ def list_project_database_collection_group_indexes(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
397
+ command = make_simple_command(:get, 'v1/{+parent}/indexes', options)
398
+ command.response_representation = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListIndexesResponse::Representation
399
+ command.response_class = Google::Apis::FirestoreV1::GoogleFirestoreAdminV1ListIndexesResponse
400
+ command.params['parent'] = parent unless parent.nil?
401
+ command.query['filter'] = filter unless filter.nil?
402
+ command.query['pageSize'] = page_size unless page_size.nil?
403
+ command.query['pageToken'] = page_token unless page_token.nil?
404
+ command.query['fields'] = fields unless fields.nil?
405
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
406
+ execute_or_queue_command(command, &block)
407
+ end
408
+
409
+ # Gets multiple documents. Documents returned by this method are not guaranteed
410
+ # to be returned in the same order that they were requested.
411
+ # @param [String] database
412
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
413
+ # database_id``.
414
+ # @param [Google::Apis::FirestoreV1::BatchGetDocumentsRequest] batch_get_documents_request_object
415
+ # @param [String] fields
416
+ # Selector specifying which fields to include in a partial response.
417
+ # @param [String] quota_user
418
+ # Available to use for quota purposes for server-side applications. Can be any
419
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
420
+ # @param [Google::Apis::RequestOptions] options
421
+ # Request-specific options
422
+ #
423
+ # @yield [result, err] Result & error if block supplied
424
+ # @yieldparam result [Google::Apis::FirestoreV1::BatchGetDocumentsResponse] parsed result object
425
+ # @yieldparam err [StandardError] error object if request failed
426
+ #
427
+ # @return [Google::Apis::FirestoreV1::BatchGetDocumentsResponse]
428
+ #
429
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
430
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
431
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
432
+ def batch_get_documents(database, batch_get_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
433
+ command = make_simple_command(:post, 'v1/{+database}/documents:batchGet', options)
434
+ command.request_representation = Google::Apis::FirestoreV1::BatchGetDocumentsRequest::Representation
435
+ command.request_object = batch_get_documents_request_object
436
+ command.response_representation = Google::Apis::FirestoreV1::BatchGetDocumentsResponse::Representation
437
+ command.response_class = Google::Apis::FirestoreV1::BatchGetDocumentsResponse
438
+ command.params['database'] = database unless database.nil?
439
+ command.query['fields'] = fields unless fields.nil?
440
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
441
+ execute_or_queue_command(command, &block)
442
+ end
443
+
444
+ # Applies a batch of write operations. The BatchWrite method does not apply the
445
+ # write operations atomically and can apply them out of order. Method does not
446
+ # allow more than one write per document. Each write succeeds or fails
447
+ # independently. See the BatchWriteResponse for the success status of each write.
448
+ # If you require an atomically applied set of writes, use Commit instead.
449
+ # @param [String] database
450
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
451
+ # database_id``.
452
+ # @param [Google::Apis::FirestoreV1::BatchWriteRequest] batch_write_request_object
453
+ # @param [String] fields
454
+ # Selector specifying which fields to include in a partial response.
455
+ # @param [String] quota_user
456
+ # Available to use for quota purposes for server-side applications. Can be any
457
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
458
+ # @param [Google::Apis::RequestOptions] options
459
+ # Request-specific options
460
+ #
461
+ # @yield [result, err] Result & error if block supplied
462
+ # @yieldparam result [Google::Apis::FirestoreV1::BatchWriteResponse] parsed result object
463
+ # @yieldparam err [StandardError] error object if request failed
464
+ #
465
+ # @return [Google::Apis::FirestoreV1::BatchWriteResponse]
466
+ #
467
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
468
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
469
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
470
+ def batch_document_write(database, batch_write_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
471
+ command = make_simple_command(:post, 'v1/{+database}/documents:batchWrite', options)
472
+ command.request_representation = Google::Apis::FirestoreV1::BatchWriteRequest::Representation
473
+ command.request_object = batch_write_request_object
474
+ command.response_representation = Google::Apis::FirestoreV1::BatchWriteResponse::Representation
475
+ command.response_class = Google::Apis::FirestoreV1::BatchWriteResponse
476
+ command.params['database'] = database unless database.nil?
477
+ command.query['fields'] = fields unless fields.nil?
478
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
479
+ execute_or_queue_command(command, &block)
480
+ end
481
+
482
+ # Starts a new transaction.
483
+ # @param [String] database
484
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
485
+ # database_id``.
486
+ # @param [Google::Apis::FirestoreV1::BeginTransactionRequest] begin_transaction_request_object
487
+ # @param [String] fields
488
+ # Selector specifying which fields to include in a partial response.
489
+ # @param [String] quota_user
490
+ # Available to use for quota purposes for server-side applications. Can be any
491
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
492
+ # @param [Google::Apis::RequestOptions] options
493
+ # Request-specific options
494
+ #
495
+ # @yield [result, err] Result & error if block supplied
496
+ # @yieldparam result [Google::Apis::FirestoreV1::BeginTransactionResponse] parsed result object
497
+ # @yieldparam err [StandardError] error object if request failed
498
+ #
499
+ # @return [Google::Apis::FirestoreV1::BeginTransactionResponse]
500
+ #
501
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
502
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
503
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
504
+ def begin_document_transaction(database, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
505
+ command = make_simple_command(:post, 'v1/{+database}/documents:beginTransaction', options)
506
+ command.request_representation = Google::Apis::FirestoreV1::BeginTransactionRequest::Representation
507
+ command.request_object = begin_transaction_request_object
508
+ command.response_representation = Google::Apis::FirestoreV1::BeginTransactionResponse::Representation
509
+ command.response_class = Google::Apis::FirestoreV1::BeginTransactionResponse
510
+ command.params['database'] = database unless database.nil?
511
+ command.query['fields'] = fields unless fields.nil?
512
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
513
+ execute_or_queue_command(command, &block)
514
+ end
515
+
516
+ # Commits a transaction, while optionally updating documents.
517
+ # @param [String] database
518
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
519
+ # database_id``.
520
+ # @param [Google::Apis::FirestoreV1::CommitRequest] commit_request_object
521
+ # @param [String] fields
522
+ # Selector specifying which fields to include in a partial response.
523
+ # @param [String] quota_user
524
+ # Available to use for quota purposes for server-side applications. Can be any
525
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
526
+ # @param [Google::Apis::RequestOptions] options
527
+ # Request-specific options
528
+ #
529
+ # @yield [result, err] Result & error if block supplied
530
+ # @yieldparam result [Google::Apis::FirestoreV1::CommitResponse] parsed result object
531
+ # @yieldparam err [StandardError] error object if request failed
532
+ #
533
+ # @return [Google::Apis::FirestoreV1::CommitResponse]
534
+ #
535
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
536
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
537
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
538
+ def commit_document(database, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
539
+ command = make_simple_command(:post, 'v1/{+database}/documents:commit', options)
540
+ command.request_representation = Google::Apis::FirestoreV1::CommitRequest::Representation
541
+ command.request_object = commit_request_object
542
+ command.response_representation = Google::Apis::FirestoreV1::CommitResponse::Representation
543
+ command.response_class = Google::Apis::FirestoreV1::CommitResponse
544
+ command.params['database'] = database unless database.nil?
545
+ command.query['fields'] = fields unless fields.nil?
546
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
547
+ execute_or_queue_command(command, &block)
548
+ end
549
+
550
+ # Creates a new document.
551
+ # @param [String] parent
552
+ # Required. The parent resource. For example: `projects/`project_id`/databases/`
553
+ # database_id`/documents` or `projects/`project_id`/databases/`database_id`/
554
+ # documents/chatrooms/`chatroom_id``
555
+ # @param [String] collection_id
556
+ # Required. The collection ID, relative to `parent`, to list. For example: `
557
+ # chatrooms`.
558
+ # @param [Google::Apis::FirestoreV1::Document] document_object
559
+ # @param [String] document_id
560
+ # The client-assigned document ID to use for this document. Optional. If not
561
+ # specified, an ID will be assigned by the service.
562
+ # @param [Array<String>, String] mask_field_paths
563
+ # The list of field paths in the mask. See Document.fields for a field path
564
+ # syntax reference.
565
+ # @param [String] fields
566
+ # Selector specifying which fields to include in a partial response.
567
+ # @param [String] quota_user
568
+ # Available to use for quota purposes for server-side applications. Can be any
569
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
570
+ # @param [Google::Apis::RequestOptions] options
571
+ # Request-specific options
572
+ #
573
+ # @yield [result, err] Result & error if block supplied
574
+ # @yieldparam result [Google::Apis::FirestoreV1::Document] parsed result object
575
+ # @yieldparam err [StandardError] error object if request failed
576
+ #
577
+ # @return [Google::Apis::FirestoreV1::Document]
578
+ #
579
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
580
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
581
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
582
+ def create_project_database_document_document(parent, collection_id, document_object = nil, document_id: nil, mask_field_paths: nil, fields: nil, quota_user: nil, options: nil, &block)
583
+ command = make_simple_command(:post, 'v1/{+parent}/{collectionId}', options)
584
+ command.request_representation = Google::Apis::FirestoreV1::Document::Representation
585
+ command.request_object = document_object
586
+ command.response_representation = Google::Apis::FirestoreV1::Document::Representation
587
+ command.response_class = Google::Apis::FirestoreV1::Document
588
+ command.params['parent'] = parent unless parent.nil?
589
+ command.params['collectionId'] = collection_id unless collection_id.nil?
590
+ command.query['documentId'] = document_id unless document_id.nil?
591
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
592
+ command.query['fields'] = fields unless fields.nil?
593
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
594
+ execute_or_queue_command(command, &block)
595
+ end
596
+
597
+ # Deletes a document.
598
+ # @param [String] name
599
+ # Required. The resource name of the Document to delete. In the format: `
600
+ # projects/`project_id`/databases/`database_id`/documents/`document_path``.
601
+ # @param [Boolean] current_document_exists
602
+ # When set to `true`, the target document must exist. When set to `false`, the
603
+ # target document must not exist.
604
+ # @param [String] current_document_update_time
605
+ # When set, the target document must exist and have been last updated at that
606
+ # time.
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
609
+ # @param [String] quota_user
610
+ # Available to use for quota purposes for server-side applications. Can be any
611
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
612
+ # @param [Google::Apis::RequestOptions] options
613
+ # Request-specific options
614
+ #
615
+ # @yield [result, err] Result & error if block supplied
616
+ # @yieldparam result [Google::Apis::FirestoreV1::Empty] parsed result object
617
+ # @yieldparam err [StandardError] error object if request failed
618
+ #
619
+ # @return [Google::Apis::FirestoreV1::Empty]
620
+ #
621
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
622
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
623
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
624
+ def delete_project_database_document(name, current_document_exists: nil, current_document_update_time: nil, fields: nil, quota_user: nil, options: nil, &block)
625
+ command = make_simple_command(:delete, 'v1/{+name}', options)
626
+ command.response_representation = Google::Apis::FirestoreV1::Empty::Representation
627
+ command.response_class = Google::Apis::FirestoreV1::Empty
628
+ command.params['name'] = name unless name.nil?
629
+ command.query['currentDocument.exists'] = current_document_exists unless current_document_exists.nil?
630
+ command.query['currentDocument.updateTime'] = current_document_update_time unless current_document_update_time.nil?
631
+ command.query['fields'] = fields unless fields.nil?
632
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
633
+ execute_or_queue_command(command, &block)
634
+ end
635
+
636
+ # Gets a single document.
637
+ # @param [String] name
638
+ # Required. The resource name of the Document to get. In the format: `projects/`
639
+ # project_id`/databases/`database_id`/documents/`document_path``.
640
+ # @param [Array<String>, String] mask_field_paths
641
+ # The list of field paths in the mask. See Document.fields for a field path
642
+ # syntax reference.
643
+ # @param [String] read_time
644
+ # Reads the version of the document at the given time. This may not be older
645
+ # than 270 seconds.
646
+ # @param [String] transaction
647
+ # Reads the document in a transaction.
648
+ # @param [String] fields
649
+ # Selector specifying which fields to include in a partial response.
650
+ # @param [String] quota_user
651
+ # Available to use for quota purposes for server-side applications. Can be any
652
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
653
+ # @param [Google::Apis::RequestOptions] options
654
+ # Request-specific options
655
+ #
656
+ # @yield [result, err] Result & error if block supplied
657
+ # @yieldparam result [Google::Apis::FirestoreV1::Document] parsed result object
658
+ # @yieldparam err [StandardError] error object if request failed
659
+ #
660
+ # @return [Google::Apis::FirestoreV1::Document]
661
+ #
662
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
663
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
664
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
665
+ def get_project_database_document(name, mask_field_paths: nil, read_time: nil, transaction: nil, fields: nil, quota_user: nil, options: nil, &block)
666
+ command = make_simple_command(:get, 'v1/{+name}', options)
667
+ command.response_representation = Google::Apis::FirestoreV1::Document::Representation
668
+ command.response_class = Google::Apis::FirestoreV1::Document
669
+ command.params['name'] = name unless name.nil?
670
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
671
+ command.query['readTime'] = read_time unless read_time.nil?
672
+ command.query['transaction'] = transaction unless transaction.nil?
673
+ command.query['fields'] = fields unless fields.nil?
674
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
675
+ execute_or_queue_command(command, &block)
676
+ end
677
+
678
+ # Lists documents.
679
+ # @param [String] parent
680
+ # Required. The parent resource name. In the format: `projects/`project_id`/
681
+ # databases/`database_id`/documents` or `projects/`project_id`/databases/`
682
+ # database_id`/documents/`document_path``. For example: `projects/my-project/
683
+ # databases/my-database/documents` or `projects/my-project/databases/my-database/
684
+ # documents/chatrooms/my-chatroom`
685
+ # @param [String] collection_id
686
+ # Required. The collection ID, relative to `parent`, to list. For example: `
687
+ # chatrooms` or `messages`.
688
+ # @param [Array<String>, String] mask_field_paths
689
+ # The list of field paths in the mask. See Document.fields for a field path
690
+ # syntax reference.
691
+ # @param [String] order_by
692
+ # The order to sort results by. For example: `priority desc, name`.
693
+ # @param [Fixnum] page_size
694
+ # The maximum number of documents to return.
695
+ # @param [String] page_token
696
+ # The `next_page_token` value returned from a previous List request, if any.
697
+ # @param [String] read_time
698
+ # Reads documents as they were at the given time. This may not be older than 270
699
+ # seconds.
700
+ # @param [Boolean] show_missing
701
+ # If the list should show missing documents. A missing document is a document
702
+ # that does not exist but has sub-documents. These documents will be returned
703
+ # with a key but will not have fields, Document.create_time, or Document.
704
+ # update_time set. Requests with `show_missing` may not specify `where` or `
705
+ # order_by`.
706
+ # @param [String] transaction
707
+ # Reads documents in a transaction.
708
+ # @param [String] fields
709
+ # Selector specifying which fields to include in a partial response.
710
+ # @param [String] quota_user
711
+ # Available to use for quota purposes for server-side applications. Can be any
712
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
713
+ # @param [Google::Apis::RequestOptions] options
714
+ # Request-specific options
715
+ #
716
+ # @yield [result, err] Result & error if block supplied
717
+ # @yieldparam result [Google::Apis::FirestoreV1::ListDocumentsResponse] parsed result object
718
+ # @yieldparam err [StandardError] error object if request failed
719
+ #
720
+ # @return [Google::Apis::FirestoreV1::ListDocumentsResponse]
721
+ #
722
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
723
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
724
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
725
+ def list_project_database_documents(parent, collection_id, mask_field_paths: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, show_missing: nil, transaction: nil, fields: nil, quota_user: nil, options: nil, &block)
726
+ command = make_simple_command(:get, 'v1/{+parent}/{collectionId}', options)
727
+ command.response_representation = Google::Apis::FirestoreV1::ListDocumentsResponse::Representation
728
+ command.response_class = Google::Apis::FirestoreV1::ListDocumentsResponse
729
+ command.params['parent'] = parent unless parent.nil?
730
+ command.params['collectionId'] = collection_id unless collection_id.nil?
731
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
732
+ command.query['orderBy'] = order_by unless order_by.nil?
733
+ command.query['pageSize'] = page_size unless page_size.nil?
734
+ command.query['pageToken'] = page_token unless page_token.nil?
735
+ command.query['readTime'] = read_time unless read_time.nil?
736
+ command.query['showMissing'] = show_missing unless show_missing.nil?
737
+ command.query['transaction'] = transaction unless transaction.nil?
738
+ command.query['fields'] = fields unless fields.nil?
739
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
740
+ execute_or_queue_command(command, &block)
741
+ end
742
+
743
+ # Lists all the collection IDs underneath a document.
744
+ # @param [String] parent
745
+ # Required. The parent document. In the format: `projects/`project_id`/databases/
746
+ # `database_id`/documents/`document_path``. For example: `projects/my-project/
747
+ # databases/my-database/documents/chatrooms/my-chatroom`
748
+ # @param [Google::Apis::FirestoreV1::ListCollectionIdsRequest] list_collection_ids_request_object
749
+ # @param [String] fields
750
+ # Selector specifying which fields to include in a partial response.
751
+ # @param [String] quota_user
752
+ # Available to use for quota purposes for server-side applications. Can be any
753
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
754
+ # @param [Google::Apis::RequestOptions] options
755
+ # Request-specific options
756
+ #
757
+ # @yield [result, err] Result & error if block supplied
758
+ # @yieldparam result [Google::Apis::FirestoreV1::ListCollectionIdsResponse] parsed result object
759
+ # @yieldparam err [StandardError] error object if request failed
760
+ #
761
+ # @return [Google::Apis::FirestoreV1::ListCollectionIdsResponse]
762
+ #
763
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
764
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
765
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
766
+ def list_document_collection_ids(parent, list_collection_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
767
+ command = make_simple_command(:post, 'v1/{+parent}:listCollectionIds', options)
768
+ command.request_representation = Google::Apis::FirestoreV1::ListCollectionIdsRequest::Representation
769
+ command.request_object = list_collection_ids_request_object
770
+ command.response_representation = Google::Apis::FirestoreV1::ListCollectionIdsResponse::Representation
771
+ command.response_class = Google::Apis::FirestoreV1::ListCollectionIdsResponse
772
+ command.params['parent'] = parent unless parent.nil?
773
+ command.query['fields'] = fields unless fields.nil?
774
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
775
+ execute_or_queue_command(command, &block)
776
+ end
777
+
778
+ # Listens to changes.
779
+ # @param [String] database
780
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
781
+ # database_id``.
782
+ # @param [Google::Apis::FirestoreV1::ListenRequest] listen_request_object
783
+ # @param [String] fields
784
+ # Selector specifying which fields to include in a partial response.
785
+ # @param [String] quota_user
786
+ # Available to use for quota purposes for server-side applications. Can be any
787
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
788
+ # @param [Google::Apis::RequestOptions] options
789
+ # Request-specific options
790
+ #
791
+ # @yield [result, err] Result & error if block supplied
792
+ # @yieldparam result [Google::Apis::FirestoreV1::ListenResponse] parsed result object
793
+ # @yieldparam err [StandardError] error object if request failed
794
+ #
795
+ # @return [Google::Apis::FirestoreV1::ListenResponse]
796
+ #
797
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
798
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
799
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
800
+ def listen_document(database, listen_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
801
+ command = make_simple_command(:post, 'v1/{+database}/documents:listen', options)
802
+ command.request_representation = Google::Apis::FirestoreV1::ListenRequest::Representation
803
+ command.request_object = listen_request_object
804
+ command.response_representation = Google::Apis::FirestoreV1::ListenResponse::Representation
805
+ command.response_class = Google::Apis::FirestoreV1::ListenResponse
806
+ command.params['database'] = database unless database.nil?
807
+ command.query['fields'] = fields unless fields.nil?
808
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
809
+ execute_or_queue_command(command, &block)
810
+ end
811
+
812
+ # Partitions a query by returning partition cursors that can be used to run the
813
+ # query in parallel. The returned partition cursors are split points that can be
814
+ # used by RunQuery as starting/end points for the query results.
815
+ # @param [String] parent
816
+ # Required. The parent resource name. In the format: `projects/`project_id`/
817
+ # databases/`database_id`/documents`. Document resource names are not supported;
818
+ # only database resource names can be specified.
819
+ # @param [Google::Apis::FirestoreV1::PartitionQueryRequest] partition_query_request_object
820
+ # @param [String] fields
821
+ # Selector specifying which fields to include in a partial response.
822
+ # @param [String] quota_user
823
+ # Available to use for quota purposes for server-side applications. Can be any
824
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
825
+ # @param [Google::Apis::RequestOptions] options
826
+ # Request-specific options
827
+ #
828
+ # @yield [result, err] Result & error if block supplied
829
+ # @yieldparam result [Google::Apis::FirestoreV1::PartitionQueryResponse] parsed result object
830
+ # @yieldparam err [StandardError] error object if request failed
831
+ #
832
+ # @return [Google::Apis::FirestoreV1::PartitionQueryResponse]
833
+ #
834
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
835
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
836
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
837
+ def partition_document_query(parent, partition_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
838
+ command = make_simple_command(:post, 'v1/{+parent}:partitionQuery', options)
839
+ command.request_representation = Google::Apis::FirestoreV1::PartitionQueryRequest::Representation
840
+ command.request_object = partition_query_request_object
841
+ command.response_representation = Google::Apis::FirestoreV1::PartitionQueryResponse::Representation
842
+ command.response_class = Google::Apis::FirestoreV1::PartitionQueryResponse
843
+ command.params['parent'] = parent unless parent.nil?
844
+ command.query['fields'] = fields unless fields.nil?
845
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
846
+ execute_or_queue_command(command, &block)
847
+ end
848
+
849
+ # Updates or inserts a document.
850
+ # @param [String] name
851
+ # The resource name of the document, for example `projects/`project_id`/
852
+ # databases/`database_id`/documents/`document_path``.
853
+ # @param [Google::Apis::FirestoreV1::Document] document_object
854
+ # @param [Boolean] current_document_exists
855
+ # When set to `true`, the target document must exist. When set to `false`, the
856
+ # target document must not exist.
857
+ # @param [String] current_document_update_time
858
+ # When set, the target document must exist and have been last updated at that
859
+ # time.
860
+ # @param [Array<String>, String] mask_field_paths
861
+ # The list of field paths in the mask. See Document.fields for a field path
862
+ # syntax reference.
863
+ # @param [Array<String>, String] update_mask_field_paths
864
+ # The list of field paths in the mask. See Document.fields for a field path
865
+ # syntax reference.
866
+ # @param [String] fields
867
+ # Selector specifying which fields to include in a partial response.
868
+ # @param [String] quota_user
869
+ # Available to use for quota purposes for server-side applications. Can be any
870
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
871
+ # @param [Google::Apis::RequestOptions] options
872
+ # Request-specific options
873
+ #
874
+ # @yield [result, err] Result & error if block supplied
875
+ # @yieldparam result [Google::Apis::FirestoreV1::Document] parsed result object
876
+ # @yieldparam err [StandardError] error object if request failed
877
+ #
878
+ # @return [Google::Apis::FirestoreV1::Document]
879
+ #
880
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
881
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
882
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
883
+ def patch_project_database_document(name, document_object = nil, current_document_exists: nil, current_document_update_time: nil, mask_field_paths: nil, update_mask_field_paths: nil, fields: nil, quota_user: nil, options: nil, &block)
884
+ command = make_simple_command(:patch, 'v1/{+name}', options)
885
+ command.request_representation = Google::Apis::FirestoreV1::Document::Representation
886
+ command.request_object = document_object
887
+ command.response_representation = Google::Apis::FirestoreV1::Document::Representation
888
+ command.response_class = Google::Apis::FirestoreV1::Document
889
+ command.params['name'] = name unless name.nil?
890
+ command.query['currentDocument.exists'] = current_document_exists unless current_document_exists.nil?
891
+ command.query['currentDocument.updateTime'] = current_document_update_time unless current_document_update_time.nil?
892
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
893
+ command.query['updateMask.fieldPaths'] = update_mask_field_paths unless update_mask_field_paths.nil?
894
+ command.query['fields'] = fields unless fields.nil?
895
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
896
+ execute_or_queue_command(command, &block)
897
+ end
898
+
899
+ # Rolls back a transaction.
900
+ # @param [String] database
901
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
902
+ # database_id``.
903
+ # @param [Google::Apis::FirestoreV1::RollbackRequest] rollback_request_object
904
+ # @param [String] fields
905
+ # Selector specifying which fields to include in a partial response.
906
+ # @param [String] quota_user
907
+ # Available to use for quota purposes for server-side applications. Can be any
908
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
909
+ # @param [Google::Apis::RequestOptions] options
910
+ # Request-specific options
911
+ #
912
+ # @yield [result, err] Result & error if block supplied
913
+ # @yieldparam result [Google::Apis::FirestoreV1::Empty] parsed result object
914
+ # @yieldparam err [StandardError] error object if request failed
915
+ #
916
+ # @return [Google::Apis::FirestoreV1::Empty]
917
+ #
918
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
919
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
920
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
921
+ def rollback_document(database, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
922
+ command = make_simple_command(:post, 'v1/{+database}/documents:rollback', options)
923
+ command.request_representation = Google::Apis::FirestoreV1::RollbackRequest::Representation
924
+ command.request_object = rollback_request_object
925
+ command.response_representation = Google::Apis::FirestoreV1::Empty::Representation
926
+ command.response_class = Google::Apis::FirestoreV1::Empty
927
+ command.params['database'] = database unless database.nil?
928
+ command.query['fields'] = fields unless fields.nil?
929
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
930
+ execute_or_queue_command(command, &block)
931
+ end
932
+
933
+ # Runs a query.
934
+ # @param [String] parent
935
+ # Required. The parent resource name. In the format: `projects/`project_id`/
936
+ # databases/`database_id`/documents` or `projects/`project_id`/databases/`
937
+ # database_id`/documents/`document_path``. For example: `projects/my-project/
938
+ # databases/my-database/documents` or `projects/my-project/databases/my-database/
939
+ # documents/chatrooms/my-chatroom`
940
+ # @param [Google::Apis::FirestoreV1::RunQueryRequest] run_query_request_object
941
+ # @param [String] fields
942
+ # Selector specifying which fields to include in a partial response.
943
+ # @param [String] quota_user
944
+ # Available to use for quota purposes for server-side applications. Can be any
945
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
946
+ # @param [Google::Apis::RequestOptions] options
947
+ # Request-specific options
948
+ #
949
+ # @yield [result, err] Result & error if block supplied
950
+ # @yieldparam result [Google::Apis::FirestoreV1::RunQueryResponse] parsed result object
951
+ # @yieldparam err [StandardError] error object if request failed
952
+ #
953
+ # @return [Google::Apis::FirestoreV1::RunQueryResponse]
954
+ #
955
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
956
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
957
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
958
+ def run_document_query(parent, run_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
959
+ command = make_simple_command(:post, 'v1/{+parent}:runQuery', options)
960
+ command.request_representation = Google::Apis::FirestoreV1::RunQueryRequest::Representation
961
+ command.request_object = run_query_request_object
962
+ command.response_representation = Google::Apis::FirestoreV1::RunQueryResponse::Representation
963
+ command.response_class = Google::Apis::FirestoreV1::RunQueryResponse
964
+ command.params['parent'] = parent unless parent.nil?
965
+ command.query['fields'] = fields unless fields.nil?
966
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
967
+ execute_or_queue_command(command, &block)
968
+ end
969
+
970
+ # Streams batches of document updates and deletes, in order.
971
+ # @param [String] database
972
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
973
+ # database_id``. This is only required in the first message.
974
+ # @param [Google::Apis::FirestoreV1::WriteRequest] write_request_object
975
+ # @param [String] fields
976
+ # Selector specifying which fields to include in a partial response.
977
+ # @param [String] quota_user
978
+ # Available to use for quota purposes for server-side applications. Can be any
979
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
980
+ # @param [Google::Apis::RequestOptions] options
981
+ # Request-specific options
982
+ #
983
+ # @yield [result, err] Result & error if block supplied
984
+ # @yieldparam result [Google::Apis::FirestoreV1::WriteResponse] parsed result object
985
+ # @yieldparam err [StandardError] error object if request failed
986
+ #
987
+ # @return [Google::Apis::FirestoreV1::WriteResponse]
988
+ #
989
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
990
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
991
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
992
+ def write_document(database, write_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
993
+ command = make_simple_command(:post, 'v1/{+database}/documents:write', options)
994
+ command.request_representation = Google::Apis::FirestoreV1::WriteRequest::Representation
995
+ command.request_object = write_request_object
996
+ command.response_representation = Google::Apis::FirestoreV1::WriteResponse::Representation
997
+ command.response_class = Google::Apis::FirestoreV1::WriteResponse
998
+ command.params['database'] = database unless database.nil?
999
+ command.query['fields'] = fields unless fields.nil?
1000
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1001
+ execute_or_queue_command(command, &block)
1002
+ end
1003
+
1004
+ # Starts asynchronous cancellation on a long-running operation. The server makes
1005
+ # a best effort to cancel the operation, but success is not guaranteed. If the
1006
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
1007
+ # Clients can use Operations.GetOperation or other methods to check whether the
1008
+ # cancellation succeeded or whether the operation completed despite cancellation.
1009
+ # On successful cancellation, the operation is not deleted; instead, it becomes
1010
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
1011
+ # corresponding to `Code.CANCELLED`.
1012
+ # @param [String] name
1013
+ # The name of the operation resource to be cancelled.
1014
+ # @param [Google::Apis::FirestoreV1::GoogleLongrunningCancelOperationRequest] google_longrunning_cancel_operation_request_object
1015
+ # @param [String] fields
1016
+ # Selector specifying which fields to include in a partial response.
1017
+ # @param [String] quota_user
1018
+ # Available to use for quota purposes for server-side applications. Can be any
1019
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1020
+ # @param [Google::Apis::RequestOptions] options
1021
+ # Request-specific options
1022
+ #
1023
+ # @yield [result, err] Result & error if block supplied
1024
+ # @yieldparam result [Google::Apis::FirestoreV1::Empty] parsed result object
1025
+ # @yieldparam err [StandardError] error object if request failed
1026
+ #
1027
+ # @return [Google::Apis::FirestoreV1::Empty]
1028
+ #
1029
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1030
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1031
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1032
+ def cancel_project_database_operation(name, google_longrunning_cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1033
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
1034
+ command.request_representation = Google::Apis::FirestoreV1::GoogleLongrunningCancelOperationRequest::Representation
1035
+ command.request_object = google_longrunning_cancel_operation_request_object
1036
+ command.response_representation = Google::Apis::FirestoreV1::Empty::Representation
1037
+ command.response_class = Google::Apis::FirestoreV1::Empty
1038
+ command.params['name'] = name unless name.nil?
1039
+ command.query['fields'] = fields unless fields.nil?
1040
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1041
+ execute_or_queue_command(command, &block)
1042
+ end
1043
+
1044
+ # Deletes a long-running operation. This method indicates that the client is no
1045
+ # longer interested in the operation result. It does not cancel the operation.
1046
+ # If the server doesn't support this method, it returns `google.rpc.Code.
1047
+ # UNIMPLEMENTED`.
1048
+ # @param [String] name
1049
+ # The name of the operation resource to be deleted.
1050
+ # @param [String] fields
1051
+ # Selector specifying which fields to include in a partial response.
1052
+ # @param [String] quota_user
1053
+ # Available to use for quota purposes for server-side applications. Can be any
1054
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1055
+ # @param [Google::Apis::RequestOptions] options
1056
+ # Request-specific options
1057
+ #
1058
+ # @yield [result, err] Result & error if block supplied
1059
+ # @yieldparam result [Google::Apis::FirestoreV1::Empty] parsed result object
1060
+ # @yieldparam err [StandardError] error object if request failed
1061
+ #
1062
+ # @return [Google::Apis::FirestoreV1::Empty]
1063
+ #
1064
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1065
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1066
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1067
+ def delete_project_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1068
+ command = make_simple_command(:delete, 'v1/{+name}', options)
1069
+ command.response_representation = Google::Apis::FirestoreV1::Empty::Representation
1070
+ command.response_class = Google::Apis::FirestoreV1::Empty
1071
+ command.params['name'] = name unless name.nil?
1072
+ command.query['fields'] = fields unless fields.nil?
1073
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1074
+ execute_or_queue_command(command, &block)
1075
+ end
1076
+
1077
+ # Gets the latest state of a long-running operation. Clients can use this method
1078
+ # to poll the operation result at intervals as recommended by the API service.
1079
+ # @param [String] name
1080
+ # The name of the operation resource.
1081
+ # @param [String] fields
1082
+ # Selector specifying which fields to include in a partial response.
1083
+ # @param [String] quota_user
1084
+ # Available to use for quota purposes for server-side applications. Can be any
1085
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1086
+ # @param [Google::Apis::RequestOptions] options
1087
+ # Request-specific options
1088
+ #
1089
+ # @yield [result, err] Result & error if block supplied
1090
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleLongrunningOperation] parsed result object
1091
+ # @yieldparam err [StandardError] error object if request failed
1092
+ #
1093
+ # @return [Google::Apis::FirestoreV1::GoogleLongrunningOperation]
1094
+ #
1095
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1096
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1097
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1098
+ def get_project_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1099
+ command = make_simple_command(:get, 'v1/{+name}', options)
1100
+ command.response_representation = Google::Apis::FirestoreV1::GoogleLongrunningOperation::Representation
1101
+ command.response_class = Google::Apis::FirestoreV1::GoogleLongrunningOperation
1102
+ command.params['name'] = name unless name.nil?
1103
+ command.query['fields'] = fields unless fields.nil?
1104
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1105
+ execute_or_queue_command(command, &block)
1106
+ end
1107
+
1108
+ # Lists operations that match the specified filter in the request. If the server
1109
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
1110
+ # binding allows API services to override the binding to use different resource
1111
+ # name schemes, such as `users/*/operations`. To override the binding, API
1112
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
1113
+ # service configuration. For backwards compatibility, the default name includes
1114
+ # the operations collection id, however overriding users must ensure the name
1115
+ # binding is the parent resource, without the operations collection id.
1116
+ # @param [String] name
1117
+ # The name of the operation's parent resource.
1118
+ # @param [String] filter
1119
+ # The standard list filter.
1120
+ # @param [Fixnum] page_size
1121
+ # The standard list page size.
1122
+ # @param [String] page_token
1123
+ # The standard list page token.
1124
+ # @param [String] fields
1125
+ # Selector specifying which fields to include in a partial response.
1126
+ # @param [String] quota_user
1127
+ # Available to use for quota purposes for server-side applications. Can be any
1128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1129
+ # @param [Google::Apis::RequestOptions] options
1130
+ # Request-specific options
1131
+ #
1132
+ # @yield [result, err] Result & error if block supplied
1133
+ # @yieldparam result [Google::Apis::FirestoreV1::GoogleLongrunningListOperationsResponse] parsed result object
1134
+ # @yieldparam err [StandardError] error object if request failed
1135
+ #
1136
+ # @return [Google::Apis::FirestoreV1::GoogleLongrunningListOperationsResponse]
1137
+ #
1138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1141
+ def list_project_database_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1142
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
1143
+ command.response_representation = Google::Apis::FirestoreV1::GoogleLongrunningListOperationsResponse::Representation
1144
+ command.response_class = Google::Apis::FirestoreV1::GoogleLongrunningListOperationsResponse
1145
+ command.params['name'] = name unless name.nil?
1146
+ command.query['filter'] = filter unless filter.nil?
1147
+ command.query['pageSize'] = page_size unless page_size.nil?
1148
+ command.query['pageToken'] = page_token unless page_token.nil?
1149
+ command.query['fields'] = fields unless fields.nil?
1150
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1151
+ execute_or_queue_command(command, &block)
1152
+ end
1153
+
1154
+ # Gets information about a location.
1155
+ # @param [String] name
1156
+ # Resource name for the location.
1157
+ # @param [String] fields
1158
+ # Selector specifying which fields to include in a partial response.
1159
+ # @param [String] quota_user
1160
+ # Available to use for quota purposes for server-side applications. Can be any
1161
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1162
+ # @param [Google::Apis::RequestOptions] options
1163
+ # Request-specific options
1164
+ #
1165
+ # @yield [result, err] Result & error if block supplied
1166
+ # @yieldparam result [Google::Apis::FirestoreV1::Location] parsed result object
1167
+ # @yieldparam err [StandardError] error object if request failed
1168
+ #
1169
+ # @return [Google::Apis::FirestoreV1::Location]
1170
+ #
1171
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1172
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1173
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1174
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
1175
+ command = make_simple_command(:get, 'v1/{+name}', options)
1176
+ command.response_representation = Google::Apis::FirestoreV1::Location::Representation
1177
+ command.response_class = Google::Apis::FirestoreV1::Location
1178
+ command.params['name'] = name unless name.nil?
1179
+ command.query['fields'] = fields unless fields.nil?
1180
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1181
+ execute_or_queue_command(command, &block)
1182
+ end
1183
+
1184
+ # Lists information about the supported locations for this service.
1185
+ # @param [String] name
1186
+ # The resource that owns the locations collection, if applicable.
1187
+ # @param [String] filter
1188
+ # The standard list filter.
1189
+ # @param [Fixnum] page_size
1190
+ # The standard list page size.
1191
+ # @param [String] page_token
1192
+ # The standard list page token.
1193
+ # @param [String] fields
1194
+ # Selector specifying which fields to include in a partial response.
1195
+ # @param [String] quota_user
1196
+ # Available to use for quota purposes for server-side applications. Can be any
1197
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1198
+ # @param [Google::Apis::RequestOptions] options
1199
+ # Request-specific options
1200
+ #
1201
+ # @yield [result, err] Result & error if block supplied
1202
+ # @yieldparam result [Google::Apis::FirestoreV1::ListLocationsResponse] parsed result object
1203
+ # @yieldparam err [StandardError] error object if request failed
1204
+ #
1205
+ # @return [Google::Apis::FirestoreV1::ListLocationsResponse]
1206
+ #
1207
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1208
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1209
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1210
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1211
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
1212
+ command.response_representation = Google::Apis::FirestoreV1::ListLocationsResponse::Representation
1213
+ command.response_class = Google::Apis::FirestoreV1::ListLocationsResponse
1214
+ command.params['name'] = name unless name.nil?
1215
+ command.query['filter'] = filter unless filter.nil?
1216
+ command.query['pageSize'] = page_size unless page_size.nil?
1217
+ command.query['pageToken'] = page_token unless page_token.nil?
1218
+ command.query['fields'] = fields unless fields.nil?
1219
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1220
+ execute_or_queue_command(command, &block)
1221
+ end
1222
+
1223
+ protected
1224
+
1225
+ def apply_command_defaults(command)
1226
+ command.query['key'] = key unless key.nil?
1227
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1228
+ end
1229
+ end
1230
+ end
1231
+ end
1232
+ end