google-cloud-pubsub 2.1.1 → 2.2.0

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: 450987f2e0c301c5b43af3211dda2c6698dfa76a29076c47dc9a9690698fa9df
4
- data.tar.gz: 84f19d7d3aacaa290e7364558ebd29795f3fce76783254df8d2df43b653e02f8
3
+ metadata.gz: e9e9ee1f9fce40c034c43b3cf0e11b8e52dc5ebdc1c43f6077cfff620b812dd8
4
+ data.tar.gz: 6d29efc615b2bb5185a013c9dbb72811f130acdcee452343f53c7c6c1881ce3b
5
5
  SHA512:
6
- metadata.gz: 7b10cd6edeb5cf4d352028f58a233eb8f56f4de079ed4f2b344cb930750efe16758c736bb160635a8e019083ddf04fe01255175f18467d35a46966e9d1c19787
7
- data.tar.gz: b67f8da4a9c0b73fa065a9364773dbaaa2682d993163f9bac62fab849b00178aaeab258cc0d4962e74106535be540ec2e42cfb6b888d973b4b97c06efb217f32
6
+ metadata.gz: '0649f14787b5d7c59e6aa7cfcf7df321b63ac5faeda81c756c793cecf57a8ba31f9691c05816d7088cf40d8c1a80c36134a58b4658d381cfa05cb745687fcf1d'
7
+ data.tar.gz: a5a82376726956e5dee8dff1e17e64ddf54a2c8100830d15b1c3a17accd9fdc364b8d42051c29a86524a221c7cb14bbf300e3c0ce1f09fde678c2e8cf03fc1b8
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.2.0 / 2020-11-11
4
+
5
+ #### Features
6
+
7
+ * Add Subscription#remove_dead_letter_policy
8
+
3
9
  ### 2.1.1 / 2020-10-26
4
10
 
5
11
  #### Documentation
@@ -377,8 +377,8 @@ module Google
377
377
  # otherwise `nil`. Dead lettering is done on a best effort basis. The same message might be dead lettered
378
378
  # multiple times.
379
379
  #
380
- # See also {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts=} and
381
- # {#dead_letter_max_delivery_attempts}.
380
+ # See also {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts=}, {#dead_letter_max_delivery_attempts}
381
+ # and {#remove_dead_letter_policy}.
382
382
  #
383
383
  # Makes an API call to retrieve the topic name when called on a reference object. See {#reference?}.
384
384
  #
@@ -409,7 +409,8 @@ module Google
409
409
  # The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached
410
410
  # to this topic since messages published to a topic with no subscriptions are lost.
411
411
  #
412
- # See also {#dead_letter_topic}, {#dead_letter_max_delivery_attempts=} and {#dead_letter_max_delivery_attempts}.
412
+ # See also {#dead_letter_topic}, {#dead_letter_max_delivery_attempts=}, {#dead_letter_max_delivery_attempts}
413
+ # and {#remove_dead_letter_policy}.
413
414
  #
414
415
  # @param [Topic] new_dead_letter_topic The topic to which dead letter messages for the subscription should be
415
416
  # published.
@@ -441,14 +442,15 @@ module Google
441
442
  # acknowledgement deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0
442
443
  # deadline. Note that client libraries may automatically extend ack_deadlines.
443
444
  #
444
- # This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used.
445
+ # This field will be honored on a best effort basis. If this parameter is `nil` or `0`, a default value of `5`
446
+ # is used.
445
447
  #
446
- # See also {#dead_letter_max_delivery_attempts=}, {#dead_letter_topic=} and {#dead_letter_topic}.
448
+ # See also {#dead_letter_max_delivery_attempts=}, {#dead_letter_topic=}, {#dead_letter_topic}
449
+ # and {#remove_dead_letter_policy}.
447
450
  #
448
451
  # Makes an API call to retrieve the value when called on a reference object. See {#reference?}.
449
452
  #
450
- # @return [Integer, nil] A value between 5 and 100, or `nil` if no dead letter policy is configured. If this
451
- # value is 0, a default value of 5 is used.
453
+ # @return [Integer, nil] A value between `5` and `100`, or `nil` if no dead letter policy is configured.
452
454
  #
453
455
  # @example
454
456
  # require "google/cloud/pubsub"
@@ -475,10 +477,13 @@ module Google
475
477
  #
476
478
  # This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used.
477
479
  #
478
- # The dead letter topic must also be set. See {#dead_letter_topic=} and {#dead_letter_topic}.
480
+ # The dead letter topic must be set first. See {#dead_letter_topic=}, {#dead_letter_topic} and
481
+ # {#remove_dead_letter_policy}.
482
+ #
483
+ # @param [Integer, nil] new_dead_letter_max_delivery_attempts A value between 5 and 100. If this parameter is
484
+ # `nil` or `0`, a default value of 5 is used.
479
485
  #
480
- # @param [Integer] new_dead_letter_max_delivery_attempts A value between 5 and 100. If this parameter is 0, a
481
- # default value of 5 is used.
486
+ # @raise [ArgumentError] if the dead letter topic has not been set. See {#dead_letter_topic=}.
482
487
  #
483
488
  # @example
484
489
  # require "google/cloud/pubsub"
@@ -503,6 +508,39 @@ module Google
503
508
  @resource_name = nil
504
509
  end
505
510
 
511
+ ##
512
+ # Removes an existing dead letter policy. A dead letter policy specifies the conditions for dead lettering
513
+ # messages in the subscription. If a dead letter policy is not set, dead lettering is disabled.
514
+ #
515
+ # See {#dead_letter_topic}, {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts} and
516
+ # {#dead_letter_max_delivery_attempts=}.
517
+ #
518
+ # @return [Boolean] `true` if an existing dead letter policy was removed, `false` if no existing dead letter
519
+ # policy was present.
520
+ #
521
+ # @example
522
+ # require "google/cloud/pubsub"
523
+ #
524
+ # pubsub = Google::Cloud::PubSub.new
525
+ #
526
+ # sub = pubsub.subscription "my-topic-sub"
527
+ #
528
+ # sub.dead_letter_topic.name #=> "projects/my-project/topics/my-dead-letter-topic"
529
+ # sub.dead_letter_max_delivery_attempts #=> 10
530
+ #
531
+ # sub.remove_dead_letter_policy
532
+ #
533
+ # sub.dead_letter_topic #=> nil
534
+ # sub.dead_letter_max_delivery_attempts #=> nil
535
+ #
536
+ def remove_dead_letter_policy
537
+ ensure_grpc!
538
+ return false if @grpc.dead_letter_policy.nil?
539
+ update_grpc = Google::Cloud::PubSub::V1::Subscription.new name: name, dead_letter_policy: nil
540
+ @grpc = service.update_subscription update_grpc, :dead_letter_policy
541
+ true
542
+ end
543
+
506
544
  ##
507
545
  # A policy that specifies how Cloud Pub/Sub retries message delivery for this subscription. If `nil`, the
508
546
  # default retry policy is applied. This generally implies that messages will be retried as soon as possible
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "2.1.1".freeze
19
+ VERSION = "2.2.0".freeze
20
20
  end
21
21
 
22
22
  Pubsub = PubSub unless const_defined? :Pubsub
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-10-26 00:00:00.000000000 Z
12
+ date: 2020-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby