google-cloud-pubsub 1.5.0 → 1.6.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: c1306c932b52a6c12aa2aa1e6ba1100ca90ae78a364ce07d8c5844c517c547f4
4
- data.tar.gz: f6b9413d4d64cebd698f02b7e7a169da5066c9f05d967432ac69737f1e8d76e5
3
+ metadata.gz: 350813891a25b960230adbe7a22dc40cd847065d368598650a0c663e81d66bc7
4
+ data.tar.gz: 881a92aec3d136aef23bee956241bf400a5dd203a7f6c0a100e162a4c22c97d0
5
5
  SHA512:
6
- metadata.gz: ebd17aea2e53e2b4fbcaa7b5dd76954fe73aa6eb36402db2014e7d7904df0db022f49a7a2cac574567b9f58c70632f7d4360b12c9a96fed15e1f1f133e3a9df2
7
- data.tar.gz: a1c0e15330824046f66db7ccb5105b16ee07984c36080338d38302ace2c1c5fded2c3e59ba4979c0d4e63c7becdc425a1b25587fda71508b86492cd03fadf8ba
6
+ metadata.gz: c364975f01a107d41f1282eecdbec83d25e1d3717abcb45252afebfb64c6d028b9651e9d054bfb5b1caeb6e179045505f79e5faf802c30071f202e7a42e576af
7
+ data.tar.gz: 7a9d23c2d74e734ad184d6dbb3acabad3868a6dd74b5836d7aa149c4c03edb7c80b414e4d52b2fe8bed9ae4e6794a0634c90c1919a5471196cda408c423f2610
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 1.6.0 / 2020-04-06
4
+
5
+ #### Features
6
+
7
+ * Add list_topic_snapshots and get_snapshot
8
+ * Add PublisherClient#list_topic_snapshots
9
+ * Add SubscriberClient#get_snapshot
10
+
11
+ #### Documentation
12
+
13
+ * Remove a spurious link in the low-level interface documentation.
14
+
3
15
  ### 1.5.0 / 2020-03-25
4
16
 
5
17
  #### Features
@@ -399,7 +399,7 @@ module Google
399
399
  # @!attribute [rw] push_endpoint
400
400
  # @return [String]
401
401
  # A URL locating the endpoint to which messages should be pushed.
402
- # For example, a Webhook endpoint might use "https://example.com/push".
402
+ # For example, a Webhook endpoint might use `https://example.com/push`.
403
403
  # @!attribute [rw] attributes
404
404
  # @return [Hash{String => String}]
405
405
  # Endpoint configuration attributes that can be used to control different
@@ -64,7 +64,11 @@ module Google
64
64
  "list_topic_subscriptions" => Google::Gax::PageDescriptor.new(
65
65
  "page_token",
66
66
  "next_page_token",
67
- "subscriptions")
67
+ "subscriptions"),
68
+ "list_topic_snapshots" => Google::Gax::PageDescriptor.new(
69
+ "page_token",
70
+ "next_page_token",
71
+ "snapshots")
68
72
  }.freeze
69
73
 
70
74
  private_constant :PAGE_DESCRIPTORS
@@ -110,8 +114,6 @@ module Google
110
114
  end
111
115
 
112
116
  # Returns a fully-qualified topic resource name string.
113
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
114
- # This helper function will be deleted in the next major version.
115
117
  # @param project [String]
116
118
  # @param topic [String]
117
119
  # @return [String]
@@ -294,6 +296,14 @@ module Google
294
296
  {'topic' => request.topic}
295
297
  end
296
298
  )
299
+ @list_topic_snapshots = Google::Gax.create_api_call(
300
+ @publisher_stub.method(:list_topic_snapshots),
301
+ defaults["list_topic_snapshots"],
302
+ exception_transformer: exception_transformer,
303
+ params_extractor: proc do |request|
304
+ {'topic' => request.topic}
305
+ end
306
+ )
297
307
  @delete_topic = Google::Gax.create_api_call(
298
308
  @publisher_stub.method(:delete_topic),
299
309
  defaults["delete_topic"],
@@ -617,6 +627,66 @@ module Google
617
627
  @list_topic_subscriptions.call(req, options, &block)
618
628
  end
619
629
 
630
+ # Lists the names of the snapshots on this topic. Snapshots are used in
631
+ # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
632
+ # operations, which allow
633
+ # you to manage message acknowledgments in bulk. That is, you can set the
634
+ # acknowledgment state of messages in an existing subscription to the state
635
+ # captured by a snapshot.
636
+ #
637
+ # @param topic [String]
638
+ # Required. The name of the topic that snapshots are attached to.
639
+ # Format is `projects/{project}/topics/{topic}`.
640
+ # @param page_size [Integer]
641
+ # The maximum number of resources contained in the underlying API
642
+ # response. If page streaming is performed per-resource, this
643
+ # parameter does not affect the return value. If page streaming is
644
+ # performed per-page, this determines the maximum number of
645
+ # resources in a page.
646
+ # @param options [Google::Gax::CallOptions]
647
+ # Overrides the default settings for this call, e.g, timeout,
648
+ # retries, etc.
649
+ # @yield [result, operation] Access the result along with the RPC operation
650
+ # @yieldparam result [Google::Gax::PagedEnumerable<String>]
651
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
652
+ # @return [Google::Gax::PagedEnumerable<String>]
653
+ # An enumerable of String instances.
654
+ # See Google::Gax::PagedEnumerable documentation for other
655
+ # operations such as per-page iteration or access to the response
656
+ # object.
657
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
658
+ # @example
659
+ # require "google/cloud/pubsub"
660
+ #
661
+ # publisher_client = Google::Cloud::PubSub::Publisher.new(version: :v1)
662
+ # formatted_topic = Google::Cloud::PubSub::V1::PublisherClient.topic_path("[PROJECT]", "[TOPIC]")
663
+ #
664
+ # # Iterate over all results.
665
+ # publisher_client.list_topic_snapshots(formatted_topic).each do |element|
666
+ # # Process element.
667
+ # end
668
+ #
669
+ # # Or iterate over results one page at a time.
670
+ # publisher_client.list_topic_snapshots(formatted_topic).each_page do |page|
671
+ # # Process each page at a time.
672
+ # page.each do |element|
673
+ # # Process element.
674
+ # end
675
+ # end
676
+
677
+ def list_topic_snapshots \
678
+ topic,
679
+ page_size: nil,
680
+ options: nil,
681
+ &block
682
+ req = {
683
+ topic: topic,
684
+ page_size: page_size
685
+ }.delete_if { |_, v| v.nil? }
686
+ req = Google::Gax::to_proto(req, Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest)
687
+ @list_topic_snapshots.call(req, options, &block)
688
+ end
689
+
620
690
  # Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
621
691
  # does not exist. After a topic is deleted, a new topic may be created with
622
692
  # the same name; this is an entirely new topic with none of the old
@@ -10,6 +10,10 @@
10
10
  "non_idempotent": [
11
11
  "UNAVAILABLE"
12
12
  ],
13
+ "idempotent2": [
14
+ "DEADLINE_EXCEEDED",
15
+ "UNAVAILABLE"
16
+ ],
13
17
  "none": [],
14
18
  "publish": [
15
19
  "ABORTED",
@@ -79,6 +83,11 @@
79
83
  "retry_codes_name": "idempotent",
80
84
  "retry_params_name": "default"
81
85
  },
86
+ "ListTopicSnapshots": {
87
+ "timeout_millis": 60000,
88
+ "retry_codes_name": "idempotent2",
89
+ "retry_params_name": "default"
90
+ },
82
91
  "DeleteTopic": {
83
92
  "timeout_millis": 60000,
84
93
  "retry_codes_name": "non_idempotent",
@@ -134,8 +134,6 @@ module Google
134
134
  end
135
135
 
136
136
  # Returns a fully-qualified topic resource name string.
137
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
138
- # This helper function will be deleted in the next major version.
139
137
  # @param project [String]
140
138
  # @param topic [String]
141
139
  # @return [String]
@@ -309,6 +307,14 @@ module Google
309
307
  {'subscription' => request.subscription}
310
308
  end
311
309
  )
310
+ @get_snapshot = Google::Gax.create_api_call(
311
+ @subscriber_stub.method(:get_snapshot),
312
+ defaults["get_snapshot"],
313
+ exception_transformer: exception_transformer,
314
+ params_extractor: proc do |request|
315
+ {'snapshot' => request.snapshot}
316
+ end
317
+ )
312
318
  @modify_ack_deadline = Google::Gax.create_api_call(
313
319
  @subscriber_stub.method(:modify_ack_deadline),
314
320
  defaults["modify_ack_deadline"],
@@ -752,6 +758,41 @@ module Google
752
758
  nil
753
759
  end
754
760
 
761
+ # Gets the configuration details of a snapshot. Snapshots are used in
762
+ # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
763
+ # operations, which allow you to manage message acknowledgments in bulk. That
764
+ # is, you can set the acknowledgment state of messages in an existing
765
+ # subscription to the state captured by a snapshot.
766
+ #
767
+ # @param snapshot [String]
768
+ # Required. The name of the snapshot to get.
769
+ # Format is `projects/{project}/snapshots/{snap}`.
770
+ # @param options [Google::Gax::CallOptions]
771
+ # Overrides the default settings for this call, e.g, timeout,
772
+ # retries, etc.
773
+ # @yield [result, operation] Access the result along with the RPC operation
774
+ # @yieldparam result [Google::Cloud::PubSub::V1::Snapshot]
775
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
776
+ # @return [Google::Cloud::PubSub::V1::Snapshot]
777
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
778
+ # @example
779
+ # require "google/cloud/pubsub"
780
+ #
781
+ # subscriber_client = Google::Cloud::PubSub::Subscriber.new(version: :v1)
782
+ # formatted_snapshot = Google::Cloud::PubSub::V1::SubscriberClient.snapshot_path("[PROJECT]", "[SNAPSHOT]")
783
+ # response = subscriber_client.get_snapshot(formatted_snapshot)
784
+
785
+ def get_snapshot \
786
+ snapshot,
787
+ options: nil,
788
+ &block
789
+ req = {
790
+ snapshot: snapshot
791
+ }.delete_if { |_, v| v.nil? }
792
+ req = Google::Gax::to_proto(req, Google::Cloud::PubSub::V1::GetSnapshotRequest)
793
+ @get_snapshot.call(req, options, &block)
794
+ end
795
+
755
796
  # Modifies the ack deadline for a specific message. This method is useful
756
797
  # to indicate that more time is needed to process a message by the
757
798
  # subscriber, or to make the message available for redelivery if the
@@ -10,6 +10,10 @@
10
10
  "non_idempotent": [
11
11
  "UNAVAILABLE"
12
12
  ],
13
+ "idempotent2": [
14
+ "DEADLINE_EXCEEDED",
15
+ "UNAVAILABLE"
16
+ ],
13
17
  "streaming_pull": [
14
18
  "ABORTED",
15
19
  "DEADLINE_EXCEEDED",
@@ -73,6 +77,11 @@
73
77
  "retry_codes_name": "non_idempotent",
74
78
  "retry_params_name": "default"
75
79
  },
80
+ "GetSnapshot": {
81
+ "timeout_millis": 60000,
82
+ "retry_codes_name": "idempotent2",
83
+ "retry_params_name": "default"
84
+ },
76
85
  "ModifyAckDeadline": {
77
86
  "timeout_millis": 60000,
78
87
  "retry_codes_name": "non_idempotent",
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "1.5.0".freeze
19
+ VERSION = "1.6.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: 1.5.0
4
+ version: 1.6.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-03-25 00:00:00.000000000 Z
12
+ date: 2020-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby