google-cloud-pubsub 2.3.1 → 2.3.2

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: 3af82f9222001a7e9b8a4648b53370da523629e3950822ec70b2994c7ff1ab69
4
- data.tar.gz: c65a361d505e5416be05189668fb62260b91eabb89be8fedc8b4928a9a0724dc
3
+ metadata.gz: 2d44dfbd212a70cfa64b25b0278a651c84c386414119644b9f92c8a2041c5c6c
4
+ data.tar.gz: 84b93c12184314f5157b913ae4769ca1d21e0070a3a78490012da5639bcd68cb
5
5
  SHA512:
6
- metadata.gz: e0fd3399bed14e3ec636a352cefc9c03a34f76ad20adbd12c3c043bdebf23ea75c68b9cab5e0fe0e259911b7a466f8b0e4d0b138ea9cd3244653d13749b38920
7
- data.tar.gz: 91243885834f4cb5c3423bc8f6e75383d95cbdb5b09b6a4bd409b701a6c0433838882188a28cf150302cd4ea3fa8c48afc669f7590d9578d67858b246ad77fc7
6
+ metadata.gz: 2fd9a8b1cfab5e94add3c5433c17ee59a37eabf97aac952a6fdc6c5d5f0618d06ca9063a2ef96c3e2d4355a43a51ff9f2d40cd953cc77a9e2f0e6c615c307428
7
+ data.tar.gz: daf39d392c2262faf7a2d5cc2db95ce145197c62e158fa4ce6acfa943a8ad6166002c26b4fd7c240dae1d3ddd1919de7ad3ae9018b61ff4d087740285f02ba99
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release History
2
2
 
3
+ ### 2.3.2 / 2021-02-08
4
+
5
+ #### Bug Fixes
6
+
7
+ * Fix project option in Project#topic and Project#subscription
8
+ * Ensure that project option is used when skip_lookup is false.
9
+ * Improve documentation of topic_name, subscription_name and snapshot_name.
10
+
3
11
  ### 2.3.1 / 2021-01-13
4
12
 
5
13
  #### Bug Fixes
@@ -44,8 +44,8 @@ module Google
44
44
  #
45
45
  # topic.async_publisher.stop!
46
46
  #
47
- # @attr_reader [String] topic_name The name of the topic the messages are published to. In the form of
48
- # "/projects/project-identifier/topics/topic-name".
47
+ # @attr_reader [String] topic_name The name of the topic the messages are published to. The value is a
48
+ # fully-qualified topic name in the form `projects/{project_id}/topics/{topic_id}`.
49
49
  # @attr_reader [Integer] max_bytes The maximum size of messages to be collected before the batch is published.
50
50
  # Default is 1,000,000 (1MB).
51
51
  # @attr_reader [Integer] max_messages The maximum number of messages to be collected before the batch is
@@ -75,10 +75,14 @@ module Google
75
75
  ##
76
76
  # Retrieves topic by name.
77
77
  #
78
- # @param [String] topic_name Name of a topic.
78
+ # @param [String] topic_name Name of a topic. The value can be a simple
79
+ # topic ID (relative name), in which case the current project ID will
80
+ # be supplied, or a fully-qualified topic name in the form
81
+ # `projects/{project_id}/topics/{topic_id}`.
79
82
  # @param [String] project If the topic belongs to a project other than
80
83
  # the one currently connected to, the alternate project ID can be
81
- # specified here. Optional.
84
+ # specified here. Optional. Not used if a fully-qualified topic name
85
+ # is provided for `topic_name`.
82
86
  # @param [Boolean] skip_lookup Optionally create a {Topic} object
83
87
  # without verifying the topic resource exists on the Pub/Sub service.
84
88
  # Calls made on this object will raise errors if the topic resource
@@ -147,7 +151,7 @@ module Google
147
151
  ensure_service!
148
152
  options = { project: project }
149
153
  return Topic.from_name topic_name, service, options if skip_lookup
150
- grpc = service.get_topic topic_name
154
+ grpc = service.get_topic topic_name, options
151
155
  Topic.from_grpc grpc, service, async: async
152
156
  rescue Google::Cloud::NotFoundError
153
157
  nil
@@ -158,7 +162,16 @@ module Google
158
162
  ##
159
163
  # Creates a new topic.
160
164
  #
161
- # @param [String] topic_name Name of a topic.
165
+ # @param [String] topic_name Name of a topic. Required.
166
+ # The value can be a simple topic ID (relative name), in which
167
+ # case the current project ID will be supplied, or a fully-qualified
168
+ # topic name in the form `projects/{project_id}/topics/{topic_id}`.
169
+ #
170
+ # The topic ID (relative name) must start with a letter, and
171
+ # contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
172
+ # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
173
+ # signs (`%`). It must be between 3 and 255 characters in length, and
174
+ # it must not start with `goog`.
162
175
  # @param [Hash] labels A hash of user-provided labels associated with
163
176
  # the topic. You can use these to organize and group your topics.
164
177
  # Label keys and values can be no longer than 63 characters, can only
@@ -250,10 +263,14 @@ module Google
250
263
  ##
251
264
  # Retrieves subscription by name.
252
265
  #
253
- # @param [String] subscription_name Name of a subscription.
266
+ # @param [String] subscription_name Name of a subscription. The value can
267
+ # be a simple subscription ID, in which case the current project ID
268
+ # will be supplied, or a fully-qualified subscription name in the form
269
+ # `projects/{project_id}/subscriptions/{subscription_id}`.
254
270
  # @param [String] project If the subscription belongs to a project other
255
271
  # than the one currently connected to, the alternate project ID can be
256
- # specified here.
272
+ # specified here. Not used if a fully-qualified subscription name is
273
+ # provided for `subscription_name`.
257
274
  # @param [Boolean] skip_lookup Optionally create a {Subscription} object
258
275
  # without verifying the subscription resource exists on the Pub/Sub
259
276
  # service. Calls made on this object will raise errors if the service
@@ -283,7 +300,7 @@ module Google
283
300
  ensure_service!
284
301
  options = { project: project }
285
302
  return Subscription.from_name subscription_name, service, options if skip_lookup
286
- grpc = service.get_subscription subscription_name
303
+ grpc = service.get_subscription subscription_name, options
287
304
  Subscription.from_grpc grpc, service
288
305
  rescue Google::Cloud::NotFoundError
289
306
  nil
@@ -58,8 +58,10 @@ module Google
58
58
  end
59
59
 
60
60
  ##
61
- # The name of the snapshot. Format is
62
- # `projects/{project}/snapshots/{snap}`.
61
+ # The name of the snapshot.
62
+ #
63
+ # @return [String] A fully-qualified snapshot name in the form
64
+ # `projects/{project_id}/snapshots/{snapshot_id}`.
63
65
  def name
64
66
  @grpc.name
65
67
  end
@@ -77,7 +77,9 @@ module Google
77
77
  ##
78
78
  # The name of the subscription.
79
79
  #
80
- # @return [String]
80
+ # @return [String] A fully-qualified subscription name in the form
81
+ # `projects/{project_id}/subscriptions/{subscription_id}`.
82
+ #
81
83
  def name
82
84
  return @resource_name if reference?
83
85
  @grpc.name
@@ -1064,14 +1066,19 @@ module Google
1064
1066
  # * Any messages published to the subscription's topic following the
1065
1067
  # successful completion of the `create_snapshot` operation.
1066
1068
  #
1067
- # @param [String, nil] snapshot_name Name of the new snapshot. If the
1068
- # name is not provided, the server will assign a random name
1069
- # for this snapshot on the same project as the subscription. The
1070
- # format is `projects/{project}/snapshots/{snap}`. The name must start
1071
- # with a letter, and contain only letters ([A-Za-z]), numbers
1072
- # ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus
1073
- # (+) or percent signs (%). It must be between 3 and 255 characters in
1074
- # length, and it must not start with "goog". Optional.
1069
+ # @param [String, nil] snapshot_name Name of the new snapshot. Optional.
1070
+ # If the name is not provided, the server will assign a random name
1071
+ # for this snapshot on the same project as the subscription.
1072
+ # The value can be a simple snapshot ID (relative name), in which
1073
+ # case the current project ID will be supplied, or a fully-qualified
1074
+ # snapshot name in the form
1075
+ # `projects/{project_id}/snapshots/{snapshot_id}`.
1076
+ #
1077
+ # The snapshot ID (relative name) must start with a letter, and
1078
+ # contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
1079
+ # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
1080
+ # signs (`%`). It must be between 3 and 255 characters in length, and
1081
+ # it must not start with `goog`.
1075
1082
  # @param [Hash] labels A hash of user-provided labels associated with
1076
1083
  # the snapshot. You can use these to organize and group your
1077
1084
  # snapshots. Label keys and values can be no longer than 63
@@ -85,10 +85,10 @@ module Google
85
85
  end
86
86
 
87
87
  ##
88
- # The name of the topic in the form of
89
- # "/projects/project-identifier/topics/topic-name".
88
+ # The name of the topic.
90
89
  #
91
- # @return [String]
90
+ # @return [String] A fully-qualified topic name in the form
91
+ # `projects/{project_id}/topics/{topic_id}`.
92
92
  #
93
93
  def name
94
94
  return @resource_name if reference?
@@ -255,11 +255,17 @@ module Google
255
255
  ##
256
256
  # Creates a new {Subscription} object on the current Topic.
257
257
  #
258
- # @param [String] subscription_name Name of the new subscription. Must
259
- # start with a letter, and contain only letters ([A-Za-z]), numbers
260
- # ([0-9], dashes (-), underscores (_), periods (.), tildes (~), plus
261
- # (+) or percent signs (%). It must be between 3 and 255 characters in
262
- # length, and it must not start with "goog". Required.
258
+ # @param [String] subscription_name Name of the new subscription. Required.
259
+ # The value can be a simple subscription ID (relative name), in which
260
+ # case the current project ID will be supplied, or a fully-qualified
261
+ # subscription name in the form
262
+ # `projects/{project_id}/subscriptions/{subscription_id}`.
263
+ #
264
+ # The subscription ID (relative name) must start with a letter, and
265
+ # contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
266
+ # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
267
+ # signs (`%`). It must be between 3 and 255 characters in length, and
268
+ # it must not start with `goog`.
263
269
  # @param [Integer] deadline The maximum number of seconds after a
264
270
  # subscriber receives a message before the subscriber should
265
271
  # acknowledge the message.
@@ -415,7 +421,11 @@ module Google
415
421
  ##
416
422
  # Retrieves subscription by name.
417
423
  #
418
- # @param [String] subscription_name Name of a subscription.
424
+ # @param [String] subscription_name Name of a subscription. The value
425
+ # can be a simple subscription ID (relative name), in which case the
426
+ # current project ID will be supplied, or a fully-qualified
427
+ # subscription name in the form
428
+ # `projects/{project_id}/subscriptions/{subscription_id}`.
419
429
  # @param [Boolean] skip_lookup Optionally create a {Subscription} object
420
430
  # without verifying the subscription resource exists on the Pub/Sub
421
431
  # service. Calls made on this object will raise errors if the service
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "2.3.1".freeze
19
+ VERSION = "2.3.2".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.3.1
4
+ version: 2.3.2
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: 2021-01-13 00:00:00.000000000 Z
12
+ date: 2021-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  - !ruby/object:Gem::Version
260
260
  version: '0'
261
261
  requirements: []
262
- rubygems_version: 3.1.4
262
+ rubygems_version: 3.2.6
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: API Client library for Google Cloud Pub/Sub