google-cloud-firestore-v1 0.4.4 → 0.4.7

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: caff5a90ad86b9e2286c019fda5d74ad2be02ea0ee356159ace27292b581f5c1
4
- data.tar.gz: 376b85b0ea7e53d4849be76978d107310836edc59e792364a5c2302b37ad3b0c
3
+ metadata.gz: 293b70f0f7cc7c6e008c6994dde6ba5f8063d7a33e2a5b28c725c0c00025e507
4
+ data.tar.gz: 871fde3478084cdaa5997777e872d74ea666f383c0edb1c4355affba0510f480
5
5
  SHA512:
6
- metadata.gz: 4321c314895807c9faf1198cb2ae2cb46799afee72cdc5990266e9a9938d57e572be10fd2e533bdd2712a06293531352305784722699075e091480a6f728a3ea
7
- data.tar.gz: 99d05447c328b45e7e618849d8ec890817024aee4fd505211ca82a2c5c3c0ed1bf3f4a3d405439124cfb9ac4f289a89fdb9ade8bb99eff501cafe9c605bbbc4c
6
+ metadata.gz: 8c47a82db34970f65434c9ce02edfcccca5d95cc4df0d045fb9c6c86cb0eafa1e9554171d2f896905fa73cee22a8fc80446895e344e934bfb1109bac8d8d6384
7
+ data.tar.gz: 7f73d907f39f970adee76595098ec2dd90a4e3174a8d3ac18da487e9b9d1795a00fa0cd5766e2de052e2a4355c2ca0ec2ce35703db5d0322f0f09d785e7da575
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud Firestore V1 API
2
+ --title="Cloud Firestore V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Firestore::V1::GetDocumentRequest.new # (request fiel
37
37
  response = client.get_document request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-firestore-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/firestore)
@@ -261,6 +261,21 @@ module Google
261
261
  #
262
262
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
263
263
  #
264
+ # @example Basic example
265
+ # require "google/cloud/firestore/v1"
266
+ #
267
+ # # Create a client object. The client can be reused for multiple calls.
268
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
269
+ #
270
+ # # Create a request. To set request fields, pass in keyword arguments.
271
+ # request = Google::Cloud::Firestore::V1::GetDocumentRequest.new
272
+ #
273
+ # # Call the get_document method.
274
+ # result = client.get_document request
275
+ #
276
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
277
+ # p result
278
+ #
264
279
  def get_document request, options = nil
265
280
  raise ::ArgumentError, "request must be provided" if request.nil?
266
281
 
@@ -278,9 +293,11 @@ module Google
278
293
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
279
294
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
280
295
 
281
- header_params = {
282
- "name" => request.name
283
- }
296
+ header_params = {}
297
+ if request.name
298
+ header_params["name"] = request.name
299
+ end
300
+
284
301
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
285
302
  metadata[:"x-goog-request-params"] ||= request_params_header
286
303
 
@@ -361,6 +378,27 @@ module Google
361
378
  #
362
379
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
363
380
  #
381
+ # @example Basic example
382
+ # require "google/cloud/firestore/v1"
383
+ #
384
+ # # Create a client object. The client can be reused for multiple calls.
385
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
386
+ #
387
+ # # Create a request. To set request fields, pass in keyword arguments.
388
+ # request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new
389
+ #
390
+ # # Call the list_documents method.
391
+ # result = client.list_documents request
392
+ #
393
+ # # The returned object is of type Gapic::PagedEnumerable. You can
394
+ # # iterate over all elements by calling #each, and the enumerable
395
+ # # will lazily make API calls to fetch subsequent pages. Other
396
+ # # methods are also available for managing paging directly.
397
+ # result.each do |response|
398
+ # # Each element is of type ::Google::Cloud::Firestore::V1::Document.
399
+ # p response
400
+ # end
401
+ #
364
402
  def list_documents request, options = nil
365
403
  raise ::ArgumentError, "request must be provided" if request.nil?
366
404
 
@@ -378,10 +416,14 @@ module Google
378
416
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
379
417
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
380
418
 
381
- header_params = {
382
- "parent" => request.parent,
383
- "collection_id" => request.collection_id
384
- }
419
+ header_params = {}
420
+ if request.parent
421
+ header_params["parent"] = request.parent
422
+ end
423
+ if request.collection_id
424
+ header_params["collection_id"] = request.collection_id
425
+ end
426
+
385
427
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
386
428
  metadata[:"x-goog-request-params"] ||= request_params_header
387
429
 
@@ -448,6 +490,21 @@ module Google
448
490
  #
449
491
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
450
492
  #
493
+ # @example Basic example
494
+ # require "google/cloud/firestore/v1"
495
+ #
496
+ # # Create a client object. The client can be reused for multiple calls.
497
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
498
+ #
499
+ # # Create a request. To set request fields, pass in keyword arguments.
500
+ # request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new
501
+ #
502
+ # # Call the update_document method.
503
+ # result = client.update_document request
504
+ #
505
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
506
+ # p result
507
+ #
451
508
  def update_document request, options = nil
452
509
  raise ::ArgumentError, "request must be provided" if request.nil?
453
510
 
@@ -465,9 +522,11 @@ module Google
465
522
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
466
523
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
524
 
468
- header_params = {
469
- "document.name" => request.document.name
470
- }
525
+ header_params = {}
526
+ if request.document&.name
527
+ header_params["document.name"] = request.document.name
528
+ end
529
+
471
530
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
472
531
  metadata[:"x-goog-request-params"] ||= request_params_header
473
532
 
@@ -520,6 +579,21 @@ module Google
520
579
  #
521
580
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
522
581
  #
582
+ # @example Basic example
583
+ # require "google/cloud/firestore/v1"
584
+ #
585
+ # # Create a client object. The client can be reused for multiple calls.
586
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
587
+ #
588
+ # # Create a request. To set request fields, pass in keyword arguments.
589
+ # request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new
590
+ #
591
+ # # Call the delete_document method.
592
+ # result = client.delete_document request
593
+ #
594
+ # # The returned object is of type Google::Protobuf::Empty.
595
+ # p result
596
+ #
523
597
  def delete_document request, options = nil
524
598
  raise ::ArgumentError, "request must be provided" if request.nil?
525
599
 
@@ -537,9 +611,11 @@ module Google
537
611
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
538
612
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
539
613
 
540
- header_params = {
541
- "name" => request.name
542
- }
614
+ header_params = {}
615
+ if request.name
616
+ header_params["name"] = request.name
617
+ end
618
+
543
619
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
544
620
  metadata[:"x-goog-request-params"] ||= request_params_header
545
621
 
@@ -612,6 +688,24 @@ module Google
612
688
  #
613
689
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
614
690
  #
691
+ # @example Basic example
692
+ # require "google/cloud/firestore/v1"
693
+ #
694
+ # # Create a client object. The client can be reused for multiple calls.
695
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
696
+ #
697
+ # # Create a request. To set request fields, pass in keyword arguments.
698
+ # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new
699
+ #
700
+ # # Call the batch_get_documents method.
701
+ # result = client.batch_get_documents request
702
+ #
703
+ # # The returned object is a streamed enumerable yielding elements of
704
+ # # type ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.
705
+ # result.each do |response|
706
+ # p response
707
+ # end
708
+ #
615
709
  def batch_get_documents request, options = nil
616
710
  raise ::ArgumentError, "request must be provided" if request.nil?
617
711
 
@@ -629,9 +723,11 @@ module Google
629
723
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
630
724
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
631
725
 
632
- header_params = {
633
- "database" => request.database
634
- }
726
+ header_params = {}
727
+ if request.database
728
+ header_params["database"] = request.database
729
+ end
730
+
635
731
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
636
732
  metadata[:"x-goog-request-params"] ||= request_params_header
637
733
 
@@ -684,6 +780,21 @@ module Google
684
780
  #
685
781
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
686
782
  #
783
+ # @example Basic example
784
+ # require "google/cloud/firestore/v1"
785
+ #
786
+ # # Create a client object. The client can be reused for multiple calls.
787
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
788
+ #
789
+ # # Create a request. To set request fields, pass in keyword arguments.
790
+ # request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new
791
+ #
792
+ # # Call the begin_transaction method.
793
+ # result = client.begin_transaction request
794
+ #
795
+ # # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse.
796
+ # p result
797
+ #
687
798
  def begin_transaction request, options = nil
688
799
  raise ::ArgumentError, "request must be provided" if request.nil?
689
800
 
@@ -701,9 +812,11 @@ module Google
701
812
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
702
813
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
703
814
 
704
- header_params = {
705
- "database" => request.database
706
- }
815
+ header_params = {}
816
+ if request.database
817
+ header_params["database"] = request.database
818
+ end
819
+
707
820
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
708
821
  metadata[:"x-goog-request-params"] ||= request_params_header
709
822
 
@@ -759,6 +872,21 @@ module Google
759
872
  #
760
873
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
761
874
  #
875
+ # @example Basic example
876
+ # require "google/cloud/firestore/v1"
877
+ #
878
+ # # Create a client object. The client can be reused for multiple calls.
879
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
880
+ #
881
+ # # Create a request. To set request fields, pass in keyword arguments.
882
+ # request = Google::Cloud::Firestore::V1::CommitRequest.new
883
+ #
884
+ # # Call the commit method.
885
+ # result = client.commit request
886
+ #
887
+ # # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse.
888
+ # p result
889
+ #
762
890
  def commit request, options = nil
763
891
  raise ::ArgumentError, "request must be provided" if request.nil?
764
892
 
@@ -776,9 +904,11 @@ module Google
776
904
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
777
905
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
778
906
 
779
- header_params = {
780
- "database" => request.database
781
- }
907
+ header_params = {}
908
+ if request.database
909
+ header_params["database"] = request.database
910
+ end
911
+
782
912
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
783
913
  metadata[:"x-goog-request-params"] ||= request_params_header
784
914
 
@@ -830,6 +960,21 @@ module Google
830
960
  #
831
961
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
832
962
  #
963
+ # @example Basic example
964
+ # require "google/cloud/firestore/v1"
965
+ #
966
+ # # Create a client object. The client can be reused for multiple calls.
967
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
968
+ #
969
+ # # Create a request. To set request fields, pass in keyword arguments.
970
+ # request = Google::Cloud::Firestore::V1::RollbackRequest.new
971
+ #
972
+ # # Call the rollback method.
973
+ # result = client.rollback request
974
+ #
975
+ # # The returned object is of type Google::Protobuf::Empty.
976
+ # p result
977
+ #
833
978
  def rollback request, options = nil
834
979
  raise ::ArgumentError, "request must be provided" if request.nil?
835
980
 
@@ -847,9 +992,11 @@ module Google
847
992
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
848
993
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
849
994
 
850
- header_params = {
851
- "database" => request.database
852
- }
995
+ header_params = {}
996
+ if request.database
997
+ header_params["database"] = request.database
998
+ end
999
+
853
1000
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
854
1001
  metadata[:"x-goog-request-params"] ||= request_params_header
855
1002
 
@@ -897,7 +1044,9 @@ module Google
897
1044
  # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash]
898
1045
  # A structured query.
899
1046
  # @param transaction [::String]
900
- # Reads documents in a transaction.
1047
+ # Run the query within an already active transaction.
1048
+ #
1049
+ # The value here is the opaque transaction ID to execute the query in.
901
1050
  # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash]
902
1051
  # Starts a new transaction and reads the documents.
903
1052
  # Defaults to a read-only transaction.
@@ -915,6 +1064,24 @@ module Google
915
1064
  #
916
1065
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
917
1066
  #
1067
+ # @example Basic example
1068
+ # require "google/cloud/firestore/v1"
1069
+ #
1070
+ # # Create a client object. The client can be reused for multiple calls.
1071
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1072
+ #
1073
+ # # Create a request. To set request fields, pass in keyword arguments.
1074
+ # request = Google::Cloud::Firestore::V1::RunQueryRequest.new
1075
+ #
1076
+ # # Call the run_query method.
1077
+ # result = client.run_query request
1078
+ #
1079
+ # # The returned object is a streamed enumerable yielding elements of
1080
+ # # type ::Google::Cloud::Firestore::V1::RunQueryResponse.
1081
+ # result.each do |response|
1082
+ # p response
1083
+ # end
1084
+ #
918
1085
  def run_query request, options = nil
919
1086
  raise ::ArgumentError, "request must be provided" if request.nil?
920
1087
 
@@ -932,9 +1099,11 @@ module Google
932
1099
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
933
1100
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
934
1101
 
935
- header_params = {
936
- "parent" => request.parent
937
- }
1102
+ header_params = {}
1103
+ if request.parent
1104
+ header_params["parent"] = request.parent
1105
+ end
1106
+
938
1107
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
939
1108
  metadata[:"x-goog-request-params"] ||= request_params_header
940
1109
 
@@ -1024,6 +1193,27 @@ module Google
1024
1193
  #
1025
1194
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1026
1195
  #
1196
+ # @example Basic example
1197
+ # require "google/cloud/firestore/v1"
1198
+ #
1199
+ # # Create a client object. The client can be reused for multiple calls.
1200
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1201
+ #
1202
+ # # Create a request. To set request fields, pass in keyword arguments.
1203
+ # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new
1204
+ #
1205
+ # # Call the partition_query method.
1206
+ # result = client.partition_query request
1207
+ #
1208
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1209
+ # # iterate over all elements by calling #each, and the enumerable
1210
+ # # will lazily make API calls to fetch subsequent pages. Other
1211
+ # # methods are also available for managing paging directly.
1212
+ # result.each do |response|
1213
+ # # Each element is of type ::Google::Cloud::Firestore::V1::Cursor.
1214
+ # p response
1215
+ # end
1216
+ #
1027
1217
  def partition_query request, options = nil
1028
1218
  raise ::ArgumentError, "request must be provided" if request.nil?
1029
1219
 
@@ -1041,9 +1231,11 @@ module Google
1041
1231
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1042
1232
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1043
1233
 
1044
- header_params = {
1045
- "parent" => request.parent
1046
- }
1234
+ header_params = {}
1235
+ if request.parent
1236
+ header_params["parent"] = request.parent
1237
+ end
1238
+
1047
1239
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1048
1240
  metadata[:"x-goog-request-params"] ||= request_params_header
1049
1241
 
@@ -1080,6 +1272,30 @@ module Google
1080
1272
  #
1081
1273
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1082
1274
  #
1275
+ # @example Basic example
1276
+ # require "google/cloud/firestore/v1"
1277
+ #
1278
+ # # Create a client object. The client can be reused for multiple calls.
1279
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1280
+ #
1281
+ # # Create an input stream
1282
+ # input = Gapic::StreamInput.new
1283
+ #
1284
+ # # Call the write method to start streaming.
1285
+ # output = client.write input
1286
+ #
1287
+ # # Send requests on the stream. For each request, pass in keyword
1288
+ # # arguments to set fields. Be sure to close the stream when done.
1289
+ # input << Google::Cloud::Firestore::V1::WriteRequest.new
1290
+ # input << Google::Cloud::Firestore::V1::WriteRequest.new
1291
+ # input.close
1292
+ #
1293
+ # # Handle streamed responses. These may be interleaved with inputs.
1294
+ # # Each response is of type ::Google::Cloud::Firestore::V1::WriteResponse.
1295
+ # output.each do |response|
1296
+ # p response
1297
+ # end
1298
+ #
1083
1299
  def write request, options = nil
1084
1300
  unless request.is_a? ::Enumerable
1085
1301
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1134,6 +1350,30 @@ module Google
1134
1350
  #
1135
1351
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1136
1352
  #
1353
+ # @example Basic example
1354
+ # require "google/cloud/firestore/v1"
1355
+ #
1356
+ # # Create a client object. The client can be reused for multiple calls.
1357
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1358
+ #
1359
+ # # Create an input stream
1360
+ # input = Gapic::StreamInput.new
1361
+ #
1362
+ # # Call the listen method to start streaming.
1363
+ # output = client.listen input
1364
+ #
1365
+ # # Send requests on the stream. For each request, pass in keyword
1366
+ # # arguments to set fields. Be sure to close the stream when done.
1367
+ # input << Google::Cloud::Firestore::V1::ListenRequest.new
1368
+ # input << Google::Cloud::Firestore::V1::ListenRequest.new
1369
+ # input.close
1370
+ #
1371
+ # # Handle streamed responses. These may be interleaved with inputs.
1372
+ # # Each response is of type ::Google::Cloud::Firestore::V1::ListenResponse.
1373
+ # output.each do |response|
1374
+ # p response
1375
+ # end
1376
+ #
1137
1377
  def listen request, options = nil
1138
1378
  unless request.is_a? ::Enumerable
1139
1379
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1209,6 +1449,21 @@ module Google
1209
1449
  #
1210
1450
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1211
1451
  #
1452
+ # @example Basic example
1453
+ # require "google/cloud/firestore/v1"
1454
+ #
1455
+ # # Create a client object. The client can be reused for multiple calls.
1456
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1457
+ #
1458
+ # # Create a request. To set request fields, pass in keyword arguments.
1459
+ # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new
1460
+ #
1461
+ # # Call the list_collection_ids method.
1462
+ # result = client.list_collection_ids request
1463
+ #
1464
+ # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse.
1465
+ # p result
1466
+ #
1212
1467
  def list_collection_ids request, options = nil
1213
1468
  raise ::ArgumentError, "request must be provided" if request.nil?
1214
1469
 
@@ -1226,9 +1481,11 @@ module Google
1226
1481
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1227
1482
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1228
1483
 
1229
- header_params = {
1230
- "parent" => request.parent
1231
- }
1484
+ header_params = {}
1485
+ if request.parent
1486
+ header_params["parent"] = request.parent
1487
+ end
1488
+
1232
1489
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1233
1490
  metadata[:"x-goog-request-params"] ||= request_params_header
1234
1491
 
@@ -1294,6 +1551,21 @@ module Google
1294
1551
  #
1295
1552
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1296
1553
  #
1554
+ # @example Basic example
1555
+ # require "google/cloud/firestore/v1"
1556
+ #
1557
+ # # Create a client object. The client can be reused for multiple calls.
1558
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1559
+ #
1560
+ # # Create a request. To set request fields, pass in keyword arguments.
1561
+ # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new
1562
+ #
1563
+ # # Call the batch_write method.
1564
+ # result = client.batch_write request
1565
+ #
1566
+ # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse.
1567
+ # p result
1568
+ #
1297
1569
  def batch_write request, options = nil
1298
1570
  raise ::ArgumentError, "request must be provided" if request.nil?
1299
1571
 
@@ -1311,9 +1583,11 @@ module Google
1311
1583
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1312
1584
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1313
1585
 
1314
- header_params = {
1315
- "database" => request.database
1316
- }
1586
+ header_params = {}
1587
+ if request.database
1588
+ header_params["database"] = request.database
1589
+ end
1590
+
1317
1591
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1318
1592
  metadata[:"x-goog-request-params"] ||= request_params_header
1319
1593
 
@@ -1377,6 +1651,21 @@ module Google
1377
1651
  #
1378
1652
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1379
1653
  #
1654
+ # @example Basic example
1655
+ # require "google/cloud/firestore/v1"
1656
+ #
1657
+ # # Create a client object. The client can be reused for multiple calls.
1658
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1659
+ #
1660
+ # # Create a request. To set request fields, pass in keyword arguments.
1661
+ # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new
1662
+ #
1663
+ # # Call the create_document method.
1664
+ # result = client.create_document request
1665
+ #
1666
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
1667
+ # p result
1668
+ #
1380
1669
  def create_document request, options = nil
1381
1670
  raise ::ArgumentError, "request must be provided" if request.nil?
1382
1671
 
@@ -1394,10 +1683,14 @@ module Google
1394
1683
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1395
1684
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1396
1685
 
1397
- header_params = {
1398
- "parent" => request.parent,
1399
- "collection_id" => request.collection_id
1400
- }
1686
+ header_params = {}
1687
+ if request.parent
1688
+ header_params["parent"] = request.parent
1689
+ end
1690
+ if request.collection_id
1691
+ header_params["collection_id"] = request.collection_id
1692
+ end
1693
+
1401
1694
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1402
1695
  metadata[:"x-goog-request-params"] ||= request_params_header
1403
1696
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Firestore
23
23
  module V1
24
- VERSION = "0.4.4"
24
+ VERSION = "0.4.7"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/cloud/firestore/v1"
29
31
  # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
30
32
  #
@@ -1,10 +1,9 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/common.proto
3
3
 
4
+ require 'google/protobuf/timestamp_pb'
4
5
  require 'google/protobuf'
5
6
 
6
- require 'google/protobuf/timestamp_pb'
7
- require 'google/api/annotations_pb'
8
7
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
8
  add_file("google/firestore/v1/common.proto", :syntax => :proto3) do
10
9
  add_message "google.firestore.v1.DocumentMask" do
@@ -1,12 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/document.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/protobuf/struct_pb'
7
5
  require 'google/protobuf/timestamp_pb'
8
6
  require 'google/type/latlng_pb'
9
- require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
10
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
10
  add_file("google/firestore/v1/document.proto", :syntax => :proto3) do
12
11
  add_message "google.firestore.v1.Document" do
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/firestore.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -13,6 +11,8 @@ require 'google/firestore/v1/write_pb'
13
11
  require 'google/protobuf/empty_pb'
14
12
  require 'google/protobuf/timestamp_pb'
15
13
  require 'google/rpc/status_pb'
14
+ require 'google/protobuf'
15
+
16
16
  Google::Protobuf::DescriptorPool.generated_pool.build do
17
17
  add_file("google/firestore/v1/firestore.proto", :syntax => :proto3) do
18
18
  add_message "google.firestore.v1.GetDocumentRequest" do
@@ -36,7 +36,7 @@ module Google
36
36
  # building truly serverless apps.
37
37
  class Service
38
38
 
39
- include GRPC::GenericService
39
+ include ::GRPC::GenericService
40
40
 
41
41
  self.marshal_class_method = :encode
42
42
  self.unmarshal_class_method = :decode
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/query.proto
3
3
 
4
- require 'google/protobuf'
5
-
4
+ require 'google/api/field_behavior_pb'
6
5
  require 'google/firestore/v1/document_pb'
7
6
  require 'google/protobuf/wrappers_pb'
8
- require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/firestore/v1/query.proto", :syntax => :proto3) do
11
11
  add_message "google.firestore.v1.StructuredQuery" do
@@ -1,12 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/write.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/firestore/v1/common_pb'
7
5
  require 'google/firestore/v1/document_pb'
8
6
  require 'google/protobuf/timestamp_pb'
9
- require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
10
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
10
  add_file("google/firestore/v1/write.proto", :syntax => :proto3) do
12
11
  add_message "google.firestore.v1.Write" do
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
@@ -43,7 +43,7 @@ module Google
43
43
  # @!attribute [rw] update_time
44
44
  # @return [::Google::Protobuf::Timestamp]
45
45
  # When set, the target document must exist and have been last updated at
46
- # that time.
46
+ # that time. Timestamp must be microsecond aligned.
47
47
  class Precondition
48
48
  include ::Google::Protobuf::MessageExts
49
49
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -319,7 +319,9 @@ module Google
319
319
  # A structured query.
320
320
  # @!attribute [rw] transaction
321
321
  # @return [::String]
322
- # Reads documents in a transaction.
322
+ # Run the query within an already active transaction.
323
+ #
324
+ # The value here is the opaque transaction ID to execute the query in.
323
325
  # @!attribute [rw] new_transaction
324
326
  # @return [::Google::Cloud::Firestore::V1::TransactionOptions]
325
327
  # Starts a new transaction and reads the documents.
@@ -344,8 +346,7 @@ module Google
344
346
  # If set, no other fields will be set in this response.
345
347
  # @!attribute [rw] document
346
348
  # @return [::Google::Cloud::Firestore::V1::Document]
347
- # A query result.
348
- # Not set when reporting partial progress.
349
+ # A query result, not set when reporting partial progress.
349
350
  # @!attribute [rw] read_time
350
351
  # @return [::Google::Protobuf::Timestamp]
351
352
  # The time at which the document was read. This may be monotonically
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  - !ruby/object:Gem::Version
216
216
  version: '0'
217
217
  requirements: []
218
- rubygems_version: 3.2.17
218
+ rubygems_version: 3.3.5
219
219
  signing_key:
220
220
  specification_version: 4
221
221
  summary: API Client library for the Cloud Firestore V1 API