google-cloud-pubsub-v1 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -357,6 +357,21 @@ module Google
357
357
  #
358
358
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
359
359
  #
360
+ # @example Basic example
361
+ # require "google/cloud/pubsub/v1"
362
+ #
363
+ # # Create a client object. The client can be reused for multiple calls.
364
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
365
+ #
366
+ # # Create a request. To set request fields, pass in keyword arguments.
367
+ # request = Google::Cloud::PubSub::V1::Subscription.new
368
+ #
369
+ # # Call the create_subscription method.
370
+ # result = client.create_subscription request
371
+ #
372
+ # # The returned object is of type Google::Cloud::PubSub::V1::Subscription.
373
+ # p result
374
+ #
360
375
  def create_subscription request, options = nil
361
376
  raise ::ArgumentError, "request must be provided" if request.nil?
362
377
 
@@ -374,9 +389,11 @@ module Google
374
389
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
375
390
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
376
391
 
377
- header_params = {
378
- "name" => request.name
379
- }
392
+ header_params = {}
393
+ if request.name
394
+ header_params["name"] = request.name
395
+ end
396
+
380
397
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
381
398
  metadata[:"x-goog-request-params"] ||= request_params_header
382
399
 
@@ -426,6 +443,21 @@ module Google
426
443
  #
427
444
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
445
  #
446
+ # @example Basic example
447
+ # require "google/cloud/pubsub/v1"
448
+ #
449
+ # # Create a client object. The client can be reused for multiple calls.
450
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
451
+ #
452
+ # # Create a request. To set request fields, pass in keyword arguments.
453
+ # request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new
454
+ #
455
+ # # Call the get_subscription method.
456
+ # result = client.get_subscription request
457
+ #
458
+ # # The returned object is of type Google::Cloud::PubSub::V1::Subscription.
459
+ # p result
460
+ #
429
461
  def get_subscription request, options = nil
430
462
  raise ::ArgumentError, "request must be provided" if request.nil?
431
463
 
@@ -443,9 +475,11 @@ module Google
443
475
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
444
476
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
477
 
446
- header_params = {
447
- "subscription" => request.subscription
448
- }
478
+ header_params = {}
479
+ if request.subscription
480
+ header_params["subscription"] = request.subscription
481
+ end
482
+
449
483
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
450
484
  metadata[:"x-goog-request-params"] ||= request_params_header
451
485
 
@@ -498,6 +532,21 @@ module Google
498
532
  #
499
533
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
500
534
  #
535
+ # @example Basic example
536
+ # require "google/cloud/pubsub/v1"
537
+ #
538
+ # # Create a client object. The client can be reused for multiple calls.
539
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
540
+ #
541
+ # # Create a request. To set request fields, pass in keyword arguments.
542
+ # request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new
543
+ #
544
+ # # Call the update_subscription method.
545
+ # result = client.update_subscription request
546
+ #
547
+ # # The returned object is of type Google::Cloud::PubSub::V1::Subscription.
548
+ # p result
549
+ #
501
550
  def update_subscription request, options = nil
502
551
  raise ::ArgumentError, "request must be provided" if request.nil?
503
552
 
@@ -515,9 +564,11 @@ module Google
515
564
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
516
565
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
517
566
 
518
- header_params = {
519
- "subscription.name" => request.subscription.name
520
- }
567
+ header_params = {}
568
+ if request.subscription&.name
569
+ header_params["subscription.name"] = request.subscription.name
570
+ end
571
+
521
572
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
522
573
  metadata[:"x-goog-request-params"] ||= request_params_header
523
574
 
@@ -573,6 +624,27 @@ module Google
573
624
  #
574
625
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
575
626
  #
627
+ # @example Basic example
628
+ # require "google/cloud/pubsub/v1"
629
+ #
630
+ # # Create a client object. The client can be reused for multiple calls.
631
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
632
+ #
633
+ # # Create a request. To set request fields, pass in keyword arguments.
634
+ # request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new
635
+ #
636
+ # # Call the list_subscriptions method.
637
+ # result = client.list_subscriptions request
638
+ #
639
+ # # The returned object is of type Gapic::PagedEnumerable. You can
640
+ # # iterate over all elements by calling #each, and the enumerable
641
+ # # will lazily make API calls to fetch subsequent pages. Other
642
+ # # methods are also available for managing paging directly.
643
+ # result.each do |response|
644
+ # # Each element is of type ::Google::Cloud::PubSub::V1::Subscription.
645
+ # p response
646
+ # end
647
+ #
576
648
  def list_subscriptions request, options = nil
577
649
  raise ::ArgumentError, "request must be provided" if request.nil?
578
650
 
@@ -590,9 +662,11 @@ module Google
590
662
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
591
663
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
592
664
 
593
- header_params = {
594
- "project" => request.project
595
- }
665
+ header_params = {}
666
+ if request.project
667
+ header_params["project"] = request.project
668
+ end
669
+
596
670
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
597
671
  metadata[:"x-goog-request-params"] ||= request_params_header
598
672
 
@@ -647,6 +721,21 @@ module Google
647
721
  #
648
722
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
649
723
  #
724
+ # @example Basic example
725
+ # require "google/cloud/pubsub/v1"
726
+ #
727
+ # # Create a client object. The client can be reused for multiple calls.
728
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
729
+ #
730
+ # # Create a request. To set request fields, pass in keyword arguments.
731
+ # request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new
732
+ #
733
+ # # Call the delete_subscription method.
734
+ # result = client.delete_subscription request
735
+ #
736
+ # # The returned object is of type Google::Protobuf::Empty.
737
+ # p result
738
+ #
650
739
  def delete_subscription request, options = nil
651
740
  raise ::ArgumentError, "request must be provided" if request.nil?
652
741
 
@@ -664,9 +753,11 @@ module Google
664
753
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
665
754
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
666
755
 
667
- header_params = {
668
- "subscription" => request.subscription
669
- }
756
+ header_params = {}
757
+ if request.subscription
758
+ header_params["subscription"] = request.subscription
759
+ end
760
+
670
761
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
671
762
  metadata[:"x-goog-request-params"] ||= request_params_header
672
763
 
@@ -731,6 +822,21 @@ module Google
731
822
  #
732
823
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
733
824
  #
825
+ # @example Basic example
826
+ # require "google/cloud/pubsub/v1"
827
+ #
828
+ # # Create a client object. The client can be reused for multiple calls.
829
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
830
+ #
831
+ # # Create a request. To set request fields, pass in keyword arguments.
832
+ # request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new
833
+ #
834
+ # # Call the modify_ack_deadline method.
835
+ # result = client.modify_ack_deadline request
836
+ #
837
+ # # The returned object is of type Google::Protobuf::Empty.
838
+ # p result
839
+ #
734
840
  def modify_ack_deadline request, options = nil
735
841
  raise ::ArgumentError, "request must be provided" if request.nil?
736
842
 
@@ -748,9 +854,11 @@ module Google
748
854
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
749
855
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
750
856
 
751
- header_params = {
752
- "subscription" => request.subscription
753
- }
857
+ header_params = {}
858
+ if request.subscription
859
+ header_params["subscription"] = request.subscription
860
+ end
861
+
754
862
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
755
863
  metadata[:"x-goog-request-params"] ||= request_params_header
756
864
 
@@ -810,6 +918,21 @@ module Google
810
918
  #
811
919
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
812
920
  #
921
+ # @example Basic example
922
+ # require "google/cloud/pubsub/v1"
923
+ #
924
+ # # Create a client object. The client can be reused for multiple calls.
925
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
926
+ #
927
+ # # Create a request. To set request fields, pass in keyword arguments.
928
+ # request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new
929
+ #
930
+ # # Call the acknowledge method.
931
+ # result = client.acknowledge request
932
+ #
933
+ # # The returned object is of type Google::Protobuf::Empty.
934
+ # p result
935
+ #
813
936
  def acknowledge request, options = nil
814
937
  raise ::ArgumentError, "request must be provided" if request.nil?
815
938
 
@@ -827,9 +950,11 @@ module Google
827
950
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
828
951
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
829
952
 
830
- header_params = {
831
- "subscription" => request.subscription
832
- }
953
+ header_params = {}
954
+ if request.subscription
955
+ header_params["subscription"] = request.subscription
956
+ end
957
+
833
958
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
834
959
  metadata[:"x-goog-request-params"] ||= request_params_header
835
960
 
@@ -893,6 +1018,21 @@ module Google
893
1018
  #
894
1019
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
895
1020
  #
1021
+ # @example Basic example
1022
+ # require "google/cloud/pubsub/v1"
1023
+ #
1024
+ # # Create a client object. The client can be reused for multiple calls.
1025
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1026
+ #
1027
+ # # Create a request. To set request fields, pass in keyword arguments.
1028
+ # request = Google::Cloud::PubSub::V1::PullRequest.new
1029
+ #
1030
+ # # Call the pull method.
1031
+ # result = client.pull request
1032
+ #
1033
+ # # The returned object is of type Google::Cloud::PubSub::V1::PullResponse.
1034
+ # p result
1035
+ #
896
1036
  def pull request, options = nil
897
1037
  raise ::ArgumentError, "request must be provided" if request.nil?
898
1038
 
@@ -910,9 +1050,11 @@ module Google
910
1050
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
911
1051
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
912
1052
 
913
- header_params = {
914
- "subscription" => request.subscription
915
- }
1053
+ header_params = {}
1054
+ if request.subscription
1055
+ header_params["subscription"] = request.subscription
1056
+ end
1057
+
916
1058
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
917
1059
  metadata[:"x-goog-request-params"] ||= request_params_header
918
1060
 
@@ -954,6 +1096,30 @@ module Google
954
1096
  #
955
1097
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
956
1098
  #
1099
+ # @example Basic example
1100
+ # require "google/cloud/pubsub/v1"
1101
+ #
1102
+ # # Create a client object. The client can be reused for multiple calls.
1103
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1104
+ #
1105
+ # # Create an input stream
1106
+ # input = Gapic::StreamInput.new
1107
+ #
1108
+ # # Call the streaming_pull method to start streaming.
1109
+ # output = client.streaming_pull input
1110
+ #
1111
+ # # Send requests on the stream. For each request, pass in keyword
1112
+ # # arguments to set fields. Be sure to close the stream when done.
1113
+ # input << Google::Cloud::PubSub::V1::StreamingPullRequest.new
1114
+ # input << Google::Cloud::PubSub::V1::StreamingPullRequest.new
1115
+ # input.close
1116
+ #
1117
+ # # Handle streamed responses. These may be interleaved with inputs.
1118
+ # # Each response is of type ::Google::Cloud::PubSub::V1::StreamingPullResponse.
1119
+ # output.each do |response|
1120
+ # p response
1121
+ # end
1122
+ #
957
1123
  def streaming_pull request, options = nil
958
1124
  unless request.is_a? ::Enumerable
959
1125
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1034,6 +1200,21 @@ module Google
1034
1200
  #
1035
1201
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1036
1202
  #
1203
+ # @example Basic example
1204
+ # require "google/cloud/pubsub/v1"
1205
+ #
1206
+ # # Create a client object. The client can be reused for multiple calls.
1207
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1208
+ #
1209
+ # # Create a request. To set request fields, pass in keyword arguments.
1210
+ # request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new
1211
+ #
1212
+ # # Call the modify_push_config method.
1213
+ # result = client.modify_push_config request
1214
+ #
1215
+ # # The returned object is of type Google::Protobuf::Empty.
1216
+ # p result
1217
+ #
1037
1218
  def modify_push_config request, options = nil
1038
1219
  raise ::ArgumentError, "request must be provided" if request.nil?
1039
1220
 
@@ -1051,9 +1232,11 @@ module Google
1051
1232
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1052
1233
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1053
1234
 
1054
- header_params = {
1055
- "subscription" => request.subscription
1056
- }
1235
+ header_params = {}
1236
+ if request.subscription
1237
+ header_params["subscription"] = request.subscription
1238
+ end
1239
+
1057
1240
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1058
1241
  metadata[:"x-goog-request-params"] ||= request_params_header
1059
1242
 
@@ -1107,6 +1290,21 @@ module Google
1107
1290
  #
1108
1291
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1109
1292
  #
1293
+ # @example Basic example
1294
+ # require "google/cloud/pubsub/v1"
1295
+ #
1296
+ # # Create a client object. The client can be reused for multiple calls.
1297
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1298
+ #
1299
+ # # Create a request. To set request fields, pass in keyword arguments.
1300
+ # request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new
1301
+ #
1302
+ # # Call the get_snapshot method.
1303
+ # result = client.get_snapshot request
1304
+ #
1305
+ # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
1306
+ # p result
1307
+ #
1110
1308
  def get_snapshot request, options = nil
1111
1309
  raise ::ArgumentError, "request must be provided" if request.nil?
1112
1310
 
@@ -1124,9 +1322,11 @@ module Google
1124
1322
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1125
1323
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1126
1324
 
1127
- header_params = {
1128
- "snapshot" => request.snapshot
1129
- }
1325
+ header_params = {}
1326
+ if request.snapshot
1327
+ header_params["snapshot"] = request.snapshot
1328
+ end
1329
+
1130
1330
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1131
1331
  metadata[:"x-goog-request-params"] ||= request_params_header
1132
1332
 
@@ -1186,6 +1386,27 @@ module Google
1186
1386
  #
1187
1387
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1188
1388
  #
1389
+ # @example Basic example
1390
+ # require "google/cloud/pubsub/v1"
1391
+ #
1392
+ # # Create a client object. The client can be reused for multiple calls.
1393
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1394
+ #
1395
+ # # Create a request. To set request fields, pass in keyword arguments.
1396
+ # request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new
1397
+ #
1398
+ # # Call the list_snapshots method.
1399
+ # result = client.list_snapshots request
1400
+ #
1401
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1402
+ # # iterate over all elements by calling #each, and the enumerable
1403
+ # # will lazily make API calls to fetch subsequent pages. Other
1404
+ # # methods are also available for managing paging directly.
1405
+ # result.each do |response|
1406
+ # # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot.
1407
+ # p response
1408
+ # end
1409
+ #
1189
1410
  def list_snapshots request, options = nil
1190
1411
  raise ::ArgumentError, "request must be provided" if request.nil?
1191
1412
 
@@ -1203,9 +1424,11 @@ module Google
1203
1424
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1204
1425
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1205
1426
 
1206
- header_params = {
1207
- "project" => request.project
1208
- }
1427
+ header_params = {}
1428
+ if request.project
1429
+ header_params["project"] = request.project
1430
+ end
1431
+
1209
1432
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1210
1433
  metadata[:"x-goog-request-params"] ||= request_params_header
1211
1434
 
@@ -1288,6 +1511,21 @@ module Google
1288
1511
  #
1289
1512
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1290
1513
  #
1514
+ # @example Basic example
1515
+ # require "google/cloud/pubsub/v1"
1516
+ #
1517
+ # # Create a client object. The client can be reused for multiple calls.
1518
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1519
+ #
1520
+ # # Create a request. To set request fields, pass in keyword arguments.
1521
+ # request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new
1522
+ #
1523
+ # # Call the create_snapshot method.
1524
+ # result = client.create_snapshot request
1525
+ #
1526
+ # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
1527
+ # p result
1528
+ #
1291
1529
  def create_snapshot request, options = nil
1292
1530
  raise ::ArgumentError, "request must be provided" if request.nil?
1293
1531
 
@@ -1305,9 +1543,11 @@ module Google
1305
1543
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1306
1544
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1307
1545
 
1308
- header_params = {
1309
- "name" => request.name
1310
- }
1546
+ header_params = {}
1547
+ if request.name
1548
+ header_params["name"] = request.name
1549
+ end
1550
+
1311
1551
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1312
1552
  metadata[:"x-goog-request-params"] ||= request_params_header
1313
1553
 
@@ -1364,6 +1604,21 @@ module Google
1364
1604
  #
1365
1605
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1366
1606
  #
1607
+ # @example Basic example
1608
+ # require "google/cloud/pubsub/v1"
1609
+ #
1610
+ # # Create a client object. The client can be reused for multiple calls.
1611
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1612
+ #
1613
+ # # Create a request. To set request fields, pass in keyword arguments.
1614
+ # request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new
1615
+ #
1616
+ # # Call the update_snapshot method.
1617
+ # result = client.update_snapshot request
1618
+ #
1619
+ # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
1620
+ # p result
1621
+ #
1367
1622
  def update_snapshot request, options = nil
1368
1623
  raise ::ArgumentError, "request must be provided" if request.nil?
1369
1624
 
@@ -1381,9 +1636,11 @@ module Google
1381
1636
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1382
1637
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1383
1638
 
1384
- header_params = {
1385
- "snapshot.name" => request.snapshot.name
1386
- }
1639
+ header_params = {}
1640
+ if request.snapshot&.name
1641
+ header_params["snapshot.name"] = request.snapshot.name
1642
+ end
1643
+
1387
1644
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1388
1645
  metadata[:"x-goog-request-params"] ||= request_params_header
1389
1646
 
@@ -1441,6 +1698,21 @@ module Google
1441
1698
  #
1442
1699
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1443
1700
  #
1701
+ # @example Basic example
1702
+ # require "google/cloud/pubsub/v1"
1703
+ #
1704
+ # # Create a client object. The client can be reused for multiple calls.
1705
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1706
+ #
1707
+ # # Create a request. To set request fields, pass in keyword arguments.
1708
+ # request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new
1709
+ #
1710
+ # # Call the delete_snapshot method.
1711
+ # result = client.delete_snapshot request
1712
+ #
1713
+ # # The returned object is of type Google::Protobuf::Empty.
1714
+ # p result
1715
+ #
1444
1716
  def delete_snapshot request, options = nil
1445
1717
  raise ::ArgumentError, "request must be provided" if request.nil?
1446
1718
 
@@ -1458,9 +1730,11 @@ module Google
1458
1730
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1459
1731
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1460
1732
 
1461
- header_params = {
1462
- "snapshot" => request.snapshot
1463
- }
1733
+ header_params = {}
1734
+ if request.snapshot
1735
+ header_params["snapshot"] = request.snapshot
1736
+ end
1737
+
1464
1738
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1465
1739
  metadata[:"x-goog-request-params"] ||= request_params_header
1466
1740
 
@@ -1531,6 +1805,21 @@ module Google
1531
1805
  #
1532
1806
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1533
1807
  #
1808
+ # @example Basic example
1809
+ # require "google/cloud/pubsub/v1"
1810
+ #
1811
+ # # Create a client object. The client can be reused for multiple calls.
1812
+ # client = Google::Cloud::PubSub::V1::Subscriber::Client.new
1813
+ #
1814
+ # # Create a request. To set request fields, pass in keyword arguments.
1815
+ # request = Google::Cloud::PubSub::V1::SeekRequest.new
1816
+ #
1817
+ # # Call the seek method.
1818
+ # result = client.seek request
1819
+ #
1820
+ # # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse.
1821
+ # p result
1822
+ #
1534
1823
  def seek request, options = nil
1535
1824
  raise ::ArgumentError, "request must be provided" if request.nil?
1536
1825
 
@@ -1548,9 +1837,11 @@ module Google
1548
1837
  gapic_version: ::Google::Cloud::PubSub::V1::VERSION
1549
1838
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1550
1839
 
1551
- header_params = {
1552
- "subscription" => request.subscription
1553
- }
1840
+ header_params = {}
1841
+ if request.subscription
1842
+ header_params["subscription"] = request.subscription
1843
+ end
1844
+
1554
1845
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1555
1846
  metadata[:"x-goog-request-params"] ||= request_params_header
1556
1847
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module PubSub
23
23
  module V1
24
- VERSION = "0.6.0"
24
+ VERSION = "0.6.1"
25
25
  end
26
26
  end
27
27
  end
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/pubsub/v1/pubsub.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'
@@ -12,6 +10,8 @@ require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/field_mask_pb'
13
11
  require 'google/protobuf/timestamp_pb'
14
12
  require 'google/pubsub/v1/schema_pb'
13
+ require 'google/protobuf'
14
+
15
15
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
16
  add_file("google/pubsub/v1/pubsub.proto", :syntax => :proto3) do
17
17
  add_message "google.pubsub.v1.MessageStoragePolicy" do
@@ -28,7 +28,7 @@ module Google
28
28
  # messages to a topic.
29
29
  class Service
30
30
 
31
- include GRPC::GenericService
31
+ include ::GRPC::GenericService
32
32
 
33
33
  self.marshal_class_method = :encode
34
34
  self.unmarshal_class_method = :decode
@@ -76,7 +76,7 @@ module Google
76
76
  # establishing a bi-directional stream using the `StreamingPull` method.
77
77
  class Service
78
78
 
79
- include GRPC::GenericService
79
+ include ::GRPC::GenericService
80
80
 
81
81
  self.marshal_class_method = :encode
82
82
  self.unmarshal_class_method = :decode
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/pubsub/v1/schema.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'
9
7
  require 'google/api/resource_pb'
10
8
  require 'google/protobuf/empty_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/pubsub/v1/schema.proto", :syntax => :proto3) do
13
13
  add_message "google.pubsub.v1.Schema" do
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for doing schema-related operations.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-pubsub-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
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