google-cloud-pubsub 0.32.2 → 0.33.0
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/CHANGELOG.md +7 -0
- data/LOGGING.md +1 -1
- data/lib/google-cloud-pubsub.rb +1 -1
- data/lib/google/cloud/pubsub/project.rb +10 -2
- data/lib/google/cloud/pubsub/service.rb +22 -2
- data/lib/google/cloud/pubsub/snapshot.rb +35 -0
- data/lib/google/cloud/pubsub/subscription.rb +46 -2
- data/lib/google/cloud/pubsub/topic.rb +51 -2
- data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/iam_policy.rb +13 -13
- data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/policy.rb +28 -28
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/duration.rb +3 -3
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/empty.rb +1 -1
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/field_mask.rb +7 -7
- data/lib/google/cloud/pubsub/v1/doc/google/protobuf/timestamp.rb +7 -7
- data/lib/google/cloud/pubsub/v1/doc/google/pubsub/v1/pubsub.rb +101 -101
- data/lib/google/cloud/pubsub/v1/publisher_client.rb +27 -27
- data/lib/google/cloud/pubsub/v1/subscriber_client.rb +68 -68
- data/lib/google/cloud/pubsub/version.rb +1 -1
- metadata +3 -3
|
@@ -293,11 +293,11 @@ module Google
|
|
|
293
293
|
#
|
|
294
294
|
# @param name [String]
|
|
295
295
|
# The name of the topic. It must have the format
|
|
296
|
-
#
|
|
297
|
-
# and contain only letters (
|
|
298
|
-
# underscores (
|
|
299
|
-
# signs (
|
|
300
|
-
# must not start with
|
|
296
|
+
# `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
|
|
297
|
+
# and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
|
|
298
|
+
# underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
|
|
299
|
+
# signs (`%`). It must be between 3 and 255 characters in length, and it
|
|
300
|
+
# must not start with `"goog"`.
|
|
301
301
|
# @param labels [Hash{String => String}]
|
|
302
302
|
# User labels.
|
|
303
303
|
# @param message_storage_policy [Google::Pubsub::V1::MessageStoragePolicy | Hash]
|
|
@@ -348,10 +348,10 @@ module Google
|
|
|
348
348
|
# can also be provided.
|
|
349
349
|
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
|
350
350
|
# Indicates which fields in the provided topic to update. Must be specified
|
|
351
|
-
# and non-empty. Note that if
|
|
351
|
+
# and non-empty. Note that if `update_mask` contains
|
|
352
352
|
# "message_storage_policy" then the new value will be determined based on the
|
|
353
353
|
# policy configured at the project or organization level. The
|
|
354
|
-
#
|
|
354
|
+
# `message_storage_policy` must not be set in the `topic` provided above.
|
|
355
355
|
# A hash of the same form as `Google::Protobuf::FieldMask`
|
|
356
356
|
# can also be provided.
|
|
357
357
|
# @param options [Google::Gax::CallOptions]
|
|
@@ -367,10 +367,10 @@ module Google
|
|
|
367
367
|
#
|
|
368
368
|
# publisher_client = Google::Cloud::Pubsub::Publisher.new(version: :v1)
|
|
369
369
|
#
|
|
370
|
-
# # TODO: Initialize
|
|
370
|
+
# # TODO: Initialize `topic`:
|
|
371
371
|
# topic = {}
|
|
372
372
|
#
|
|
373
|
-
# # TODO: Initialize
|
|
373
|
+
# # TODO: Initialize `update_mask`:
|
|
374
374
|
# update_mask = {}
|
|
375
375
|
# response = publisher_client.update_topic(topic, update_mask)
|
|
376
376
|
|
|
@@ -387,13 +387,13 @@ module Google
|
|
|
387
387
|
@update_topic.call(req, options, &block)
|
|
388
388
|
end
|
|
389
389
|
|
|
390
|
-
# Adds one or more messages to the topic. Returns
|
|
390
|
+
# Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
|
|
391
391
|
# does not exist. The message payload must not be empty; it must contain
|
|
392
392
|
# either a non-empty data field, or at least one attribute.
|
|
393
393
|
#
|
|
394
394
|
# @param topic [String]
|
|
395
395
|
# The messages in the request will be published on this topic.
|
|
396
|
-
# Format is
|
|
396
|
+
# Format is `projects/{project}/topics/{topic}`.
|
|
397
397
|
# @param messages [Array<Google::Pubsub::V1::PubsubMessage | Hash>]
|
|
398
398
|
# The messages to publish.
|
|
399
399
|
# A hash of the same form as `Google::Pubsub::V1::PubsubMessage`
|
|
@@ -433,7 +433,7 @@ module Google
|
|
|
433
433
|
#
|
|
434
434
|
# @param topic [String]
|
|
435
435
|
# The name of the topic to get.
|
|
436
|
-
# Format is
|
|
436
|
+
# Format is `projects/{project}/topics/{topic}`.
|
|
437
437
|
# @param options [Google::Gax::CallOptions]
|
|
438
438
|
# Overrides the default settings for this call, e.g, timeout,
|
|
439
439
|
# retries, etc.
|
|
@@ -464,7 +464,7 @@ module Google
|
|
|
464
464
|
#
|
|
465
465
|
# @param project [String]
|
|
466
466
|
# The name of the cloud project that topics belong to.
|
|
467
|
-
# Format is
|
|
467
|
+
# Format is `projects/{project}`.
|
|
468
468
|
# @param page_size [Integer]
|
|
469
469
|
# The maximum number of resources contained in the underlying API
|
|
470
470
|
# response. If page streaming is performed per-resource, this
|
|
@@ -519,7 +519,7 @@ module Google
|
|
|
519
519
|
#
|
|
520
520
|
# @param topic [String]
|
|
521
521
|
# The name of the topic that subscriptions are attached to.
|
|
522
|
-
# Format is
|
|
522
|
+
# Format is `projects/{project}/topics/{topic}`.
|
|
523
523
|
# @param page_size [Integer]
|
|
524
524
|
# The maximum number of resources contained in the underlying API
|
|
525
525
|
# response. If page streaming is performed per-resource, this
|
|
@@ -570,15 +570,15 @@ module Google
|
|
|
570
570
|
@list_topic_subscriptions.call(req, options, &block)
|
|
571
571
|
end
|
|
572
572
|
|
|
573
|
-
# Deletes the topic with the given name. Returns
|
|
573
|
+
# Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
|
|
574
574
|
# does not exist. After a topic is deleted, a new topic may be created with
|
|
575
575
|
# the same name; this is an entirely new topic with none of the old
|
|
576
576
|
# configuration or subscriptions. Existing subscriptions to this topic are
|
|
577
|
-
# not deleted, but their
|
|
577
|
+
# not deleted, but their `topic` field is set to `_deleted-topic_`.
|
|
578
578
|
#
|
|
579
579
|
# @param topic [String]
|
|
580
580
|
# Name of the topic to delete.
|
|
581
|
-
# Format is
|
|
581
|
+
# Format is `projects/{project}/topics/{topic}`.
|
|
582
582
|
# @param options [Google::Gax::CallOptions]
|
|
583
583
|
# Overrides the default settings for this call, e.g, timeout,
|
|
584
584
|
# retries, etc.
|
|
@@ -610,10 +610,10 @@ module Google
|
|
|
610
610
|
#
|
|
611
611
|
# @param resource [String]
|
|
612
612
|
# REQUIRED: The resource for which the policy is being specified.
|
|
613
|
-
#
|
|
614
|
-
# resource is specified as
|
|
613
|
+
# `resource` is usually specified as a path. For example, a Project
|
|
614
|
+
# resource is specified as `projects/{project}`.
|
|
615
615
|
# @param policy [Google::Iam::V1::Policy | Hash]
|
|
616
|
-
# REQUIRED: The complete policy to be applied to the
|
|
616
|
+
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
|
617
617
|
# the policy is limited to a few 10s of KB. An empty policy is a
|
|
618
618
|
# valid policy but certain Cloud Platform services (such as Projects)
|
|
619
619
|
# might reject them.
|
|
@@ -633,7 +633,7 @@ module Google
|
|
|
633
633
|
# publisher_client = Google::Cloud::Pubsub::Publisher.new(version: :v1)
|
|
634
634
|
# formatted_resource = Google::Cloud::Pubsub::V1::PublisherClient.topic_path("[PROJECT]", "[TOPIC]")
|
|
635
635
|
#
|
|
636
|
-
# # TODO: Initialize
|
|
636
|
+
# # TODO: Initialize `policy`:
|
|
637
637
|
# policy = {}
|
|
638
638
|
# response = publisher_client.set_iam_policy(formatted_resource, policy)
|
|
639
639
|
|
|
@@ -656,8 +656,8 @@ module Google
|
|
|
656
656
|
#
|
|
657
657
|
# @param resource [String]
|
|
658
658
|
# REQUIRED: The resource for which the policy is being requested.
|
|
659
|
-
#
|
|
660
|
-
# resource is specified as
|
|
659
|
+
# `resource` is usually specified as a path. For example, a Project
|
|
660
|
+
# resource is specified as `projects/{project}`.
|
|
661
661
|
# @param options [Google::Gax::CallOptions]
|
|
662
662
|
# Overrides the default settings for this call, e.g, timeout,
|
|
663
663
|
# retries, etc.
|
|
@@ -690,10 +690,10 @@ module Google
|
|
|
690
690
|
#
|
|
691
691
|
# @param resource [String]
|
|
692
692
|
# REQUIRED: The resource for which the policy detail is being requested.
|
|
693
|
-
#
|
|
694
|
-
# resource is specified as
|
|
693
|
+
# `resource` is usually specified as a path. For example, a Project
|
|
694
|
+
# resource is specified as `projects/{project}`.
|
|
695
695
|
# @param permissions [Array<String>]
|
|
696
|
-
# The set of permissions to check for the
|
|
696
|
+
# The set of permissions to check for the `resource`. Permissions with
|
|
697
697
|
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
|
698
698
|
# information see
|
|
699
699
|
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
|
@@ -711,7 +711,7 @@ module Google
|
|
|
711
711
|
# publisher_client = Google::Cloud::Pubsub::Publisher.new(version: :v1)
|
|
712
712
|
# formatted_resource = Google::Cloud::Pubsub::V1::PublisherClient.topic_path("[PROJECT]", "[TOPIC]")
|
|
713
713
|
#
|
|
714
|
-
# # TODO: Initialize
|
|
714
|
+
# # TODO: Initialize `permissions`:
|
|
715
715
|
# permissions = []
|
|
716
716
|
# response = publisher_client.test_iam_permissions(formatted_resource, permissions)
|
|
717
717
|
|
|
@@ -34,8 +34,8 @@ module Google
|
|
|
34
34
|
module Pubsub
|
|
35
35
|
module V1
|
|
36
36
|
# The service that an application uses to manipulate subscriptions and to
|
|
37
|
-
# consume messages from a subscription via the
|
|
38
|
-
# establishing a bi-directional stream using the
|
|
37
|
+
# consume messages from a subscription via the `Pull` method or by
|
|
38
|
+
# establishing a bi-directional stream using the `StreamingPull` method.
|
|
39
39
|
#
|
|
40
40
|
# @!attribute [r] iam_policy_stub
|
|
41
41
|
# @return [Google::Iam::V1::IAMPolicy::Stub]
|
|
@@ -353,8 +353,8 @@ module Google
|
|
|
353
353
|
|
|
354
354
|
# Creates a subscription to a given topic. See the
|
|
355
355
|
# <a href="/pubsub/docs/admin#resource_names"> resource name rules</a>.
|
|
356
|
-
# If the subscription already exists, returns
|
|
357
|
-
# If the corresponding topic doesn't exist, returns
|
|
356
|
+
# If the subscription already exists, returns `ALREADY_EXISTS`.
|
|
357
|
+
# If the corresponding topic doesn't exist, returns `NOT_FOUND`.
|
|
358
358
|
#
|
|
359
359
|
# If the name is not provided in the request, the server will assign a random
|
|
360
360
|
# name for this subscription on the same project as the topic, conforming
|
|
@@ -365,19 +365,19 @@ module Google
|
|
|
365
365
|
#
|
|
366
366
|
# @param name [String]
|
|
367
367
|
# The name of the subscription. It must have the format
|
|
368
|
-
#
|
|
369
|
-
# start with a letter, and contain only letters (
|
|
370
|
-
# (
|
|
371
|
-
# plus (
|
|
372
|
-
# in length, and it must not start with
|
|
368
|
+
# `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
|
|
369
|
+
# start with a letter, and contain only letters (`[A-Za-z]`), numbers
|
|
370
|
+
# (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
|
|
371
|
+
# plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
|
|
372
|
+
# in length, and it must not start with `"goog"`
|
|
373
373
|
# @param topic [String]
|
|
374
374
|
# The name of the topic from which this subscription is receiving messages.
|
|
375
|
-
# Format is
|
|
376
|
-
# The value of this field will be
|
|
375
|
+
# Format is `projects/{project}/topics/{topic}`.
|
|
376
|
+
# The value of this field will be `_deleted-topic_` if the topic has been
|
|
377
377
|
# deleted.
|
|
378
378
|
# @param push_config [Google::Pubsub::V1::PushConfig | Hash]
|
|
379
379
|
# If push delivery is used with this subscription, this field is
|
|
380
|
-
# used to configure it. An empty
|
|
380
|
+
# used to configure it. An empty `pushConfig` signifies that the subscriber
|
|
381
381
|
# will pull and ack messages using API methods.
|
|
382
382
|
# A hash of the same form as `Google::Pubsub::V1::PushConfig`
|
|
383
383
|
# can also be provided.
|
|
@@ -390,9 +390,9 @@ module Google
|
|
|
390
390
|
#
|
|
391
391
|
# For pull subscriptions, this value is used as the initial value for the ack
|
|
392
392
|
# deadline. To override this value for a given message, call
|
|
393
|
-
#
|
|
394
|
-
# non-streaming pull or send the
|
|
395
|
-
#
|
|
393
|
+
# `ModifyAckDeadline` with the corresponding `ack_id` if using
|
|
394
|
+
# non-streaming pull or send the `ack_id` in a
|
|
395
|
+
# `StreamingModifyAckDeadlineRequest` if using streaming pull.
|
|
396
396
|
# The minimum custom deadline you can specify is 10 seconds.
|
|
397
397
|
# The maximum custom deadline you can specify is 600 seconds (10 minutes).
|
|
398
398
|
# If this parameter is 0, a default value of 10 seconds is used.
|
|
@@ -405,7 +405,7 @@ module Google
|
|
|
405
405
|
# @param retain_acked_messages [true, false]
|
|
406
406
|
# Indicates whether to retain acknowledged messages. If true, then
|
|
407
407
|
# messages are not expunged from the subscription's backlog, even if they are
|
|
408
|
-
# acknowledged, until they fall out of the
|
|
408
|
+
# acknowledged, until they fall out of the `message_retention_duration`
|
|
409
409
|
# window.<br><br>
|
|
410
410
|
# <b>ALPHA:</b> This feature is part of an alpha release. This API might be
|
|
411
411
|
# changed in backward-incompatible ways and is not recommended for production
|
|
@@ -413,8 +413,8 @@ module Google
|
|
|
413
413
|
# @param message_retention_duration [Google::Protobuf::Duration | Hash]
|
|
414
414
|
# How long to retain unacknowledged messages in the subscription's backlog,
|
|
415
415
|
# from the moment a message is published.
|
|
416
|
-
# If
|
|
417
|
-
# of acknowledged messages, and thus configures how far back in time a
|
|
416
|
+
# If `retain_acked_messages` is true, then this also configures the retention
|
|
417
|
+
# of acknowledged messages, and thus configures how far back in time a `Seek`
|
|
418
418
|
# can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
|
|
419
419
|
# minutes.<br><br>
|
|
420
420
|
# <b>ALPHA:</b> This feature is part of an alpha release. This API might be
|
|
@@ -467,7 +467,7 @@ module Google
|
|
|
467
467
|
#
|
|
468
468
|
# @param subscription [String]
|
|
469
469
|
# The name of the subscription to get.
|
|
470
|
-
# Format is
|
|
470
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
471
471
|
# @param options [Google::Gax::CallOptions]
|
|
472
472
|
# Overrides the default settings for this call, e.g, timeout,
|
|
473
473
|
# retries, etc.
|
|
@@ -542,7 +542,7 @@ module Google
|
|
|
542
542
|
#
|
|
543
543
|
# @param project [String]
|
|
544
544
|
# The name of the cloud project that subscriptions belong to.
|
|
545
|
-
# Format is
|
|
545
|
+
# Format is `projects/{project}`.
|
|
546
546
|
# @param page_size [Integer]
|
|
547
547
|
# The maximum number of resources contained in the underlying API
|
|
548
548
|
# response. If page streaming is performed per-resource, this
|
|
@@ -594,14 +594,14 @@ module Google
|
|
|
594
594
|
end
|
|
595
595
|
|
|
596
596
|
# Deletes an existing subscription. All messages retained in the subscription
|
|
597
|
-
# are immediately dropped. Calls to
|
|
598
|
-
#
|
|
597
|
+
# are immediately dropped. Calls to `Pull` after deletion will return
|
|
598
|
+
# `NOT_FOUND`. After a subscription is deleted, a new one may be created with
|
|
599
599
|
# the same name, but the new one has no association with the old
|
|
600
600
|
# subscription or its topic unless the same topic is specified.
|
|
601
601
|
#
|
|
602
602
|
# @param subscription [String]
|
|
603
603
|
# The subscription to delete.
|
|
604
|
-
# Format is
|
|
604
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
605
605
|
# @param options [Google::Gax::CallOptions]
|
|
606
606
|
# Overrides the default settings for this call, e.g, timeout,
|
|
607
607
|
# retries, etc.
|
|
@@ -632,17 +632,17 @@ module Google
|
|
|
632
632
|
# to indicate that more time is needed to process a message by the
|
|
633
633
|
# subscriber, or to make the message available for redelivery if the
|
|
634
634
|
# processing was interrupted. Note that this does not modify the
|
|
635
|
-
# subscription-level
|
|
635
|
+
# subscription-level `ackDeadlineSeconds` used for subsequent messages.
|
|
636
636
|
#
|
|
637
637
|
# @param subscription [String]
|
|
638
638
|
# The name of the subscription.
|
|
639
|
-
# Format is
|
|
639
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
640
640
|
# @param ack_ids [Array<String>]
|
|
641
641
|
# List of acknowledgment IDs.
|
|
642
642
|
# @param ack_deadline_seconds [Integer]
|
|
643
643
|
# The new ack deadline with respect to the time this request was sent to
|
|
644
644
|
# the Pub/Sub system. For example, if the value is 10, the new
|
|
645
|
-
# ack deadline will expire 10 seconds after the
|
|
645
|
+
# ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
|
|
646
646
|
# was made. Specifying zero may immediately make the message available for
|
|
647
647
|
# another pull request.
|
|
648
648
|
# The minimum deadline you can specify is 0 seconds.
|
|
@@ -660,10 +660,10 @@ module Google
|
|
|
660
660
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
661
661
|
# formatted_subscription = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
662
662
|
#
|
|
663
|
-
# # TODO: Initialize
|
|
663
|
+
# # TODO: Initialize `ack_ids`:
|
|
664
664
|
# ack_ids = []
|
|
665
665
|
#
|
|
666
|
-
# # TODO: Initialize
|
|
666
|
+
# # TODO: Initialize `ack_deadline_seconds`:
|
|
667
667
|
# ack_deadline_seconds = 0
|
|
668
668
|
# subscriber_client.modify_ack_deadline(formatted_subscription, ack_ids, ack_deadline_seconds)
|
|
669
669
|
|
|
@@ -683,8 +683,8 @@ module Google
|
|
|
683
683
|
nil
|
|
684
684
|
end
|
|
685
685
|
|
|
686
|
-
# Acknowledges the messages associated with the
|
|
687
|
-
#
|
|
686
|
+
# Acknowledges the messages associated with the `ack_ids` in the
|
|
687
|
+
# `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
|
|
688
688
|
# from the subscription.
|
|
689
689
|
#
|
|
690
690
|
# Acknowledging a message whose ack deadline has expired may succeed,
|
|
@@ -693,10 +693,10 @@ module Google
|
|
|
693
693
|
#
|
|
694
694
|
# @param subscription [String]
|
|
695
695
|
# The subscription whose message is being acknowledged.
|
|
696
|
-
# Format is
|
|
696
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
697
697
|
# @param ack_ids [Array<String>]
|
|
698
698
|
# The acknowledgment ID for the messages being acknowledged that was returned
|
|
699
|
-
# by the Pub/Sub system in the
|
|
699
|
+
# by the Pub/Sub system in the `Pull` response. Must not be empty.
|
|
700
700
|
# @param options [Google::Gax::CallOptions]
|
|
701
701
|
# Overrides the default settings for this call, e.g, timeout,
|
|
702
702
|
# retries, etc.
|
|
@@ -710,7 +710,7 @@ module Google
|
|
|
710
710
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
711
711
|
# formatted_subscription = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
712
712
|
#
|
|
713
|
-
# # TODO: Initialize
|
|
713
|
+
# # TODO: Initialize `ack_ids`:
|
|
714
714
|
# ack_ids = []
|
|
715
715
|
# subscriber_client.acknowledge(formatted_subscription, ack_ids)
|
|
716
716
|
|
|
@@ -729,19 +729,19 @@ module Google
|
|
|
729
729
|
end
|
|
730
730
|
|
|
731
731
|
# Pulls messages from the server. Returns an empty list if there are no
|
|
732
|
-
# messages available in the backlog. The server may return
|
|
732
|
+
# messages available in the backlog. The server may return `UNAVAILABLE` if
|
|
733
733
|
# there are too many concurrent pull requests pending for the given
|
|
734
734
|
# subscription.
|
|
735
735
|
#
|
|
736
736
|
# @param subscription [String]
|
|
737
737
|
# The subscription from which messages should be pulled.
|
|
738
|
-
# Format is
|
|
738
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
739
739
|
# @param max_messages [Integer]
|
|
740
740
|
# The maximum number of messages returned for this request. The Pub/Sub
|
|
741
741
|
# system may return fewer than the number specified.
|
|
742
742
|
# @param return_immediately [true, false]
|
|
743
743
|
# If this field set to true, the system will respond immediately even if
|
|
744
|
-
# it there are no messages available to return in the
|
|
744
|
+
# it there are no messages available to return in the `Pull` response.
|
|
745
745
|
# Otherwise, the system may wait (for a bounded amount of time) until at
|
|
746
746
|
# least one message is available, rather than returning no messages. The
|
|
747
747
|
# client may cancel the request if it does not wish to wait any longer for
|
|
@@ -760,7 +760,7 @@ module Google
|
|
|
760
760
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
761
761
|
# formatted_subscription = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
762
762
|
#
|
|
763
|
-
# # TODO: Initialize
|
|
763
|
+
# # TODO: Initialize `max_messages`:
|
|
764
764
|
# max_messages = 0
|
|
765
765
|
# response = subscriber_client.pull(formatted_subscription, max_messages)
|
|
766
766
|
|
|
@@ -782,7 +782,7 @@ module Google
|
|
|
782
782
|
# Establishes a stream with the server, which sends messages down to the
|
|
783
783
|
# client. The client streams acknowledgements and ack deadline modifications
|
|
784
784
|
# back to the server. The server will close the stream and return the status
|
|
785
|
-
# on any error. The server may close the stream with status
|
|
785
|
+
# on any error. The server may close the stream with status `UNAVAILABLE` to
|
|
786
786
|
# reassign server-side resources, in which case, the client should
|
|
787
787
|
# re-establish the stream. Flow control can be achieved by configuring the
|
|
788
788
|
# underlying RPC channel.
|
|
@@ -808,7 +808,7 @@ module Google
|
|
|
808
808
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
809
809
|
# formatted_subscription = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
810
810
|
#
|
|
811
|
-
# # TODO: Initialize
|
|
811
|
+
# # TODO: Initialize `stream_ack_deadline_seconds`:
|
|
812
812
|
# stream_ack_deadline_seconds = 0
|
|
813
813
|
# request = { subscription: formatted_subscription, stream_ack_deadline_seconds: stream_ack_deadline_seconds }
|
|
814
814
|
# requests = [request]
|
|
@@ -823,23 +823,23 @@ module Google
|
|
|
823
823
|
@streaming_pull.call(request_protos, options)
|
|
824
824
|
end
|
|
825
825
|
|
|
826
|
-
# Modifies the
|
|
826
|
+
# Modifies the `PushConfig` for a specified subscription.
|
|
827
827
|
#
|
|
828
828
|
# This may be used to change a push subscription to a pull one (signified by
|
|
829
|
-
# an empty
|
|
829
|
+
# an empty `PushConfig`) or vice versa, or change the endpoint URL and other
|
|
830
830
|
# attributes of a push subscription. Messages will accumulate for delivery
|
|
831
|
-
# continuously through the call regardless of changes to the
|
|
831
|
+
# continuously through the call regardless of changes to the `PushConfig`.
|
|
832
832
|
#
|
|
833
833
|
# @param subscription [String]
|
|
834
834
|
# The name of the subscription.
|
|
835
|
-
# Format is
|
|
835
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
836
836
|
# @param push_config [Google::Pubsub::V1::PushConfig | Hash]
|
|
837
837
|
# The push configuration for future deliveries.
|
|
838
838
|
#
|
|
839
|
-
# An empty
|
|
839
|
+
# An empty `pushConfig` indicates that the Pub/Sub system should
|
|
840
840
|
# stop pushing messages from the given subscription and allow
|
|
841
841
|
# messages to be pulled and acknowledged - effectively pausing
|
|
842
|
-
# the subscription if
|
|
842
|
+
# the subscription if `Pull` or `StreamingPull` is not called.
|
|
843
843
|
# A hash of the same form as `Google::Pubsub::V1::PushConfig`
|
|
844
844
|
# can also be provided.
|
|
845
845
|
# @param options [Google::Gax::CallOptions]
|
|
@@ -855,7 +855,7 @@ module Google
|
|
|
855
855
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
856
856
|
# formatted_subscription = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
857
857
|
#
|
|
858
|
-
# # TODO: Initialize
|
|
858
|
+
# # TODO: Initialize `push_config`:
|
|
859
859
|
# push_config = {}
|
|
860
860
|
# subscriber_client.modify_push_config(formatted_subscription, push_config)
|
|
861
861
|
|
|
@@ -880,7 +880,7 @@ module Google
|
|
|
880
880
|
#
|
|
881
881
|
# @param project [String]
|
|
882
882
|
# The name of the cloud project that snapshots belong to.
|
|
883
|
-
# Format is
|
|
883
|
+
# Format is `projects/{project}`.
|
|
884
884
|
# @param page_size [Integer]
|
|
885
885
|
# The maximum number of resources contained in the underlying API
|
|
886
886
|
# response. If page streaming is performed per-resource, this
|
|
@@ -935,11 +935,11 @@ module Google
|
|
|
935
935
|
# <b>ALPHA:</b> This feature is part of an alpha release. This API might be
|
|
936
936
|
# changed in backward-incompatible ways and is not recommended for production
|
|
937
937
|
# use. It is not subject to any SLA or deprecation policy.
|
|
938
|
-
# If the snapshot already exists, returns
|
|
939
|
-
# If the requested subscription doesn't exist, returns
|
|
938
|
+
# If the snapshot already exists, returns `ALREADY_EXISTS`.
|
|
939
|
+
# If the requested subscription doesn't exist, returns `NOT_FOUND`.
|
|
940
940
|
# If the backlog in the subscription is too old -- and the resulting snapshot
|
|
941
|
-
# would expire in less than 1 hour -- then
|
|
942
|
-
# See also the
|
|
941
|
+
# would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
|
|
942
|
+
# See also the `Snapshot.expire_time` field. If the name is not provided in
|
|
943
943
|
# the request, the server will assign a random
|
|
944
944
|
# name for this snapshot on the same project as the subscription, conforming
|
|
945
945
|
# to the [resource name format](https://cloud.google.com/pubsub/docs/overview#names).
|
|
@@ -952,17 +952,17 @@ module Google
|
|
|
952
952
|
# If the name is not provided in the request, the server will assign a random
|
|
953
953
|
# name for this snapshot on the same project as the subscription.
|
|
954
954
|
# Note that for REST API requests, you must specify a name.
|
|
955
|
-
# Format is
|
|
955
|
+
# Format is `projects/{project}/snapshots/{snap}`.
|
|
956
956
|
# @param subscription [String]
|
|
957
957
|
# The subscription whose backlog the snapshot retains.
|
|
958
958
|
# Specifically, the created snapshot is guaranteed to retain:
|
|
959
959
|
# (a) The existing backlog on the subscription. More precisely, this is
|
|
960
960
|
# defined as the messages in the subscription's backlog that are
|
|
961
961
|
# unacknowledged upon the successful completion of the
|
|
962
|
-
#
|
|
962
|
+
# `CreateSnapshot` request; as well as:
|
|
963
963
|
# (b) Any messages published to the subscription's topic following the
|
|
964
964
|
# successful completion of the CreateSnapshot request.
|
|
965
|
-
# Format is
|
|
965
|
+
# Format is `projects/{project}/subscriptions/{sub}`.
|
|
966
966
|
# @param labels [Hash{String => String}]
|
|
967
967
|
# User labels.
|
|
968
968
|
# @param options [Google::Gax::CallOptions]
|
|
@@ -1055,7 +1055,7 @@ module Google
|
|
|
1055
1055
|
#
|
|
1056
1056
|
# @param snapshot [String]
|
|
1057
1057
|
# The name of the snapshot to delete.
|
|
1058
|
-
# Format is
|
|
1058
|
+
# Format is `projects/{project}/snapshots/{snap}`.
|
|
1059
1059
|
# @param options [Google::Gax::CallOptions]
|
|
1060
1060
|
# Overrides the default settings for this call, e.g, timeout,
|
|
1061
1061
|
# retries, etc.
|
|
@@ -1097,8 +1097,8 @@ module Google
|
|
|
1097
1097
|
# subscription that were published after this time are marked as
|
|
1098
1098
|
# unacknowledged. Note that this operation affects only those messages
|
|
1099
1099
|
# retained in the subscription (configured by the combination of
|
|
1100
|
-
#
|
|
1101
|
-
# if
|
|
1100
|
+
# `message_retention_duration` and `retain_acked_messages`). For example,
|
|
1101
|
+
# if `time` corresponds to a point before the message retention
|
|
1102
1102
|
# window (or to a point before the system's notion of the subscription
|
|
1103
1103
|
# creation time), only retained messages will be marked as unacknowledged,
|
|
1104
1104
|
# and already-expunged messages will not be restored.
|
|
@@ -1107,7 +1107,7 @@ module Google
|
|
|
1107
1107
|
# @param snapshot [String]
|
|
1108
1108
|
# The snapshot to seek to. The snapshot's topic must be the same as that of
|
|
1109
1109
|
# the provided subscription.
|
|
1110
|
-
# Format is
|
|
1110
|
+
# Format is `projects/{project}/snapshots/{snap}`.
|
|
1111
1111
|
# @param options [Google::Gax::CallOptions]
|
|
1112
1112
|
# Overrides the default settings for this call, e.g, timeout,
|
|
1113
1113
|
# retries, etc.
|
|
@@ -1143,10 +1143,10 @@ module Google
|
|
|
1143
1143
|
#
|
|
1144
1144
|
# @param resource [String]
|
|
1145
1145
|
# REQUIRED: The resource for which the policy is being specified.
|
|
1146
|
-
#
|
|
1147
|
-
# resource is specified as
|
|
1146
|
+
# `resource` is usually specified as a path. For example, a Project
|
|
1147
|
+
# resource is specified as `projects/{project}`.
|
|
1148
1148
|
# @param policy [Google::Iam::V1::Policy | Hash]
|
|
1149
|
-
# REQUIRED: The complete policy to be applied to the
|
|
1149
|
+
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
|
1150
1150
|
# the policy is limited to a few 10s of KB. An empty policy is a
|
|
1151
1151
|
# valid policy but certain Cloud Platform services (such as Projects)
|
|
1152
1152
|
# might reject them.
|
|
@@ -1166,7 +1166,7 @@ module Google
|
|
|
1166
1166
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
1167
1167
|
# formatted_resource = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
1168
1168
|
#
|
|
1169
|
-
# # TODO: Initialize
|
|
1169
|
+
# # TODO: Initialize `policy`:
|
|
1170
1170
|
# policy = {}
|
|
1171
1171
|
# response = subscriber_client.set_iam_policy(formatted_resource, policy)
|
|
1172
1172
|
|
|
@@ -1189,8 +1189,8 @@ module Google
|
|
|
1189
1189
|
#
|
|
1190
1190
|
# @param resource [String]
|
|
1191
1191
|
# REQUIRED: The resource for which the policy is being requested.
|
|
1192
|
-
#
|
|
1193
|
-
# resource is specified as
|
|
1192
|
+
# `resource` is usually specified as a path. For example, a Project
|
|
1193
|
+
# resource is specified as `projects/{project}`.
|
|
1194
1194
|
# @param options [Google::Gax::CallOptions]
|
|
1195
1195
|
# Overrides the default settings for this call, e.g, timeout,
|
|
1196
1196
|
# retries, etc.
|
|
@@ -1223,10 +1223,10 @@ module Google
|
|
|
1223
1223
|
#
|
|
1224
1224
|
# @param resource [String]
|
|
1225
1225
|
# REQUIRED: The resource for which the policy detail is being requested.
|
|
1226
|
-
#
|
|
1227
|
-
# resource is specified as
|
|
1226
|
+
# `resource` is usually specified as a path. For example, a Project
|
|
1227
|
+
# resource is specified as `projects/{project}`.
|
|
1228
1228
|
# @param permissions [Array<String>]
|
|
1229
|
-
# The set of permissions to check for the
|
|
1229
|
+
# The set of permissions to check for the `resource`. Permissions with
|
|
1230
1230
|
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
|
1231
1231
|
# information see
|
|
1232
1232
|
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
|
@@ -1244,7 +1244,7 @@ module Google
|
|
|
1244
1244
|
# subscriber_client = Google::Cloud::Pubsub::Subscriber.new(version: :v1)
|
|
1245
1245
|
# formatted_resource = Google::Cloud::Pubsub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
|
|
1246
1246
|
#
|
|
1247
|
-
# # TODO: Initialize
|
|
1247
|
+
# # TODO: Initialize `permissions`:
|
|
1248
1248
|
# permissions = []
|
|
1249
1249
|
# response = subscriber_client.test_iam_permissions(formatted_resource, permissions)
|
|
1250
1250
|
|