google-cloud-pubsub 2.16.0 → 2.18.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: 35cc037d6f0aede3871e054b4e0b9a1e05cee0423b88bf690fc86b9fc8f1aade
4
- data.tar.gz: 0d2f6d0b84f496f18772b7437e611d0f28c615e063ad6ef2ec7f0d0d5ddb6d13
3
+ metadata.gz: aa13ece856d024f68e7e1c7848ca48568a10935852bbfa118cd9bfc8f7e9fded
4
+ data.tar.gz: b02df87b18dfb4d060a9020d56305b0ee29790bf1fc2beb0bd4b24b61e265c60
5
5
  SHA512:
6
- metadata.gz: 95e2bd59d4810cf9db705f5a3078d75950c2ceae5908a8d43613f1fc0d0dcf68beb8d13fdef39584ef00bd14b3cb1201327a87b07bbbfe9a5d684c12e6902248
7
- data.tar.gz: c50f46c0f07df73a2e3c4490c91a35fae5380c48276bc5513860ec9401dedf7c5ed0415e9375adc7b17259f6e84c0e8f76ede1162f649a7c8cf8b2bf7aceefb3
6
+ metadata.gz: 55a8f00a15cf513a9042e16fc4cb7bc988cf4f450aaecab34a4882e95896910c3810687af52d35a653d08b2c4fa20fa85a18c25d4f87b5bd3b862110afc3556a
7
+ data.tar.gz: cf0bae5e83e225dad9e7c05fc9e808c2f41333dad011e1274e1d2851c6daa5f418726a1e5c68d2b4a582b14429c7284d48b580fa2a03052936f8db3bab54e8c1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 2.18.0 (2024-03-26)
4
+
5
+ #### Features
6
+
7
+ * support ingestion_data_source_settings for create_topic ([#25418](https://github.com/googleapis/google-cloud-ruby/issues/25418))
8
+
9
+ ### 2.17.0 (2024-03-07)
10
+
11
+ #### Features
12
+
13
+ * Update minimum supported Ruby version to 2.7 ([#25298](https://github.com/googleapis/google-cloud-ruby/issues/25298))
14
+
3
15
  ### 2.16.0 (2024-01-25)
4
16
 
5
17
  #### Features
@@ -69,7 +69,7 @@ module Google
69
69
  data_bytes = String(data).dup.force_encoding(Encoding::ASCII_8BIT).freeze
70
70
 
71
71
  # Convert attributes to strings to match the protobuf definition
72
- attributes = Hash[attributes.map { |k, v| [String(k), String(v)] }]
72
+ attributes = attributes.to_h { |k, v| [String(k), String(v)] }
73
73
 
74
74
  # Ordering Key must always be a string
75
75
  ordering_key = String(ordering_key).freeze
@@ -84,7 +84,6 @@ module Google
84
84
 
85
85
  protected
86
86
 
87
- # rubocop:disable Style/IdenticalConditionalBranches
88
87
  # rubocop:disable Style/GuardClause
89
88
 
90
89
  def acquire_or_wait message_size
@@ -117,7 +116,6 @@ module Google
117
116
  end
118
117
  end
119
118
 
120
- # rubocop:enable Style/IdenticalConditionalBranches
121
119
  # rubocop:enable Style/GuardClause
122
120
 
123
121
  def is_new_and_others_wait? waiter
@@ -62,7 +62,7 @@ module Google
62
62
  # This can be used to publish several messages in bulk.
63
63
  def initialize data = nil, attributes = {}
64
64
  # Convert attributes to strings to match the protobuf definition
65
- attributes = Hash[attributes.map { |k, v| [String(k), String(v)] }]
65
+ attributes = attributes.to_h { |k, v| [String(k), String(v)] }
66
66
 
67
67
  @grpc = Google::Cloud::PubSub::V1::PubsubMessage.new(
68
68
  data: String(data).dup.force_encoding(Encoding::ASCII_8BIT),
@@ -81,8 +81,7 @@ module Google
81
81
  # Optional attributes for the message.
82
82
  def attributes
83
83
  return @grpc.attributes.to_h if @grpc.attributes.respond_to? :to_h
84
- # Enumerable doesn't have to_h on Ruby 2.0, so fallback to this
85
- Hash[@grpc.attributes.to_a]
84
+ @grpc.attributes.to_a.to_h
86
85
  end
87
86
 
88
87
  ##
@@ -263,6 +263,8 @@ module Google
263
263
  # that is up to `retention` number of seconds in the past. If this field is
264
264
  # not set, message retention is controlled by settings on individual
265
265
  # subscriptions. Cannot be less than 600 (10 minutes) or more than 604,800 (7 days).
266
+ # @param ingestion_data_source_settings [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings, ::Hash]
267
+ # Optional. Settings for ingestion from a data source into this topic.
266
268
  #
267
269
  # @return [Google::Cloud::PubSub::Topic]
268
270
  #
@@ -279,15 +281,17 @@ module Google
279
281
  async: nil,
280
282
  schema_name: nil,
281
283
  message_encoding: nil,
282
- retention: nil
284
+ retention: nil,
285
+ ingestion_data_source_settings: nil
283
286
  ensure_service!
284
287
  grpc = service.create_topic topic_name,
285
- labels: labels,
286
- kms_key_name: kms_key,
288
+ labels: labels,
289
+ kms_key_name: kms_key,
287
290
  persistence_regions: persistence_regions,
288
- schema_name: schema_name,
289
- message_encoding: message_encoding,
290
- retention: retention
291
+ schema_name: schema_name,
292
+ message_encoding: message_encoding,
293
+ retention: retention,
294
+ ingestion_data_source_settings: ingestion_data_source_settings
291
295
  Topic.from_grpc grpc, service, async: async
292
296
  end
293
297
  alias new_topic create_topic
@@ -136,6 +136,7 @@ module Google
136
136
  schema_name: nil,
137
137
  message_encoding: nil,
138
138
  retention: nil,
139
+ ingestion_data_source_settings: nil,
139
140
  options: {}
140
141
  if persistence_regions
141
142
  message_storage_policy = Google::Cloud::PubSub::V1::MessageStoragePolicy.new(
@@ -154,12 +155,13 @@ module Google
154
155
  end
155
156
 
156
157
  publisher.create_topic \
157
- name: topic_path(topic_name, options),
158
- labels: labels,
159
- kms_key_name: kms_key_name,
160
- message_storage_policy: message_storage_policy,
161
- schema_settings: schema_settings,
162
- message_retention_duration: Convert.number_to_duration(retention)
158
+ name: topic_path(topic_name, options),
159
+ labels: labels,
160
+ kms_key_name: kms_key_name,
161
+ message_storage_policy: message_storage_policy,
162
+ schema_settings: schema_settings,
163
+ message_retention_duration: Convert.number_to_duration(retention),
164
+ ingestion_data_source_settings: ingestion_data_source_settings
163
165
  end
164
166
 
165
167
  def update_topic topic_obj, *fields
@@ -262,7 +264,7 @@ module Google
262
264
  # Modifies the PushConfig for a specified subscription.
263
265
  def modify_push_config subscription, endpoint, attributes
264
266
  # Convert attributes to strings to match the protobuf definition
265
- attributes = Hash[attributes.map { |k, v| [String(k), String(v)] }]
267
+ attributes = attributes.to_h { |k, v| [String(k), String(v)] }
266
268
  push_config = Google::Cloud::PubSub::V1::PushConfig.new(
267
269
  push_endpoint: endpoint,
268
270
  attributes: attributes
@@ -246,7 +246,7 @@ module Google
246
246
  break if synchronize { @stopped }
247
247
 
248
248
  begin
249
- # Cannot syncronize the enumerator, causes deadlock
249
+ # Cannot synchronize the enumerator, causes deadlock
250
250
  response = enum.next
251
251
  new_exactly_once_delivery_enabled = response&.subscription_properties&.exactly_once_delivery_enabled
252
252
  received_messages = response.received_messages
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "2.16.0".freeze
19
+ VERSION = "2.18.0".freeze
20
20
  end
21
21
 
22
22
  Pubsub = PubSub unless const_defined? :Pubsub
@@ -83,7 +83,7 @@ module Google
83
83
  emulator_host: nil,
84
84
  project: nil,
85
85
  keyfile: nil
86
- project_id ||= (project || default_project_id)
86
+ project_id ||= project || default_project_id
87
87
  scope ||= configure.scope
88
88
  timeout ||= configure.timeout
89
89
  endpoint ||= configure.endpoint
@@ -94,7 +94,7 @@ module Google
94
94
  credentials = :this_channel_is_insecure
95
95
  endpoint = emulator_host
96
96
  else
97
- credentials ||= (keyfile || default_credentials(scope: scope))
97
+ credentials ||= keyfile || default_credentials(scope: scope)
98
98
  unless credentials.is_a? Google::Auth::Credentials
99
99
  credentials = PubSub::Credentials.new credentials, scope: scope
100
100
  end
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.16.0
4
+ version: 2.18.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: 2024-01-25 00:00:00.000000000 Z
12
+ date: 2024-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -67,160 +67,6 @@ dependencies:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '3.1'
70
- - !ruby/object:Gem::Dependency
71
- name: autotest-suffix
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '1.1'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '1.1'
84
- - !ruby/object:Gem::Dependency
85
- name: avro
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '1.10'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '1.10'
98
- - !ruby/object:Gem::Dependency
99
- name: google-style
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: 1.25.1
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: 1.25.1
112
- - !ruby/object:Gem::Dependency
113
- name: minitest
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '5.16'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '5.16'
126
- - !ruby/object:Gem::Dependency
127
- name: minitest-autotest
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: '1.0'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '1.0'
140
- - !ruby/object:Gem::Dependency
141
- name: minitest-focus
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - "~>"
145
- - !ruby/object:Gem::Version
146
- version: '1.1'
147
- type: :development
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - "~>"
152
- - !ruby/object:Gem::Version
153
- version: '1.1'
154
- - !ruby/object:Gem::Dependency
155
- name: minitest-rg
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - "~>"
159
- - !ruby/object:Gem::Version
160
- version: '5.2'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - "~>"
166
- - !ruby/object:Gem::Version
167
- version: '5.2'
168
- - !ruby/object:Gem::Dependency
169
- name: redcarpet
170
- requirement: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - "~>"
173
- - !ruby/object:Gem::Version
174
- version: '3.0'
175
- type: :development
176
- prerelease: false
177
- version_requirements: !ruby/object:Gem::Requirement
178
- requirements:
179
- - - "~>"
180
- - !ruby/object:Gem::Version
181
- version: '3.0'
182
- - !ruby/object:Gem::Dependency
183
- name: simplecov
184
- requirement: !ruby/object:Gem::Requirement
185
- requirements:
186
- - - "~>"
187
- - !ruby/object:Gem::Version
188
- version: '0.9'
189
- type: :development
190
- prerelease: false
191
- version_requirements: !ruby/object:Gem::Requirement
192
- requirements:
193
- - - "~>"
194
- - !ruby/object:Gem::Version
195
- version: '0.9'
196
- - !ruby/object:Gem::Dependency
197
- name: yard
198
- requirement: !ruby/object:Gem::Requirement
199
- requirements:
200
- - - "~>"
201
- - !ruby/object:Gem::Version
202
- version: '0.9'
203
- type: :development
204
- prerelease: false
205
- version_requirements: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - "~>"
208
- - !ruby/object:Gem::Version
209
- version: '0.9'
210
- - !ruby/object:Gem::Dependency
211
- name: yard-doctest
212
- requirement: !ruby/object:Gem::Requirement
213
- requirements:
214
- - - "~>"
215
- - !ruby/object:Gem::Version
216
- version: 0.1.13
217
- type: :development
218
- prerelease: false
219
- version_requirements: !ruby/object:Gem::Requirement
220
- requirements:
221
- - - "~>"
222
- - !ruby/object:Gem::Version
223
- version: 0.1.13
224
70
  description: google-cloud-pubsub is the official library for Google Cloud Pub/Sub.
225
71
  email:
226
72
  - mike@blowmage.com
@@ -284,14 +130,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
130
  requirements:
285
131
  - - ">="
286
132
  - !ruby/object:Gem::Version
287
- version: '2.5'
133
+ version: '2.7'
288
134
  required_rubygems_version: !ruby/object:Gem::Requirement
289
135
  requirements:
290
136
  - - ">="
291
137
  - !ruby/object:Gem::Version
292
138
  version: '0'
293
139
  requirements: []
294
- rubygems_version: 3.5.3
140
+ rubygems_version: 3.5.6
295
141
  signing_key:
296
142
  specification_version: 4
297
143
  summary: API Client library for Google Cloud Pub/Sub