google-cloud-firestore-v1 0.8.0 → 0.9.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: 2fcbf0267a51ef3d6aa2bd915dc9395feb479bf10be6d246173ee43bb34d5bfe
4
+ data.tar.gz: e4c4e23ff5f4e666a3e0d06c8caa05fec89889b42eae60378ff774f89726ab10
5
5
  SHA512:
6
- metadata.gz: 237cc0f52525a3c60eb4e0783d27c461cc2b21d02359d6e19eccdec1ce70d0dd4aa940fdcc1ae26f71191171c8e7b6a75761bf5402f44bf0aafc6f06df18965b
7
- data.tar.gz: 6d75b35dc3929b94ea27cbb684f630c7b7b6ff9a569a349688bf25505f4a9d8e54a1ff8836a25d62bb25f3b10c376cd0aede9bb657a854942c9155b0061a59d0
6
+ metadata.gz: b9a71c321fa41feb3f871f84843f1bdd4eea7a3a1021351a1610982f8ceac8953ef9cd4b70f4ff9413d7f8c1131cb3456e06e4316b45ee0e2bc4014f6c2b9ce4
7
+ data.tar.gz: 6c12cdf0bfda03c2bfa980a0a74d41753b427d5dbd8e5357ea7f2c3d6a4edc1c068163b084c50997a13a2ba13dce82d497e6fc7958e90be3099a1bec440d3e35
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
  #
@@ -36,10 +36,10 @@ module Google
36
36
  # document database that simplifies storing, syncing, and querying data for
37
37
  # your mobile, web, and IoT apps at global scale. Its client libraries provide
38
38
  # live synchronization and offline support, while its security features and
39
- # integrations with Firebase and Google Cloud Platform (GCP) accelerate
40
- # building truly serverless apps.
39
+ # integrations with Firebase and Google Cloud Platform accelerate building
40
+ # truly serverless apps.
41
41
  #
42
- # To load this service and instantiate a client:
42
+ # @example Load this service and instantiate a gRPC client
43
43
  #
44
44
  # require "google/cloud/firestore/v1/firestore"
45
45
  # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Firestore
23
23
  module V1
24
- VERSION = "0.8.0"
24
+ VERSION = "0.9.0"
25
25
  end
26
26
  end
27
27
  end
@@ -23,9 +23,9 @@ module Google
23
23
  module Cloud
24
24
  module Firestore
25
25
  ##
26
- # To load this package, including all its services, and instantiate a client:
26
+ # API client module.
27
27
  #
28
- # @example
28
+ # @example Load this package, including all its services, and instantiate a gRPC client
29
29
  #
30
30
  # require "google/cloud/firestore/v1"
31
31
  # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
@@ -32,8 +32,8 @@ module Google
32
32
  # document database that simplifies storing, syncing, and querying data for
33
33
  # your mobile, web, and IoT apps at global scale. Its client libraries provide
34
34
  # live synchronization and offline support, while its security features and
35
- # integrations with Firebase and Google Cloud Platform (GCP) accelerate
36
- # building truly serverless apps.
35
+ # integrations with Firebase and Google Cloud Platform accelerate building
36
+ # truly serverless apps.
37
37
  class Service
38
38
 
39
39
  include ::GRPC::GenericService
@@ -65,8 +65,9 @@ module Google
65
65
  rpc :RunQuery, ::Google::Cloud::Firestore::V1::RunQueryRequest, stream(::Google::Cloud::Firestore::V1::RunQueryResponse)
66
66
  # Runs an aggregation query.
67
67
  #
68
- # Rather than producing [Document][google.firestore.v1.Document] results like [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery],
69
- # this API allows running an aggregation to produce a series of
68
+ # Rather than producing [Document][google.firestore.v1.Document] results like
69
+ # [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API
70
+ # allows running an aggregation to produce a series of
70
71
  # [AggregationResult][google.firestore.v1.AggregationResult] server-side.
71
72
  #
72
73
  # High-Level Example:
@@ -80,9 +81,11 @@ module Google
80
81
  # the query in parallel. The returned partition cursors are split points that
81
82
  # can be used by RunQuery as starting/end points for the query results.
82
83
  rpc :PartitionQuery, ::Google::Cloud::Firestore::V1::PartitionQueryRequest, ::Google::Cloud::Firestore::V1::PartitionQueryResponse
83
- # Streams batches of document updates and deletes, in order.
84
+ # Streams batches of document updates and deletes, in order. This method is
85
+ # only available via the gRPC API (not REST).
84
86
  rpc :Write, stream(::Google::Cloud::Firestore::V1::WriteRequest), stream(::Google::Cloud::Firestore::V1::WriteResponse)
85
- # Listens to changes.
87
+ # Listens to changes. This method is only available via the gRPC API (not
88
+ # REST).
86
89
  rpc :Listen, stream(::Google::Cloud::Firestore::V1::ListenRequest), stream(::Google::Cloud::Firestore::V1::ListenResponse)
87
90
  # Lists all the collection IDs underneath a document.
88
91
  rpc :ListCollectionIds, ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse
@@ -91,7 +94,8 @@ module Google
91
94
  # The BatchWrite method does not apply the write operations atomically
92
95
  # and can apply them out of order. Method does not allow more than one write
93
96
  # per document. Each write succeeds or fails independently. See the
94
- # [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the success status of each write.
97
+ # [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the
98
+ # success status of each write.
95
99
  #
96
100
  # If you require an atomically applied set of writes, use
97
101
  # [Commit][google.firestore.v1.Firestore.Commit] instead.
@@ -37,6 +37,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
37
37
  add_enum "google.firestore.v1.StructuredQuery.CompositeFilter.Operator" do
38
38
  value :OPERATOR_UNSPECIFIED, 0
39
39
  value :AND, 1
40
+ value :OR, 2
40
41
  end
41
42
  add_message "google.firestore.v1.StructuredQuery.FieldFilter" do
42
43
  optional :field, :message, 1, "google.firestore.v1.StructuredQuery.FieldReference"