google-cloud-pubsub 1.7.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 176ccfcca66573d1d858c76096cf3e2cbb437163aeaf0993df5e394594158a4d
4
- data.tar.gz: 02c9e180e88ef9a5d87e68677fe40814b26a903fb65aa994ae50473080f2d27c
3
+ metadata.gz: 25d3602668077c7dee90a868dcc01353710ac3001ece8ebe92b7acc6c7bc1bb3
4
+ data.tar.gz: 2119781ea548d6e87d201bdb759643c7ac78b7ffab0a4ee7505f731c3c812670
5
5
  SHA512:
6
- metadata.gz: 2a1b5a6de847eb054cf72ec388eca205cf5e3a03dc00b0125ef9a9a0eb2bcd94fb21389f3cef3b56983e59e9f2a11672d02f5a2b7005be7e2658a60633798896
7
- data.tar.gz: 1c81891756ab4f80a54ed12663a9a339b0e1ba57f821e3ee7f5f0a545a60b6cec4b5c94828bc888bc5b51cf4ab947a642ce3895b8103bc4824ce3026fac56d49
6
+ metadata.gz: ed1de151bbd790feb886162024dbe20e75825c7313de7f0349468d8adbdf0400ce0616f53925315a1a2558b2683fd9ac8b478b842b2008dae67990676c163a4b
7
+ data.tar.gz: 2247b98b5f04c936bd908c7a517d396e03af0f07030e7939282f750d8d2b9f569f428961c793f929d5595da60445a55948fe17864a1f25f1ab7d1746b06be9c0
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 1.7.1 / 2020-05-28
4
+
5
+ #### Documentation
6
+
7
+ * Fix a few broken links
8
+
3
9
  ### 1.7.0 / 2020-05-21
4
10
 
5
11
  #### Features
@@ -24,14 +24,8 @@ improved, *please* create a new issue on GitHub so we can talk about it.
24
24
 
25
25
  - [New issue][gh-ruby]
26
26
 
27
- Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
28
- can use the "ruby" channel for general Ruby questions, or use the
29
- "google-cloud-ruby" channel if you have questions about this gem in particular.
30
-
31
27
  [so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+pubsub
32
28
 
33
- [gh-search-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues?q=label%3A%22api%3A+pubsub%22
34
-
35
- [gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
29
+ [gh-search-ruby]: https://github.com/googleapis/google-cloud-ruby/issues?q=label%3A%22api%3A+pubsub%22
36
30
 
37
- [slack-ruby]: https://gcp-slack.appspot.com/
31
+ [gh-ruby]: https://github.com/googleapis/google-cloud-ruby/issues/new
@@ -173,7 +173,7 @@ module Google
173
173
  # Response for the `ListTopicSubscriptions` method.
174
174
  # @!attribute [rw] subscriptions
175
175
  # @return [Array<String>]
176
- # The names of the subscriptions that match the request.
176
+ # The names of subscriptions attached to the topic specified in the request.
177
177
  # @!attribute [rw] next_page_token
178
178
  # @return [String]
179
179
  # If not empty, indicates that there may be more subscriptions that match
@@ -214,6 +214,17 @@ module Google
214
214
  # Format is `projects/{project}/topics/{topic}`.
215
215
  class DeleteTopicRequest; end
216
216
 
217
+ # Request for the DetachSubscription method.
218
+ # @!attribute [rw] subscription
219
+ # @return [String]
220
+ # Required. The subscription to detach.
221
+ # Format is `projects/{project}/subscriptions/{subscription}`.
222
+ class DetachSubscriptionRequest; end
223
+
224
+ # Response for the DetachSubscription method.
225
+ # Reserved for future use.
226
+ class DetachSubscriptionResponse; end
227
+
217
228
  # A subscription resource.
218
229
  # @!attribute [rw] name
219
230
  # @return [String]
@@ -98,6 +98,12 @@ module Google
98
98
 
99
99
  private_constant :PROJECT_PATH_TEMPLATE
100
100
 
101
+ SUBSCRIPTION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
102
+ "projects/{project}/subscriptions/{subscription}"
103
+ )
104
+
105
+ private_constant :SUBSCRIPTION_PATH_TEMPLATE
106
+
101
107
  TOPIC_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
102
108
  "projects/{project}/topics/{topic}"
103
109
  )
@@ -113,6 +119,17 @@ module Google
113
119
  )
114
120
  end
115
121
 
122
+ # Returns a fully-qualified subscription resource name string.
123
+ # @param project [String]
124
+ # @param subscription [String]
125
+ # @return [String]
126
+ def self.subscription_path project, subscription
127
+ SUBSCRIPTION_PATH_TEMPLATE.render(
128
+ :"project" => project,
129
+ :"subscription" => subscription
130
+ )
131
+ end
132
+
116
133
  # Returns a fully-qualified topic resource name string.
117
134
  # @param project [String]
118
135
  # @param topic [String]
@@ -336,6 +353,14 @@ module Google
336
353
  {'resource' => request.resource}
337
354
  end
338
355
  )
356
+ @detach_subscription = Google::Gax.create_api_call(
357
+ @publisher_stub.method(:detach_subscription),
358
+ defaults["detach_subscription"],
359
+ exception_transformer: exception_transformer,
360
+ params_extractor: proc do |request|
361
+ {'subscription' => request.subscription}
362
+ end
363
+ )
339
364
  end
340
365
 
341
366
  # Service calls
@@ -572,7 +597,7 @@ module Google
572
597
  @list_topics.call(req, options, &block)
573
598
  end
574
599
 
575
- # Lists the names of the subscriptions on this topic.
600
+ # Lists the names of the attached subscriptions on this topic.
576
601
  #
577
602
  # @param topic [String]
578
603
  # Required. The name of the topic that subscriptions are attached to.
@@ -860,6 +885,40 @@ module Google
860
885
  req = Google::Gax::to_proto(req, Google::Iam::V1::TestIamPermissionsRequest)
861
886
  @test_iam_permissions.call(req, options, &block)
862
887
  end
888
+
889
+ # Detaches a subscription from this topic. All messages retained in the
890
+ # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
891
+ # will return FAILED_PRECONDITION. If the subscription is a push
892
+ # subscription, pushes to the endpoint will stop.
893
+ #
894
+ # @param subscription [String]
895
+ # Required. The subscription to detach.
896
+ # Format is `projects/{project}/subscriptions/{subscription}`.
897
+ # @param options [Google::Gax::CallOptions]
898
+ # Overrides the default settings for this call, e.g, timeout,
899
+ # retries, etc.
900
+ # @yield [result, operation] Access the result along with the RPC operation
901
+ # @yieldparam result [Google::Cloud::PubSub::V1::DetachSubscriptionResponse]
902
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
903
+ # @return [Google::Cloud::PubSub::V1::DetachSubscriptionResponse]
904
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
905
+ # @example
906
+ # require "google/cloud/pubsub"
907
+ #
908
+ # publisher_client = Google::Cloud::PubSub::Publisher.new(version: :v1)
909
+ # formatted_subscription = Google::Cloud::PubSub::V1::PublisherClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]")
910
+ # response = publisher_client.detach_subscription(formatted_subscription)
911
+
912
+ def detach_subscription \
913
+ subscription,
914
+ options: nil,
915
+ &block
916
+ req = {
917
+ subscription: subscription
918
+ }.delete_if { |_, v| v.nil? }
919
+ req = Google::Gax::to_proto(req, Google::Cloud::PubSub::V1::DetachSubscriptionRequest)
920
+ @detach_subscription.call(req, options, &block)
921
+ end
863
922
  end
864
923
  end
865
924
  end
@@ -7,6 +7,7 @@
7
7
  "UNAVAILABLE",
8
8
  "UNKNOWN"
9
9
  ],
10
+ "non_idempotent2": [],
10
11
  "non_idempotent": [
11
12
  "UNAVAILABLE"
12
13
  ],
@@ -107,6 +108,11 @@
107
108
  "timeout_millis": 60000,
108
109
  "retry_codes_name": "non_idempotent",
109
110
  "retry_params_name": "default"
111
+ },
112
+ "DetachSubscription": {
113
+ "timeout_millis": 60000,
114
+ "retry_codes_name": "non_idempotent2",
115
+ "retry_params_name": "default"
110
116
  }
111
117
  }
112
118
  }
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "1.7.0".freeze
19
+ VERSION = "1.7.1".freeze
20
20
  end
21
21
 
22
22
  Pubsub = PubSub unless const_defined? :Pubsub
@@ -73,6 +73,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
73
73
  add_message "google.pubsub.v1.DeleteTopicRequest" do
74
74
  optional :topic, :string, 1
75
75
  end
76
+ add_message "google.pubsub.v1.DetachSubscriptionRequest" do
77
+ optional :subscription, :string, 1
78
+ end
79
+ add_message "google.pubsub.v1.DetachSubscriptionResponse" do
80
+ end
76
81
  add_message "google.pubsub.v1.Subscription" do
77
82
  optional :name, :string, 1
78
83
  optional :topic, :string, 2
@@ -228,6 +233,8 @@ module Google::Cloud::PubSub::V1
228
233
  ListTopicSnapshotsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSnapshotsRequest").msgclass
229
234
  ListTopicSnapshotsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSnapshotsResponse").msgclass
230
235
  DeleteTopicRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteTopicRequest").msgclass
236
+ DetachSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DetachSubscriptionRequest").msgclass
237
+ DetachSubscriptionResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DetachSubscriptionResponse").msgclass
231
238
  Subscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Subscription").msgclass
232
239
  RetryPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.RetryPolicy").msgclass
233
240
  DeadLetterPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeadLetterPolicy").msgclass
@@ -53,7 +53,7 @@ module Google::Cloud::PubSub::V1
53
53
  rpc :GetTopic, GetTopicRequest, Topic
54
54
  # Lists matching topics.
55
55
  rpc :ListTopics, ListTopicsRequest, ListTopicsResponse
56
- # Lists the names of the subscriptions on this topic.
56
+ # Lists the names of the attached subscriptions on this topic.
57
57
  rpc :ListTopicSubscriptions, ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse
58
58
  # Lists the names of the snapshots on this topic. Snapshots are used in
59
59
  # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
@@ -68,6 +68,11 @@ module Google::Cloud::PubSub::V1
68
68
  # configuration or subscriptions. Existing subscriptions to this topic are
69
69
  # not deleted, but their `topic` field is set to `_deleted-topic_`.
70
70
  rpc :DeleteTopic, DeleteTopicRequest, Google::Protobuf::Empty
71
+ # Detaches a subscription from this topic. All messages retained in the
72
+ # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
73
+ # will return FAILED_PRECONDITION. If the subscription is a push
74
+ # subscription, pushes to the endpoint will stop.
75
+ rpc :DetachSubscription, DetachSubscriptionRequest, DetachSubscriptionResponse
71
76
  end
72
77
 
73
78
  Stub = Service.rpc_stub_class
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.7.0
4
+ version: 1.7.1
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-05-21 00:00:00.000000000 Z
12
+ date: 2020-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby