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 +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/firestore/v1/firestore/client.rb +87 -66
- data/lib/google/cloud/firestore/v1/firestore/rest/client.rb +1600 -0
- data/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb +912 -0
- data/lib/google/cloud/firestore/v1/firestore/rest.rb +58 -0
- data/lib/google/cloud/firestore/v1/firestore.rb +9 -3
- data/lib/google/cloud/firestore/v1/rest.rb +37 -0
- data/lib/google/cloud/firestore/v1/version.rb +1 -1
- data/lib/google/cloud/firestore/v1.rb +7 -2
- data/lib/google/firestore/v1/firestore_services_pb.rb +11 -7
- data/lib/google/firestore/v1/query_pb.rb +1 -0
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/firestore/v1/aggregation_result.rb +2 -1
- data/proto_docs/google/firestore/v1/common.rb +5 -3
- data/proto_docs/google/firestore/v1/firestore.rb +89 -44
- data/proto_docs/google/firestore/v1/query.rb +15 -6
- data/proto_docs/google/firestore/v1/write.rb +27 -18
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +16 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb73865cabf048a91f48e3fbd2e03d26d3bfda63ca86d5615ec09f66b197715b
|
4
|
+
data.tar.gz: 3dc2ee99432f186a1ae3aaa8a2a8864c43798686e859f2fdf9681e1eca655a4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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
|
38
|
-
#
|
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
|
-
#
|
366
|
-
#
|
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
|
-
#
|
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
|
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
|
-
#
|
396
|
+
# Perform the read as part of an already active transaction.
|
380
397
|
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
381
|
-
#
|
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.
|
385
|
-
#
|
386
|
-
#
|
387
|
-
#
|
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
|
-
# #
|
414
|
-
#
|
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
|
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
|
-
#
|
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
|
-
# #
|
724
|
-
#
|
725
|
-
# p
|
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
|
-
#
|
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
|
-
# #
|
1100
|
-
#
|
1101
|
-
# p
|
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
|
1149
|
-
# this API
|
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
|
-
#
|
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
|
-
# #
|
1221
|
-
#
|
1222
|
-
# p
|
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
|
-
# #
|
1353
|
-
#
|
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
|
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,
|
1431
|
-
# #
|
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
|
-
# #
|
1437
|
-
# #
|
1438
|
-
# output.each do |
|
1439
|
-
# p
|
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,
|
1509
|
-
# #
|
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
|
-
# #
|
1515
|
-
# #
|
1516
|
-
# output.each do |
|
1517
|
-
# p
|
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
|
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:
|
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
|
#
|