google-cloud-pubsub-v1 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/README.md +1 -1
- data/lib/google/cloud/pubsub/v1/iam_policy/client.rb +60 -9
- data/lib/google/cloud/pubsub/v1/publisher/client.rb +186 -27
- data/lib/google/cloud/pubsub/v1/schema_service/client.rb +126 -18
- data/lib/google/cloud/pubsub/v1/subscriber/client.rb +349 -46
- data/lib/google/cloud/pubsub/v1/version.rb +1 -1
- data/lib/google/pubsub/v1/pubsub_pb.rb +17 -2
- data/lib/google/pubsub/v1/pubsub_services_pb.rb +2 -2
- data/lib/google/pubsub/v1/schema_pb.rb +2 -2
- data/lib/google/pubsub/v1/schema_services_pb.rb +1 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/pubsub/v1/pubsub.rb +55 -0
- metadata +3 -3
@@ -249,7 +249,7 @@ module Google
|
|
249
249
|
# @param options [::Gapic::CallOptions, ::Hash]
|
250
250
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
251
251
|
#
|
252
|
-
# @overload create_subscription(name: nil, topic: nil, push_config: nil, ack_deadline_seconds: nil, retain_acked_messages: nil, message_retention_duration: nil, labels: nil, enable_message_ordering: nil, expiration_policy: nil, filter: nil, dead_letter_policy: nil, retry_policy: nil, detached: nil)
|
252
|
+
# @overload create_subscription(name: nil, topic: nil, push_config: nil, ack_deadline_seconds: nil, retain_acked_messages: nil, message_retention_duration: nil, labels: nil, enable_message_ordering: nil, expiration_policy: nil, filter: nil, dead_letter_policy: nil, retry_policy: nil, detached: nil, enable_exactly_once_delivery: nil)
|
253
253
|
# Pass arguments to `create_subscription` via keyword arguments. Note that at
|
254
254
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
255
255
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -348,6 +348,18 @@ module Google
|
|
348
348
|
# backlog. `Pull` and `StreamingPull` requests will return
|
349
349
|
# FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
|
350
350
|
# the endpoint will not be made.
|
351
|
+
# @param enable_exactly_once_delivery [::Boolean]
|
352
|
+
# If true, Pub/Sub provides the following guarantees for the delivery of
|
353
|
+
# a message with a given value of `message_id` on this subscription:
|
354
|
+
#
|
355
|
+
# * The message sent to a subscriber is guaranteed not to be resent
|
356
|
+
# before the message's acknowledgement deadline expires.
|
357
|
+
# * An acknowledged message will not be resent to a subscriber.
|
358
|
+
#
|
359
|
+
# Note that subscribers may still receive multiple copies of a message
|
360
|
+
# when `enable_exactly_once_delivery` is true if the message was published
|
361
|
+
# multiple times by a publisher client. These copies are considered distinct
|
362
|
+
# by Pub/Sub and have distinct `message_id` values.
|
351
363
|
#
|
352
364
|
# @yield [response, operation] Access the result along with the RPC operation
|
353
365
|
# @yieldparam response [::Google::Cloud::PubSub::V1::Subscription]
|
@@ -357,6 +369,21 @@ module Google
|
|
357
369
|
#
|
358
370
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
359
371
|
#
|
372
|
+
# @example Basic example
|
373
|
+
# require "google/cloud/pubsub/v1"
|
374
|
+
#
|
375
|
+
# # Create a client object. The client can be reused for multiple calls.
|
376
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
377
|
+
#
|
378
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
379
|
+
# request = Google::Cloud::PubSub::V1::Subscription.new
|
380
|
+
#
|
381
|
+
# # Call the create_subscription method.
|
382
|
+
# result = client.create_subscription request
|
383
|
+
#
|
384
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::Subscription.
|
385
|
+
# p result
|
386
|
+
#
|
360
387
|
def create_subscription request, options = nil
|
361
388
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
362
389
|
|
@@ -374,9 +401,11 @@ module Google
|
|
374
401
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
375
402
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
376
403
|
|
377
|
-
header_params = {
|
378
|
-
|
379
|
-
|
404
|
+
header_params = {}
|
405
|
+
if request.name
|
406
|
+
header_params["name"] = request.name
|
407
|
+
end
|
408
|
+
|
380
409
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
381
410
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
382
411
|
|
@@ -426,6 +455,21 @@ module Google
|
|
426
455
|
#
|
427
456
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
428
457
|
#
|
458
|
+
# @example Basic example
|
459
|
+
# require "google/cloud/pubsub/v1"
|
460
|
+
#
|
461
|
+
# # Create a client object. The client can be reused for multiple calls.
|
462
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
463
|
+
#
|
464
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
465
|
+
# request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new
|
466
|
+
#
|
467
|
+
# # Call the get_subscription method.
|
468
|
+
# result = client.get_subscription request
|
469
|
+
#
|
470
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::Subscription.
|
471
|
+
# p result
|
472
|
+
#
|
429
473
|
def get_subscription request, options = nil
|
430
474
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
431
475
|
|
@@ -443,9 +487,11 @@ module Google
|
|
443
487
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
444
488
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
445
489
|
|
446
|
-
header_params = {
|
447
|
-
|
448
|
-
|
490
|
+
header_params = {}
|
491
|
+
if request.subscription
|
492
|
+
header_params["subscription"] = request.subscription
|
493
|
+
end
|
494
|
+
|
449
495
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
450
496
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
451
497
|
|
@@ -498,6 +544,21 @@ module Google
|
|
498
544
|
#
|
499
545
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
500
546
|
#
|
547
|
+
# @example Basic example
|
548
|
+
# require "google/cloud/pubsub/v1"
|
549
|
+
#
|
550
|
+
# # Create a client object. The client can be reused for multiple calls.
|
551
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
552
|
+
#
|
553
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
554
|
+
# request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new
|
555
|
+
#
|
556
|
+
# # Call the update_subscription method.
|
557
|
+
# result = client.update_subscription request
|
558
|
+
#
|
559
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::Subscription.
|
560
|
+
# p result
|
561
|
+
#
|
501
562
|
def update_subscription request, options = nil
|
502
563
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
503
564
|
|
@@ -515,9 +576,11 @@ module Google
|
|
515
576
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
516
577
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
517
578
|
|
518
|
-
header_params = {
|
519
|
-
|
520
|
-
|
579
|
+
header_params = {}
|
580
|
+
if request.subscription&.name
|
581
|
+
header_params["subscription.name"] = request.subscription.name
|
582
|
+
end
|
583
|
+
|
521
584
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
522
585
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
523
586
|
|
@@ -573,6 +636,27 @@ module Google
|
|
573
636
|
#
|
574
637
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
575
638
|
#
|
639
|
+
# @example Basic example
|
640
|
+
# require "google/cloud/pubsub/v1"
|
641
|
+
#
|
642
|
+
# # Create a client object. The client can be reused for multiple calls.
|
643
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
644
|
+
#
|
645
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
646
|
+
# request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new
|
647
|
+
#
|
648
|
+
# # Call the list_subscriptions method.
|
649
|
+
# result = client.list_subscriptions request
|
650
|
+
#
|
651
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
652
|
+
# # iterate over all elements by calling #each, and the enumerable
|
653
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
654
|
+
# # methods are also available for managing paging directly.
|
655
|
+
# result.each do |response|
|
656
|
+
# # Each element is of type ::Google::Cloud::PubSub::V1::Subscription.
|
657
|
+
# p response
|
658
|
+
# end
|
659
|
+
#
|
576
660
|
def list_subscriptions request, options = nil
|
577
661
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
578
662
|
|
@@ -590,9 +674,11 @@ module Google
|
|
590
674
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
591
675
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
592
676
|
|
593
|
-
header_params = {
|
594
|
-
|
595
|
-
|
677
|
+
header_params = {}
|
678
|
+
if request.project
|
679
|
+
header_params["project"] = request.project
|
680
|
+
end
|
681
|
+
|
596
682
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
597
683
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
598
684
|
|
@@ -647,6 +733,21 @@ module Google
|
|
647
733
|
#
|
648
734
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
649
735
|
#
|
736
|
+
# @example Basic example
|
737
|
+
# require "google/cloud/pubsub/v1"
|
738
|
+
#
|
739
|
+
# # Create a client object. The client can be reused for multiple calls.
|
740
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
741
|
+
#
|
742
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
743
|
+
# request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new
|
744
|
+
#
|
745
|
+
# # Call the delete_subscription method.
|
746
|
+
# result = client.delete_subscription request
|
747
|
+
#
|
748
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
749
|
+
# p result
|
750
|
+
#
|
650
751
|
def delete_subscription request, options = nil
|
651
752
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
652
753
|
|
@@ -664,9 +765,11 @@ module Google
|
|
664
765
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
665
766
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
666
767
|
|
667
|
-
header_params = {
|
668
|
-
|
669
|
-
|
768
|
+
header_params = {}
|
769
|
+
if request.subscription
|
770
|
+
header_params["subscription"] = request.subscription
|
771
|
+
end
|
772
|
+
|
670
773
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
671
774
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
672
775
|
|
@@ -731,6 +834,21 @@ module Google
|
|
731
834
|
#
|
732
835
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
733
836
|
#
|
837
|
+
# @example Basic example
|
838
|
+
# require "google/cloud/pubsub/v1"
|
839
|
+
#
|
840
|
+
# # Create a client object. The client can be reused for multiple calls.
|
841
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
842
|
+
#
|
843
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
844
|
+
# request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new
|
845
|
+
#
|
846
|
+
# # Call the modify_ack_deadline method.
|
847
|
+
# result = client.modify_ack_deadline request
|
848
|
+
#
|
849
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
850
|
+
# p result
|
851
|
+
#
|
734
852
|
def modify_ack_deadline request, options = nil
|
735
853
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
736
854
|
|
@@ -748,9 +866,11 @@ module Google
|
|
748
866
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
749
867
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
750
868
|
|
751
|
-
header_params = {
|
752
|
-
|
753
|
-
|
869
|
+
header_params = {}
|
870
|
+
if request.subscription
|
871
|
+
header_params["subscription"] = request.subscription
|
872
|
+
end
|
873
|
+
|
754
874
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
755
875
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
756
876
|
|
@@ -810,6 +930,21 @@ module Google
|
|
810
930
|
#
|
811
931
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
812
932
|
#
|
933
|
+
# @example Basic example
|
934
|
+
# require "google/cloud/pubsub/v1"
|
935
|
+
#
|
936
|
+
# # Create a client object. The client can be reused for multiple calls.
|
937
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
938
|
+
#
|
939
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
940
|
+
# request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new
|
941
|
+
#
|
942
|
+
# # Call the acknowledge method.
|
943
|
+
# result = client.acknowledge request
|
944
|
+
#
|
945
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
946
|
+
# p result
|
947
|
+
#
|
813
948
|
def acknowledge request, options = nil
|
814
949
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
815
950
|
|
@@ -827,9 +962,11 @@ module Google
|
|
827
962
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
828
963
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
829
964
|
|
830
|
-
header_params = {
|
831
|
-
|
832
|
-
|
965
|
+
header_params = {}
|
966
|
+
if request.subscription
|
967
|
+
header_params["subscription"] = request.subscription
|
968
|
+
end
|
969
|
+
|
833
970
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
834
971
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
835
972
|
|
@@ -893,6 +1030,21 @@ module Google
|
|
893
1030
|
#
|
894
1031
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
895
1032
|
#
|
1033
|
+
# @example Basic example
|
1034
|
+
# require "google/cloud/pubsub/v1"
|
1035
|
+
#
|
1036
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1037
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1038
|
+
#
|
1039
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1040
|
+
# request = Google::Cloud::PubSub::V1::PullRequest.new
|
1041
|
+
#
|
1042
|
+
# # Call the pull method.
|
1043
|
+
# result = client.pull request
|
1044
|
+
#
|
1045
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::PullResponse.
|
1046
|
+
# p result
|
1047
|
+
#
|
896
1048
|
def pull request, options = nil
|
897
1049
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
898
1050
|
|
@@ -910,9 +1062,11 @@ module Google
|
|
910
1062
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
911
1063
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
912
1064
|
|
913
|
-
header_params = {
|
914
|
-
|
915
|
-
|
1065
|
+
header_params = {}
|
1066
|
+
if request.subscription
|
1067
|
+
header_params["subscription"] = request.subscription
|
1068
|
+
end
|
1069
|
+
|
916
1070
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
917
1071
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
918
1072
|
|
@@ -954,6 +1108,30 @@ module Google
|
|
954
1108
|
#
|
955
1109
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
956
1110
|
#
|
1111
|
+
# @example Basic example
|
1112
|
+
# require "google/cloud/pubsub/v1"
|
1113
|
+
#
|
1114
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1115
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1116
|
+
#
|
1117
|
+
# # Create an input stream
|
1118
|
+
# input = Gapic::StreamInput.new
|
1119
|
+
#
|
1120
|
+
# # Call the streaming_pull method to start streaming.
|
1121
|
+
# output = client.streaming_pull input
|
1122
|
+
#
|
1123
|
+
# # Send requests on the stream. For each request, pass in keyword
|
1124
|
+
# # arguments to set fields. Be sure to close the stream when done.
|
1125
|
+
# input << Google::Cloud::PubSub::V1::StreamingPullRequest.new
|
1126
|
+
# input << Google::Cloud::PubSub::V1::StreamingPullRequest.new
|
1127
|
+
# input.close
|
1128
|
+
#
|
1129
|
+
# # Handle streamed responses. These may be interleaved with inputs.
|
1130
|
+
# # Each response is of type ::Google::Cloud::PubSub::V1::StreamingPullResponse.
|
1131
|
+
# output.each do |response|
|
1132
|
+
# p response
|
1133
|
+
# end
|
1134
|
+
#
|
957
1135
|
def streaming_pull request, options = nil
|
958
1136
|
unless request.is_a? ::Enumerable
|
959
1137
|
raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
@@ -1034,6 +1212,21 @@ module Google
|
|
1034
1212
|
#
|
1035
1213
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1036
1214
|
#
|
1215
|
+
# @example Basic example
|
1216
|
+
# require "google/cloud/pubsub/v1"
|
1217
|
+
#
|
1218
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1219
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1220
|
+
#
|
1221
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1222
|
+
# request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new
|
1223
|
+
#
|
1224
|
+
# # Call the modify_push_config method.
|
1225
|
+
# result = client.modify_push_config request
|
1226
|
+
#
|
1227
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1228
|
+
# p result
|
1229
|
+
#
|
1037
1230
|
def modify_push_config request, options = nil
|
1038
1231
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1039
1232
|
|
@@ -1051,9 +1244,11 @@ module Google
|
|
1051
1244
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1052
1245
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1053
1246
|
|
1054
|
-
header_params = {
|
1055
|
-
|
1056
|
-
|
1247
|
+
header_params = {}
|
1248
|
+
if request.subscription
|
1249
|
+
header_params["subscription"] = request.subscription
|
1250
|
+
end
|
1251
|
+
|
1057
1252
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1058
1253
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1059
1254
|
|
@@ -1107,6 +1302,21 @@ module Google
|
|
1107
1302
|
#
|
1108
1303
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1109
1304
|
#
|
1305
|
+
# @example Basic example
|
1306
|
+
# require "google/cloud/pubsub/v1"
|
1307
|
+
#
|
1308
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1309
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1310
|
+
#
|
1311
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1312
|
+
# request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new
|
1313
|
+
#
|
1314
|
+
# # Call the get_snapshot method.
|
1315
|
+
# result = client.get_snapshot request
|
1316
|
+
#
|
1317
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
|
1318
|
+
# p result
|
1319
|
+
#
|
1110
1320
|
def get_snapshot request, options = nil
|
1111
1321
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1112
1322
|
|
@@ -1124,9 +1334,11 @@ module Google
|
|
1124
1334
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1125
1335
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1126
1336
|
|
1127
|
-
header_params = {
|
1128
|
-
|
1129
|
-
|
1337
|
+
header_params = {}
|
1338
|
+
if request.snapshot
|
1339
|
+
header_params["snapshot"] = request.snapshot
|
1340
|
+
end
|
1341
|
+
|
1130
1342
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1131
1343
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1132
1344
|
|
@@ -1186,6 +1398,27 @@ module Google
|
|
1186
1398
|
#
|
1187
1399
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1188
1400
|
#
|
1401
|
+
# @example Basic example
|
1402
|
+
# require "google/cloud/pubsub/v1"
|
1403
|
+
#
|
1404
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1405
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1406
|
+
#
|
1407
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1408
|
+
# request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new
|
1409
|
+
#
|
1410
|
+
# # Call the list_snapshots method.
|
1411
|
+
# result = client.list_snapshots request
|
1412
|
+
#
|
1413
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1414
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1415
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1416
|
+
# # methods are also available for managing paging directly.
|
1417
|
+
# result.each do |response|
|
1418
|
+
# # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot.
|
1419
|
+
# p response
|
1420
|
+
# end
|
1421
|
+
#
|
1189
1422
|
def list_snapshots request, options = nil
|
1190
1423
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1191
1424
|
|
@@ -1203,9 +1436,11 @@ module Google
|
|
1203
1436
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1204
1437
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1205
1438
|
|
1206
|
-
header_params = {
|
1207
|
-
|
1208
|
-
|
1439
|
+
header_params = {}
|
1440
|
+
if request.project
|
1441
|
+
header_params["project"] = request.project
|
1442
|
+
end
|
1443
|
+
|
1209
1444
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1210
1445
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1211
1446
|
|
@@ -1288,6 +1523,21 @@ module Google
|
|
1288
1523
|
#
|
1289
1524
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1290
1525
|
#
|
1526
|
+
# @example Basic example
|
1527
|
+
# require "google/cloud/pubsub/v1"
|
1528
|
+
#
|
1529
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1530
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1531
|
+
#
|
1532
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1533
|
+
# request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new
|
1534
|
+
#
|
1535
|
+
# # Call the create_snapshot method.
|
1536
|
+
# result = client.create_snapshot request
|
1537
|
+
#
|
1538
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
|
1539
|
+
# p result
|
1540
|
+
#
|
1291
1541
|
def create_snapshot request, options = nil
|
1292
1542
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1293
1543
|
|
@@ -1305,9 +1555,11 @@ module Google
|
|
1305
1555
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1306
1556
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1307
1557
|
|
1308
|
-
header_params = {
|
1309
|
-
|
1310
|
-
|
1558
|
+
header_params = {}
|
1559
|
+
if request.name
|
1560
|
+
header_params["name"] = request.name
|
1561
|
+
end
|
1562
|
+
|
1311
1563
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1312
1564
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1313
1565
|
|
@@ -1364,6 +1616,21 @@ module Google
|
|
1364
1616
|
#
|
1365
1617
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1366
1618
|
#
|
1619
|
+
# @example Basic example
|
1620
|
+
# require "google/cloud/pubsub/v1"
|
1621
|
+
#
|
1622
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1623
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1624
|
+
#
|
1625
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1626
|
+
# request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new
|
1627
|
+
#
|
1628
|
+
# # Call the update_snapshot method.
|
1629
|
+
# result = client.update_snapshot request
|
1630
|
+
#
|
1631
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::Snapshot.
|
1632
|
+
# p result
|
1633
|
+
#
|
1367
1634
|
def update_snapshot request, options = nil
|
1368
1635
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1369
1636
|
|
@@ -1381,9 +1648,11 @@ module Google
|
|
1381
1648
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1382
1649
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1383
1650
|
|
1384
|
-
header_params = {
|
1385
|
-
|
1386
|
-
|
1651
|
+
header_params = {}
|
1652
|
+
if request.snapshot&.name
|
1653
|
+
header_params["snapshot.name"] = request.snapshot.name
|
1654
|
+
end
|
1655
|
+
|
1387
1656
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1388
1657
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1389
1658
|
|
@@ -1441,6 +1710,21 @@ module Google
|
|
1441
1710
|
#
|
1442
1711
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1443
1712
|
#
|
1713
|
+
# @example Basic example
|
1714
|
+
# require "google/cloud/pubsub/v1"
|
1715
|
+
#
|
1716
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1717
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1718
|
+
#
|
1719
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1720
|
+
# request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new
|
1721
|
+
#
|
1722
|
+
# # Call the delete_snapshot method.
|
1723
|
+
# result = client.delete_snapshot request
|
1724
|
+
#
|
1725
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1726
|
+
# p result
|
1727
|
+
#
|
1444
1728
|
def delete_snapshot request, options = nil
|
1445
1729
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1446
1730
|
|
@@ -1458,9 +1742,11 @@ module Google
|
|
1458
1742
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1459
1743
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1460
1744
|
|
1461
|
-
header_params = {
|
1462
|
-
|
1463
|
-
|
1745
|
+
header_params = {}
|
1746
|
+
if request.snapshot
|
1747
|
+
header_params["snapshot"] = request.snapshot
|
1748
|
+
end
|
1749
|
+
|
1464
1750
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1465
1751
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1466
1752
|
|
@@ -1531,6 +1817,21 @@ module Google
|
|
1531
1817
|
#
|
1532
1818
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1533
1819
|
#
|
1820
|
+
# @example Basic example
|
1821
|
+
# require "google/cloud/pubsub/v1"
|
1822
|
+
#
|
1823
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1824
|
+
# client = Google::Cloud::PubSub::V1::Subscriber::Client.new
|
1825
|
+
#
|
1826
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1827
|
+
# request = Google::Cloud::PubSub::V1::SeekRequest.new
|
1828
|
+
#
|
1829
|
+
# # Call the seek method.
|
1830
|
+
# result = client.seek request
|
1831
|
+
#
|
1832
|
+
# # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse.
|
1833
|
+
# p result
|
1834
|
+
#
|
1534
1835
|
def seek request, options = nil
|
1535
1836
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1536
1837
|
|
@@ -1548,9 +1849,11 @@ module Google
|
|
1548
1849
|
gapic_version: ::Google::Cloud::PubSub::V1::VERSION
|
1549
1850
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1550
1851
|
|
1551
|
-
header_params = {
|
1552
|
-
|
1553
|
-
|
1852
|
+
header_params = {}
|
1853
|
+
if request.subscription
|
1854
|
+
header_params["subscription"] = request.subscription
|
1855
|
+
end
|
1856
|
+
|
1554
1857
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1555
1858
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1556
1859
|
|