aws-sdk-sqs 1.50.0 → 1.54.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -1
- data/VERSION +1 -1
- data/lib/aws-sdk-sqs/client.rb +261 -151
- data/lib/aws-sdk-sqs/client_api.rb +219 -51
- data/lib/aws-sdk-sqs/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sqs/endpoint_provider.rb +57 -0
- data/lib/aws-sdk-sqs/endpoints.rb +295 -0
- data/lib/aws-sdk-sqs/errors.rb +246 -0
- data/lib/aws-sdk-sqs/plugins/endpoints.rb +108 -0
- data/lib/aws-sdk-sqs/plugins/queue_urls.rb +20 -18
- data/lib/aws-sdk-sqs/queue.rb +60 -26
- data/lib/aws-sdk-sqs/queue_poller.rb +6 -0
- data/lib/aws-sdk-sqs/resource.rb +61 -27
- data/lib/aws-sdk-sqs/types.rb +449 -391
- data/lib/aws-sdk-sqs.rb +5 -1
- metadata +8 -4
data/lib/aws-sdk-sqs/errors.rb
CHANGED
@@ -30,10 +30,20 @@ module Aws::SQS
|
|
30
30
|
# * {BatchEntryIdsNotDistinct}
|
31
31
|
# * {BatchRequestTooLong}
|
32
32
|
# * {EmptyBatchRequest}
|
33
|
+
# * {InvalidAddress}
|
33
34
|
# * {InvalidAttributeName}
|
35
|
+
# * {InvalidAttributeValue}
|
34
36
|
# * {InvalidBatchEntryId}
|
35
37
|
# * {InvalidIdFormat}
|
36
38
|
# * {InvalidMessageContents}
|
39
|
+
# * {InvalidSecurity}
|
40
|
+
# * {KmsAccessDenied}
|
41
|
+
# * {KmsDisabled}
|
42
|
+
# * {KmsInvalidKeyUsage}
|
43
|
+
# * {KmsInvalidState}
|
44
|
+
# * {KmsNotFound}
|
45
|
+
# * {KmsOptInRequired}
|
46
|
+
# * {KmsThrottled}
|
37
47
|
# * {MessageNotInflight}
|
38
48
|
# * {OverLimit}
|
39
49
|
# * {PurgeQueueInProgress}
|
@@ -41,6 +51,7 @@ module Aws::SQS
|
|
41
51
|
# * {QueueDoesNotExist}
|
42
52
|
# * {QueueNameExists}
|
43
53
|
# * {ReceiptHandleIsInvalid}
|
54
|
+
# * {RequestThrottled}
|
44
55
|
# * {TooManyEntriesInBatchRequest}
|
45
56
|
# * {UnsupportedOperation}
|
46
57
|
#
|
@@ -58,6 +69,11 @@ module Aws::SQS
|
|
58
69
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
59
70
|
super(context, message, data)
|
60
71
|
end
|
72
|
+
|
73
|
+
# @return [String]
|
74
|
+
def message
|
75
|
+
@message || @data[:message]
|
76
|
+
end
|
61
77
|
end
|
62
78
|
|
63
79
|
class BatchRequestTooLong < ServiceError
|
@@ -68,6 +84,11 @@ module Aws::SQS
|
|
68
84
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
69
85
|
super(context, message, data)
|
70
86
|
end
|
87
|
+
|
88
|
+
# @return [String]
|
89
|
+
def message
|
90
|
+
@message || @data[:message]
|
91
|
+
end
|
71
92
|
end
|
72
93
|
|
73
94
|
class EmptyBatchRequest < ServiceError
|
@@ -78,6 +99,26 @@ module Aws::SQS
|
|
78
99
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
79
100
|
super(context, message, data)
|
80
101
|
end
|
102
|
+
|
103
|
+
# @return [String]
|
104
|
+
def message
|
105
|
+
@message || @data[:message]
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
class InvalidAddress < ServiceError
|
110
|
+
|
111
|
+
# @param [Seahorse::Client::RequestContext] context
|
112
|
+
# @param [String] message
|
113
|
+
# @param [Aws::SQS::Types::InvalidAddress] data
|
114
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
115
|
+
super(context, message, data)
|
116
|
+
end
|
117
|
+
|
118
|
+
# @return [String]
|
119
|
+
def message
|
120
|
+
@message || @data[:message]
|
121
|
+
end
|
81
122
|
end
|
82
123
|
|
83
124
|
class InvalidAttributeName < ServiceError
|
@@ -88,6 +129,26 @@ module Aws::SQS
|
|
88
129
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
89
130
|
super(context, message, data)
|
90
131
|
end
|
132
|
+
|
133
|
+
# @return [String]
|
134
|
+
def message
|
135
|
+
@message || @data[:message]
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
class InvalidAttributeValue < ServiceError
|
140
|
+
|
141
|
+
# @param [Seahorse::Client::RequestContext] context
|
142
|
+
# @param [String] message
|
143
|
+
# @param [Aws::SQS::Types::InvalidAttributeValue] data
|
144
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
145
|
+
super(context, message, data)
|
146
|
+
end
|
147
|
+
|
148
|
+
# @return [String]
|
149
|
+
def message
|
150
|
+
@message || @data[:message]
|
151
|
+
end
|
91
152
|
end
|
92
153
|
|
93
154
|
class InvalidBatchEntryId < ServiceError
|
@@ -98,6 +159,11 @@ module Aws::SQS
|
|
98
159
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
99
160
|
super(context, message, data)
|
100
161
|
end
|
162
|
+
|
163
|
+
# @return [String]
|
164
|
+
def message
|
165
|
+
@message || @data[:message]
|
166
|
+
end
|
101
167
|
end
|
102
168
|
|
103
169
|
class InvalidIdFormat < ServiceError
|
@@ -118,6 +184,131 @@ module Aws::SQS
|
|
118
184
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
119
185
|
super(context, message, data)
|
120
186
|
end
|
187
|
+
|
188
|
+
# @return [String]
|
189
|
+
def message
|
190
|
+
@message || @data[:message]
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
class InvalidSecurity < ServiceError
|
195
|
+
|
196
|
+
# @param [Seahorse::Client::RequestContext] context
|
197
|
+
# @param [String] message
|
198
|
+
# @param [Aws::SQS::Types::InvalidSecurity] data
|
199
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
200
|
+
super(context, message, data)
|
201
|
+
end
|
202
|
+
|
203
|
+
# @return [String]
|
204
|
+
def message
|
205
|
+
@message || @data[:message]
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
class KmsAccessDenied < ServiceError
|
210
|
+
|
211
|
+
# @param [Seahorse::Client::RequestContext] context
|
212
|
+
# @param [String] message
|
213
|
+
# @param [Aws::SQS::Types::KmsAccessDenied] data
|
214
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
215
|
+
super(context, message, data)
|
216
|
+
end
|
217
|
+
|
218
|
+
# @return [String]
|
219
|
+
def message
|
220
|
+
@message || @data[:message]
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
class KmsDisabled < ServiceError
|
225
|
+
|
226
|
+
# @param [Seahorse::Client::RequestContext] context
|
227
|
+
# @param [String] message
|
228
|
+
# @param [Aws::SQS::Types::KmsDisabled] data
|
229
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
230
|
+
super(context, message, data)
|
231
|
+
end
|
232
|
+
|
233
|
+
# @return [String]
|
234
|
+
def message
|
235
|
+
@message || @data[:message]
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
class KmsInvalidKeyUsage < ServiceError
|
240
|
+
|
241
|
+
# @param [Seahorse::Client::RequestContext] context
|
242
|
+
# @param [String] message
|
243
|
+
# @param [Aws::SQS::Types::KmsInvalidKeyUsage] data
|
244
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
245
|
+
super(context, message, data)
|
246
|
+
end
|
247
|
+
|
248
|
+
# @return [String]
|
249
|
+
def message
|
250
|
+
@message || @data[:message]
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
class KmsInvalidState < ServiceError
|
255
|
+
|
256
|
+
# @param [Seahorse::Client::RequestContext] context
|
257
|
+
# @param [String] message
|
258
|
+
# @param [Aws::SQS::Types::KmsInvalidState] data
|
259
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
260
|
+
super(context, message, data)
|
261
|
+
end
|
262
|
+
|
263
|
+
# @return [String]
|
264
|
+
def message
|
265
|
+
@message || @data[:message]
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
class KmsNotFound < ServiceError
|
270
|
+
|
271
|
+
# @param [Seahorse::Client::RequestContext] context
|
272
|
+
# @param [String] message
|
273
|
+
# @param [Aws::SQS::Types::KmsNotFound] data
|
274
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
275
|
+
super(context, message, data)
|
276
|
+
end
|
277
|
+
|
278
|
+
# @return [String]
|
279
|
+
def message
|
280
|
+
@message || @data[:message]
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
class KmsOptInRequired < ServiceError
|
285
|
+
|
286
|
+
# @param [Seahorse::Client::RequestContext] context
|
287
|
+
# @param [String] message
|
288
|
+
# @param [Aws::SQS::Types::KmsOptInRequired] data
|
289
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
290
|
+
super(context, message, data)
|
291
|
+
end
|
292
|
+
|
293
|
+
# @return [String]
|
294
|
+
def message
|
295
|
+
@message || @data[:message]
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
class KmsThrottled < ServiceError
|
300
|
+
|
301
|
+
# @param [Seahorse::Client::RequestContext] context
|
302
|
+
# @param [String] message
|
303
|
+
# @param [Aws::SQS::Types::KmsThrottled] data
|
304
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
305
|
+
super(context, message, data)
|
306
|
+
end
|
307
|
+
|
308
|
+
# @return [String]
|
309
|
+
def message
|
310
|
+
@message || @data[:message]
|
311
|
+
end
|
121
312
|
end
|
122
313
|
|
123
314
|
class MessageNotInflight < ServiceError
|
@@ -138,6 +329,11 @@ module Aws::SQS
|
|
138
329
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
139
330
|
super(context, message, data)
|
140
331
|
end
|
332
|
+
|
333
|
+
# @return [String]
|
334
|
+
def message
|
335
|
+
@message || @data[:message]
|
336
|
+
end
|
141
337
|
end
|
142
338
|
|
143
339
|
class PurgeQueueInProgress < ServiceError
|
@@ -148,6 +344,11 @@ module Aws::SQS
|
|
148
344
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
149
345
|
super(context, message, data)
|
150
346
|
end
|
347
|
+
|
348
|
+
# @return [String]
|
349
|
+
def message
|
350
|
+
@message || @data[:message]
|
351
|
+
end
|
151
352
|
end
|
152
353
|
|
153
354
|
class QueueDeletedRecently < ServiceError
|
@@ -158,6 +359,11 @@ module Aws::SQS
|
|
158
359
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
159
360
|
super(context, message, data)
|
160
361
|
end
|
362
|
+
|
363
|
+
# @return [String]
|
364
|
+
def message
|
365
|
+
@message || @data[:message]
|
366
|
+
end
|
161
367
|
end
|
162
368
|
|
163
369
|
class QueueDoesNotExist < ServiceError
|
@@ -168,6 +374,11 @@ module Aws::SQS
|
|
168
374
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
169
375
|
super(context, message, data)
|
170
376
|
end
|
377
|
+
|
378
|
+
# @return [String]
|
379
|
+
def message
|
380
|
+
@message || @data[:message]
|
381
|
+
end
|
171
382
|
end
|
172
383
|
|
173
384
|
class QueueNameExists < ServiceError
|
@@ -178,6 +389,11 @@ module Aws::SQS
|
|
178
389
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
179
390
|
super(context, message, data)
|
180
391
|
end
|
392
|
+
|
393
|
+
# @return [String]
|
394
|
+
def message
|
395
|
+
@message || @data[:message]
|
396
|
+
end
|
181
397
|
end
|
182
398
|
|
183
399
|
class ReceiptHandleIsInvalid < ServiceError
|
@@ -188,6 +404,26 @@ module Aws::SQS
|
|
188
404
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
189
405
|
super(context, message, data)
|
190
406
|
end
|
407
|
+
|
408
|
+
# @return [String]
|
409
|
+
def message
|
410
|
+
@message || @data[:message]
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
414
|
+
class RequestThrottled < ServiceError
|
415
|
+
|
416
|
+
# @param [Seahorse::Client::RequestContext] context
|
417
|
+
# @param [String] message
|
418
|
+
# @param [Aws::SQS::Types::RequestThrottled] data
|
419
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
420
|
+
super(context, message, data)
|
421
|
+
end
|
422
|
+
|
423
|
+
# @return [String]
|
424
|
+
def message
|
425
|
+
@message || @data[:message]
|
426
|
+
end
|
191
427
|
end
|
192
428
|
|
193
429
|
class TooManyEntriesInBatchRequest < ServiceError
|
@@ -198,6 +434,11 @@ module Aws::SQS
|
|
198
434
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
199
435
|
super(context, message, data)
|
200
436
|
end
|
437
|
+
|
438
|
+
# @return [String]
|
439
|
+
def message
|
440
|
+
@message || @data[:message]
|
441
|
+
end
|
201
442
|
end
|
202
443
|
|
203
444
|
class UnsupportedOperation < ServiceError
|
@@ -208,6 +449,11 @@ module Aws::SQS
|
|
208
449
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
209
450
|
super(context, message, data)
|
210
451
|
end
|
452
|
+
|
453
|
+
# @return [String]
|
454
|
+
def message
|
455
|
+
@message || @data[:message]
|
456
|
+
end
|
211
457
|
end
|
212
458
|
|
213
459
|
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
|
11
|
+
module Aws::SQS
|
12
|
+
module Plugins
|
13
|
+
class Endpoints < Seahorse::Client::Plugin
|
14
|
+
option(
|
15
|
+
:endpoint_provider,
|
16
|
+
doc_type: 'Aws::SQS::EndpointProvider',
|
17
|
+
docstring: 'The endpoint provider used to resolve endpoints. Any '\
|
18
|
+
'object that responds to `#resolve_endpoint(parameters)` '\
|
19
|
+
'where `parameters` is a Struct similar to '\
|
20
|
+
'`Aws::SQS::EndpointParameters`'
|
21
|
+
) do |cfg|
|
22
|
+
Aws::SQS::EndpointProvider.new
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
class Handler < Seahorse::Client::Handler
|
27
|
+
def call(context)
|
28
|
+
# If endpoint was discovered, do not resolve or apply the endpoint.
|
29
|
+
unless context[:discovered_endpoint]
|
30
|
+
params = parameters_for_operation(context)
|
31
|
+
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
32
|
+
|
33
|
+
context.http_request.endpoint = endpoint.url
|
34
|
+
apply_endpoint_headers(context, endpoint.headers)
|
35
|
+
end
|
36
|
+
|
37
|
+
context[:endpoint_params] = params
|
38
|
+
context[:auth_scheme] =
|
39
|
+
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
40
|
+
|
41
|
+
@handler.call(context)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def apply_endpoint_headers(context, headers)
|
47
|
+
headers.each do |key, values|
|
48
|
+
value = values
|
49
|
+
.compact
|
50
|
+
.map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
|
51
|
+
.join(',')
|
52
|
+
|
53
|
+
context.http_request.headers[key] = value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def parameters_for_operation(context)
|
58
|
+
case context.operation_name
|
59
|
+
when :add_permission
|
60
|
+
Aws::SQS::Endpoints::AddPermission.build(context)
|
61
|
+
when :change_message_visibility
|
62
|
+
Aws::SQS::Endpoints::ChangeMessageVisibility.build(context)
|
63
|
+
when :change_message_visibility_batch
|
64
|
+
Aws::SQS::Endpoints::ChangeMessageVisibilityBatch.build(context)
|
65
|
+
when :create_queue
|
66
|
+
Aws::SQS::Endpoints::CreateQueue.build(context)
|
67
|
+
when :delete_message
|
68
|
+
Aws::SQS::Endpoints::DeleteMessage.build(context)
|
69
|
+
when :delete_message_batch
|
70
|
+
Aws::SQS::Endpoints::DeleteMessageBatch.build(context)
|
71
|
+
when :delete_queue
|
72
|
+
Aws::SQS::Endpoints::DeleteQueue.build(context)
|
73
|
+
when :get_queue_attributes
|
74
|
+
Aws::SQS::Endpoints::GetQueueAttributes.build(context)
|
75
|
+
when :get_queue_url
|
76
|
+
Aws::SQS::Endpoints::GetQueueUrl.build(context)
|
77
|
+
when :list_dead_letter_source_queues
|
78
|
+
Aws::SQS::Endpoints::ListDeadLetterSourceQueues.build(context)
|
79
|
+
when :list_queue_tags
|
80
|
+
Aws::SQS::Endpoints::ListQueueTags.build(context)
|
81
|
+
when :list_queues
|
82
|
+
Aws::SQS::Endpoints::ListQueues.build(context)
|
83
|
+
when :purge_queue
|
84
|
+
Aws::SQS::Endpoints::PurgeQueue.build(context)
|
85
|
+
when :receive_message
|
86
|
+
Aws::SQS::Endpoints::ReceiveMessage.build(context)
|
87
|
+
when :remove_permission
|
88
|
+
Aws::SQS::Endpoints::RemovePermission.build(context)
|
89
|
+
when :send_message
|
90
|
+
Aws::SQS::Endpoints::SendMessage.build(context)
|
91
|
+
when :send_message_batch
|
92
|
+
Aws::SQS::Endpoints::SendMessageBatch.build(context)
|
93
|
+
when :set_queue_attributes
|
94
|
+
Aws::SQS::Endpoints::SetQueueAttributes.build(context)
|
95
|
+
when :tag_queue
|
96
|
+
Aws::SQS::Endpoints::TagQueue.build(context)
|
97
|
+
when :untag_queue
|
98
|
+
Aws::SQS::Endpoints::UntagQueue.build(context)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def add_handlers(handlers, _config)
|
104
|
+
handlers.add(Handler, step: :build, priority: 75)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -5,11 +5,10 @@ module Aws
|
|
5
5
|
module Plugins
|
6
6
|
# @api private
|
7
7
|
class QueueUrls < Seahorse::Client::Plugin
|
8
|
-
|
8
|
+
# Extract region from a provided queue_url
|
9
9
|
class Handler < Seahorse::Client::Handler
|
10
|
-
|
11
10
|
def call(context)
|
12
|
-
if queue_url = context.params[:queue_url]
|
11
|
+
if (queue_url = context.params[:queue_url])
|
13
12
|
update_endpoint(context, queue_url)
|
14
13
|
update_region(context, queue_url)
|
15
14
|
end
|
@@ -21,28 +20,31 @@ module Aws
|
|
21
20
|
end
|
22
21
|
|
23
22
|
# If the region in the queue url is not the configured
|
24
|
-
# region, then we will modify
|
25
|
-
# a sigv4 signer for the proper region.
|
23
|
+
# region, then we will modify signing to use it
|
26
24
|
def update_region(context, queue_url)
|
27
|
-
if queue_region = parse_region(queue_url)
|
28
|
-
|
29
|
-
|
30
|
-
config.region = queue_region
|
31
|
-
config.sigv4_region = queue_region
|
32
|
-
config.sigv4_signer = Aws::Plugins::SignatureV4.build_signer(config)
|
33
|
-
context.config = config
|
34
|
-
end
|
25
|
+
if (queue_region = parse_region(queue_url)) &&
|
26
|
+
queue_region != context.config.region
|
27
|
+
context[:auth_scheme]['signingRegion'] = queue_region
|
35
28
|
end
|
36
29
|
end
|
37
30
|
|
38
31
|
private
|
39
32
|
|
40
|
-
# take the first component after service
|
41
|
-
#
|
42
|
-
#
|
33
|
+
# take the first component after the SQS service component
|
34
|
+
# Will return us-east-1 for:
|
35
|
+
# https://sqs.us-east-1.amazonaws.com/1234567890/demo
|
36
|
+
# https://vpce-x-y.sqs.us-east-1.vpce.amazonaws.com/1234567890/demo
|
37
|
+
# Will not return for:
|
38
|
+
# https://localstack-sqs.example.dev/queue/example
|
43
39
|
def parse_region(url)
|
44
|
-
parts = url.split('
|
45
|
-
parts
|
40
|
+
parts = URI.parse(url).host.split('.')
|
41
|
+
parts.each_with_index do |part, index|
|
42
|
+
if part == 'sqs'
|
43
|
+
# assume region is the part right after the 'sqs' part
|
44
|
+
return parts[index + 1]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
nil # no region found
|
46
48
|
end
|
47
49
|
|
48
50
|
end
|
data/lib/aws-sdk-sqs/queue.rb
CHANGED
@@ -218,7 +218,7 @@ module Aws::SQS
|
|
218
218
|
#
|
219
219
|
# * `SenderId`
|
220
220
|
#
|
221
|
-
# * For
|
221
|
+
# * For a user, returns the user ID, for example
|
222
222
|
# `ABCDEFGHI1JKLMNOPQ23R`.
|
223
223
|
#
|
224
224
|
# * For an IAM role, returns the IAM role ID, for example
|
@@ -229,7 +229,7 @@ module Aws::SQS
|
|
229
229
|
#
|
230
230
|
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
231
231
|
# SQS owned encryption keys. Only one server-side encryption option is
|
232
|
-
# supported per queue (
|
232
|
+
# supported per queue (for example, [SSE-KMS][2] or [SSE-SQS][3]).
|
233
233
|
#
|
234
234
|
# * `MessageDeduplicationId` – Returns the value provided by the
|
235
235
|
# producer that calls the ` SendMessage ` action.
|
@@ -416,7 +416,7 @@ module Aws::SQS
|
|
416
416
|
# @param [Hash] options ({})
|
417
417
|
# @option options [required, String] :message_body
|
418
418
|
# The message to send. The minimum size is one character. The maximum
|
419
|
-
# size is 256
|
419
|
+
# size is 256 KiB.
|
420
420
|
#
|
421
421
|
# A message can include only XML, JSON, and unformatted text. The
|
422
422
|
# following Unicode characters are allowed:
|
@@ -626,7 +626,13 @@ module Aws::SQS
|
|
626
626
|
# * `MessageRetentionPeriod` – The length of time, in seconds, for which
|
627
627
|
# Amazon SQS retains a message. Valid values: An integer representing
|
628
628
|
# seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600
|
629
|
-
# (4 days).
|
629
|
+
# (4 days). When you change a queue's attributes, the change can take
|
630
|
+
# up to 60 seconds for most of the attributes to propagate throughout
|
631
|
+
# the Amazon SQS system. Changes made to the `MessageRetentionPeriod`
|
632
|
+
# attribute can take up to 15 minutes and will impact existing
|
633
|
+
# messages in the queue potentially causing them to be expired and
|
634
|
+
# deleted if the `MessageRetentionPeriod` is reduced below the age of
|
635
|
+
# existing messages.
|
630
636
|
#
|
631
637
|
# * `Policy` – The queue's policy. A valid Amazon Web Services policy.
|
632
638
|
# For more information about policy structure, see [Overview of Amazon
|
@@ -637,33 +643,61 @@ module Aws::SQS
|
|
637
643
|
# for which a ` ReceiveMessage ` action waits for a message to arrive.
|
638
644
|
# Valid values: An integer from 0 to 20 (seconds). Default: 0.
|
639
645
|
#
|
646
|
+
# * `VisibilityTimeout` – The visibility timeout for the queue, in
|
647
|
+
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
648
|
+
# Default: 30. For more information about the visibility timeout, see
|
649
|
+
# [Visibility Timeout][2] in the *Amazon SQS Developer Guide*.
|
650
|
+
#
|
651
|
+
# The following attributes apply only to [dead-letter queues:][3]
|
652
|
+
#
|
640
653
|
# * `RedrivePolicy` – The string that includes the parameters for the
|
641
654
|
# dead-letter queue functionality of the source queue as a JSON
|
642
|
-
# object.
|
643
|
-
# dead-letter queues, see [Using Amazon SQS Dead-Letter Queues][2] in
|
644
|
-
# the *Amazon SQS Developer Guide*.
|
655
|
+
# object. The parameters are as follows:
|
645
656
|
#
|
646
657
|
# * `deadLetterTargetArn` – The Amazon Resource Name (ARN) of the
|
647
658
|
# dead-letter queue to which Amazon SQS moves messages after the
|
648
659
|
# value of `maxReceiveCount` is exceeded.
|
649
660
|
#
|
650
661
|
# * `maxReceiveCount` – The number of times a message is delivered to
|
651
|
-
# the source queue before being moved to the dead-letter queue.
|
652
|
-
# the `ReceiveCount` for a message exceeds the
|
653
|
-
# a queue, Amazon SQS moves the message to the
|
654
|
-
#
|
655
|
-
#
|
656
|
-
#
|
657
|
-
#
|
662
|
+
# the source queue before being moved to the dead-letter queue.
|
663
|
+
# Default: 10. When the `ReceiveCount` for a message exceeds the
|
664
|
+
# `maxReceiveCount` for a queue, Amazon SQS moves the message to the
|
665
|
+
# dead-letter-queue.
|
666
|
+
#
|
667
|
+
# * `RedriveAllowPolicy` – The string that includes the parameters for
|
668
|
+
# the permissions for the dead-letter queue redrive permission and
|
669
|
+
# which source queues can specify dead-letter queues as a JSON object.
|
670
|
+
# The parameters are as follows:
|
671
|
+
#
|
672
|
+
# * `redrivePermission` – The permission type that defines which
|
673
|
+
# source queues can specify the current queue as the dead-letter
|
674
|
+
# queue. Valid values are:
|
675
|
+
#
|
676
|
+
# * `allowAll` – (Default) Any source queues in this Amazon Web
|
677
|
+
# Services account in the same Region can specify this queue as
|
678
|
+
# the dead-letter queue.
|
679
|
+
#
|
680
|
+
# * `denyAll` – No source queues can specify this queue as the
|
681
|
+
# dead-letter queue.
|
682
|
+
#
|
683
|
+
# * `byQueue` – Only queues specified by the `sourceQueueArns`
|
684
|
+
# parameter can specify this queue as the dead-letter queue.
|
685
|
+
#
|
686
|
+
# * `sourceQueueArns` – The Amazon Resource Names (ARN)s of the source
|
687
|
+
# queues that can specify this queue as the dead-letter queue and
|
688
|
+
# redrive messages. You can specify this parameter only when the
|
689
|
+
# `redrivePermission` parameter is set to `byQueue`. You can specify
|
690
|
+
# up to 10 source queue ARNs. To allow more than 10 source queues to
|
691
|
+
# specify dead-letter queues, set the `redrivePermission` parameter
|
692
|
+
# to `allowAll`.
|
693
|
+
#
|
694
|
+
# <note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
|
695
|
+
# Similarly, the dead-letter queue of a standard queue must also be a
|
696
|
+
# standard queue.
|
658
697
|
#
|
659
|
-
#
|
660
|
-
#
|
661
|
-
# * `VisibilityTimeout` – The visibility timeout for the queue, in
|
662
|
-
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
663
|
-
# Default: 30. For more information about the visibility timeout, see
|
664
|
-
# [Visibility Timeout][3] in the *Amazon SQS Developer Guide*.
|
698
|
+
# </note>
|
665
699
|
#
|
666
|
-
# The following attributes apply only to [server-side-encryption][4]
|
700
|
+
# The following attributes apply only to [server-side-encryption][4]:
|
667
701
|
#
|
668
702
|
# * `KmsMasterKeyId` – The ID of an Amazon Web Services managed customer
|
669
703
|
# master key (CMK) for Amazon SQS or a custom CMK. For more
|
@@ -683,10 +717,10 @@ module Aws::SQS
|
|
683
717
|
#
|
684
718
|
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
685
719
|
# SQS owned encryption keys. Only one server-side encryption option is
|
686
|
-
# supported per queue (
|
720
|
+
# supported per queue (for example, [SSE-KMS][9] or [SSE-SQS][10]).
|
687
721
|
#
|
688
722
|
# The following attribute applies only to [FIFO (first-in-first-out)
|
689
|
-
# queues][11]
|
723
|
+
# queues][11]:
|
690
724
|
#
|
691
725
|
# * `ContentBasedDeduplication` – Enables content-based deduplication.
|
692
726
|
# For more information, see [Exactly-once processing][12] in the
|
@@ -721,7 +755,7 @@ module Aws::SQS
|
|
721
755
|
# duplicates and only one copy of the message is delivered.
|
722
756
|
#
|
723
757
|
# The following attributes apply only to [high throughput for FIFO
|
724
|
-
# queues][13]
|
758
|
+
# queues][13]:
|
725
759
|
#
|
726
760
|
# * `DeduplicationScope` – Specifies whether message deduplication
|
727
761
|
# occurs at the message group or queue level. Valid values are
|
@@ -749,8 +783,8 @@ module Aws::SQS
|
|
749
783
|
#
|
750
784
|
#
|
751
785
|
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
|
752
|
-
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-
|
753
|
-
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-
|
786
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
787
|
+
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
|
754
788
|
# [4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
|
755
789
|
# [5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
|
756
790
|
# [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
@@ -498,6 +498,12 @@ module Aws
|
|
498
498
|
raise ArgumentError, "invalid option #{opt_name.inspect}"
|
499
499
|
end
|
500
500
|
end
|
501
|
+
|
502
|
+
max_number_of_messages = @request_params[:max_number_of_messages]
|
503
|
+
unless max_number_of_messages.is_a?(Integer) && max_number_of_messages.positive?
|
504
|
+
raise ArgumentError, ':max_number_of_messages must be a positive integer'
|
505
|
+
end
|
506
|
+
|
501
507
|
@request_params.freeze
|
502
508
|
freeze
|
503
509
|
end
|