google-apis-firestore_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,876 @@
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 FirestoreV1beta1
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_v1beta1'
30
+ #
31
+ # Firestore = Google::Apis::FirestoreV1beta1 # 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_v1beta1',
49
+ client_version: Google::Apis::FirestoreV1beta1::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
+ # Database to export. Should be of the form: `projects/`project_id`/databases/`
62
+ # database_id``.
63
+ # @param [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ExportDocumentsRequest] google_firestore_admin_v1beta1_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::FirestoreV1beta1::GoogleLongrunningOperation] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::FirestoreV1beta1::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_v1beta1_export_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v1beta1/{+name}:exportDocuments', options)
83
+ command.request_representation = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ExportDocumentsRequest::Representation
84
+ command.request_object = google_firestore_admin_v1beta1_export_documents_request_object
85
+ command.response_representation = Google::Apis::FirestoreV1beta1::GoogleLongrunningOperation::Representation
86
+ command.response_class = Google::Apis::FirestoreV1beta1::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
+ # Database to import into. Should be of the form: `projects/`project_id`/
100
+ # databases/`database_id``.
101
+ # @param [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ImportDocumentsRequest] google_firestore_admin_v1beta1_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::FirestoreV1beta1::GoogleLongrunningOperation] parsed result object
112
+ # @yieldparam err [StandardError] error object if request failed
113
+ #
114
+ # @return [Google::Apis::FirestoreV1beta1::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_v1beta1_import_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
120
+ command = make_simple_command(:post, 'v1beta1/{+name}:importDocuments', options)
121
+ command.request_representation = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ImportDocumentsRequest::Representation
122
+ command.request_object = google_firestore_admin_v1beta1_import_documents_request_object
123
+ command.response_representation = Google::Apis::FirestoreV1beta1::GoogleLongrunningOperation::Representation
124
+ command.response_class = Google::Apis::FirestoreV1beta1::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 multiple documents. Documents returned by this method are not guaranteed
132
+ # to be returned in the same order that they were requested.
133
+ # @param [String] database
134
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
135
+ # database_id``.
136
+ # @param [Google::Apis::FirestoreV1beta1::BatchGetDocumentsRequest] batch_get_documents_request_object
137
+ # @param [String] fields
138
+ # Selector specifying which fields to include in a partial response.
139
+ # @param [String] quota_user
140
+ # Available to use for quota purposes for server-side applications. Can be any
141
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
142
+ # @param [Google::Apis::RequestOptions] options
143
+ # Request-specific options
144
+ #
145
+ # @yield [result, err] Result & error if block supplied
146
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::BatchGetDocumentsResponse] parsed result object
147
+ # @yieldparam err [StandardError] error object if request failed
148
+ #
149
+ # @return [Google::Apis::FirestoreV1beta1::BatchGetDocumentsResponse]
150
+ #
151
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
152
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
153
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
154
+ def batch_get_documents(database, batch_get_documents_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
155
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:batchGet', options)
156
+ command.request_representation = Google::Apis::FirestoreV1beta1::BatchGetDocumentsRequest::Representation
157
+ command.request_object = batch_get_documents_request_object
158
+ command.response_representation = Google::Apis::FirestoreV1beta1::BatchGetDocumentsResponse::Representation
159
+ command.response_class = Google::Apis::FirestoreV1beta1::BatchGetDocumentsResponse
160
+ command.params['database'] = database unless database.nil?
161
+ command.query['fields'] = fields unless fields.nil?
162
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
163
+ execute_or_queue_command(command, &block)
164
+ end
165
+
166
+ # Applies a batch of write operations. The BatchWrite method does not apply the
167
+ # write operations atomically and can apply them out of order. Method does not
168
+ # allow more than one write per document. Each write succeeds or fails
169
+ # independently. See the BatchWriteResponse for the success status of each write.
170
+ # If you require an atomically applied set of writes, use Commit instead.
171
+ # @param [String] database
172
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
173
+ # database_id``.
174
+ # @param [Google::Apis::FirestoreV1beta1::BatchWriteRequest] batch_write_request_object
175
+ # @param [String] fields
176
+ # Selector specifying which fields to include in a partial response.
177
+ # @param [String] quota_user
178
+ # Available to use for quota purposes for server-side applications. Can be any
179
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
180
+ # @param [Google::Apis::RequestOptions] options
181
+ # Request-specific options
182
+ #
183
+ # @yield [result, err] Result & error if block supplied
184
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::BatchWriteResponse] parsed result object
185
+ # @yieldparam err [StandardError] error object if request failed
186
+ #
187
+ # @return [Google::Apis::FirestoreV1beta1::BatchWriteResponse]
188
+ #
189
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
190
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
191
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
192
+ def batch_document_write(database, batch_write_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
193
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:batchWrite', options)
194
+ command.request_representation = Google::Apis::FirestoreV1beta1::BatchWriteRequest::Representation
195
+ command.request_object = batch_write_request_object
196
+ command.response_representation = Google::Apis::FirestoreV1beta1::BatchWriteResponse::Representation
197
+ command.response_class = Google::Apis::FirestoreV1beta1::BatchWriteResponse
198
+ command.params['database'] = database unless database.nil?
199
+ command.query['fields'] = fields unless fields.nil?
200
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
201
+ execute_or_queue_command(command, &block)
202
+ end
203
+
204
+ # Starts a new transaction.
205
+ # @param [String] database
206
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
207
+ # database_id``.
208
+ # @param [Google::Apis::FirestoreV1beta1::BeginTransactionRequest] begin_transaction_request_object
209
+ # @param [String] fields
210
+ # Selector specifying which fields to include in a partial response.
211
+ # @param [String] quota_user
212
+ # Available to use for quota purposes for server-side applications. Can be any
213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
214
+ # @param [Google::Apis::RequestOptions] options
215
+ # Request-specific options
216
+ #
217
+ # @yield [result, err] Result & error if block supplied
218
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::BeginTransactionResponse] parsed result object
219
+ # @yieldparam err [StandardError] error object if request failed
220
+ #
221
+ # @return [Google::Apis::FirestoreV1beta1::BeginTransactionResponse]
222
+ #
223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
226
+ def begin_document_transaction(database, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
227
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:beginTransaction', options)
228
+ command.request_representation = Google::Apis::FirestoreV1beta1::BeginTransactionRequest::Representation
229
+ command.request_object = begin_transaction_request_object
230
+ command.response_representation = Google::Apis::FirestoreV1beta1::BeginTransactionResponse::Representation
231
+ command.response_class = Google::Apis::FirestoreV1beta1::BeginTransactionResponse
232
+ command.params['database'] = database unless database.nil?
233
+ command.query['fields'] = fields unless fields.nil?
234
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
235
+ execute_or_queue_command(command, &block)
236
+ end
237
+
238
+ # Commits a transaction, while optionally updating documents.
239
+ # @param [String] database
240
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
241
+ # database_id``.
242
+ # @param [Google::Apis::FirestoreV1beta1::CommitRequest] commit_request_object
243
+ # @param [String] fields
244
+ # Selector specifying which fields to include in a partial response.
245
+ # @param [String] quota_user
246
+ # Available to use for quota purposes for server-side applications. Can be any
247
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
248
+ # @param [Google::Apis::RequestOptions] options
249
+ # Request-specific options
250
+ #
251
+ # @yield [result, err] Result & error if block supplied
252
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::CommitResponse] parsed result object
253
+ # @yieldparam err [StandardError] error object if request failed
254
+ #
255
+ # @return [Google::Apis::FirestoreV1beta1::CommitResponse]
256
+ #
257
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
258
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
259
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
260
+ def commit_document(database, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
261
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:commit', options)
262
+ command.request_representation = Google::Apis::FirestoreV1beta1::CommitRequest::Representation
263
+ command.request_object = commit_request_object
264
+ command.response_representation = Google::Apis::FirestoreV1beta1::CommitResponse::Representation
265
+ command.response_class = Google::Apis::FirestoreV1beta1::CommitResponse
266
+ command.params['database'] = database unless database.nil?
267
+ command.query['fields'] = fields unless fields.nil?
268
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
269
+ execute_or_queue_command(command, &block)
270
+ end
271
+
272
+ # Creates a new document.
273
+ # @param [String] parent
274
+ # Required. The parent resource. For example: `projects/`project_id`/databases/`
275
+ # database_id`/documents` or `projects/`project_id`/databases/`database_id`/
276
+ # documents/chatrooms/`chatroom_id``
277
+ # @param [String] collection_id
278
+ # Required. The collection ID, relative to `parent`, to list. For example: `
279
+ # chatrooms`.
280
+ # @param [Google::Apis::FirestoreV1beta1::Document] document_object
281
+ # @param [String] document_id
282
+ # The client-assigned document ID to use for this document. Optional. If not
283
+ # specified, an ID will be assigned by the service.
284
+ # @param [Array<String>, String] mask_field_paths
285
+ # The list of field paths in the mask. See Document.fields for a field path
286
+ # syntax reference.
287
+ # @param [String] fields
288
+ # Selector specifying which fields to include in a partial response.
289
+ # @param [String] quota_user
290
+ # Available to use for quota purposes for server-side applications. Can be any
291
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
292
+ # @param [Google::Apis::RequestOptions] options
293
+ # Request-specific options
294
+ #
295
+ # @yield [result, err] Result & error if block supplied
296
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::Document] parsed result object
297
+ # @yieldparam err [StandardError] error object if request failed
298
+ #
299
+ # @return [Google::Apis::FirestoreV1beta1::Document]
300
+ #
301
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
302
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
303
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
304
+ 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)
305
+ command = make_simple_command(:post, 'v1beta1/{+parent}/{collectionId}', options)
306
+ command.request_representation = Google::Apis::FirestoreV1beta1::Document::Representation
307
+ command.request_object = document_object
308
+ command.response_representation = Google::Apis::FirestoreV1beta1::Document::Representation
309
+ command.response_class = Google::Apis::FirestoreV1beta1::Document
310
+ command.params['parent'] = parent unless parent.nil?
311
+ command.params['collectionId'] = collection_id unless collection_id.nil?
312
+ command.query['documentId'] = document_id unless document_id.nil?
313
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
314
+ command.query['fields'] = fields unless fields.nil?
315
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
316
+ execute_or_queue_command(command, &block)
317
+ end
318
+
319
+ # Deletes a document.
320
+ # @param [String] name
321
+ # Required. The resource name of the Document to delete. In the format: `
322
+ # projects/`project_id`/databases/`database_id`/documents/`document_path``.
323
+ # @param [Boolean] current_document_exists
324
+ # When set to `true`, the target document must exist. When set to `false`, the
325
+ # target document must not exist.
326
+ # @param [String] current_document_update_time
327
+ # When set, the target document must exist and have been last updated at that
328
+ # time.
329
+ # @param [String] fields
330
+ # Selector specifying which fields to include in a partial response.
331
+ # @param [String] quota_user
332
+ # Available to use for quota purposes for server-side applications. Can be any
333
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
334
+ # @param [Google::Apis::RequestOptions] options
335
+ # Request-specific options
336
+ #
337
+ # @yield [result, err] Result & error if block supplied
338
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::Empty] parsed result object
339
+ # @yieldparam err [StandardError] error object if request failed
340
+ #
341
+ # @return [Google::Apis::FirestoreV1beta1::Empty]
342
+ #
343
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
344
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
345
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
346
+ def delete_project_database_document(name, current_document_exists: nil, current_document_update_time: nil, fields: nil, quota_user: nil, options: nil, &block)
347
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
348
+ command.response_representation = Google::Apis::FirestoreV1beta1::Empty::Representation
349
+ command.response_class = Google::Apis::FirestoreV1beta1::Empty
350
+ command.params['name'] = name unless name.nil?
351
+ command.query['currentDocument.exists'] = current_document_exists unless current_document_exists.nil?
352
+ command.query['currentDocument.updateTime'] = current_document_update_time unless current_document_update_time.nil?
353
+ command.query['fields'] = fields unless fields.nil?
354
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
355
+ execute_or_queue_command(command, &block)
356
+ end
357
+
358
+ # Gets a single document.
359
+ # @param [String] name
360
+ # Required. The resource name of the Document to get. In the format: `projects/`
361
+ # project_id`/databases/`database_id`/documents/`document_path``.
362
+ # @param [Array<String>, String] mask_field_paths
363
+ # The list of field paths in the mask. See Document.fields for a field path
364
+ # syntax reference.
365
+ # @param [String] read_time
366
+ # Reads the version of the document at the given time. This may not be older
367
+ # than 270 seconds.
368
+ # @param [String] transaction
369
+ # Reads the document in a transaction.
370
+ # @param [String] fields
371
+ # Selector specifying which fields to include in a partial response.
372
+ # @param [String] quota_user
373
+ # Available to use for quota purposes for server-side applications. Can be any
374
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
375
+ # @param [Google::Apis::RequestOptions] options
376
+ # Request-specific options
377
+ #
378
+ # @yield [result, err] Result & error if block supplied
379
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::Document] parsed result object
380
+ # @yieldparam err [StandardError] error object if request failed
381
+ #
382
+ # @return [Google::Apis::FirestoreV1beta1::Document]
383
+ #
384
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
385
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
386
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
387
+ def get_project_database_document(name, mask_field_paths: nil, read_time: nil, transaction: nil, fields: nil, quota_user: nil, options: nil, &block)
388
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
389
+ command.response_representation = Google::Apis::FirestoreV1beta1::Document::Representation
390
+ command.response_class = Google::Apis::FirestoreV1beta1::Document
391
+ command.params['name'] = name unless name.nil?
392
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
393
+ command.query['readTime'] = read_time unless read_time.nil?
394
+ command.query['transaction'] = transaction unless transaction.nil?
395
+ command.query['fields'] = fields unless fields.nil?
396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
397
+ execute_or_queue_command(command, &block)
398
+ end
399
+
400
+ # Lists documents.
401
+ # @param [String] parent
402
+ # Required. The parent resource name. In the format: `projects/`project_id`/
403
+ # databases/`database_id`/documents` or `projects/`project_id`/databases/`
404
+ # database_id`/documents/`document_path``. For example: `projects/my-project/
405
+ # databases/my-database/documents` or `projects/my-project/databases/my-database/
406
+ # documents/chatrooms/my-chatroom`
407
+ # @param [String] collection_id
408
+ # Required. The collection ID, relative to `parent`, to list. For example: `
409
+ # chatrooms` or `messages`.
410
+ # @param [Array<String>, String] mask_field_paths
411
+ # The list of field paths in the mask. See Document.fields for a field path
412
+ # syntax reference.
413
+ # @param [String] order_by
414
+ # The order to sort results by. For example: `priority desc, name`.
415
+ # @param [Fixnum] page_size
416
+ # The maximum number of documents to return.
417
+ # @param [String] page_token
418
+ # The `next_page_token` value returned from a previous List request, if any.
419
+ # @param [String] read_time
420
+ # Reads documents as they were at the given time. This may not be older than 270
421
+ # seconds.
422
+ # @param [Boolean] show_missing
423
+ # If the list should show missing documents. A missing document is a document
424
+ # that does not exist but has sub-documents. These documents will be returned
425
+ # with a key but will not have fields, Document.create_time, or Document.
426
+ # update_time set. Requests with `show_missing` may not specify `where` or `
427
+ # order_by`.
428
+ # @param [String] transaction
429
+ # Reads documents in a transaction.
430
+ # @param [String] fields
431
+ # Selector specifying which fields to include in a partial response.
432
+ # @param [String] quota_user
433
+ # Available to use for quota purposes for server-side applications. Can be any
434
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
435
+ # @param [Google::Apis::RequestOptions] options
436
+ # Request-specific options
437
+ #
438
+ # @yield [result, err] Result & error if block supplied
439
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::ListDocumentsResponse] parsed result object
440
+ # @yieldparam err [StandardError] error object if request failed
441
+ #
442
+ # @return [Google::Apis::FirestoreV1beta1::ListDocumentsResponse]
443
+ #
444
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
445
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
446
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
447
+ 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)
448
+ command = make_simple_command(:get, 'v1beta1/{+parent}/{collectionId}', options)
449
+ command.response_representation = Google::Apis::FirestoreV1beta1::ListDocumentsResponse::Representation
450
+ command.response_class = Google::Apis::FirestoreV1beta1::ListDocumentsResponse
451
+ command.params['parent'] = parent unless parent.nil?
452
+ command.params['collectionId'] = collection_id unless collection_id.nil?
453
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
454
+ command.query['orderBy'] = order_by unless order_by.nil?
455
+ command.query['pageSize'] = page_size unless page_size.nil?
456
+ command.query['pageToken'] = page_token unless page_token.nil?
457
+ command.query['readTime'] = read_time unless read_time.nil?
458
+ command.query['showMissing'] = show_missing unless show_missing.nil?
459
+ command.query['transaction'] = transaction unless transaction.nil?
460
+ command.query['fields'] = fields unless fields.nil?
461
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
462
+ execute_or_queue_command(command, &block)
463
+ end
464
+
465
+ # Lists all the collection IDs underneath a document.
466
+ # @param [String] parent
467
+ # Required. The parent document. In the format: `projects/`project_id`/databases/
468
+ # `database_id`/documents/`document_path``. For example: `projects/my-project/
469
+ # databases/my-database/documents/chatrooms/my-chatroom`
470
+ # @param [Google::Apis::FirestoreV1beta1::ListCollectionIdsRequest] list_collection_ids_request_object
471
+ # @param [String] fields
472
+ # Selector specifying which fields to include in a partial response.
473
+ # @param [String] quota_user
474
+ # Available to use for quota purposes for server-side applications. Can be any
475
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
476
+ # @param [Google::Apis::RequestOptions] options
477
+ # Request-specific options
478
+ #
479
+ # @yield [result, err] Result & error if block supplied
480
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::ListCollectionIdsResponse] parsed result object
481
+ # @yieldparam err [StandardError] error object if request failed
482
+ #
483
+ # @return [Google::Apis::FirestoreV1beta1::ListCollectionIdsResponse]
484
+ #
485
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
486
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
487
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
488
+ def list_project_database_document_collection_ids(parent, list_collection_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
489
+ command = make_simple_command(:post, 'v1beta1/{+parent}:listCollectionIds', options)
490
+ command.request_representation = Google::Apis::FirestoreV1beta1::ListCollectionIdsRequest::Representation
491
+ command.request_object = list_collection_ids_request_object
492
+ command.response_representation = Google::Apis::FirestoreV1beta1::ListCollectionIdsResponse::Representation
493
+ command.response_class = Google::Apis::FirestoreV1beta1::ListCollectionIdsResponse
494
+ command.params['parent'] = parent unless parent.nil?
495
+ command.query['fields'] = fields unless fields.nil?
496
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
497
+ execute_or_queue_command(command, &block)
498
+ end
499
+
500
+ # Listens to changes.
501
+ # @param [String] database
502
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
503
+ # database_id``.
504
+ # @param [Google::Apis::FirestoreV1beta1::ListenRequest] listen_request_object
505
+ # @param [String] fields
506
+ # Selector specifying which fields to include in a partial response.
507
+ # @param [String] quota_user
508
+ # Available to use for quota purposes for server-side applications. Can be any
509
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
510
+ # @param [Google::Apis::RequestOptions] options
511
+ # Request-specific options
512
+ #
513
+ # @yield [result, err] Result & error if block supplied
514
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::ListenResponse] parsed result object
515
+ # @yieldparam err [StandardError] error object if request failed
516
+ #
517
+ # @return [Google::Apis::FirestoreV1beta1::ListenResponse]
518
+ #
519
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
520
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
521
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
522
+ def listen_document(database, listen_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
523
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:listen', options)
524
+ command.request_representation = Google::Apis::FirestoreV1beta1::ListenRequest::Representation
525
+ command.request_object = listen_request_object
526
+ command.response_representation = Google::Apis::FirestoreV1beta1::ListenResponse::Representation
527
+ command.response_class = Google::Apis::FirestoreV1beta1::ListenResponse
528
+ command.params['database'] = database unless database.nil?
529
+ command.query['fields'] = fields unless fields.nil?
530
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
531
+ execute_or_queue_command(command, &block)
532
+ end
533
+
534
+ # Partitions a query by returning partition cursors that can be used to run the
535
+ # query in parallel. The returned partition cursors are split points that can be
536
+ # used by RunQuery as starting/end points for the query results.
537
+ # @param [String] parent
538
+ # Required. The parent resource name. In the format: `projects/`project_id`/
539
+ # databases/`database_id`/documents`. Document resource names are not supported;
540
+ # only database resource names can be specified.
541
+ # @param [Google::Apis::FirestoreV1beta1::PartitionQueryRequest] partition_query_request_object
542
+ # @param [String] fields
543
+ # Selector specifying which fields to include in a partial response.
544
+ # @param [String] quota_user
545
+ # Available to use for quota purposes for server-side applications. Can be any
546
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
547
+ # @param [Google::Apis::RequestOptions] options
548
+ # Request-specific options
549
+ #
550
+ # @yield [result, err] Result & error if block supplied
551
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::PartitionQueryResponse] parsed result object
552
+ # @yieldparam err [StandardError] error object if request failed
553
+ #
554
+ # @return [Google::Apis::FirestoreV1beta1::PartitionQueryResponse]
555
+ #
556
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
557
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
558
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
559
+ def partition_document_query(parent, partition_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
560
+ command = make_simple_command(:post, 'v1beta1/{+parent}:partitionQuery', options)
561
+ command.request_representation = Google::Apis::FirestoreV1beta1::PartitionQueryRequest::Representation
562
+ command.request_object = partition_query_request_object
563
+ command.response_representation = Google::Apis::FirestoreV1beta1::PartitionQueryResponse::Representation
564
+ command.response_class = Google::Apis::FirestoreV1beta1::PartitionQueryResponse
565
+ command.params['parent'] = parent unless parent.nil?
566
+ command.query['fields'] = fields unless fields.nil?
567
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
568
+ execute_or_queue_command(command, &block)
569
+ end
570
+
571
+ # Updates or inserts a document.
572
+ # @param [String] name
573
+ # The resource name of the document, for example `projects/`project_id`/
574
+ # databases/`database_id`/documents/`document_path``.
575
+ # @param [Google::Apis::FirestoreV1beta1::Document] document_object
576
+ # @param [Boolean] current_document_exists
577
+ # When set to `true`, the target document must exist. When set to `false`, the
578
+ # target document must not exist.
579
+ # @param [String] current_document_update_time
580
+ # When set, the target document must exist and have been last updated at that
581
+ # time.
582
+ # @param [Array<String>, String] mask_field_paths
583
+ # The list of field paths in the mask. See Document.fields for a field path
584
+ # syntax reference.
585
+ # @param [Array<String>, String] update_mask_field_paths
586
+ # The list of field paths in the mask. See Document.fields for a field path
587
+ # syntax reference.
588
+ # @param [String] fields
589
+ # Selector specifying which fields to include in a partial response.
590
+ # @param [String] quota_user
591
+ # Available to use for quota purposes for server-side applications. Can be any
592
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
593
+ # @param [Google::Apis::RequestOptions] options
594
+ # Request-specific options
595
+ #
596
+ # @yield [result, err] Result & error if block supplied
597
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::Document] parsed result object
598
+ # @yieldparam err [StandardError] error object if request failed
599
+ #
600
+ # @return [Google::Apis::FirestoreV1beta1::Document]
601
+ #
602
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
603
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
604
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
605
+ 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)
606
+ command = make_simple_command(:patch, 'v1beta1/{+name}', options)
607
+ command.request_representation = Google::Apis::FirestoreV1beta1::Document::Representation
608
+ command.request_object = document_object
609
+ command.response_representation = Google::Apis::FirestoreV1beta1::Document::Representation
610
+ command.response_class = Google::Apis::FirestoreV1beta1::Document
611
+ command.params['name'] = name unless name.nil?
612
+ command.query['currentDocument.exists'] = current_document_exists unless current_document_exists.nil?
613
+ command.query['currentDocument.updateTime'] = current_document_update_time unless current_document_update_time.nil?
614
+ command.query['mask.fieldPaths'] = mask_field_paths unless mask_field_paths.nil?
615
+ command.query['updateMask.fieldPaths'] = update_mask_field_paths unless update_mask_field_paths.nil?
616
+ command.query['fields'] = fields unless fields.nil?
617
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
618
+ execute_or_queue_command(command, &block)
619
+ end
620
+
621
+ # Rolls back a transaction.
622
+ # @param [String] database
623
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
624
+ # database_id``.
625
+ # @param [Google::Apis::FirestoreV1beta1::RollbackRequest] rollback_request_object
626
+ # @param [String] fields
627
+ # Selector specifying which fields to include in a partial response.
628
+ # @param [String] quota_user
629
+ # Available to use for quota purposes for server-side applications. Can be any
630
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
631
+ # @param [Google::Apis::RequestOptions] options
632
+ # Request-specific options
633
+ #
634
+ # @yield [result, err] Result & error if block supplied
635
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::Empty] parsed result object
636
+ # @yieldparam err [StandardError] error object if request failed
637
+ #
638
+ # @return [Google::Apis::FirestoreV1beta1::Empty]
639
+ #
640
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
641
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
642
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
643
+ def rollback_document(database, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
644
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:rollback', options)
645
+ command.request_representation = Google::Apis::FirestoreV1beta1::RollbackRequest::Representation
646
+ command.request_object = rollback_request_object
647
+ command.response_representation = Google::Apis::FirestoreV1beta1::Empty::Representation
648
+ command.response_class = Google::Apis::FirestoreV1beta1::Empty
649
+ command.params['database'] = database unless database.nil?
650
+ command.query['fields'] = fields unless fields.nil?
651
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
652
+ execute_or_queue_command(command, &block)
653
+ end
654
+
655
+ # Runs a query.
656
+ # @param [String] parent
657
+ # Required. The parent resource name. In the format: `projects/`project_id`/
658
+ # databases/`database_id`/documents` or `projects/`project_id`/databases/`
659
+ # database_id`/documents/`document_path``. For example: `projects/my-project/
660
+ # databases/my-database/documents` or `projects/my-project/databases/my-database/
661
+ # documents/chatrooms/my-chatroom`
662
+ # @param [Google::Apis::FirestoreV1beta1::RunQueryRequest] run_query_request_object
663
+ # @param [String] fields
664
+ # Selector specifying which fields to include in a partial response.
665
+ # @param [String] quota_user
666
+ # Available to use for quota purposes for server-side applications. Can be any
667
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
668
+ # @param [Google::Apis::RequestOptions] options
669
+ # Request-specific options
670
+ #
671
+ # @yield [result, err] Result & error if block supplied
672
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::RunQueryResponse] parsed result object
673
+ # @yieldparam err [StandardError] error object if request failed
674
+ #
675
+ # @return [Google::Apis::FirestoreV1beta1::RunQueryResponse]
676
+ #
677
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
678
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
679
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
680
+ def run_document_query(parent, run_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
681
+ command = make_simple_command(:post, 'v1beta1/{+parent}:runQuery', options)
682
+ command.request_representation = Google::Apis::FirestoreV1beta1::RunQueryRequest::Representation
683
+ command.request_object = run_query_request_object
684
+ command.response_representation = Google::Apis::FirestoreV1beta1::RunQueryResponse::Representation
685
+ command.response_class = Google::Apis::FirestoreV1beta1::RunQueryResponse
686
+ command.params['parent'] = parent unless parent.nil?
687
+ command.query['fields'] = fields unless fields.nil?
688
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
689
+ execute_or_queue_command(command, &block)
690
+ end
691
+
692
+ # Streams batches of document updates and deletes, in order.
693
+ # @param [String] database
694
+ # Required. The database name. In the format: `projects/`project_id`/databases/`
695
+ # database_id``. This is only required in the first message.
696
+ # @param [Google::Apis::FirestoreV1beta1::WriteRequest] write_request_object
697
+ # @param [String] fields
698
+ # Selector specifying which fields to include in a partial response.
699
+ # @param [String] quota_user
700
+ # Available to use for quota purposes for server-side applications. Can be any
701
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
702
+ # @param [Google::Apis::RequestOptions] options
703
+ # Request-specific options
704
+ #
705
+ # @yield [result, err] Result & error if block supplied
706
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::WriteResponse] parsed result object
707
+ # @yieldparam err [StandardError] error object if request failed
708
+ #
709
+ # @return [Google::Apis::FirestoreV1beta1::WriteResponse]
710
+ #
711
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
712
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
713
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
714
+ def write_document(database, write_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
715
+ command = make_simple_command(:post, 'v1beta1/{+database}/documents:write', options)
716
+ command.request_representation = Google::Apis::FirestoreV1beta1::WriteRequest::Representation
717
+ command.request_object = write_request_object
718
+ command.response_representation = Google::Apis::FirestoreV1beta1::WriteResponse::Representation
719
+ command.response_class = Google::Apis::FirestoreV1beta1::WriteResponse
720
+ command.params['database'] = database unless database.nil?
721
+ command.query['fields'] = fields unless fields.nil?
722
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
723
+ execute_or_queue_command(command, &block)
724
+ end
725
+
726
+ # Creates the specified index. A newly created index's initial state is `
727
+ # CREATING`. On completion of the returned google.longrunning.Operation, the
728
+ # state will be `READY`. If the index already exists, the call will return an `
729
+ # ALREADY_EXISTS` status. During creation, the process could result in an error,
730
+ # in which case the index will move to the `ERROR` state. The process can be
731
+ # recovered by fixing the data that caused the error, removing the index with
732
+ # delete, then re-creating the index with create. Indexes with a single field
733
+ # cannot be created.
734
+ # @param [String] parent
735
+ # The name of the database this index will apply to. For example: `projects/`
736
+ # project_id`/databases/`database_id``
737
+ # @param [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1Index] google_firestore_admin_v1beta1_index_object
738
+ # @param [String] fields
739
+ # Selector specifying which fields to include in a partial response.
740
+ # @param [String] quota_user
741
+ # Available to use for quota purposes for server-side applications. Can be any
742
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
743
+ # @param [Google::Apis::RequestOptions] options
744
+ # Request-specific options
745
+ #
746
+ # @yield [result, err] Result & error if block supplied
747
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::GoogleLongrunningOperation] parsed result object
748
+ # @yieldparam err [StandardError] error object if request failed
749
+ #
750
+ # @return [Google::Apis::FirestoreV1beta1::GoogleLongrunningOperation]
751
+ #
752
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
753
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
754
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
755
+ def create_project_database_index(parent, google_firestore_admin_v1beta1_index_object = nil, fields: nil, quota_user: nil, options: nil, &block)
756
+ command = make_simple_command(:post, 'v1beta1/{+parent}/indexes', options)
757
+ command.request_representation = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1Index::Representation
758
+ command.request_object = google_firestore_admin_v1beta1_index_object
759
+ command.response_representation = Google::Apis::FirestoreV1beta1::GoogleLongrunningOperation::Representation
760
+ command.response_class = Google::Apis::FirestoreV1beta1::GoogleLongrunningOperation
761
+ command.params['parent'] = parent unless parent.nil?
762
+ command.query['fields'] = fields unless fields.nil?
763
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
764
+ execute_or_queue_command(command, &block)
765
+ end
766
+
767
+ # Deletes an index.
768
+ # @param [String] name
769
+ # The index name. For example: `projects/`project_id`/databases/`database_id`/
770
+ # indexes/`index_id``
771
+ # @param [String] fields
772
+ # Selector specifying which fields to include in a partial response.
773
+ # @param [String] quota_user
774
+ # Available to use for quota purposes for server-side applications. Can be any
775
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
776
+ # @param [Google::Apis::RequestOptions] options
777
+ # Request-specific options
778
+ #
779
+ # @yield [result, err] Result & error if block supplied
780
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::Empty] parsed result object
781
+ # @yieldparam err [StandardError] error object if request failed
782
+ #
783
+ # @return [Google::Apis::FirestoreV1beta1::Empty]
784
+ #
785
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
786
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
787
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
788
+ def delete_project_database_index(name, fields: nil, quota_user: nil, options: nil, &block)
789
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
790
+ command.response_representation = Google::Apis::FirestoreV1beta1::Empty::Representation
791
+ command.response_class = Google::Apis::FirestoreV1beta1::Empty
792
+ command.params['name'] = name unless name.nil?
793
+ command.query['fields'] = fields unless fields.nil?
794
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
795
+ execute_or_queue_command(command, &block)
796
+ end
797
+
798
+ # Gets an index.
799
+ # @param [String] name
800
+ # The name of the index. For example: `projects/`project_id`/databases/`
801
+ # database_id`/indexes/`index_id``
802
+ # @param [String] fields
803
+ # Selector specifying which fields to include in a partial response.
804
+ # @param [String] quota_user
805
+ # Available to use for quota purposes for server-side applications. Can be any
806
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
807
+ # @param [Google::Apis::RequestOptions] options
808
+ # Request-specific options
809
+ #
810
+ # @yield [result, err] Result & error if block supplied
811
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1Index] parsed result object
812
+ # @yieldparam err [StandardError] error object if request failed
813
+ #
814
+ # @return [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1Index]
815
+ #
816
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
817
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
818
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
819
+ def get_project_database_index(name, fields: nil, quota_user: nil, options: nil, &block)
820
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
821
+ command.response_representation = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1Index::Representation
822
+ command.response_class = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1Index
823
+ command.params['name'] = name unless name.nil?
824
+ command.query['fields'] = fields unless fields.nil?
825
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
826
+ execute_or_queue_command(command, &block)
827
+ end
828
+
829
+ # Lists the indexes that match the specified filters.
830
+ # @param [String] parent
831
+ # The database name. For example: `projects/`project_id`/databases/`database_id``
832
+ # @param [String] filter
833
+ # @param [Fixnum] page_size
834
+ # The standard List page size.
835
+ # @param [String] page_token
836
+ # The standard List page token.
837
+ # @param [String] fields
838
+ # Selector specifying which fields to include in a partial response.
839
+ # @param [String] quota_user
840
+ # Available to use for quota purposes for server-side applications. Can be any
841
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
842
+ # @param [Google::Apis::RequestOptions] options
843
+ # Request-specific options
844
+ #
845
+ # @yield [result, err] Result & error if block supplied
846
+ # @yieldparam result [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ListIndexesResponse] parsed result object
847
+ # @yieldparam err [StandardError] error object if request failed
848
+ #
849
+ # @return [Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ListIndexesResponse]
850
+ #
851
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
852
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
853
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
854
+ def list_project_database_indexes(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
855
+ command = make_simple_command(:get, 'v1beta1/{+parent}/indexes', options)
856
+ command.response_representation = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ListIndexesResponse::Representation
857
+ command.response_class = Google::Apis::FirestoreV1beta1::GoogleFirestoreAdminV1beta1ListIndexesResponse
858
+ command.params['parent'] = parent unless parent.nil?
859
+ command.query['filter'] = filter unless filter.nil?
860
+ command.query['pageSize'] = page_size unless page_size.nil?
861
+ command.query['pageToken'] = page_token unless page_token.nil?
862
+ command.query['fields'] = fields unless fields.nil?
863
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
864
+ execute_or_queue_command(command, &block)
865
+ end
866
+
867
+ protected
868
+
869
+ def apply_command_defaults(command)
870
+ command.query['key'] = key unless key.nil?
871
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
872
+ end
873
+ end
874
+ end
875
+ end
876
+ end