aws-sdk-sqs 1.23.1 → 1.28.0
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 +5 -5
- data/lib/aws-sdk-sqs.rb +9 -4
- data/lib/aws-sdk-sqs/client.rb +206 -110
- data/lib/aws-sdk-sqs/client_api.rb +54 -0
- data/lib/aws-sdk-sqs/customizations.rb +2 -0
- data/lib/aws-sdk-sqs/errors.rb +200 -0
- data/lib/aws-sdk-sqs/message.rb +4 -0
- data/lib/aws-sdk-sqs/plugins/md5s.rb +6 -6
- data/lib/aws-sdk-sqs/plugins/queue_urls.rb +2 -0
- data/lib/aws-sdk-sqs/queue.rb +58 -41
- data/lib/aws-sdk-sqs/queue_poller.rb +2 -0
- data/lib/aws-sdk-sqs/resource.rb +40 -24
- data/lib/aws-sdk-sqs/types.rb +256 -86
- metadata +5 -5
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
@@ -22,6 +24,7 @@ module Aws::SQS
|
|
22
24
|
Binary = Shapes::BlobShape.new(name: 'Binary')
|
23
25
|
BinaryList = Shapes::ListShape.new(name: 'BinaryList', flattened: true)
|
24
26
|
Boolean = Shapes::BooleanShape.new(name: 'Boolean')
|
27
|
+
BoxedInteger = Shapes::IntegerShape.new(name: 'BoxedInteger')
|
25
28
|
ChangeMessageVisibilityBatchRequest = Shapes::StructureShape.new(name: 'ChangeMessageVisibilityBatchRequest')
|
26
29
|
ChangeMessageVisibilityBatchRequestEntry = Shapes::StructureShape.new(name: 'ChangeMessageVisibilityBatchRequestEntry')
|
27
30
|
ChangeMessageVisibilityBatchRequestEntryList = Shapes::ListShape.new(name: 'ChangeMessageVisibilityBatchRequestEntryList', flattened: true)
|
@@ -96,6 +99,7 @@ module Aws::SQS
|
|
96
99
|
TagMap = Shapes::MapShape.new(name: 'TagMap', flattened: true)
|
97
100
|
TagQueueRequest = Shapes::StructureShape.new(name: 'TagQueueRequest')
|
98
101
|
TagValue = Shapes::StringShape.new(name: 'TagValue')
|
102
|
+
Token = Shapes::StringShape.new(name: 'Token')
|
99
103
|
TooManyEntriesInBatchRequest = Shapes::StructureShape.new(name: 'TooManyEntriesInBatchRequest')
|
100
104
|
UnsupportedOperation = Shapes::StructureShape.new(name: 'UnsupportedOperation')
|
101
105
|
UntagQueueRequest = Shapes::StructureShape.new(name: 'UntagQueueRequest')
|
@@ -112,6 +116,10 @@ module Aws::SQS
|
|
112
116
|
|
113
117
|
AttributeNameList.member = Shapes::ShapeRef.new(shape: QueueAttributeName, location_name: "AttributeName")
|
114
118
|
|
119
|
+
BatchEntryIdsNotDistinct.struct_class = Types::BatchEntryIdsNotDistinct
|
120
|
+
|
121
|
+
BatchRequestTooLong.struct_class = Types::BatchRequestTooLong
|
122
|
+
|
115
123
|
BatchResultErrorEntry.add_member(:id, Shapes::ShapeRef.new(shape: String, required: true, location_name: "Id"))
|
116
124
|
BatchResultErrorEntry.add_member(:sender_fault, Shapes::ShapeRef.new(shape: Boolean, required: true, location_name: "SenderFault"))
|
117
125
|
BatchResultErrorEntry.add_member(:code, Shapes::ShapeRef.new(shape: String, required: true, location_name: "Code"))
|
@@ -181,6 +189,8 @@ module Aws::SQS
|
|
181
189
|
DeleteQueueRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
182
190
|
DeleteQueueRequest.struct_class = Types::DeleteQueueRequest
|
183
191
|
|
192
|
+
EmptyBatchRequest.struct_class = Types::EmptyBatchRequest
|
193
|
+
|
184
194
|
GetQueueAttributesRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
185
195
|
GetQueueAttributesRequest.add_member(:attribute_names, Shapes::ShapeRef.new(shape: AttributeNameList, location_name: "AttributeNames"))
|
186
196
|
GetQueueAttributesRequest.struct_class = Types::GetQueueAttributesRequest
|
@@ -195,10 +205,21 @@ module Aws::SQS
|
|
195
205
|
GetQueueUrlResult.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, location_name: "QueueUrl"))
|
196
206
|
GetQueueUrlResult.struct_class = Types::GetQueueUrlResult
|
197
207
|
|
208
|
+
InvalidAttributeName.struct_class = Types::InvalidAttributeName
|
209
|
+
|
210
|
+
InvalidBatchEntryId.struct_class = Types::InvalidBatchEntryId
|
211
|
+
|
212
|
+
InvalidIdFormat.struct_class = Types::InvalidIdFormat
|
213
|
+
|
214
|
+
InvalidMessageContents.struct_class = Types::InvalidMessageContents
|
215
|
+
|
198
216
|
ListDeadLetterSourceQueuesRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
217
|
+
ListDeadLetterSourceQueuesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: Token, location_name: "NextToken"))
|
218
|
+
ListDeadLetterSourceQueuesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: BoxedInteger, location_name: "MaxResults"))
|
199
219
|
ListDeadLetterSourceQueuesRequest.struct_class = Types::ListDeadLetterSourceQueuesRequest
|
200
220
|
|
201
221
|
ListDeadLetterSourceQueuesResult.add_member(:queue_urls, Shapes::ShapeRef.new(shape: QueueUrlList, required: true, location_name: "queueUrls"))
|
222
|
+
ListDeadLetterSourceQueuesResult.add_member(:next_token, Shapes::ShapeRef.new(shape: Token, location_name: "NextToken"))
|
202
223
|
ListDeadLetterSourceQueuesResult.struct_class = Types::ListDeadLetterSourceQueuesResult
|
203
224
|
|
204
225
|
ListQueueTagsRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
@@ -208,9 +229,12 @@ module Aws::SQS
|
|
208
229
|
ListQueueTagsResult.struct_class = Types::ListQueueTagsResult
|
209
230
|
|
210
231
|
ListQueuesRequest.add_member(:queue_name_prefix, Shapes::ShapeRef.new(shape: String, location_name: "QueueNamePrefix"))
|
232
|
+
ListQueuesRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: Token, location_name: "NextToken"))
|
233
|
+
ListQueuesRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: BoxedInteger, location_name: "MaxResults"))
|
211
234
|
ListQueuesRequest.struct_class = Types::ListQueuesRequest
|
212
235
|
|
213
236
|
ListQueuesResult.add_member(:queue_urls, Shapes::ShapeRef.new(shape: QueueUrlList, location_name: "QueueUrls"))
|
237
|
+
ListQueuesResult.add_member(:next_token, Shapes::ShapeRef.new(shape: Token, location_name: "NextToken"))
|
214
238
|
ListQueuesResult.struct_class = Types::ListQueuesResult
|
215
239
|
|
216
240
|
Message.add_member(:message_id, Shapes::ShapeRef.new(shape: String, location_name: "MessageId"))
|
@@ -239,6 +263,8 @@ module Aws::SQS
|
|
239
263
|
|
240
264
|
MessageList.member = Shapes::ShapeRef.new(shape: Message, location_name: "Message")
|
241
265
|
|
266
|
+
MessageNotInflight.struct_class = Types::MessageNotInflight
|
267
|
+
|
242
268
|
MessageSystemAttributeMap.key = Shapes::ShapeRef.new(shape: MessageSystemAttributeName, location_name: "Name")
|
243
269
|
MessageSystemAttributeMap.value = Shapes::ShapeRef.new(shape: String, location_name: "Value")
|
244
270
|
|
@@ -249,14 +275,26 @@ module Aws::SQS
|
|
249
275
|
MessageSystemAttributeValue.add_member(:data_type, Shapes::ShapeRef.new(shape: String, required: true, location_name: "DataType"))
|
250
276
|
MessageSystemAttributeValue.struct_class = Types::MessageSystemAttributeValue
|
251
277
|
|
278
|
+
OverLimit.struct_class = Types::OverLimit
|
279
|
+
|
280
|
+
PurgeQueueInProgress.struct_class = Types::PurgeQueueInProgress
|
281
|
+
|
252
282
|
PurgeQueueRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
253
283
|
PurgeQueueRequest.struct_class = Types::PurgeQueueRequest
|
254
284
|
|
255
285
|
QueueAttributeMap.key = Shapes::ShapeRef.new(shape: QueueAttributeName, location_name: "Name")
|
256
286
|
QueueAttributeMap.value = Shapes::ShapeRef.new(shape: String, location_name: "Value")
|
257
287
|
|
288
|
+
QueueDeletedRecently.struct_class = Types::QueueDeletedRecently
|
289
|
+
|
290
|
+
QueueDoesNotExist.struct_class = Types::QueueDoesNotExist
|
291
|
+
|
292
|
+
QueueNameExists.struct_class = Types::QueueNameExists
|
293
|
+
|
258
294
|
QueueUrlList.member = Shapes::ShapeRef.new(shape: String, location_name: "QueueUrl")
|
259
295
|
|
296
|
+
ReceiptHandleIsInvalid.struct_class = Types::ReceiptHandleIsInvalid
|
297
|
+
|
260
298
|
ReceiveMessageRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
261
299
|
ReceiveMessageRequest.add_member(:attribute_names, Shapes::ShapeRef.new(shape: AttributeNameList, location_name: "AttributeNames"))
|
262
300
|
ReceiveMessageRequest.add_member(:message_attribute_names, Shapes::ShapeRef.new(shape: MessageAttributeNameList, location_name: "MessageAttributeNames"))
|
@@ -333,6 +371,10 @@ module Aws::SQS
|
|
333
371
|
TagQueueRequest.add_member(:tags, Shapes::ShapeRef.new(shape: TagMap, required: true, location_name: "Tags"))
|
334
372
|
TagQueueRequest.struct_class = Types::TagQueueRequest
|
335
373
|
|
374
|
+
TooManyEntriesInBatchRequest.struct_class = Types::TooManyEntriesInBatchRequest
|
375
|
+
|
376
|
+
UnsupportedOperation.struct_class = Types::UnsupportedOperation
|
377
|
+
|
336
378
|
UntagQueueRequest.add_member(:queue_url, Shapes::ShapeRef.new(shape: String, required: true, location_name: "QueueUrl"))
|
337
379
|
UntagQueueRequest.add_member(:tag_keys, Shapes::ShapeRef.new(shape: TagKeyList, required: true, location_name: "TagKeys"))
|
338
380
|
UntagQueueRequest.struct_class = Types::UntagQueueRequest
|
@@ -452,6 +494,12 @@ module Aws::SQS
|
|
452
494
|
o.input = Shapes::ShapeRef.new(shape: ListDeadLetterSourceQueuesRequest)
|
453
495
|
o.output = Shapes::ShapeRef.new(shape: ListDeadLetterSourceQueuesResult)
|
454
496
|
o.errors << Shapes::ShapeRef.new(shape: QueueDoesNotExist)
|
497
|
+
o[:pager] = Aws::Pager.new(
|
498
|
+
limit_key: "max_results",
|
499
|
+
tokens: {
|
500
|
+
"next_token" => "next_token"
|
501
|
+
}
|
502
|
+
)
|
455
503
|
end)
|
456
504
|
|
457
505
|
api.add_operation(:list_queue_tags, Seahorse::Model::Operation.new.tap do |o|
|
@@ -468,6 +516,12 @@ module Aws::SQS
|
|
468
516
|
o.http_request_uri = "/"
|
469
517
|
o.input = Shapes::ShapeRef.new(shape: ListQueuesRequest)
|
470
518
|
o.output = Shapes::ShapeRef.new(shape: ListQueuesResult)
|
519
|
+
o[:pager] = Aws::Pager.new(
|
520
|
+
limit_key: "max_results",
|
521
|
+
tokens: {
|
522
|
+
"next_token" => "next_token"
|
523
|
+
}
|
524
|
+
)
|
471
525
|
end)
|
472
526
|
|
473
527
|
api.add_operation(:purge_queue, Seahorse::Model::Operation.new.tap do |o|
|
data/lib/aws-sdk-sqs/errors.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
@@ -6,9 +8,207 @@
|
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::SQS
|
11
|
+
|
12
|
+
# When SQS returns an error response, the Ruby SDK constructs and raises an error.
|
13
|
+
# These errors all extend Aws::SQS::Errors::ServiceError < {Aws::Errors::ServiceError}
|
14
|
+
#
|
15
|
+
# You can rescue all SQS errors using ServiceError:
|
16
|
+
#
|
17
|
+
# begin
|
18
|
+
# # do stuff
|
19
|
+
# rescue Aws::SQS::Errors::ServiceError
|
20
|
+
# # rescues all SQS API errors
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
#
|
24
|
+
# ## Request Context
|
25
|
+
# ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
|
26
|
+
# information about the request that generated the error.
|
27
|
+
# See {Seahorse::Client::RequestContext} for more information.
|
28
|
+
#
|
29
|
+
# ## Error Classes
|
30
|
+
# * {BatchEntryIdsNotDistinct}
|
31
|
+
# * {BatchRequestTooLong}
|
32
|
+
# * {EmptyBatchRequest}
|
33
|
+
# * {InvalidAttributeName}
|
34
|
+
# * {InvalidBatchEntryId}
|
35
|
+
# * {InvalidIdFormat}
|
36
|
+
# * {InvalidMessageContents}
|
37
|
+
# * {MessageNotInflight}
|
38
|
+
# * {OverLimit}
|
39
|
+
# * {PurgeQueueInProgress}
|
40
|
+
# * {QueueDeletedRecently}
|
41
|
+
# * {QueueDoesNotExist}
|
42
|
+
# * {QueueNameExists}
|
43
|
+
# * {ReceiptHandleIsInvalid}
|
44
|
+
# * {TooManyEntriesInBatchRequest}
|
45
|
+
# * {UnsupportedOperation}
|
46
|
+
#
|
47
|
+
# Additionally, error classes are dynamically generated for service errors based on the error code
|
48
|
+
# if they are not defined above.
|
9
49
|
module Errors
|
10
50
|
|
11
51
|
extend Aws::Errors::DynamicErrors
|
12
52
|
|
53
|
+
class BatchEntryIdsNotDistinct < ServiceError
|
54
|
+
|
55
|
+
# @param [Seahorse::Client::RequestContext] context
|
56
|
+
# @param [String] message
|
57
|
+
# @param [Aws::SQS::Types::BatchEntryIdsNotDistinct] data
|
58
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
59
|
+
super(context, message, data)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
class BatchRequestTooLong < ServiceError
|
64
|
+
|
65
|
+
# @param [Seahorse::Client::RequestContext] context
|
66
|
+
# @param [String] message
|
67
|
+
# @param [Aws::SQS::Types::BatchRequestTooLong] data
|
68
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
69
|
+
super(context, message, data)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
class EmptyBatchRequest < ServiceError
|
74
|
+
|
75
|
+
# @param [Seahorse::Client::RequestContext] context
|
76
|
+
# @param [String] message
|
77
|
+
# @param [Aws::SQS::Types::EmptyBatchRequest] data
|
78
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
79
|
+
super(context, message, data)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class InvalidAttributeName < ServiceError
|
84
|
+
|
85
|
+
# @param [Seahorse::Client::RequestContext] context
|
86
|
+
# @param [String] message
|
87
|
+
# @param [Aws::SQS::Types::InvalidAttributeName] data
|
88
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
89
|
+
super(context, message, data)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class InvalidBatchEntryId < ServiceError
|
94
|
+
|
95
|
+
# @param [Seahorse::Client::RequestContext] context
|
96
|
+
# @param [String] message
|
97
|
+
# @param [Aws::SQS::Types::InvalidBatchEntryId] data
|
98
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
99
|
+
super(context, message, data)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
class InvalidIdFormat < ServiceError
|
104
|
+
|
105
|
+
# @param [Seahorse::Client::RequestContext] context
|
106
|
+
# @param [String] message
|
107
|
+
# @param [Aws::SQS::Types::InvalidIdFormat] data
|
108
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
109
|
+
super(context, message, data)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
class InvalidMessageContents < ServiceError
|
114
|
+
|
115
|
+
# @param [Seahorse::Client::RequestContext] context
|
116
|
+
# @param [String] message
|
117
|
+
# @param [Aws::SQS::Types::InvalidMessageContents] data
|
118
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
119
|
+
super(context, message, data)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
class MessageNotInflight < ServiceError
|
124
|
+
|
125
|
+
# @param [Seahorse::Client::RequestContext] context
|
126
|
+
# @param [String] message
|
127
|
+
# @param [Aws::SQS::Types::MessageNotInflight] data
|
128
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
129
|
+
super(context, message, data)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
class OverLimit < ServiceError
|
134
|
+
|
135
|
+
# @param [Seahorse::Client::RequestContext] context
|
136
|
+
# @param [String] message
|
137
|
+
# @param [Aws::SQS::Types::OverLimit] data
|
138
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
139
|
+
super(context, message, data)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
class PurgeQueueInProgress < ServiceError
|
144
|
+
|
145
|
+
# @param [Seahorse::Client::RequestContext] context
|
146
|
+
# @param [String] message
|
147
|
+
# @param [Aws::SQS::Types::PurgeQueueInProgress] data
|
148
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
149
|
+
super(context, message, data)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
class QueueDeletedRecently < ServiceError
|
154
|
+
|
155
|
+
# @param [Seahorse::Client::RequestContext] context
|
156
|
+
# @param [String] message
|
157
|
+
# @param [Aws::SQS::Types::QueueDeletedRecently] data
|
158
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
159
|
+
super(context, message, data)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
class QueueDoesNotExist < ServiceError
|
164
|
+
|
165
|
+
# @param [Seahorse::Client::RequestContext] context
|
166
|
+
# @param [String] message
|
167
|
+
# @param [Aws::SQS::Types::QueueDoesNotExist] data
|
168
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
169
|
+
super(context, message, data)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
class QueueNameExists < ServiceError
|
174
|
+
|
175
|
+
# @param [Seahorse::Client::RequestContext] context
|
176
|
+
# @param [String] message
|
177
|
+
# @param [Aws::SQS::Types::QueueNameExists] data
|
178
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
179
|
+
super(context, message, data)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
class ReceiptHandleIsInvalid < ServiceError
|
184
|
+
|
185
|
+
# @param [Seahorse::Client::RequestContext] context
|
186
|
+
# @param [String] message
|
187
|
+
# @param [Aws::SQS::Types::ReceiptHandleIsInvalid] data
|
188
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
189
|
+
super(context, message, data)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
class TooManyEntriesInBatchRequest < ServiceError
|
194
|
+
|
195
|
+
# @param [Seahorse::Client::RequestContext] context
|
196
|
+
# @param [String] message
|
197
|
+
# @param [Aws::SQS::Types::TooManyEntriesInBatchRequest] data
|
198
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
199
|
+
super(context, message, data)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
class UnsupportedOperation < ServiceError
|
204
|
+
|
205
|
+
# @param [Seahorse::Client::RequestContext] context
|
206
|
+
# @param [String] message
|
207
|
+
# @param [Aws::SQS::Types::UnsupportedOperation] data
|
208
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
209
|
+
super(context, message, data)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
13
213
|
end
|
14
214
|
end
|
data/lib/aws-sdk-sqs/message.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
@@ -6,6 +8,7 @@
|
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::SQS
|
11
|
+
|
9
12
|
class Message
|
10
13
|
|
11
14
|
extend Aws::Deprecations
|
@@ -24,6 +27,7 @@ module Aws::SQS
|
|
24
27
|
@receipt_handle = extract_receipt_handle(args, options)
|
25
28
|
@data = options.delete(:data)
|
26
29
|
@client = options.delete(:client) || Client.new(options)
|
30
|
+
@waiter_block_warned = false
|
27
31
|
end
|
28
32
|
|
29
33
|
# @!group Read-Only Attributes
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'openssl'
|
2
4
|
|
3
5
|
module Aws
|
@@ -119,14 +121,12 @@ module Aws
|
|
119
121
|
end
|
120
122
|
|
121
123
|
def mismatch_error_message(section, local_md5, returned_md5, response)
|
122
|
-
m =
|
123
|
-
|
124
|
-
|
124
|
+
m = 'MD5 returned by SQS does not match '\
|
125
|
+
'the calculation on the original request. ('
|
125
126
|
if response.respond_to?(:id) && !response.id.nil?
|
126
|
-
m
|
127
|
+
m = "#{m}Message ID: #{response.id}, "
|
127
128
|
end
|
128
|
-
|
129
|
-
m << "MD5 calculated by the #{section}: " <<
|
129
|
+
"#{m}MD5 calculated by the #{section}: "\
|
130
130
|
"'#{local_md5}', MD5 checksum returned: '#{returned_md5}')"
|
131
131
|
end
|
132
132
|
end
|
data/lib/aws-sdk-sqs/queue.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
@@ -6,6 +8,7 @@
|
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::SQS
|
11
|
+
|
9
12
|
class Queue
|
10
13
|
|
11
14
|
extend Aws::Deprecations
|
@@ -21,6 +24,7 @@ module Aws::SQS
|
|
21
24
|
@url = extract_url(args, options)
|
22
25
|
@data = options.delete(:data)
|
23
26
|
@client = options.delete(:client) || Client.new(options)
|
27
|
+
@waiter_block_warned = false
|
24
28
|
end
|
25
29
|
|
26
30
|
# @!group Read-Only Attributes
|
@@ -203,15 +207,15 @@ module Aws::SQS
|
|
203
207
|
# A list of attributes that need to be returned along with each message.
|
204
208
|
# These attributes include:
|
205
209
|
#
|
206
|
-
# * `All`
|
210
|
+
# * `All` – Returns all values.
|
207
211
|
#
|
208
|
-
# * `ApproximateFirstReceiveTimestamp`
|
212
|
+
# * `ApproximateFirstReceiveTimestamp` – Returns the time the message
|
209
213
|
# was first received from the queue ([epoch time][1] in milliseconds).
|
210
214
|
#
|
211
|
-
# * `ApproximateReceiveCount`
|
212
|
-
# has been received
|
215
|
+
# * `ApproximateReceiveCount` – Returns the number of times a message
|
216
|
+
# has been received across all queues but not deleted.
|
213
217
|
#
|
214
|
-
# * `AWSTraceHeader`
|
218
|
+
# * `AWSTraceHeader` – Returns the AWS X-Ray trace header string.
|
215
219
|
#
|
216
220
|
# * `SenderId`
|
217
221
|
#
|
@@ -221,17 +225,17 @@ module Aws::SQS
|
|
221
225
|
# * For an IAM role, returns the IAM role ID, for example
|
222
226
|
# `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`.
|
223
227
|
#
|
224
|
-
# * `SentTimestamp`
|
228
|
+
# * `SentTimestamp` – Returns the time the message was sent to the queue
|
225
229
|
# ([epoch time][1] in milliseconds).
|
226
230
|
#
|
227
|
-
# * `MessageDeduplicationId`
|
231
|
+
# * `MessageDeduplicationId` – Returns the value provided by the
|
228
232
|
# producer that calls the ` SendMessage ` action.
|
229
233
|
#
|
230
|
-
# * `MessageGroupId`
|
234
|
+
# * `MessageGroupId` – Returns the value provided by the producer that
|
231
235
|
# calls the ` SendMessage ` action. Messages with the same
|
232
236
|
# `MessageGroupId` are returned in sequence.
|
233
237
|
#
|
234
|
-
# * `SequenceNumber`
|
238
|
+
# * `SequenceNumber` – Returns the value provided by Amazon SQS.
|
235
239
|
#
|
236
240
|
#
|
237
241
|
#
|
@@ -271,14 +275,25 @@ module Aws::SQS
|
|
271
275
|
# call returns sooner than `WaitTimeSeconds`. If no messages are
|
272
276
|
# available and the wait time expires, the call returns successfully
|
273
277
|
# with an empty list of messages.
|
278
|
+
#
|
279
|
+
# To avoid HTTP errors, ensure that the HTTP response timeout for
|
280
|
+
# `ReceiveMessage` requests is longer than the `WaitTimeSeconds`
|
281
|
+
# parameter. For example, with the Java SDK, you can set HTTP transport
|
282
|
+
# settings using the [ NettyNioAsyncHttpClient][1] for asynchronous
|
283
|
+
# clients, or the [ ApacheHttpClient][2] for synchronous clients.
|
284
|
+
#
|
285
|
+
#
|
286
|
+
#
|
287
|
+
# [1]: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html
|
288
|
+
# [2]: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html
|
274
289
|
# @option options [String] :receive_request_attempt_id
|
275
290
|
# This parameter applies only to FIFO (first-in-first-out) queues.
|
276
291
|
#
|
277
292
|
# The token used for deduplication of `ReceiveMessage` calls. If a
|
278
293
|
# networking issue occurs after a `ReceiveMessage` action, and instead
|
279
|
-
# of a response you receive a generic error,
|
280
|
-
# action with an identical `ReceiveRequestAttemptId` to retrieve
|
281
|
-
# same set of messages, even if their visibility timeout has not yet
|
294
|
+
# of a response you receive a generic error, it is possible to retry the
|
295
|
+
# same action with an identical `ReceiveRequestAttemptId` to retrieve
|
296
|
+
# the same set of messages, even if their visibility timeout has not yet
|
282
297
|
# expired.
|
283
298
|
#
|
284
299
|
# * You can use `ReceiveRequestAttemptId` only for 5 minutes after a
|
@@ -291,7 +306,7 @@ module Aws::SQS
|
|
291
306
|
# `ReceiveRequestAttemptId`, Amazon SQS generates a
|
292
307
|
# `ReceiveRequestAttemptId`.
|
293
308
|
#
|
294
|
-
# *
|
309
|
+
# * It is possible to retry the `ReceiveMessage` action with the same
|
295
310
|
# `ReceiveRequestAttemptId` if none of the messages have been modified
|
296
311
|
# (deleted or had their visibility changes).
|
297
312
|
#
|
@@ -322,7 +337,7 @@ module Aws::SQS
|
|
322
337
|
# visibility timeout expires. As a result, delays might occur but the
|
323
338
|
# messages in the queue remain in a strict order.
|
324
339
|
#
|
325
|
-
# The length of `ReceiveRequestAttemptId` is 128 characters.
|
340
|
+
# The maximum length of `ReceiveRequestAttemptId` is 128 characters.
|
326
341
|
# `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`,
|
327
342
|
# `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
|
328
343
|
# ``).
|
@@ -434,7 +449,7 @@ module Aws::SQS
|
|
434
449
|
#
|
435
450
|
# * Currently, the only supported message system attribute is
|
436
451
|
# `AWSTraceHeader`. Its type must be `String` and its value must be a
|
437
|
-
# correctly formatted AWS X-Ray trace string.
|
452
|
+
# correctly formatted AWS X-Ray trace header string.
|
438
453
|
#
|
439
454
|
# * The size of a message system attribute doesn't count towards the
|
440
455
|
# total size of a message.
|
@@ -486,7 +501,7 @@ module Aws::SQS
|
|
486
501
|
#
|
487
502
|
# </note>
|
488
503
|
#
|
489
|
-
# The length of `MessageDeduplicationId` is 128 characters.
|
504
|
+
# The maximum length of `MessageDeduplicationId` is 128 characters.
|
490
505
|
# `MessageDeduplicationId` can contain alphanumeric characters (`a-z`,
|
491
506
|
# `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
|
492
507
|
# ``).
|
@@ -594,39 +609,39 @@ module Aws::SQS
|
|
594
609
|
# The following lists the names, descriptions, and values of the special
|
595
610
|
# request parameters that the `SetQueueAttributes` action uses:
|
596
611
|
#
|
597
|
-
# * `DelaySeconds`
|
612
|
+
# * `DelaySeconds` – The length of time, in seconds, for which the
|
598
613
|
# delivery of all messages in the queue is delayed. Valid values: An
|
599
614
|
# integer from 0 to 900 (15 minutes). Default: 0.
|
600
615
|
#
|
601
|
-
# * `MaximumMessageSize`
|
616
|
+
# * `MaximumMessageSize` – The limit of how many bytes a message can
|
602
617
|
# contain before Amazon SQS rejects it. Valid values: An integer from
|
603
618
|
# 1,024 bytes (1 KiB) up to 262,144 bytes (256 KiB). Default: 262,144
|
604
619
|
# (256 KiB).
|
605
620
|
#
|
606
|
-
# * `MessageRetentionPeriod`
|
621
|
+
# * `MessageRetentionPeriod` – The length of time, in seconds, for which
|
607
622
|
# Amazon SQS retains a message. Valid values: An integer representing
|
608
623
|
# seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600
|
609
624
|
# (4 days).
|
610
625
|
#
|
611
|
-
# * `Policy`
|
626
|
+
# * `Policy` – The queue's policy. A valid AWS policy. For more
|
612
627
|
# information about policy structure, see [Overview of AWS IAM
|
613
628
|
# Policies][1] in the *Amazon IAM User Guide*.
|
614
629
|
#
|
615
|
-
# * `ReceiveMessageWaitTimeSeconds`
|
630
|
+
# * `ReceiveMessageWaitTimeSeconds` – The length of time, in seconds,
|
616
631
|
# for which a ` ReceiveMessage ` action waits for a message to arrive.
|
617
|
-
# Valid values:
|
632
|
+
# Valid values: An integer from 0 to 20 (seconds). Default: 0.
|
618
633
|
#
|
619
|
-
# * `RedrivePolicy`
|
620
|
-
# dead-letter queue functionality of the source queue
|
621
|
-
# information about the redrive policy and
|
622
|
-
# [Using Amazon SQS Dead-Letter Queues][2] in
|
623
|
-
# Service Developer Guide*.
|
634
|
+
# * `RedrivePolicy` – The string that includes the parameters for the
|
635
|
+
# dead-letter queue functionality of the source queue as a JSON
|
636
|
+
# object. For more information about the redrive policy and
|
637
|
+
# dead-letter queues, see [Using Amazon SQS Dead-Letter Queues][2] in
|
638
|
+
# the *Amazon Simple Queue Service Developer Guide*.
|
624
639
|
#
|
625
|
-
# * `deadLetterTargetArn`
|
640
|
+
# * `deadLetterTargetArn` – The Amazon Resource Name (ARN) of the
|
626
641
|
# dead-letter queue to which Amazon SQS moves messages after the
|
627
642
|
# value of `maxReceiveCount` is exceeded.
|
628
643
|
#
|
629
|
-
# * `maxReceiveCount`
|
644
|
+
# * `maxReceiveCount` – The number of times a message is delivered to
|
630
645
|
# the source queue before being moved to the dead-letter queue. When
|
631
646
|
# the `ReceiveCount` for a message exceeds the `maxReceiveCount` for
|
632
647
|
# a queue, Amazon SQS moves the message to the dead-letter-queue.
|
@@ -637,22 +652,22 @@ module Aws::SQS
|
|
637
652
|
#
|
638
653
|
# </note>
|
639
654
|
#
|
640
|
-
# * `VisibilityTimeout`
|
641
|
-
# seconds. Valid values:
|
655
|
+
# * `VisibilityTimeout` – The visibility timeout for the queue, in
|
656
|
+
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
642
657
|
# Default: 30. For more information about the visibility timeout, see
|
643
658
|
# [Visibility Timeout][3] in the *Amazon Simple Queue Service
|
644
659
|
# Developer Guide*.
|
645
660
|
#
|
646
661
|
# The following attributes apply only to [server-side-encryption][4]\:
|
647
662
|
#
|
648
|
-
# * `KmsMasterKeyId`
|
663
|
+
# * `KmsMasterKeyId` – The ID of an AWS-managed customer master key
|
649
664
|
# (CMK) for Amazon SQS or a custom CMK. For more information, see [Key
|
650
665
|
# Terms][5]. While the alias of the AWS-managed CMK for Amazon SQS is
|
651
666
|
# always `alias/aws/sqs`, the alias of a custom CMK can, for example,
|
652
667
|
# be `alias/MyAlias `. For more examples, see [KeyId][6] in the *AWS
|
653
668
|
# Key Management Service API Reference*.
|
654
669
|
#
|
655
|
-
# * `KmsDataKeyReusePeriodSeconds`
|
670
|
+
# * `KmsDataKeyReusePeriodSeconds` – The length of time, in seconds, for
|
656
671
|
# which Amazon SQS can reuse a [data key][7] to encrypt or decrypt
|
657
672
|
# messages before calling AWS KMS again. An integer representing
|
658
673
|
# seconds, between 60 seconds (1 minute) and 86,400 seconds (24
|
@@ -664,7 +679,7 @@ module Aws::SQS
|
|
664
679
|
# The following attribute applies only to [FIFO (first-in-first-out)
|
665
680
|
# queues][9]\:
|
666
681
|
#
|
667
|
-
# * `ContentBasedDeduplication`
|
682
|
+
# * `ContentBasedDeduplication` – Enables content-based deduplication.
|
668
683
|
# For more information, see [Exactly-Once Processing][10] in the
|
669
684
|
# *Amazon Simple Queue Service Developer Guide*.
|
670
685
|
#
|
@@ -724,16 +739,18 @@ module Aws::SQS
|
|
724
739
|
# @return [Queue::Collection]
|
725
740
|
def dead_letter_source_queues(options = {})
|
726
741
|
batches = Enumerator.new do |y|
|
727
|
-
batch = []
|
728
742
|
options = options.merge(queue_url: @url)
|
729
743
|
resp = @client.list_dead_letter_source_queues(options)
|
730
|
-
resp.
|
731
|
-
batch
|
732
|
-
|
733
|
-
|
734
|
-
|
744
|
+
resp.each_page do |page|
|
745
|
+
batch = []
|
746
|
+
page.data.queue_urls.each do |q|
|
747
|
+
batch << Queue.new(
|
748
|
+
url: q,
|
749
|
+
client: @client
|
750
|
+
)
|
751
|
+
end
|
752
|
+
y.yield(batch)
|
735
753
|
end
|
736
|
-
y.yield(batch)
|
737
754
|
end
|
738
755
|
Queue::Collection.new(batches)
|
739
756
|
end
|