aws-sdk-sqs 1.39.0 → 1.86.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,8 @@ module Aws::SQS
41
51
  # * {QueueDoesNotExist}
42
52
  # * {QueueNameExists}
43
53
  # * {ReceiptHandleIsInvalid}
54
+ # * {RequestThrottled}
55
+ # * {ResourceNotFoundException}
44
56
  # * {TooManyEntriesInBatchRequest}
45
57
  # * {UnsupportedOperation}
46
58
  #
@@ -58,6 +70,11 @@ module Aws::SQS
58
70
  def initialize(context, message, data = Aws::EmptyStructure.new)
59
71
  super(context, message, data)
60
72
  end
73
+
74
+ # @return [String]
75
+ def message
76
+ @message || @data[:message]
77
+ end
61
78
  end
62
79
 
63
80
  class BatchRequestTooLong < ServiceError
@@ -68,6 +85,11 @@ module Aws::SQS
68
85
  def initialize(context, message, data = Aws::EmptyStructure.new)
69
86
  super(context, message, data)
70
87
  end
88
+
89
+ # @return [String]
90
+ def message
91
+ @message || @data[:message]
92
+ end
71
93
  end
72
94
 
73
95
  class EmptyBatchRequest < ServiceError
@@ -78,6 +100,26 @@ module Aws::SQS
78
100
  def initialize(context, message, data = Aws::EmptyStructure.new)
79
101
  super(context, message, data)
80
102
  end
103
+
104
+ # @return [String]
105
+ def message
106
+ @message || @data[:message]
107
+ end
108
+ end
109
+
110
+ class InvalidAddress < ServiceError
111
+
112
+ # @param [Seahorse::Client::RequestContext] context
113
+ # @param [String] message
114
+ # @param [Aws::SQS::Types::InvalidAddress] data
115
+ def initialize(context, message, data = Aws::EmptyStructure.new)
116
+ super(context, message, data)
117
+ end
118
+
119
+ # @return [String]
120
+ def message
121
+ @message || @data[:message]
122
+ end
81
123
  end
82
124
 
83
125
  class InvalidAttributeName < ServiceError
@@ -88,6 +130,26 @@ module Aws::SQS
88
130
  def initialize(context, message, data = Aws::EmptyStructure.new)
89
131
  super(context, message, data)
90
132
  end
133
+
134
+ # @return [String]
135
+ def message
136
+ @message || @data[:message]
137
+ end
138
+ end
139
+
140
+ class InvalidAttributeValue < ServiceError
141
+
142
+ # @param [Seahorse::Client::RequestContext] context
143
+ # @param [String] message
144
+ # @param [Aws::SQS::Types::InvalidAttributeValue] data
145
+ def initialize(context, message, data = Aws::EmptyStructure.new)
146
+ super(context, message, data)
147
+ end
148
+
149
+ # @return [String]
150
+ def message
151
+ @message || @data[:message]
152
+ end
91
153
  end
92
154
 
93
155
  class InvalidBatchEntryId < ServiceError
@@ -98,6 +160,11 @@ module Aws::SQS
98
160
  def initialize(context, message, data = Aws::EmptyStructure.new)
99
161
  super(context, message, data)
100
162
  end
163
+
164
+ # @return [String]
165
+ def message
166
+ @message || @data[:message]
167
+ end
101
168
  end
102
169
 
103
170
  class InvalidIdFormat < ServiceError
@@ -118,6 +185,131 @@ module Aws::SQS
118
185
  def initialize(context, message, data = Aws::EmptyStructure.new)
119
186
  super(context, message, data)
120
187
  end
188
+
189
+ # @return [String]
190
+ def message
191
+ @message || @data[:message]
192
+ end
193
+ end
194
+
195
+ class InvalidSecurity < ServiceError
196
+
197
+ # @param [Seahorse::Client::RequestContext] context
198
+ # @param [String] message
199
+ # @param [Aws::SQS::Types::InvalidSecurity] data
200
+ def initialize(context, message, data = Aws::EmptyStructure.new)
201
+ super(context, message, data)
202
+ end
203
+
204
+ # @return [String]
205
+ def message
206
+ @message || @data[:message]
207
+ end
208
+ end
209
+
210
+ class KmsAccessDenied < ServiceError
211
+
212
+ # @param [Seahorse::Client::RequestContext] context
213
+ # @param [String] message
214
+ # @param [Aws::SQS::Types::KmsAccessDenied] data
215
+ def initialize(context, message, data = Aws::EmptyStructure.new)
216
+ super(context, message, data)
217
+ end
218
+
219
+ # @return [String]
220
+ def message
221
+ @message || @data[:message]
222
+ end
223
+ end
224
+
225
+ class KmsDisabled < ServiceError
226
+
227
+ # @param [Seahorse::Client::RequestContext] context
228
+ # @param [String] message
229
+ # @param [Aws::SQS::Types::KmsDisabled] data
230
+ def initialize(context, message, data = Aws::EmptyStructure.new)
231
+ super(context, message, data)
232
+ end
233
+
234
+ # @return [String]
235
+ def message
236
+ @message || @data[:message]
237
+ end
238
+ end
239
+
240
+ class KmsInvalidKeyUsage < ServiceError
241
+
242
+ # @param [Seahorse::Client::RequestContext] context
243
+ # @param [String] message
244
+ # @param [Aws::SQS::Types::KmsInvalidKeyUsage] data
245
+ def initialize(context, message, data = Aws::EmptyStructure.new)
246
+ super(context, message, data)
247
+ end
248
+
249
+ # @return [String]
250
+ def message
251
+ @message || @data[:message]
252
+ end
253
+ end
254
+
255
+ class KmsInvalidState < ServiceError
256
+
257
+ # @param [Seahorse::Client::RequestContext] context
258
+ # @param [String] message
259
+ # @param [Aws::SQS::Types::KmsInvalidState] data
260
+ def initialize(context, message, data = Aws::EmptyStructure.new)
261
+ super(context, message, data)
262
+ end
263
+
264
+ # @return [String]
265
+ def message
266
+ @message || @data[:message]
267
+ end
268
+ end
269
+
270
+ class KmsNotFound < ServiceError
271
+
272
+ # @param [Seahorse::Client::RequestContext] context
273
+ # @param [String] message
274
+ # @param [Aws::SQS::Types::KmsNotFound] data
275
+ def initialize(context, message, data = Aws::EmptyStructure.new)
276
+ super(context, message, data)
277
+ end
278
+
279
+ # @return [String]
280
+ def message
281
+ @message || @data[:message]
282
+ end
283
+ end
284
+
285
+ class KmsOptInRequired < ServiceError
286
+
287
+ # @param [Seahorse::Client::RequestContext] context
288
+ # @param [String] message
289
+ # @param [Aws::SQS::Types::KmsOptInRequired] data
290
+ def initialize(context, message, data = Aws::EmptyStructure.new)
291
+ super(context, message, data)
292
+ end
293
+
294
+ # @return [String]
295
+ def message
296
+ @message || @data[:message]
297
+ end
298
+ end
299
+
300
+ class KmsThrottled < ServiceError
301
+
302
+ # @param [Seahorse::Client::RequestContext] context
303
+ # @param [String] message
304
+ # @param [Aws::SQS::Types::KmsThrottled] data
305
+ def initialize(context, message, data = Aws::EmptyStructure.new)
306
+ super(context, message, data)
307
+ end
308
+
309
+ # @return [String]
310
+ def message
311
+ @message || @data[:message]
312
+ end
121
313
  end
122
314
 
123
315
  class MessageNotInflight < ServiceError
@@ -138,6 +330,11 @@ module Aws::SQS
138
330
  def initialize(context, message, data = Aws::EmptyStructure.new)
139
331
  super(context, message, data)
140
332
  end
333
+
334
+ # @return [String]
335
+ def message
336
+ @message || @data[:message]
337
+ end
141
338
  end
142
339
 
143
340
  class PurgeQueueInProgress < ServiceError
@@ -148,6 +345,11 @@ module Aws::SQS
148
345
  def initialize(context, message, data = Aws::EmptyStructure.new)
149
346
  super(context, message, data)
150
347
  end
348
+
349
+ # @return [String]
350
+ def message
351
+ @message || @data[:message]
352
+ end
151
353
  end
152
354
 
153
355
  class QueueDeletedRecently < ServiceError
@@ -158,6 +360,11 @@ module Aws::SQS
158
360
  def initialize(context, message, data = Aws::EmptyStructure.new)
159
361
  super(context, message, data)
160
362
  end
363
+
364
+ # @return [String]
365
+ def message
366
+ @message || @data[:message]
367
+ end
161
368
  end
162
369
 
163
370
  class QueueDoesNotExist < ServiceError
@@ -168,6 +375,11 @@ module Aws::SQS
168
375
  def initialize(context, message, data = Aws::EmptyStructure.new)
169
376
  super(context, message, data)
170
377
  end
378
+
379
+ # @return [String]
380
+ def message
381
+ @message || @data[:message]
382
+ end
171
383
  end
172
384
 
173
385
  class QueueNameExists < ServiceError
@@ -178,6 +390,11 @@ module Aws::SQS
178
390
  def initialize(context, message, data = Aws::EmptyStructure.new)
179
391
  super(context, message, data)
180
392
  end
393
+
394
+ # @return [String]
395
+ def message
396
+ @message || @data[:message]
397
+ end
181
398
  end
182
399
 
183
400
  class ReceiptHandleIsInvalid < ServiceError
@@ -188,6 +405,41 @@ module Aws::SQS
188
405
  def initialize(context, message, data = Aws::EmptyStructure.new)
189
406
  super(context, message, data)
190
407
  end
408
+
409
+ # @return [String]
410
+ def message
411
+ @message || @data[:message]
412
+ end
413
+ end
414
+
415
+ class RequestThrottled < ServiceError
416
+
417
+ # @param [Seahorse::Client::RequestContext] context
418
+ # @param [String] message
419
+ # @param [Aws::SQS::Types::RequestThrottled] data
420
+ def initialize(context, message, data = Aws::EmptyStructure.new)
421
+ super(context, message, data)
422
+ end
423
+
424
+ # @return [String]
425
+ def message
426
+ @message || @data[:message]
427
+ end
428
+ end
429
+
430
+ class ResourceNotFoundException < ServiceError
431
+
432
+ # @param [Seahorse::Client::RequestContext] context
433
+ # @param [String] message
434
+ # @param [Aws::SQS::Types::ResourceNotFoundException] data
435
+ def initialize(context, message, data = Aws::EmptyStructure.new)
436
+ super(context, message, data)
437
+ end
438
+
439
+ # @return [String]
440
+ def message
441
+ @message || @data[:message]
442
+ end
191
443
  end
192
444
 
193
445
  class TooManyEntriesInBatchRequest < ServiceError
@@ -198,6 +450,11 @@ module Aws::SQS
198
450
  def initialize(context, message, data = Aws::EmptyStructure.new)
199
451
  super(context, message, data)
200
452
  end
453
+
454
+ # @return [String]
455
+ def message
456
+ @message || @data[:message]
457
+ end
201
458
  end
202
459
 
203
460
  class UnsupportedOperation < ServiceError
@@ -208,6 +465,11 @@ module Aws::SQS
208
465
  def initialize(context, message, data = Aws::EmptyStructure.new)
209
466
  super(context, message, data)
210
467
  end
468
+
469
+ # @return [String]
470
+ def message
471
+ @message || @data[:message]
472
+ end
211
473
  end
212
474
 
213
475
  end
@@ -43,7 +43,8 @@ module Aws::SQS
43
43
  end
44
44
 
45
45
  # A unique identifier for the message. A `MessageId`is considered unique
46
- # across all AWS accounts for an extended period of time.
46
+ # across all Amazon Web Services accounts for an extended period of
47
+ # time.
47
48
  # @return [String]
48
49
  def message_id
49
50
  data[:message_id]
@@ -104,8 +105,8 @@ module Aws::SQS
104
105
  end
105
106
 
106
107
  # Each message attribute consists of a `Name`, `Type`, and `Value`. For
107
- # more information, see [Amazon SQS Message Attributes][1] in the
108
- # *Amazon Simple Queue Service Developer Guide*.
108
+ # more information, see [Amazon SQS message attributes][1] in the
109
+ # *Amazon SQS Developer Guide*.
109
110
  #
110
111
  #
111
112
  #
@@ -162,7 +163,9 @@ module Aws::SQS
162
163
  queue_url: @queue_url,
163
164
  receipt_handle: @receipt_handle
164
165
  )
165
- resp = @client.change_message_visibility(options)
166
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
167
+ @client.change_message_visibility(options)
168
+ end
166
169
  resp.data
167
170
  end
168
171
 
@@ -176,7 +179,9 @@ module Aws::SQS
176
179
  queue_url: @queue_url,
177
180
  receipt_handle: @receipt_handle
178
181
  )
179
- resp = @client.delete_message(options)
182
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
183
+ @client.delete_message(options)
184
+ end
180
185
  resp.data
181
186
  end
182
187
 
@@ -241,7 +246,9 @@ module Aws::SQS
241
246
  receipt_handle: item.receipt_handle
242
247
  }
243
248
  end
244
- batch[0].client.delete_message_batch(params)
249
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
250
+ batch[0].client.delete_message_batch(params)
251
+ end
245
252
  end
246
253
  nil
247
254
  end
@@ -0,0 +1,128 @@
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
+ rbs_type: 'untyped',
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::SQS::EndpointParameters`.
22
+ DOCS
23
+ Aws::SQS::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
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
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ with_metrics(context) { @handler.call(context) }
44
+ end
45
+
46
+ private
47
+
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
60
+ def apply_endpoint_headers(context, headers)
61
+ headers.each do |key, values|
62
+ value = values
63
+ .compact
64
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
65
+ .join(',')
66
+
67
+ context.http_request.headers[key] = value
68
+ end
69
+ end
70
+
71
+ def parameters_for_operation(context)
72
+ case context.operation_name
73
+ when :add_permission
74
+ Aws::SQS::Endpoints::AddPermission.build(context)
75
+ when :cancel_message_move_task
76
+ Aws::SQS::Endpoints::CancelMessageMoveTask.build(context)
77
+ when :change_message_visibility
78
+ Aws::SQS::Endpoints::ChangeMessageVisibility.build(context)
79
+ when :change_message_visibility_batch
80
+ Aws::SQS::Endpoints::ChangeMessageVisibilityBatch.build(context)
81
+ when :create_queue
82
+ Aws::SQS::Endpoints::CreateQueue.build(context)
83
+ when :delete_message
84
+ Aws::SQS::Endpoints::DeleteMessage.build(context)
85
+ when :delete_message_batch
86
+ Aws::SQS::Endpoints::DeleteMessageBatch.build(context)
87
+ when :delete_queue
88
+ Aws::SQS::Endpoints::DeleteQueue.build(context)
89
+ when :get_queue_attributes
90
+ Aws::SQS::Endpoints::GetQueueAttributes.build(context)
91
+ when :get_queue_url
92
+ Aws::SQS::Endpoints::GetQueueUrl.build(context)
93
+ when :list_dead_letter_source_queues
94
+ Aws::SQS::Endpoints::ListDeadLetterSourceQueues.build(context)
95
+ when :list_message_move_tasks
96
+ Aws::SQS::Endpoints::ListMessageMoveTasks.build(context)
97
+ when :list_queue_tags
98
+ Aws::SQS::Endpoints::ListQueueTags.build(context)
99
+ when :list_queues
100
+ Aws::SQS::Endpoints::ListQueues.build(context)
101
+ when :purge_queue
102
+ Aws::SQS::Endpoints::PurgeQueue.build(context)
103
+ when :receive_message
104
+ Aws::SQS::Endpoints::ReceiveMessage.build(context)
105
+ when :remove_permission
106
+ Aws::SQS::Endpoints::RemovePermission.build(context)
107
+ when :send_message
108
+ Aws::SQS::Endpoints::SendMessage.build(context)
109
+ when :send_message_batch
110
+ Aws::SQS::Endpoints::SendMessageBatch.build(context)
111
+ when :set_queue_attributes
112
+ Aws::SQS::Endpoints::SetQueueAttributes.build(context)
113
+ when :start_message_move_task
114
+ Aws::SQS::Endpoints::StartMessageMoveTask.build(context)
115
+ when :tag_queue
116
+ Aws::SQS::Endpoints::TagQueue.build(context)
117
+ when :untag_queue
118
+ Aws::SQS::Endpoints::UntagQueue.build(context)
119
+ end
120
+ end
121
+ end
122
+
123
+ def add_handlers(handlers, _config)
124
+ handlers.add(Handler, step: :build, priority: 75)
125
+ end
126
+ end
127
+ end
128
+ end