google-cloud-firestore-v1 0.4.4 → 0.4.5

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: ed18d4ae4fcf183d7ccfa9bc8943718b32c9a024e0cac4a596ad96183115582b
4
+ data.tar.gz: 94f8c799a2460e0b6a2ea8b8c419cec0dfb2359e2d62af94f9bb7cc48bce51db
5
5
  SHA512:
6
- metadata.gz: 4321c314895807c9faf1198cb2ae2cb46799afee72cdc5990266e9a9938d57e572be10fd2e533bdd2712a06293531352305784722699075e091480a6f728a3ea
7
- data.tar.gz: 99d05447c328b45e7e618849d8ec890817024aee4fd505211ca82a2c5c3c0ed1bf3f4a3d405439124cfb9ac4f289a89fdb9ade8bb99eff501cafe9c605bbbc4c
6
+ metadata.gz: 525f9bf96d470937c512228a38dc08e12565c3cad66697551417945a2b2feecea008519dc5ee528b9e5cca83492878e4741f24e583c13885098ba761b5e43c9b
7
+ data.tar.gz: ca5325bd0d0d92b81674bd4fc7b02cff4b636da9730e721e3601c2f3c935a5303f8d269867ab13b2d800323d8f77d76f89a8cb0873c58b1f82b835d800294c6d
@@ -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
 
@@ -915,6 +1062,24 @@ module Google
915
1062
  #
916
1063
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
917
1064
  #
1065
+ # @example Basic example
1066
+ # require "google/cloud/firestore/v1"
1067
+ #
1068
+ # # Create a client object. The client can be reused for multiple calls.
1069
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1070
+ #
1071
+ # # Create a request. To set request fields, pass in keyword arguments.
1072
+ # request = Google::Cloud::Firestore::V1::RunQueryRequest.new
1073
+ #
1074
+ # # Call the run_query method.
1075
+ # result = client.run_query request
1076
+ #
1077
+ # # The returned object is a streamed enumerable yielding elements of
1078
+ # # type ::Google::Cloud::Firestore::V1::RunQueryResponse.
1079
+ # result.each do |response|
1080
+ # p response
1081
+ # end
1082
+ #
918
1083
  def run_query request, options = nil
919
1084
  raise ::ArgumentError, "request must be provided" if request.nil?
920
1085
 
@@ -932,9 +1097,11 @@ module Google
932
1097
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
933
1098
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
934
1099
 
935
- header_params = {
936
- "parent" => request.parent
937
- }
1100
+ header_params = {}
1101
+ if request.parent
1102
+ header_params["parent"] = request.parent
1103
+ end
1104
+
938
1105
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
939
1106
  metadata[:"x-goog-request-params"] ||= request_params_header
940
1107
 
@@ -1024,6 +1191,27 @@ module Google
1024
1191
  #
1025
1192
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1026
1193
  #
1194
+ # @example Basic example
1195
+ # require "google/cloud/firestore/v1"
1196
+ #
1197
+ # # Create a client object. The client can be reused for multiple calls.
1198
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1199
+ #
1200
+ # # Create a request. To set request fields, pass in keyword arguments.
1201
+ # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new
1202
+ #
1203
+ # # Call the partition_query method.
1204
+ # result = client.partition_query request
1205
+ #
1206
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1207
+ # # iterate over all elements by calling #each, and the enumerable
1208
+ # # will lazily make API calls to fetch subsequent pages. Other
1209
+ # # methods are also available for managing paging directly.
1210
+ # result.each do |response|
1211
+ # # Each element is of type ::Google::Cloud::Firestore::V1::Cursor.
1212
+ # p response
1213
+ # end
1214
+ #
1027
1215
  def partition_query request, options = nil
1028
1216
  raise ::ArgumentError, "request must be provided" if request.nil?
1029
1217
 
@@ -1041,9 +1229,11 @@ module Google
1041
1229
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1042
1230
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1043
1231
 
1044
- header_params = {
1045
- "parent" => request.parent
1046
- }
1232
+ header_params = {}
1233
+ if request.parent
1234
+ header_params["parent"] = request.parent
1235
+ end
1236
+
1047
1237
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1048
1238
  metadata[:"x-goog-request-params"] ||= request_params_header
1049
1239
 
@@ -1080,6 +1270,30 @@ module Google
1080
1270
  #
1081
1271
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1082
1272
  #
1273
+ # @example Basic example
1274
+ # require "google/cloud/firestore/v1"
1275
+ #
1276
+ # # Create a client object. The client can be reused for multiple calls.
1277
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1278
+ #
1279
+ # # Create an input stream
1280
+ # input = Gapic::StreamInput.new
1281
+ #
1282
+ # # Call the write method to start streaming.
1283
+ # output = client.write input
1284
+ #
1285
+ # # Send requests on the stream. For each request, pass in keyword
1286
+ # # arguments to set fields. Be sure to close the stream when done.
1287
+ # input << Google::Cloud::Firestore::V1::WriteRequest.new
1288
+ # input << Google::Cloud::Firestore::V1::WriteRequest.new
1289
+ # input.close
1290
+ #
1291
+ # # Handle streamed responses. These may be interleaved with inputs.
1292
+ # # Each response is of type ::Google::Cloud::Firestore::V1::WriteResponse.
1293
+ # output.each do |response|
1294
+ # p response
1295
+ # end
1296
+ #
1083
1297
  def write request, options = nil
1084
1298
  unless request.is_a? ::Enumerable
1085
1299
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1134,6 +1348,30 @@ module Google
1134
1348
  #
1135
1349
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1136
1350
  #
1351
+ # @example Basic example
1352
+ # require "google/cloud/firestore/v1"
1353
+ #
1354
+ # # Create a client object. The client can be reused for multiple calls.
1355
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1356
+ #
1357
+ # # Create an input stream
1358
+ # input = Gapic::StreamInput.new
1359
+ #
1360
+ # # Call the listen method to start streaming.
1361
+ # output = client.listen input
1362
+ #
1363
+ # # Send requests on the stream. For each request, pass in keyword
1364
+ # # arguments to set fields. Be sure to close the stream when done.
1365
+ # input << Google::Cloud::Firestore::V1::ListenRequest.new
1366
+ # input << Google::Cloud::Firestore::V1::ListenRequest.new
1367
+ # input.close
1368
+ #
1369
+ # # Handle streamed responses. These may be interleaved with inputs.
1370
+ # # Each response is of type ::Google::Cloud::Firestore::V1::ListenResponse.
1371
+ # output.each do |response|
1372
+ # p response
1373
+ # end
1374
+ #
1137
1375
  def listen request, options = nil
1138
1376
  unless request.is_a? ::Enumerable
1139
1377
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1209,6 +1447,21 @@ module Google
1209
1447
  #
1210
1448
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1211
1449
  #
1450
+ # @example Basic example
1451
+ # require "google/cloud/firestore/v1"
1452
+ #
1453
+ # # Create a client object. The client can be reused for multiple calls.
1454
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1455
+ #
1456
+ # # Create a request. To set request fields, pass in keyword arguments.
1457
+ # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new
1458
+ #
1459
+ # # Call the list_collection_ids method.
1460
+ # result = client.list_collection_ids request
1461
+ #
1462
+ # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse.
1463
+ # p result
1464
+ #
1212
1465
  def list_collection_ids request, options = nil
1213
1466
  raise ::ArgumentError, "request must be provided" if request.nil?
1214
1467
 
@@ -1226,9 +1479,11 @@ module Google
1226
1479
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1227
1480
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1228
1481
 
1229
- header_params = {
1230
- "parent" => request.parent
1231
- }
1482
+ header_params = {}
1483
+ if request.parent
1484
+ header_params["parent"] = request.parent
1485
+ end
1486
+
1232
1487
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1233
1488
  metadata[:"x-goog-request-params"] ||= request_params_header
1234
1489
 
@@ -1294,6 +1549,21 @@ module Google
1294
1549
  #
1295
1550
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1296
1551
  #
1552
+ # @example Basic example
1553
+ # require "google/cloud/firestore/v1"
1554
+ #
1555
+ # # Create a client object. The client can be reused for multiple calls.
1556
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1557
+ #
1558
+ # # Create a request. To set request fields, pass in keyword arguments.
1559
+ # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new
1560
+ #
1561
+ # # Call the batch_write method.
1562
+ # result = client.batch_write request
1563
+ #
1564
+ # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse.
1565
+ # p result
1566
+ #
1297
1567
  def batch_write request, options = nil
1298
1568
  raise ::ArgumentError, "request must be provided" if request.nil?
1299
1569
 
@@ -1311,9 +1581,11 @@ module Google
1311
1581
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1312
1582
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1313
1583
 
1314
- header_params = {
1315
- "database" => request.database
1316
- }
1584
+ header_params = {}
1585
+ if request.database
1586
+ header_params["database"] = request.database
1587
+ end
1588
+
1317
1589
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1318
1590
  metadata[:"x-goog-request-params"] ||= request_params_header
1319
1591
 
@@ -1377,6 +1649,21 @@ module Google
1377
1649
  #
1378
1650
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1379
1651
  #
1652
+ # @example Basic example
1653
+ # require "google/cloud/firestore/v1"
1654
+ #
1655
+ # # Create a client object. The client can be reused for multiple calls.
1656
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1657
+ #
1658
+ # # Create a request. To set request fields, pass in keyword arguments.
1659
+ # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new
1660
+ #
1661
+ # # Call the create_document method.
1662
+ # result = client.create_document request
1663
+ #
1664
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
1665
+ # p result
1666
+ #
1380
1667
  def create_document request, options = nil
1381
1668
  raise ::ArgumentError, "request must be provided" if request.nil?
1382
1669
 
@@ -1394,10 +1681,14 @@ module Google
1394
1681
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1395
1682
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1396
1683
 
1397
- header_params = {
1398
- "parent" => request.parent,
1399
- "collection_id" => request.collection_id
1400
- }
1684
+ header_params = {}
1685
+ if request.parent
1686
+ header_params["parent"] = request.parent
1687
+ end
1688
+ if request.collection_id
1689
+ header_params["collection_id"] = request.collection_id
1690
+ end
1691
+
1401
1692
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1402
1693
  metadata[:"x-goog-request-params"] ||= request_params_header
1403
1694
 
@@ -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.5"
25
25
  end
26
26
  end
27
27
  end
@@ -1,10 +1,10 @@
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'
5
-
6
4
  require 'google/protobuf/timestamp_pb'
7
5
  require 'google/api/annotations_pb'
6
+ require 'google/protobuf'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/firestore/v1/common.proto", :syntax => :proto3) do
10
10
  add_message "google.firestore.v1.DocumentMask" do
@@ -1,12 +1,12 @@
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
7
  require 'google/api/annotations_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/firestore/v1/document.proto", :syntax => :proto3) do
12
12
  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
-
6
4
  require 'google/firestore/v1/document_pb'
7
5
  require 'google/protobuf/wrappers_pb'
8
6
  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,12 @@
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
7
  require 'google/api/annotations_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/firestore/v1/write.proto", :syntax => :proto3) do
12
12
  add_message "google.firestore.v1.Write" do
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.5
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: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common