google-cloud-firestore-v1 0.8.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcc0798a8aa1b6a70669958d01f1353dff7e9d002ded6fc42a27ec538d92e597
4
- data.tar.gz: 5e35f28c24d813ad220148bfe15ba385359440563dedb5b2342a2d262add911c
3
+ metadata.gz: eb73865cabf048a91f48e3fbd2e03d26d3bfda63ca86d5615ec09f66b197715b
4
+ data.tar.gz: 3dc2ee99432f186a1ae3aaa8a2a8864c43798686e859f2fdf9681e1eca655a4f
5
5
  SHA512:
6
- metadata.gz: 237cc0f52525a3c60eb4e0783d27c461cc2b21d02359d6e19eccdec1ce70d0dd4aa940fdcc1ae26f71191171c8e7b6a75761bf5402f44bf0aafc6f06df18965b
7
- data.tar.gz: 6d75b35dc3929b94ea27cbb684f630c7b7b6ff9a569a349688bf25505f4a9d8e54a1ff8836a25d62bb25f3b10c376cd0aede9bb657a854942c9155b0061a59d0
6
+ metadata.gz: 64695f7ce62c795f612349c1024918cab68d5c2cc023b03253ccafda63ad2fdc7ee94228a2eaa15b506554ad5b426a1842ded3d565fe62e87cc0c9b3dc57127c
7
+ data.tar.gz: 9d7c31a397e4364c283f5b702a2ae94a546d0f3c835c04a2c671f1021873644fc3257a411c02c3c4ab1f5f576b6df9bcb30ea137a26ebe1010cd094c8b64adfc
data/README.md CHANGED
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -34,8 +34,8 @@ module Google
34
34
  # document database that simplifies storing, syncing, and querying data for
35
35
  # your mobile, web, and IoT apps at global scale. Its client libraries provide
36
36
  # live synchronization and offline support, while its security features and
37
- # integrations with Firebase and Google Cloud Platform (GCP) accelerate
38
- # building truly serverless apps.
37
+ # integrations with Firebase and Google Cloud Platform accelerate building
38
+ # truly serverless apps.
39
39
  #
40
40
  class Client
41
41
  # @private
@@ -358,36 +358,56 @@ module Google
358
358
  # Required. The parent resource name. In the format:
359
359
  # `projects/{project_id}/databases/{database_id}/documents` or
360
360
  # `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
361
+ #
361
362
  # For example:
362
363
  # `projects/my-project/databases/my-database/documents` or
363
364
  # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
364
365
  # @param collection_id [::String]
365
- # Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`
366
- # or `messages`.
366
+ # Optional. The collection ID, relative to `parent`, to list.
367
+ #
368
+ # For example: `chatrooms` or `messages`.
369
+ #
370
+ # This is optional, and when not provided, Firestore will list documents
371
+ # from all collections under the provided `parent`.
367
372
  # @param page_size [::Integer]
368
- # The maximum number of documents to return.
373
+ # Optional. The maximum number of documents to return in a single response.
374
+ #
375
+ # Firestore may return fewer than this value.
369
376
  # @param page_token [::String]
370
- # The `next_page_token` value returned from a previous List request, if any.
377
+ # Optional. A page token, received from a previous `ListDocuments` response.
378
+ #
379
+ # Provide this to retrieve the subsequent page. When paginating, all other
380
+ # parameters (with the exception of `page_size`) must match the values set
381
+ # in the request that generated the page token.
371
382
  # @param order_by [::String]
372
- # The order to sort results by. For example: `priority desc, name`.
383
+ # Optional. The optional ordering of the documents to return.
384
+ #
385
+ # For example: `priority desc, __name__ desc`.
386
+ #
387
+ # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`}
388
+ # used in Firestore queries but in a string representation. When absent,
389
+ # documents are ordered based on `__name__ ASC`.
373
390
  # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash]
374
- # The fields to return. If not set, returns all fields.
391
+ # Optional. The fields to return. If not set, returns all fields.
375
392
  #
376
393
  # If a document has a field that is not present in this mask, that field
377
394
  # will not be returned in the response.
378
395
  # @param transaction [::String]
379
- # Reads documents in a transaction.
396
+ # Perform the read as part of an already active transaction.
380
397
  # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
381
- # Reads documents as they were at the given time.
398
+ # Perform the read at the provided time.
399
+ #
382
400
  # This may not be older than 270 seconds.
383
401
  # @param show_missing [::Boolean]
384
- # If the list should show missing documents. A missing document is a
385
- # document that does not exist but has sub-documents. These documents will
386
- # be returned with a key but will not have fields, {::Google::Cloud::Firestore::V1::Document#create_time Document.create_time},
387
- # or {::Google::Cloud::Firestore::V1::Document#update_time Document.update_time} set.
402
+ # If the list should show missing documents.
403
+ #
404
+ # A document is missing if it does not exist, but there are sub-documents
405
+ # nested underneath it. When true, such missing documents will be returned
406
+ # with a key but will not have fields,
407
+ # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or
408
+ # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set.
388
409
  #
389
- # Requests with `show_missing` may not specify `where` or
390
- # `order_by`.
410
+ # Requests with `show_missing` may not specify `where` or `order_by`.
391
411
  #
392
412
  # @yield [response, operation] Access the result along with the RPC operation
393
413
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>]
@@ -409,13 +429,11 @@ module Google
409
429
  # # Call the list_documents method.
410
430
  # result = client.list_documents request
411
431
  #
412
- # # The returned object is of type Gapic::PagedEnumerable. You can
413
- # # iterate over all elements by calling #each, and the enumerable
414
- # # will lazily make API calls to fetch subsequent pages. Other
415
- # # methods are also available for managing paging directly.
416
- # result.each do |response|
432
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
433
+ # # over elements, and API calls will be issued to fetch pages as needed.
434
+ # result.each do |item|
417
435
  # # Each element is of type ::Google::Cloud::Firestore::V1::Document.
418
- # p response
436
+ # p item
419
437
  # end
420
438
  #
421
439
  def list_documents request, options = nil
@@ -716,13 +734,13 @@ module Google
716
734
  # # Create a request. To set request fields, pass in keyword arguments.
717
735
  # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new
718
736
  #
719
- # # Call the batch_get_documents method.
720
- # result = client.batch_get_documents request
737
+ # # Call the batch_get_documents method to start streaming.
738
+ # output = client.batch_get_documents request
721
739
  #
722
- # # The returned object is a streamed enumerable yielding elements of
723
- # # type ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.
724
- # result.each do |response|
725
- # p response
740
+ # # The returned object is a streamed enumerable yielding elements of type
741
+ # # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse
742
+ # output.each do |current_response|
743
+ # p current_response
726
744
  # end
727
745
  #
728
746
  def batch_get_documents request, options = nil
@@ -1092,13 +1110,13 @@ module Google
1092
1110
  # # Create a request. To set request fields, pass in keyword arguments.
1093
1111
  # request = Google::Cloud::Firestore::V1::RunQueryRequest.new
1094
1112
  #
1095
- # # Call the run_query method.
1096
- # result = client.run_query request
1113
+ # # Call the run_query method to start streaming.
1114
+ # output = client.run_query request
1097
1115
  #
1098
- # # The returned object is a streamed enumerable yielding elements of
1099
- # # type ::Google::Cloud::Firestore::V1::RunQueryResponse.
1100
- # result.each do |response|
1101
- # p response
1116
+ # # The returned object is a streamed enumerable yielding elements of type
1117
+ # # ::Google::Cloud::Firestore::V1::RunQueryResponse
1118
+ # output.each do |current_response|
1119
+ # p current_response
1102
1120
  # end
1103
1121
  #
1104
1122
  def run_query request, options = nil
@@ -1145,8 +1163,9 @@ module Google
1145
1163
  ##
1146
1164
  # Runs an aggregation query.
1147
1165
  #
1148
- # Rather than producing {::Google::Cloud::Firestore::V1::Document Document} results like {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery},
1149
- # this API allows running an aggregation to produce a series of
1166
+ # Rather than producing {::Google::Cloud::Firestore::V1::Document Document} results like
1167
+ # {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}, this API
1168
+ # allows running an aggregation to produce a series of
1150
1169
  # {::Google::Cloud::Firestore::V1::AggregationResult AggregationResult} server-side.
1151
1170
  #
1152
1171
  # High-Level Example:
@@ -1213,13 +1232,13 @@ module Google
1213
1232
  # # Create a request. To set request fields, pass in keyword arguments.
1214
1233
  # request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new
1215
1234
  #
1216
- # # Call the run_aggregation_query method.
1217
- # result = client.run_aggregation_query request
1235
+ # # Call the run_aggregation_query method to start streaming.
1236
+ # output = client.run_aggregation_query request
1218
1237
  #
1219
- # # The returned object is a streamed enumerable yielding elements of
1220
- # # type ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse.
1221
- # result.each do |response|
1222
- # p response
1238
+ # # The returned object is a streamed enumerable yielding elements of type
1239
+ # # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse
1240
+ # output.each do |current_response|
1241
+ # p current_response
1223
1242
  # end
1224
1243
  #
1225
1244
  def run_aggregation_query request, options = nil
@@ -1348,13 +1367,11 @@ module Google
1348
1367
  # # Call the partition_query method.
1349
1368
  # result = client.partition_query request
1350
1369
  #
1351
- # # The returned object is of type Gapic::PagedEnumerable. You can
1352
- # # iterate over all elements by calling #each, and the enumerable
1353
- # # will lazily make API calls to fetch subsequent pages. Other
1354
- # # methods are also available for managing paging directly.
1355
- # result.each do |response|
1370
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1371
+ # # over elements, and API calls will be issued to fetch pages as needed.
1372
+ # result.each do |item|
1356
1373
  # # Each element is of type ::Google::Cloud::Firestore::V1::Cursor.
1357
- # p response
1374
+ # p item
1358
1375
  # end
1359
1376
  #
1360
1377
  def partition_query request, options = nil
@@ -1400,7 +1417,8 @@ module Google
1400
1417
  end
1401
1418
 
1402
1419
  ##
1403
- # Streams batches of document updates and deletes, in order.
1420
+ # Streams batches of document updates and deletes, in order. This method is
1421
+ # only available via the gRPC API (not REST).
1404
1422
  #
1405
1423
  # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Firestore::V1::WriteRequest, ::Hash>]
1406
1424
  # An enumerable of {::Google::Cloud::Firestore::V1::WriteRequest} instances.
@@ -1421,22 +1439,22 @@ module Google
1421
1439
  # # Create a client object. The client can be reused for multiple calls.
1422
1440
  # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1423
1441
  #
1424
- # # Create an input stream
1442
+ # # Create an input stream.
1425
1443
  # input = Gapic::StreamInput.new
1426
1444
  #
1427
1445
  # # Call the write method to start streaming.
1428
1446
  # output = client.write input
1429
1447
  #
1430
- # # Send requests on the stream. For each request, pass in keyword
1431
- # # arguments to set fields. Be sure to close the stream when done.
1448
+ # # Send requests on the stream. For each request object, set fields by
1449
+ # # passing keyword arguments. Be sure to close the stream when done.
1432
1450
  # input << Google::Cloud::Firestore::V1::WriteRequest.new
1433
1451
  # input << Google::Cloud::Firestore::V1::WriteRequest.new
1434
1452
  # input.close
1435
1453
  #
1436
- # # Handle streamed responses. These may be interleaved with inputs.
1437
- # # Each response is of type ::Google::Cloud::Firestore::V1::WriteResponse.
1438
- # output.each do |response|
1439
- # p response
1454
+ # # The returned object is a streamed enumerable yielding elements of type
1455
+ # # ::Google::Cloud::Firestore::V1::WriteResponse
1456
+ # output.each do |current_response|
1457
+ # p current_response
1440
1458
  # end
1441
1459
  #
1442
1460
  def write request, options = nil
@@ -1478,7 +1496,8 @@ module Google
1478
1496
  end
1479
1497
 
1480
1498
  ##
1481
- # Listens to changes.
1499
+ # Listens to changes. This method is only available via the gRPC API (not
1500
+ # REST).
1482
1501
  #
1483
1502
  # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Firestore::V1::ListenRequest, ::Hash>]
1484
1503
  # An enumerable of {::Google::Cloud::Firestore::V1::ListenRequest} instances.
@@ -1499,22 +1518,22 @@ module Google
1499
1518
  # # Create a client object. The client can be reused for multiple calls.
1500
1519
  # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1501
1520
  #
1502
- # # Create an input stream
1521
+ # # Create an input stream.
1503
1522
  # input = Gapic::StreamInput.new
1504
1523
  #
1505
1524
  # # Call the listen method to start streaming.
1506
1525
  # output = client.listen input
1507
1526
  #
1508
- # # Send requests on the stream. For each request, pass in keyword
1509
- # # arguments to set fields. Be sure to close the stream when done.
1527
+ # # Send requests on the stream. For each request object, set fields by
1528
+ # # passing keyword arguments. Be sure to close the stream when done.
1510
1529
  # input << Google::Cloud::Firestore::V1::ListenRequest.new
1511
1530
  # input << Google::Cloud::Firestore::V1::ListenRequest.new
1512
1531
  # input.close
1513
1532
  #
1514
- # # Handle streamed responses. These may be interleaved with inputs.
1515
- # # Each response is of type ::Google::Cloud::Firestore::V1::ListenResponse.
1516
- # output.each do |response|
1517
- # p response
1533
+ # # The returned object is a streamed enumerable yielding elements of type
1534
+ # # ::Google::Cloud::Firestore::V1::ListenResponse
1535
+ # output.each do |current_response|
1536
+ # p current_response
1518
1537
  # end
1519
1538
  #
1520
1539
  def listen request, options = nil
@@ -1657,7 +1676,8 @@ module Google
1657
1676
  # The BatchWrite method does not apply the write operations atomically
1658
1677
  # and can apply them out of order. Method does not allow more than one write
1659
1678
  # per document. Each write succeeds or fails independently. See the
1660
- # {::Google::Cloud::Firestore::V1::BatchWriteResponse BatchWriteResponse} for the success status of each write.
1679
+ # {::Google::Cloud::Firestore::V1::BatchWriteResponse BatchWriteResponse} for the
1680
+ # success status of each write.
1661
1681
  #
1662
1682
  # If you require an atomically applied set of writes, use
1663
1683
  # {::Google::Cloud::Firestore::V1::Firestore::Client#commit Commit} instead.
@@ -1776,7 +1796,8 @@ module Google
1776
1796
  # `projects/{project_id}/databases/{database_id}/documents` or
1777
1797
  # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
1778
1798
  # @param collection_id [::String]
1779
- # Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.
1799
+ # Required. The collection ID, relative to `parent`, to list. For example:
1800
+ # `chatrooms`.
1780
1801
  # @param document_id [::String]
1781
1802
  # The client-assigned document ID to use for this document.
1782
1803
  #