aws-sdk-sqs 1.51.1 → 1.58.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 +42 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-sqs/client.rb +395 -152
- data/lib/aws-sdk-sqs/client_api.rb +76 -0
- 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 +338 -0
- data/lib/aws-sdk-sqs/errors.rb +11 -0
- data/lib/aws-sdk-sqs/message.rb +9 -3
- data/lib/aws-sdk-sqs/plugins/endpoints.rb +114 -0
- data/lib/aws-sdk-sqs/plugins/queue_urls.rb +4 -10
- data/lib/aws-sdk-sqs/queue.rb +98 -40
- data/lib/aws-sdk-sqs/queue_poller.rb +6 -0
- data/lib/aws-sdk-sqs/resource.rb +70 -30
- data/lib/aws-sdk-sqs/types.rb +349 -379
- data/lib/aws-sdk-sqs.rb +5 -1
- metadata +8 -4
@@ -0,0 +1,114 @@
|
|
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 :cancel_message_move_task
|
62
|
+
Aws::SQS::Endpoints::CancelMessageMoveTask.build(context)
|
63
|
+
when :change_message_visibility
|
64
|
+
Aws::SQS::Endpoints::ChangeMessageVisibility.build(context)
|
65
|
+
when :change_message_visibility_batch
|
66
|
+
Aws::SQS::Endpoints::ChangeMessageVisibilityBatch.build(context)
|
67
|
+
when :create_queue
|
68
|
+
Aws::SQS::Endpoints::CreateQueue.build(context)
|
69
|
+
when :delete_message
|
70
|
+
Aws::SQS::Endpoints::DeleteMessage.build(context)
|
71
|
+
when :delete_message_batch
|
72
|
+
Aws::SQS::Endpoints::DeleteMessageBatch.build(context)
|
73
|
+
when :delete_queue
|
74
|
+
Aws::SQS::Endpoints::DeleteQueue.build(context)
|
75
|
+
when :get_queue_attributes
|
76
|
+
Aws::SQS::Endpoints::GetQueueAttributes.build(context)
|
77
|
+
when :get_queue_url
|
78
|
+
Aws::SQS::Endpoints::GetQueueUrl.build(context)
|
79
|
+
when :list_dead_letter_source_queues
|
80
|
+
Aws::SQS::Endpoints::ListDeadLetterSourceQueues.build(context)
|
81
|
+
when :list_message_move_tasks
|
82
|
+
Aws::SQS::Endpoints::ListMessageMoveTasks.build(context)
|
83
|
+
when :list_queue_tags
|
84
|
+
Aws::SQS::Endpoints::ListQueueTags.build(context)
|
85
|
+
when :list_queues
|
86
|
+
Aws::SQS::Endpoints::ListQueues.build(context)
|
87
|
+
when :purge_queue
|
88
|
+
Aws::SQS::Endpoints::PurgeQueue.build(context)
|
89
|
+
when :receive_message
|
90
|
+
Aws::SQS::Endpoints::ReceiveMessage.build(context)
|
91
|
+
when :remove_permission
|
92
|
+
Aws::SQS::Endpoints::RemovePermission.build(context)
|
93
|
+
when :send_message
|
94
|
+
Aws::SQS::Endpoints::SendMessage.build(context)
|
95
|
+
when :send_message_batch
|
96
|
+
Aws::SQS::Endpoints::SendMessageBatch.build(context)
|
97
|
+
when :set_queue_attributes
|
98
|
+
Aws::SQS::Endpoints::SetQueueAttributes.build(context)
|
99
|
+
when :start_message_move_task
|
100
|
+
Aws::SQS::Endpoints::StartMessageMoveTask.build(context)
|
101
|
+
when :tag_queue
|
102
|
+
Aws::SQS::Endpoints::TagQueue.build(context)
|
103
|
+
when :untag_queue
|
104
|
+
Aws::SQS::Endpoints::UntagQueue.build(context)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def add_handlers(handlers, _config)
|
110
|
+
handlers.add(Handler, step: :build, priority: 75)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -20,17 +20,11 @@ module Aws
|
|
20
20
|
end
|
21
21
|
|
22
22
|
# If the region in the queue url is not the configured
|
23
|
-
# region, then we will modify
|
24
|
-
# a sigv4 signer for the proper region.
|
23
|
+
# region, then we will modify signing to use it
|
25
24
|
def update_region(context, queue_url)
|
26
|
-
if (queue_region = parse_region(queue_url))
|
27
|
-
|
28
|
-
|
29
|
-
config.region = queue_region
|
30
|
-
config.sigv4_region = queue_region
|
31
|
-
config.sigv4_signer = Aws::Plugins::SignatureV4.build_signer(config)
|
32
|
-
context.config = config
|
33
|
-
end
|
25
|
+
if (queue_region = parse_region(queue_url)) &&
|
26
|
+
queue_region != context.config.region
|
27
|
+
context[:auth_scheme]['signingRegion'] = queue_region
|
34
28
|
end
|
35
29
|
end
|
36
30
|
|
data/lib/aws-sdk-sqs/queue.rb
CHANGED
@@ -54,10 +54,12 @@ module Aws::SQS
|
|
54
54
|
#
|
55
55
|
# @return [self]
|
56
56
|
def load
|
57
|
-
resp =
|
57
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
58
|
+
@client.get_queue_attributes(
|
58
59
|
queue_url: @url,
|
59
60
|
attribute_names: ["All"]
|
60
61
|
)
|
62
|
+
end
|
61
63
|
@data = resp.data
|
62
64
|
self
|
63
65
|
end
|
@@ -123,7 +125,9 @@ module Aws::SQS
|
|
123
125
|
# @return [EmptyStructure]
|
124
126
|
def add_permission(options = {})
|
125
127
|
options = options.merge(queue_url: @url)
|
126
|
-
resp =
|
128
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
129
|
+
@client.add_permission(options)
|
130
|
+
end
|
127
131
|
resp.data
|
128
132
|
end
|
129
133
|
|
@@ -140,12 +144,14 @@ module Aws::SQS
|
|
140
144
|
# })
|
141
145
|
# @param [Hash] options ({})
|
142
146
|
# @option options [required, Array<Types::ChangeMessageVisibilityBatchRequestEntry>] :entries
|
143
|
-
#
|
147
|
+
# Lists the receipt handles of the messages for which the visibility
|
144
148
|
# timeout must be changed.
|
145
149
|
# @return [Types::ChangeMessageVisibilityBatchResult]
|
146
150
|
def change_message_visibility_batch(options = {})
|
147
151
|
options = options.merge(queue_url: @url)
|
148
|
-
resp =
|
152
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
153
|
+
@client.change_message_visibility_batch(options)
|
154
|
+
end
|
149
155
|
resp.data
|
150
156
|
end
|
151
157
|
|
@@ -156,7 +162,9 @@ module Aws::SQS
|
|
156
162
|
# @return [EmptyStructure]
|
157
163
|
def delete(options = {})
|
158
164
|
options = options.merge(queue_url: @url)
|
159
|
-
resp =
|
165
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
166
|
+
@client.delete_queue(options)
|
167
|
+
end
|
160
168
|
resp.data
|
161
169
|
end
|
162
170
|
|
@@ -172,11 +180,13 @@ module Aws::SQS
|
|
172
180
|
# })
|
173
181
|
# @param [Hash] options ({})
|
174
182
|
# @option options [required, Array<Types::DeleteMessageBatchRequestEntry>] :entries
|
175
|
-
#
|
183
|
+
# Lists the receipt handles for the messages to be deleted.
|
176
184
|
# @return [Types::DeleteMessageBatchResult]
|
177
185
|
def delete_messages(options = {})
|
178
186
|
options = options.merge(queue_url: @url)
|
179
|
-
resp =
|
187
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
188
|
+
@client.delete_message_batch(options)
|
189
|
+
end
|
180
190
|
resp.data
|
181
191
|
end
|
182
192
|
|
@@ -187,7 +197,9 @@ module Aws::SQS
|
|
187
197
|
# @return [EmptyStructure]
|
188
198
|
def purge(options = {})
|
189
199
|
options = options.merge(queue_url: @url)
|
190
|
-
resp =
|
200
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
201
|
+
@client.purge_queue(options)
|
202
|
+
end
|
191
203
|
resp.data
|
192
204
|
end
|
193
205
|
|
@@ -218,7 +230,7 @@ module Aws::SQS
|
|
218
230
|
#
|
219
231
|
# * `SenderId`
|
220
232
|
#
|
221
|
-
# * For
|
233
|
+
# * For a user, returns the user ID, for example
|
222
234
|
# `ABCDEFGHI1JKLMNOPQ23R`.
|
223
235
|
#
|
224
236
|
# * For an IAM role, returns the IAM role ID, for example
|
@@ -229,7 +241,7 @@ module Aws::SQS
|
|
229
241
|
#
|
230
242
|
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
231
243
|
# SQS owned encryption keys. Only one server-side encryption option is
|
232
|
-
# supported per queue (
|
244
|
+
# supported per queue (for example, [SSE-KMS][2] or [SSE-SQS][3]).
|
233
245
|
#
|
234
246
|
# * `MessageDeduplicationId` – Returns the value provided by the
|
235
247
|
# producer that calls the ` SendMessage ` action.
|
@@ -359,7 +371,9 @@ module Aws::SQS
|
|
359
371
|
def receive_messages(options = {})
|
360
372
|
batch = []
|
361
373
|
options = options.merge(queue_url: @url)
|
362
|
-
resp =
|
374
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
375
|
+
@client.receive_message(options)
|
376
|
+
end
|
363
377
|
resp.data.messages.each do |m|
|
364
378
|
batch << Message.new(
|
365
379
|
queue_url: @url,
|
@@ -383,7 +397,9 @@ module Aws::SQS
|
|
383
397
|
# @return [EmptyStructure]
|
384
398
|
def remove_permission(options = {})
|
385
399
|
options = options.merge(queue_url: @url)
|
386
|
-
resp =
|
400
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
401
|
+
@client.remove_permission(options)
|
402
|
+
end
|
387
403
|
resp.data
|
388
404
|
end
|
389
405
|
|
@@ -416,7 +432,7 @@ module Aws::SQS
|
|
416
432
|
# @param [Hash] options ({})
|
417
433
|
# @option options [required, String] :message_body
|
418
434
|
# The message to send. The minimum size is one character. The maximum
|
419
|
-
# size is 256
|
435
|
+
# size is 256 KiB.
|
420
436
|
#
|
421
437
|
# A message can include only XML, JSON, and unformatted text. The
|
422
438
|
# following Unicode characters are allowed:
|
@@ -555,7 +571,9 @@ module Aws::SQS
|
|
555
571
|
# @return [Types::SendMessageResult]
|
556
572
|
def send_message(options = {})
|
557
573
|
options = options.merge(queue_url: @url)
|
558
|
-
resp =
|
574
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
575
|
+
@client.send_message(options)
|
576
|
+
end
|
559
577
|
resp.data
|
560
578
|
end
|
561
579
|
|
@@ -596,7 +614,9 @@ module Aws::SQS
|
|
596
614
|
# @return [Types::SendMessageBatchResult]
|
597
615
|
def send_messages(options = {})
|
598
616
|
options = options.merge(queue_url: @url)
|
599
|
-
resp =
|
617
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
618
|
+
@client.send_message_batch(options)
|
619
|
+
end
|
600
620
|
resp.data
|
601
621
|
end
|
602
622
|
|
@@ -626,7 +646,13 @@ module Aws::SQS
|
|
626
646
|
# * `MessageRetentionPeriod` – The length of time, in seconds, for which
|
627
647
|
# Amazon SQS retains a message. Valid values: An integer representing
|
628
648
|
# seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600
|
629
|
-
# (4 days).
|
649
|
+
# (4 days). When you change a queue's attributes, the change can take
|
650
|
+
# up to 60 seconds for most of the attributes to propagate throughout
|
651
|
+
# the Amazon SQS system. Changes made to the `MessageRetentionPeriod`
|
652
|
+
# attribute can take up to 15 minutes and will impact existing
|
653
|
+
# messages in the queue potentially causing them to be expired and
|
654
|
+
# deleted if the `MessageRetentionPeriod` is reduced below the age of
|
655
|
+
# existing messages.
|
630
656
|
#
|
631
657
|
# * `Policy` – The queue's policy. A valid Amazon Web Services policy.
|
632
658
|
# For more information about policy structure, see [Overview of Amazon
|
@@ -637,33 +663,61 @@ module Aws::SQS
|
|
637
663
|
# for which a ` ReceiveMessage ` action waits for a message to arrive.
|
638
664
|
# Valid values: An integer from 0 to 20 (seconds). Default: 0.
|
639
665
|
#
|
666
|
+
# * `VisibilityTimeout` – The visibility timeout for the queue, in
|
667
|
+
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
668
|
+
# Default: 30. For more information about the visibility timeout, see
|
669
|
+
# [Visibility Timeout][2] in the *Amazon SQS Developer Guide*.
|
670
|
+
#
|
671
|
+
# The following attributes apply only to [dead-letter queues:][3]
|
672
|
+
#
|
640
673
|
# * `RedrivePolicy` – The string that includes the parameters for the
|
641
674
|
# 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*.
|
675
|
+
# object. The parameters are as follows:
|
645
676
|
#
|
646
677
|
# * `deadLetterTargetArn` – The Amazon Resource Name (ARN) of the
|
647
678
|
# dead-letter queue to which Amazon SQS moves messages after the
|
648
679
|
# value of `maxReceiveCount` is exceeded.
|
649
680
|
#
|
650
681
|
# * `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
|
682
|
+
# the source queue before being moved to the dead-letter queue.
|
683
|
+
# Default: 10. When the `ReceiveCount` for a message exceeds the
|
684
|
+
# `maxReceiveCount` for a queue, Amazon SQS moves the message to the
|
685
|
+
# dead-letter-queue.
|
686
|
+
#
|
687
|
+
# * `RedriveAllowPolicy` – The string that includes the parameters for
|
688
|
+
# the permissions for the dead-letter queue redrive permission and
|
689
|
+
# which source queues can specify dead-letter queues as a JSON object.
|
690
|
+
# The parameters are as follows:
|
691
|
+
#
|
692
|
+
# * `redrivePermission` – The permission type that defines which
|
693
|
+
# source queues can specify the current queue as the dead-letter
|
694
|
+
# queue. Valid values are:
|
695
|
+
#
|
696
|
+
# * `allowAll` – (Default) Any source queues in this Amazon Web
|
697
|
+
# Services account in the same Region can specify this queue as
|
698
|
+
# the dead-letter queue.
|
699
|
+
#
|
700
|
+
# * `denyAll` – No source queues can specify this queue as the
|
701
|
+
# dead-letter queue.
|
702
|
+
#
|
703
|
+
# * `byQueue` – Only queues specified by the `sourceQueueArns`
|
704
|
+
# parameter can specify this queue as the dead-letter queue.
|
705
|
+
#
|
706
|
+
# * `sourceQueueArns` – The Amazon Resource Names (ARN)s of the source
|
707
|
+
# queues that can specify this queue as the dead-letter queue and
|
708
|
+
# redrive messages. You can specify this parameter only when the
|
709
|
+
# `redrivePermission` parameter is set to `byQueue`. You can specify
|
710
|
+
# up to 10 source queue ARNs. To allow more than 10 source queues to
|
711
|
+
# specify dead-letter queues, set the `redrivePermission` parameter
|
712
|
+
# to `allowAll`.
|
713
|
+
#
|
714
|
+
# <note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
|
715
|
+
# Similarly, the dead-letter queue of a standard queue must also be a
|
716
|
+
# standard queue.
|
654
717
|
#
|
655
|
-
#
|
656
|
-
# Similarly, the dead-letter queue of a standard queue must also be a
|
657
|
-
# standard queue.
|
658
|
-
#
|
659
|
-
# </note>
|
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*.
|
718
|
+
# </note>
|
665
719
|
#
|
666
|
-
# The following attributes apply only to [server-side-encryption][4]
|
720
|
+
# The following attributes apply only to [server-side-encryption][4]:
|
667
721
|
#
|
668
722
|
# * `KmsMasterKeyId` – The ID of an Amazon Web Services managed customer
|
669
723
|
# master key (CMK) for Amazon SQS or a custom CMK. For more
|
@@ -683,10 +737,10 @@ module Aws::SQS
|
|
683
737
|
#
|
684
738
|
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
685
739
|
# SQS owned encryption keys. Only one server-side encryption option is
|
686
|
-
# supported per queue (
|
740
|
+
# supported per queue (for example, [SSE-KMS][9] or [SSE-SQS][10]).
|
687
741
|
#
|
688
742
|
# The following attribute applies only to [FIFO (first-in-first-out)
|
689
|
-
# queues][11]
|
743
|
+
# queues][11]:
|
690
744
|
#
|
691
745
|
# * `ContentBasedDeduplication` – Enables content-based deduplication.
|
692
746
|
# For more information, see [Exactly-once processing][12] in the
|
@@ -721,7 +775,7 @@ module Aws::SQS
|
|
721
775
|
# duplicates and only one copy of the message is delivered.
|
722
776
|
#
|
723
777
|
# The following attributes apply only to [high throughput for FIFO
|
724
|
-
# queues][13]
|
778
|
+
# queues][13]:
|
725
779
|
#
|
726
780
|
# * `DeduplicationScope` – Specifies whether message deduplication
|
727
781
|
# occurs at the message group or queue level. Valid values are
|
@@ -749,8 +803,8 @@ module Aws::SQS
|
|
749
803
|
#
|
750
804
|
#
|
751
805
|
# [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-
|
806
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
807
|
+
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
|
754
808
|
# [4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
|
755
809
|
# [5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
|
756
810
|
# [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
@@ -765,7 +819,9 @@ module Aws::SQS
|
|
765
819
|
# @return [EmptyStructure]
|
766
820
|
def set_attributes(options = {})
|
767
821
|
options = options.merge(queue_url: @url)
|
768
|
-
resp =
|
822
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
823
|
+
@client.set_queue_attributes(options)
|
824
|
+
end
|
769
825
|
resp.data
|
770
826
|
end
|
771
827
|
|
@@ -779,7 +835,9 @@ module Aws::SQS
|
|
779
835
|
def dead_letter_source_queues(options = {})
|
780
836
|
batches = Enumerator.new do |y|
|
781
837
|
options = options.merge(queue_url: @url)
|
782
|
-
resp =
|
838
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
839
|
+
@client.list_dead_letter_source_queues(options)
|
840
|
+
end
|
783
841
|
resp.each_page do |page|
|
784
842
|
batch = []
|
785
843
|
page.data.queue_urls.each do |q|
|
@@ -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
|
data/lib/aws-sdk-sqs/resource.rb
CHANGED
@@ -76,43 +76,77 @@ module Aws::SQS
|
|
76
76
|
# * `MessageRetentionPeriod` – The length of time, in seconds, for which
|
77
77
|
# Amazon SQS retains a message. Valid values: An integer from 60
|
78
78
|
# seconds (1 minute) to 1,209,600 seconds (14 days). Default: 345,600
|
79
|
-
# (4 days).
|
79
|
+
# (4 days). When you change a queue's attributes, the change can take
|
80
|
+
# up to 60 seconds for most of the attributes to propagate throughout
|
81
|
+
# the Amazon SQS system. Changes made to the `MessageRetentionPeriod`
|
82
|
+
# attribute can take up to 15 minutes and will impact existing
|
83
|
+
# messages in the queue potentially causing them to be expired and
|
84
|
+
# deleted if the `MessageRetentionPeriod` is reduced below the age of
|
85
|
+
# existing messages.
|
80
86
|
#
|
81
87
|
# * `Policy` – The queue's policy. A valid Amazon Web Services policy.
|
82
88
|
# For more information about policy structure, see [Overview of Amazon
|
83
|
-
# Web Services IAM Policies][1] in the *
|
89
|
+
# Web Services IAM Policies][1] in the *IAM User Guide*.
|
84
90
|
#
|
85
91
|
# * `ReceiveMessageWaitTimeSeconds` – The length of time, in seconds,
|
86
92
|
# for which a ` ReceiveMessage ` action waits for a message to arrive.
|
87
93
|
# Valid values: An integer from 0 to 20 (seconds). Default: 0.
|
88
94
|
#
|
95
|
+
# * `VisibilityTimeout` – The visibility timeout for the queue, in
|
96
|
+
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
97
|
+
# Default: 30. For more information about the visibility timeout, see
|
98
|
+
# [Visibility Timeout][2] in the *Amazon SQS Developer Guide*.
|
99
|
+
#
|
100
|
+
# The following attributes apply only to [dead-letter queues:][3]
|
101
|
+
#
|
89
102
|
# * `RedrivePolicy` – The string that includes the parameters for the
|
90
103
|
# dead-letter queue functionality of the source queue as a JSON
|
91
|
-
# object.
|
92
|
-
# dead-letter queues, see [Using Amazon SQS Dead-Letter Queues][2] in
|
93
|
-
# the *Amazon SQS Developer Guide*.
|
104
|
+
# object. The parameters are as follows:
|
94
105
|
#
|
95
106
|
# * `deadLetterTargetArn` – The Amazon Resource Name (ARN) of the
|
96
107
|
# dead-letter queue to which Amazon SQS moves messages after the
|
97
108
|
# value of `maxReceiveCount` is exceeded.
|
98
109
|
#
|
99
110
|
# * `maxReceiveCount` – The number of times a message is delivered to
|
100
|
-
# the source queue before being moved to the dead-letter queue.
|
101
|
-
# the `ReceiveCount` for a message exceeds the
|
102
|
-
# a queue, Amazon SQS moves the message to the
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
111
|
+
# the source queue before being moved to the dead-letter queue.
|
112
|
+
# Default: 10. When the `ReceiveCount` for a message exceeds the
|
113
|
+
# `maxReceiveCount` for a queue, Amazon SQS moves the message to the
|
114
|
+
# dead-letter-queue.
|
115
|
+
#
|
116
|
+
# * `RedriveAllowPolicy` – The string that includes the parameters for
|
117
|
+
# the permissions for the dead-letter queue redrive permission and
|
118
|
+
# which source queues can specify dead-letter queues as a JSON object.
|
119
|
+
# The parameters are as follows:
|
120
|
+
#
|
121
|
+
# * `redrivePermission` – The permission type that defines which
|
122
|
+
# source queues can specify the current queue as the dead-letter
|
123
|
+
# queue. Valid values are:
|
124
|
+
#
|
125
|
+
# * `allowAll` – (Default) Any source queues in this Amazon Web
|
126
|
+
# Services account in the same Region can specify this queue as
|
127
|
+
# the dead-letter queue.
|
128
|
+
#
|
129
|
+
# * `denyAll` – No source queues can specify this queue as the
|
130
|
+
# dead-letter queue.
|
131
|
+
#
|
132
|
+
# * `byQueue` – Only queues specified by the `sourceQueueArns`
|
133
|
+
# parameter can specify this queue as the dead-letter queue.
|
134
|
+
#
|
135
|
+
# * `sourceQueueArns` – The Amazon Resource Names (ARN)s of the source
|
136
|
+
# queues that can specify this queue as the dead-letter queue and
|
137
|
+
# redrive messages. You can specify this parameter only when the
|
138
|
+
# `redrivePermission` parameter is set to `byQueue`. You can specify
|
139
|
+
# up to 10 source queue ARNs. To allow more than 10 source queues to
|
140
|
+
# specify dead-letter queues, set the `redrivePermission` parameter
|
141
|
+
# to `allowAll`.
|
142
|
+
#
|
143
|
+
# <note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
|
144
|
+
# Similarly, the dead-letter queue of a standard queue must also be a
|
145
|
+
# standard queue.
|
109
146
|
#
|
110
|
-
#
|
111
|
-
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
112
|
-
# Default: 30. For more information about the visibility timeout, see
|
113
|
-
# [Visibility Timeout][3] in the *Amazon SQS Developer Guide*.
|
147
|
+
# </note>
|
114
148
|
#
|
115
|
-
# The following attributes apply only to [server-side-encryption][4]
|
149
|
+
# The following attributes apply only to [server-side-encryption][4]:
|
116
150
|
#
|
117
151
|
# * `KmsMasterKeyId` – The ID of an Amazon Web Services managed customer
|
118
152
|
# master key (CMK) for Amazon SQS or a custom CMK. For more
|
@@ -129,14 +163,14 @@ module Aws::SQS
|
|
129
163
|
# Default: 300 (5 minutes). A shorter time period provides better
|
130
164
|
# security but results in more calls to KMS which might incur charges
|
131
165
|
# after Free Tier. For more information, see [How Does the Data Key
|
132
|
-
# Reuse Period Work?][8]
|
166
|
+
# Reuse Period Work?][8]
|
133
167
|
#
|
134
168
|
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
135
169
|
# SQS owned encryption keys. Only one server-side encryption option is
|
136
|
-
# supported per queue (
|
170
|
+
# supported per queue (for example, [SSE-KMS][9] or [SSE-SQS][10]).
|
137
171
|
#
|
138
172
|
# The following attributes apply only to [FIFO (first-in-first-out)
|
139
|
-
# queues][11]
|
173
|
+
# queues][11]:
|
140
174
|
#
|
141
175
|
# * `FifoQueue` – Designates a queue as FIFO. Valid values are `true`
|
142
176
|
# and `false`. If you don't specify the `FifoQueue` attribute, Amazon
|
@@ -182,7 +216,7 @@ module Aws::SQS
|
|
182
216
|
# duplicates and only one copy of the message is delivered.
|
183
217
|
#
|
184
218
|
# The following attributes apply only to [high throughput for FIFO
|
185
|
-
# queues][14]
|
219
|
+
# queues][14]:
|
186
220
|
#
|
187
221
|
# * `DeduplicationScope` – Specifies whether message deduplication
|
188
222
|
# occurs at the message group or queue level. Valid values are
|
@@ -210,8 +244,8 @@ module Aws::SQS
|
|
210
244
|
#
|
211
245
|
#
|
212
246
|
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
|
213
|
-
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-
|
214
|
-
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-
|
247
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
248
|
+
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
|
215
249
|
# [4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
|
216
250
|
# [5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
|
217
251
|
# [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
@@ -248,8 +282,8 @@ module Aws::SQS
|
|
248
282
|
# `sqs:CreateQueue` and `sqs:TagQueue` permissions.
|
249
283
|
#
|
250
284
|
# Cross-account permissions don't apply to this action. For more
|
251
|
-
# information, see [Grant cross-account permissions to a role and a
|
252
|
-
#
|
285
|
+
# information, see [Grant cross-account permissions to a role and a
|
286
|
+
# username][3] in the *Amazon SQS Developer Guide*.
|
253
287
|
#
|
254
288
|
# </note>
|
255
289
|
#
|
@@ -260,7 +294,9 @@ module Aws::SQS
|
|
260
294
|
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name
|
261
295
|
# @return [Queue]
|
262
296
|
def create_queue(options = {})
|
263
|
-
resp =
|
297
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
298
|
+
@client.create_queue(options)
|
299
|
+
end
|
264
300
|
Queue.new(
|
265
301
|
url: resp.data.queue_url,
|
266
302
|
client: @client
|
@@ -285,7 +321,9 @@ module Aws::SQS
|
|
285
321
|
# queue.
|
286
322
|
# @return [Queue]
|
287
323
|
def get_queue_by_name(options = {})
|
288
|
-
resp =
|
324
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
325
|
+
@client.get_queue_url(options)
|
326
|
+
end
|
289
327
|
Queue.new(
|
290
328
|
url: resp.data.queue_url,
|
291
329
|
client: @client
|
@@ -317,7 +355,9 @@ module Aws::SQS
|
|
317
355
|
# @return [Queue::Collection]
|
318
356
|
def queues(options = {})
|
319
357
|
batches = Enumerator.new do |y|
|
320
|
-
resp =
|
358
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
359
|
+
@client.list_queues(options)
|
360
|
+
end
|
321
361
|
resp.each_page do |page|
|
322
362
|
batch = []
|
323
363
|
page.data.queue_urls.each do |q|
|