aws-sdk-sqs 1.30.0 → 1.89.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.
@@ -4,7 +4,6 @@ require 'set'
4
4
 
5
5
  module Aws
6
6
  module SQS
7
-
8
7
  # A utility class for long polling messages in a loop. **Messages are
9
8
  # automatically deleted from the queue at the end of the given block.**
10
9
  #
@@ -181,6 +180,16 @@ module Aws
181
180
  # end
182
181
  # ```
183
182
  #
183
+ # * Configure an {#after_empty_receive} callback.
184
+ #
185
+ # ```
186
+ # poller.after_empty_receive do |stats|
187
+ # logger.info("requests: #{stats.request_count}")
188
+ # logger.info("messages: #{stats.received_message_count}")
189
+ # logger.info("last-timestamp: #{stats.last_message_received_at}")
190
+ # end
191
+ # ```
192
+ #
184
193
  # * Accept a 2nd argument in the poll block, for example:
185
194
  #
186
195
  # ```
@@ -203,7 +212,6 @@ module Aws
203
212
  # ```
204
213
  #
205
214
  class QueuePoller
206
-
207
215
  # @param [String] queue_url
208
216
  # @option options [Client] :client
209
217
  # @option (see #poll)
@@ -258,6 +266,21 @@ module Aws
258
266
  @default_config = @default_config.with(before_request: block) if block_given?
259
267
  end
260
268
 
269
+ # Registers a callback that is invoked when the poll requests returns with no messages.
270
+ # This callback is invoked after the idle timeout is checked.
271
+ #
272
+ # poller.after_empty_receive do |stats|
273
+ # # Handle empty receive
274
+ # end
275
+ #
276
+ # @yieldparam [PollerStats] stats An object that tracks a few
277
+ # client-side statistics about the queue polling.
278
+ #
279
+ # @return [void]
280
+ def after_empty_receive(&block)
281
+ @default_config = @default_config.with(after_empty_receive: block) if block_given?
282
+ end
283
+
261
284
  # Polls the queue, yielded a message, or an array of messages.
262
285
  # Messages are automatically deleted from the queue at the
263
286
  # end of the given block. See the class documentation on
@@ -290,7 +313,7 @@ module Aws
290
313
  # @option options [Integer] :visibility_timeout (nil)
291
314
  # The number of seconds you have to process a message before
292
315
  # it is put back into the queue and can be received again.
293
- # By default, the queue's
316
+ # By default, the queue's visibility timeout is not set.
294
317
  #
295
318
  # @option options [Array<String>] :attribute_names ([])
296
319
  # The list of attributes that need to be returned along with each
@@ -333,7 +356,8 @@ module Aws
333
356
  loop do
334
357
  messages = get_messages(config, stats)
335
358
  if messages.empty?
336
- check_idle_timeout(config, stats, messages)
359
+ check_idle_timeout(config, stats)
360
+ config.after_empty_receive&.call(stats)
337
361
  else
338
362
  process_messages(config, stats, messages, &block)
339
363
  end
@@ -348,21 +372,21 @@ module Aws
348
372
  # `#receipt_handle`.
349
373
  # @param [Integer] seconds
350
374
  def change_message_visibility_timeout(message, seconds)
351
- @client.change_message_visibility({
375
+ @client.change_message_visibility(
352
376
  queue_url: @queue_url,
353
377
  receipt_handle: message.receipt_handle,
354
- visibility_timeout: seconds,
355
- })
378
+ visibility_timeout: seconds
379
+ )
356
380
  end
357
381
 
358
382
  # @note This method should be called from inside a {#poll} block.
359
383
  # @param [#receipt_handle] message An object that responds to
360
384
  # `#receipt_handle`.
361
385
  def delete_message(message)
362
- @client.delete_message({
386
+ @client.delete_message(
363
387
  queue_url: @queue_url,
364
- receipt_handle: message.receipt_handle,
365
- })
388
+ receipt_handle: message.receipt_handle
389
+ )
366
390
  end
367
391
 
368
392
  # @note This method should be called from inside a {#poll} block.
@@ -372,16 +396,16 @@ module Aws
372
396
  def delete_messages(messages)
373
397
  @client.delete_message_batch(
374
398
  queue_url: @queue_url,
375
- entries: messages.map { |msg|
399
+ entries: messages.map do |msg|
376
400
  { id: msg.message_id, receipt_handle: msg.receipt_handle }
377
- }
401
+ end
378
402
  )
379
403
  end
380
404
 
381
405
  private
382
406
 
383
407
  def get_messages(config, stats)
384
- config.before_request.call(stats) if config.before_request
408
+ config.before_request&.call(stats)
385
409
  messages = send_request(config).messages
386
410
  stats.request_count += 1
387
411
  messages
@@ -392,17 +416,22 @@ module Aws
392
416
  @client.receive_message(params)
393
417
  end
394
418
 
395
- def check_idle_timeout(config, stats, messages)
396
- if config.idle_timeout
397
- since = stats.last_message_received_at || stats.polling_started_at
398
- idle_time = Time.now - since
399
- throw :stop_polling if idle_time > config.idle_timeout
400
- end
419
+ def check_idle_timeout(config, stats)
420
+ return unless config.idle_timeout
421
+
422
+ since = stats.last_message_received_at || stats.polling_started_at
423
+ idle_time = Time.now - since
424
+ throw :stop_polling if idle_time > config.idle_timeout
401
425
  end
402
426
 
403
427
  def process_messages(config, stats, messages, &block)
404
428
  stats.received_message_count += messages.count
405
429
  stats.last_message_received_at = Time.now
430
+
431
+ # duplicated messages will have a different receipt handle
432
+ # so we need to provide the most recent receipt to
433
+ # delete a batch - thus, filtering below by message_id
434
+ messages = messages.reverse.uniq(&:message_id).reverse!
406
435
  catch(:skip_delete) do
407
436
  yield_messages(config, messages, stats, &block)
408
437
  delete_messages(messages) unless config.skip_delete
@@ -421,7 +450,6 @@ module Aws
421
450
 
422
451
  # Statistics tracked client-side by the {QueuePoller}.
423
452
  class PollerStats
424
-
425
453
  def initialize
426
454
  @request_count = 0
427
455
  @received_message_count = 0
@@ -444,27 +472,26 @@ module Aws
444
472
 
445
473
  # @return [Time,nil]
446
474
  attr_accessor :polling_stopped_at
447
-
448
475
  end
449
476
 
450
477
  # A read-only set of configuration used by the QueuePoller.
451
478
  class PollerConfig
452
-
453
479
  # @api private
454
- CONFIG_OPTIONS = Set.new([
455
- :idle_timeout,
456
- :skip_delete,
457
- :before_request,
458
- ])
480
+ CONFIG_OPTIONS = Set.new %i[
481
+ idle_timeout
482
+ skip_delete
483
+ before_request
484
+ after_empty_receive
485
+ ]
459
486
 
460
487
  # @api private
461
- PARAM_OPTIONS = Set.new([
462
- :wait_time_seconds,
463
- :max_number_of_messages,
464
- :visibility_timeout,
465
- :attribute_names,
466
- :message_attribute_names,
467
- ])
488
+ PARAM_OPTIONS = Set.new %i[
489
+ wait_time_seconds
490
+ max_number_of_messages
491
+ visibility_timeout
492
+ attribute_names
493
+ message_attribute_names
494
+ ]
468
495
 
469
496
  # @return [Integer,nil]
470
497
  attr_reader :idle_timeout
@@ -475,6 +502,9 @@ module Aws
475
502
  # @return [Proc,nil]
476
503
  attr_reader :before_request
477
504
 
505
+ # @return [Proc,nil]
506
+ attr_reader :after_empty_receive
507
+
478
508
  # @return [Hash]
479
509
  attr_reader :request_params
480
510
 
@@ -482,12 +512,13 @@ module Aws
482
512
  @idle_timeout = nil
483
513
  @skip_delete = false
484
514
  @before_request = nil
515
+ @after_empty_receive = nil
485
516
  @request_params = {
486
517
  wait_time_seconds: 20,
487
518
  max_number_of_messages: 1,
488
519
  visibility_timeout: nil,
489
520
  attribute_names: ['All'],
490
- message_attribute_names: ['All'],
521
+ message_attribute_names: ['All']
491
522
  }
492
523
  options.each do |opt_name, value|
493
524
  if CONFIG_OPTIONS.include?(opt_name)
@@ -498,6 +529,12 @@ module Aws
498
529
  raise ArgumentError, "invalid option #{opt_name.inspect}"
499
530
  end
500
531
  end
532
+
533
+ max_number_of_messages = @request_params[:max_number_of_messages]
534
+ unless max_number_of_messages.is_a?(Integer) && max_number_of_messages.positive?
535
+ raise ArgumentError, ':max_number_of_messages must be a positive integer'
536
+ end
537
+
501
538
  @request_params.freeze
502
539
  freeze
503
540
  end
@@ -516,7 +553,6 @@ module Aws
516
553
  PARAM_OPTIONS.each { |key| hash[key] = @request_params[key] }
517
554
  hash
518
555
  end
519
-
520
556
  end
521
557
  end
522
558
  end
@@ -3,7 +3,7 @@
3
3
  # WARNING ABOUT GENERATED CODE
4
4
  #
5
5
  # This file is generated. See the contributing guide for more information:
6
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
@@ -76,80 +76,116 @@ 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).
80
- #
81
- # * `Policy` The queue's policy. A valid AWS policy. For more
82
- # information about policy structure, see [Overview of AWS IAM
83
- # Policies][1] in the *Amazon IAM User Guide*.
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.
86
+ #
87
+ # * `Policy` – The queue's policy. A valid Amazon Web Services policy.
88
+ # For more information about policy structure, see [Overview of Amazon
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. For more information about the redrive policy and
92
- # dead-letter queues, see [Using Amazon SQS Dead-Letter Queues][2] in
93
- # the *Amazon Simple Queue Service 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. When
101
- # the `ReceiveCount` for a message exceeds the `maxReceiveCount` for
102
- # a queue, Amazon SQS moves the message to the dead-letter-queue.
103
- #
104
- # <note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
105
- # Similarly, the dead-letter queue of a standard queue must also be a
106
- # standard queue.
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
+ # * `RedriveAllowPolicy` The string that includes the parameters for
116
+ # the permissions for the dead-letter queue redrive permission and
117
+ # which source queues can specify dead-letter queues as a JSON object.
118
+ # The parameters are as follows:
119
+ #
120
+ # * `redrivePermission` – The permission type that defines which
121
+ # source queues can specify the current queue as the dead-letter
122
+ # queue. Valid values are:
123
+ #
124
+ # * `allowAll` – (Default) Any source queues in this Amazon Web
125
+ # Services account in the same Region can specify this queue as
126
+ # the dead-letter queue.
127
+ #
128
+ # * `denyAll` – No source queues can specify this queue as the
129
+ # dead-letter queue.
130
+ #
131
+ # * `byQueue` – Only queues specified by the `sourceQueueArns`
132
+ # parameter can specify this queue as the dead-letter queue.
133
+ # * `sourceQueueArns` – The Amazon Resource Names (ARN)s of the source
134
+ # queues that can specify this queue as the dead-letter queue and
135
+ # redrive messages. You can specify this parameter only when the
136
+ # `redrivePermission` parameter is set to `byQueue`. You can specify
137
+ # up to 10 source queue ARNs. To allow more than 10 source queues to
138
+ # specify dead-letter queues, set the `redrivePermission` parameter
139
+ # to `allowAll`.
140
+ #
141
+ # <note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
142
+ # Similarly, the dead-letter queue of a standard queue must also be a
143
+ # standard queue.
107
144
  #
108
- # </note>
109
- #
110
- # * `VisibilityTimeout` – The visibility timeout for the queue, in
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 Simple Queue Service
114
- # Developer Guide*.
145
+ # </note>
115
146
  #
116
- # The following attributes apply only to [server-side-encryption][4]\:
147
+ # The following attributes apply only to [server-side-encryption][4]:
117
148
  #
118
- # * `KmsMasterKeyId` – The ID of an AWS-managed customer master key
119
- # (CMK) for Amazon SQS or a custom CMK. For more information, see [Key
120
- # Terms][5]. While the alias of the AWS-managed CMK for Amazon SQS is
121
- # always `alias/aws/sqs`, the alias of a custom CMK can, for example,
122
- # be `alias/MyAlias `. For more examples, see [KeyId][6] in the *AWS
123
- # Key Management Service API Reference*.
149
+ # * `KmsMasterKeyId` – The ID of an Amazon Web Services managed customer
150
+ # master key (CMK) for Amazon SQS or a custom CMK. For more
151
+ # information, see [Key Terms][5]. While the alias of the Amazon Web
152
+ # Services managed CMK for Amazon SQS is always `alias/aws/sqs`, the
153
+ # alias of a custom CMK can, for example, be `alias/MyAlias `. For
154
+ # more examples, see [KeyId][6] in the *Key Management Service API
155
+ # Reference*.
124
156
  #
125
157
  # * `KmsDataKeyReusePeriodSeconds` – The length of time, in seconds, for
126
158
  # which Amazon SQS can reuse a [data key][7] to encrypt or decrypt
127
- # messages before calling AWS KMS again. An integer representing
128
- # seconds, between 60 seconds (1 minute) and 86,400 seconds (24
129
- # hours). Default: 300 (5 minutes). A shorter time period provides
130
- # better security but results in more calls to KMS which might incur
131
- # charges after Free Tier. For more information, see [How Does the
132
- # Data Key Reuse Period Work?][8].
159
+ # messages before calling KMS again. An integer representing seconds,
160
+ # between 60 seconds (1 minute) and 86,400 seconds (24 hours).
161
+ # Default: 300 (5 minutes). A shorter time period provides better
162
+ # security but results in more calls to KMS which might incur charges
163
+ # after Free Tier. For more information, see [How Does the Data Key
164
+ # Reuse Period Work?][8]
165
+ #
166
+ # * `SqsManagedSseEnabled` – Enables server-side queue encryption using
167
+ # SQS owned encryption keys. Only one server-side encryption option is
168
+ # supported per queue (for example, [SSE-KMS][9] or [SSE-SQS][10]).
133
169
  #
134
170
  # The following attributes apply only to [FIFO (first-in-first-out)
135
- # queues][9]\:
171
+ # queues][11]:
136
172
  #
137
- # * `FifoQueue` – Designates a queue as FIFO. Valid values: `true`,
138
- # `false`. If you don't specify the `FifoQueue` attribute, Amazon SQS
139
- # creates a standard queue. You can provide this attribute only during
140
- # queue creation. You can't change it for an existing queue. When you
141
- # set this attribute, you must also provide the `MessageGroupId` for
142
- # your messages explicitly.
173
+ # * `FifoQueue` – Designates a queue as FIFO. Valid values are `true`
174
+ # and `false`. If you don't specify the `FifoQueue` attribute, Amazon
175
+ # SQS creates a standard queue. You can provide this attribute only
176
+ # during queue creation. You can't change it for an existing queue.
177
+ # When you set this attribute, you must also provide the
178
+ # `MessageGroupId` for your messages explicitly.
143
179
  #
144
- # For more information, see [FIFO Queue Logic][10] in the *Amazon
145
- # Simple Queue Service Developer Guide*.
180
+ # For more information, see [FIFO queue logic][12] in the *Amazon SQS
181
+ # Developer Guide*.
146
182
  #
147
183
  # * `ContentBasedDeduplication` – Enables content-based deduplication.
148
- # Valid values: `true`, `false`. For more information, see
149
- # [Exactly-Once Processing][11] in the *Amazon Simple Queue Service
150
- # Developer Guide*.
184
+ # Valid values are `true` and `false`. For more information, see
185
+ # [Exactly-once processing][13] in the *Amazon SQS Developer Guide*.
186
+ # Note the following:
151
187
  #
152
- # * Every message must have a unique `MessageDeduplicationId`,
188
+ # * Every message must have a unique `MessageDeduplicationId`.
153
189
  #
154
190
  # * You may provide a `MessageDeduplicationId` explicitly.
155
191
  #
@@ -165,7 +201,6 @@ module Aws::SQS
165
201
  #
166
202
  # * If the queue has `ContentBasedDeduplication` set, your
167
203
  # `MessageDeduplicationId` overrides the generated one.
168
- #
169
204
  # * When `ContentBasedDeduplication` is in effect, messages with
170
205
  # identical content sent within the deduplication interval are
171
206
  # treated as duplicates and only one copy of the message is
@@ -177,23 +212,53 @@ module Aws::SQS
177
212
  # `MessageDeduplicationId`, the two messages are treated as
178
213
  # duplicates and only one copy of the message is delivered.
179
214
  #
215
+ # The following attributes apply only to [high throughput for FIFO
216
+ # queues][14]:
217
+ #
218
+ # * `DeduplicationScope` – Specifies whether message deduplication
219
+ # occurs at the message group or queue level. Valid values are
220
+ # `messageGroup` and `queue`.
221
+ #
222
+ # * `FifoThroughputLimit` – Specifies whether the FIFO queue throughput
223
+ # quota applies to the entire queue or per message group. Valid values
224
+ # are `perQueue` and `perMessageGroupId`. The `perMessageGroupId`
225
+ # value is allowed only when the value for `DeduplicationScope` is
226
+ # `messageGroup`.
227
+ #
228
+ # To enable high throughput for FIFO queues, do the following:
229
+ #
230
+ # * Set `DeduplicationScope` to `messageGroup`.
231
+ #
232
+ # * Set `FifoThroughputLimit` to `perMessageGroupId`.
233
+ #
234
+ # If you set these attributes to anything other than the values shown
235
+ # for enabling high throughput, normal throughput is in effect and
236
+ # deduplication occurs as specified.
237
+ #
238
+ # For information on throughput quotas, see [Quotas related to
239
+ # messages][15] in the *Amazon SQS Developer Guide*.
240
+ #
180
241
  #
181
242
  #
182
243
  # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
183
- # [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
184
- # [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
244
+ # [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
245
+ # [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
185
246
  # [4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
186
247
  # [5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
187
248
  # [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
188
249
  # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
189
250
  # [8]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work
190
- # [9]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
191
- # [10]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic
192
- # [11]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
251
+ # [9]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html
252
+ # [10]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html
253
+ # [11]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
254
+ # [12]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html
255
+ # [13]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html
256
+ # [14]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html
257
+ # [15]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html
193
258
  # @option options [Hash<String,String>] :tags
194
259
  # Add cost allocation tags to the specified Amazon SQS queue. For an
195
- # overview, see [Tagging Your Amazon SQS Queues][1] in the *Amazon
196
- # Simple Queue Service Developer Guide*.
260
+ # overview, see [Tagging Your Amazon SQS Queues][1] in the *Amazon SQS
261
+ # Developer Guide*.
197
262
  #
198
263
  # When you use queue tags, keep the following guidelines in mind:
199
264
  #
@@ -207,15 +272,15 @@ module Aws::SQS
207
272
  # * A new tag with a key identical to that of an existing tag overwrites
208
273
  # the existing tag.
209
274
  #
210
- # For a full list of tag restrictions, see [Limits Related to Queues][2]
211
- # in the *Amazon Simple Queue Service Developer Guide*.
275
+ # For a full list of tag restrictions, see [Quotas related to queues][2]
276
+ # in the *Amazon SQS Developer Guide*.
212
277
  #
213
278
  # <note markdown="1"> To be able to tag a queue on creation, you must have the
214
279
  # `sqs:CreateQueue` and `sqs:TagQueue` permissions.
215
280
  #
216
281
  # Cross-account permissions don't apply to this action. For more
217
- # information, see [Grant Cross-Account Permissions to a Role and a User
218
- # Name][3] in the *Amazon Simple Queue Service Developer Guide*.
282
+ # information, see [Grant cross-account permissions to a role and a
283
+ # username][3] in the *Amazon SQS Developer Guide*.
219
284
  #
220
285
  # </note>
221
286
  #
@@ -226,7 +291,9 @@ module Aws::SQS
226
291
  # [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name
227
292
  # @return [Queue]
228
293
  def create_queue(options = {})
229
- resp = @client.create_queue(options)
294
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
295
+ @client.create_queue(options)
296
+ end
230
297
  Queue.new(
231
298
  url: resp.data.queue_url,
232
299
  client: @client
@@ -247,10 +314,13 @@ module Aws::SQS
247
314
  #
248
315
  # Queue URLs and names are case-sensitive.
249
316
  # @option options [String] :queue_owner_aws_account_id
250
- # The AWS account ID of the account that created the queue.
317
+ # The Amazon Web Services account ID of the account that created the
318
+ # queue.
251
319
  # @return [Queue]
252
320
  def get_queue_by_name(options = {})
253
- resp = @client.get_queue_url(options)
321
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
322
+ @client.get_queue_url(options)
323
+ end
254
324
  Queue.new(
255
325
  url: resp.data.queue_url,
256
326
  client: @client
@@ -282,7 +352,9 @@ module Aws::SQS
282
352
  # @return [Queue::Collection]
283
353
  def queues(options = {})
284
354
  batches = Enumerator.new do |y|
285
- resp = @client.list_queues(options)
355
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
356
+ @client.list_queues(options)
357
+ end
286
358
  resp.each_page do |page|
287
359
  batch = []
288
360
  page.data.queue_urls.each do |q|