aws-sdk-sqs 1.10.0 → 1.34.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.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'openssl'
2
4
 
3
5
  module Aws
@@ -50,7 +52,9 @@ module Aws
50
52
 
51
53
  def validate_single_message(body, attributes, response)
52
54
  validate_body(body, response)
53
- validate_attributes(attributes, response) unless attributes.nil?
55
+ unless attributes.nil? || attributes.empty?
56
+ validate_attributes(attributes, response)
57
+ end
54
58
  end
55
59
 
56
60
  def validate_body(body, response)
@@ -117,14 +121,12 @@ module Aws
117
121
  end
118
122
 
119
123
  def mismatch_error_message(section, local_md5, returned_md5, response)
120
- m = "MD5 returned by SQS does not match " <<
121
- "the calculation on the original request. ("
122
-
124
+ m = 'MD5 returned by SQS does not match '\
125
+ 'the calculation on the original request. ('
123
126
  if response.respond_to?(:id) && !response.id.nil?
124
- m << "Message ID: #{response.id}, "
127
+ m = "#{m}Message ID: #{response.id}, "
125
128
  end
126
-
127
- m << "MD5 calculated by the #{section}: " <<
129
+ "#{m}MD5 calculated by the #{section}: "\
128
130
  "'#{local_md5}', MD5 checksum returned: '#{returned_md5}')"
129
131
  end
130
132
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module SQS
3
5
  module Plugins
@@ -22,7 +24,7 @@ module Aws
22
24
  # region, then we will modify the request to have
23
25
  # a sigv4 signer for the proper region.
24
26
  def update_region(context, queue_url)
25
- if queue_region = queue_url.to_s.split('.')[1]
27
+ if queue_region = parse_region(queue_url)
26
28
  if queue_region != context.config.region
27
29
  config = context.config.dup
28
30
  config.region = queue_region
@@ -33,6 +35,16 @@ module Aws
33
35
  end
34
36
  end
35
37
 
38
+ private
39
+
40
+ # take the first component after service delimiter
41
+ # https://sqs.us-east-1.amazonaws.com/1234567890/demo
42
+ # https://vpce-x-y.sqs.us-east-1.vpce.amazonaws.com/1234567890/demo
43
+ def parse_region(url)
44
+ parts = url.split('sqs.')
45
+ parts[1].split('.').first if parts.size > 1
46
+ end
47
+
36
48
  end
37
49
 
38
50
  handler(Handler)
@@ -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
@@ -98,8 +102,8 @@ module Aws::SQS
98
102
  #
99
103
  #
100
104
  #
101
- # [1]: http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P
102
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication
105
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P
106
+ # [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication
103
107
  # @option options [required, Array<String>] :actions
104
108
  # The action the client wants to allow for the specified principal.
105
109
  # Valid values: the name of any action or `*`.
@@ -116,7 +120,7 @@ module Aws::SQS
116
120
  #
117
121
  #
118
122
  #
119
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html
123
+ # [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html
120
124
  # @return [EmptyStructure]
121
125
  def add_permission(options = {})
122
126
  options = options.merge(queue_url: @url)
@@ -200,16 +204,18 @@ module Aws::SQS
200
204
  # })
201
205
  # @param [Hash] options ({})
202
206
  # @option options [Array<String>] :attribute_names
203
- # A list of s that need to be returned along with each message. These
204
- # attributes include:
207
+ # A list of attributes that need to be returned along with each message.
208
+ # These attributes include:
205
209
  #
206
- # * `All` - Returns all values.
210
+ # * `All` Returns all values.
207
211
  #
208
- # * `ApproximateFirstReceiveTimestamp` - Returns the time the message
212
+ # * `ApproximateFirstReceiveTimestamp` Returns the time the message
209
213
  # was first received from the queue ([epoch time][1] in milliseconds).
210
214
  #
211
- # * `ApproximateReceiveCount` - Returns the number of times a message
212
- # has been received from the queue but not deleted.
215
+ # * `ApproximateReceiveCount` Returns the number of times a message
216
+ # has been received across all queues but not deleted.
217
+ #
218
+ # * `AWSTraceHeader` – Returns the AWS X-Ray trace header string.
213
219
  #
214
220
  # * `SenderId`
215
221
  #
@@ -219,17 +225,17 @@ module Aws::SQS
219
225
  # * For an IAM role, returns the IAM role ID, for example
220
226
  # `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`.
221
227
  #
222
- # * `SentTimestamp` - Returns the time the message was sent to the queue
228
+ # * `SentTimestamp` Returns the time the message was sent to the queue
223
229
  # ([epoch time][1] in milliseconds).
224
230
  #
225
- # * `MessageDeduplicationId` - Returns the value provided by the
231
+ # * `MessageDeduplicationId` Returns the value provided by the
226
232
  # producer that calls the ` SendMessage ` action.
227
233
  #
228
- # * `MessageGroupId` - Returns the value provided by the producer that
234
+ # * `MessageGroupId` Returns the value provided by the producer that
229
235
  # calls the ` SendMessage ` action. Messages with the same
230
236
  # `MessageGroupId` are returned in sequence.
231
237
  #
232
- # * `SequenceNumber` - Returns the value provided by Amazon SQS.
238
+ # * `SequenceNumber` Returns the value provided by Amazon SQS.
233
239
  #
234
240
  #
235
241
  #
@@ -269,14 +275,25 @@ module Aws::SQS
269
275
  # call returns sooner than `WaitTimeSeconds`. If no messages are
270
276
  # available and the wait time expires, the call returns successfully
271
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
272
289
  # @option options [String] :receive_request_attempt_id
273
290
  # This parameter applies only to FIFO (first-in-first-out) queues.
274
291
  #
275
292
  # The token used for deduplication of `ReceiveMessage` calls. If a
276
293
  # networking issue occurs after a `ReceiveMessage` action, and instead
277
- # of a response you receive a generic error, you can retry the same
278
- # action with an identical `ReceiveRequestAttemptId` to retrieve the
279
- # 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
280
297
  # expired.
281
298
  #
282
299
  # * You can use `ReceiveRequestAttemptId` only for 5 minutes after a
@@ -289,7 +306,7 @@ module Aws::SQS
289
306
  # `ReceiveRequestAttemptId`, Amazon SQS generates a
290
307
  # `ReceiveRequestAttemptId`.
291
308
  #
292
- # * You can retry the `ReceiveMessage` action with the same
309
+ # * It is possible to retry the `ReceiveMessage` action with the same
293
310
  # `ReceiveRequestAttemptId` if none of the messages have been modified
294
311
  # (deleted or had their visibility changes).
295
312
  #
@@ -320,7 +337,7 @@ module Aws::SQS
320
337
  # visibility timeout expires. As a result, delays might occur but the
321
338
  # messages in the queue remain in a strict order.
322
339
  #
323
- # The length of `ReceiveRequestAttemptId` is 128 characters.
340
+ # The maximum length of `ReceiveRequestAttemptId` is 128 characters.
324
341
  # `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`,
325
342
  # `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
326
343
  # ``).
@@ -331,8 +348,8 @@ module Aws::SQS
331
348
  #
332
349
  #
333
350
  #
334
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
335
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html
351
+ # [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
352
+ # [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html
336
353
  # @return [Message::Collection]
337
354
  def receive_messages(options = {})
338
355
  batch = []
@@ -379,12 +396,22 @@ module Aws::SQS
379
396
  # data_type: "String", # required
380
397
  # },
381
398
  # },
399
+ # message_system_attributes: {
400
+ # "AWSTraceHeader" => {
401
+ # string_value: "String",
402
+ # binary_value: "data",
403
+ # string_list_values: ["String"],
404
+ # binary_list_values: ["data"],
405
+ # data_type: "String", # required
406
+ # },
407
+ # },
382
408
  # message_deduplication_id: "String",
383
409
  # message_group_id: "String",
384
410
  # })
385
411
  # @param [Hash] options ({})
386
412
  # @option options [required, String] :message_body
387
- # The message to send. The maximum string size is 256 KB.
413
+ # The message to send. The minimum size is one character. The maximum
414
+ # size is 256 KB.
388
415
  #
389
416
  # A message can include only XML, JSON, and unformatted text. The
390
417
  # following Unicode characters are allowed:
@@ -416,7 +443,17 @@ module Aws::SQS
416
443
  #
417
444
  #
418
445
  #
419
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html
446
+ # [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes
447
+ # @option options [Hash<String,Types::MessageSystemAttributeValue>] :message_system_attributes
448
+ # The message system attribute to send. Each message system attribute
449
+ # consists of a `Name`, `Type`, and `Value`.
450
+ #
451
+ # * Currently, the only supported message system attribute is
452
+ # `AWSTraceHeader`. Its type must be `String` and its value must be a
453
+ # correctly formatted AWS X-Ray trace header string.
454
+ #
455
+ # * The size of a message system attribute doesn't count towards the
456
+ # total size of a message.
420
457
  # @option options [String] :message_deduplication_id
421
458
  # This parameter applies only to FIFO (first-in-first-out) queues.
422
459
  #
@@ -465,7 +502,7 @@ module Aws::SQS
465
502
  #
466
503
  # </note>
467
504
  #
468
- # The length of `MessageDeduplicationId` is 128 characters.
505
+ # The maximum length of `MessageDeduplicationId` is 128 characters.
469
506
  # `MessageDeduplicationId` can contain alphanumeric characters (`a-z`,
470
507
  # `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
471
508
  # ``).
@@ -476,8 +513,8 @@ module Aws::SQS
476
513
  #
477
514
  #
478
515
  #
479
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
480
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html
516
+ # [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
517
+ # [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html
481
518
  # @option options [String] :message_group_id
482
519
  # This parameter applies only to FIFO (first-in-first-out) queues.
483
520
  #
@@ -510,7 +547,7 @@ module Aws::SQS
510
547
  #
511
548
  #
512
549
  #
513
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html
550
+ # [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html
514
551
  # @return [Types::SendMessageResult]
515
552
  def send_message(options = {})
516
553
  options = options.merge(queue_url: @url)
@@ -535,6 +572,15 @@ module Aws::SQS
535
572
  # data_type: "String", # required
536
573
  # },
537
574
  # },
575
+ # message_system_attributes: {
576
+ # "AWSTraceHeader" => {
577
+ # string_value: "String",
578
+ # binary_value: "data",
579
+ # string_list_values: ["String"],
580
+ # binary_list_values: ["data"],
581
+ # data_type: "String", # required
582
+ # },
583
+ # },
538
584
  # message_deduplication_id: "String",
539
585
  # message_group_id: "String",
540
586
  # },
@@ -564,39 +610,39 @@ module Aws::SQS
564
610
  # The following lists the names, descriptions, and values of the special
565
611
  # request parameters that the `SetQueueAttributes` action uses:
566
612
  #
567
- # * `DelaySeconds` - The length of time, in seconds, for which the
613
+ # * `DelaySeconds` The length of time, in seconds, for which the
568
614
  # delivery of all messages in the queue is delayed. Valid values: An
569
615
  # integer from 0 to 900 (15 minutes). Default: 0.
570
616
  #
571
- # * `MaximumMessageSize` - The limit of how many bytes a message can
617
+ # * `MaximumMessageSize` The limit of how many bytes a message can
572
618
  # contain before Amazon SQS rejects it. Valid values: An integer from
573
619
  # 1,024 bytes (1 KiB) up to 262,144 bytes (256 KiB). Default: 262,144
574
620
  # (256 KiB).
575
621
  #
576
- # * `MessageRetentionPeriod` - The length of time, in seconds, for which
622
+ # * `MessageRetentionPeriod` The length of time, in seconds, for which
577
623
  # Amazon SQS retains a message. Valid values: An integer representing
578
624
  # seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600
579
625
  # (4 days).
580
626
  #
581
- # * `Policy` - The queue's policy. A valid AWS policy. For more
627
+ # * `Policy` The queue's policy. A valid AWS policy. For more
582
628
  # information about policy structure, see [Overview of AWS IAM
583
629
  # Policies][1] in the *Amazon IAM User Guide*.
584
630
  #
585
- # * `ReceiveMessageWaitTimeSeconds` - The length of time, in seconds,
631
+ # * `ReceiveMessageWaitTimeSeconds` The length of time, in seconds,
586
632
  # for which a ` ReceiveMessage ` action waits for a message to arrive.
587
- # Valid values: an integer from 0 to 20 (seconds). Default: 0.
633
+ # Valid values: An integer from 0 to 20 (seconds). Default: 0.
588
634
  #
589
- # * `RedrivePolicy` - The string that includes the parameters for the
590
- # dead-letter queue functionality of the source queue. For more
591
- # information about the redrive policy and dead-letter queues, see
592
- # [Using Amazon SQS Dead-Letter Queues][2] in the *Amazon Simple Queue
593
- # Service Developer Guide*.
635
+ # * `RedrivePolicy` The string that includes the parameters for the
636
+ # dead-letter queue functionality of the source queue as a JSON
637
+ # object. For more information about the redrive policy and
638
+ # dead-letter queues, see [Using Amazon SQS Dead-Letter Queues][2] in
639
+ # the *Amazon Simple Queue Service Developer Guide*.
594
640
  #
595
- # * `deadLetterTargetArn` - The Amazon Resource Name (ARN) of the
641
+ # * `deadLetterTargetArn` The Amazon Resource Name (ARN) of the
596
642
  # dead-letter queue to which Amazon SQS moves messages after the
597
643
  # value of `maxReceiveCount` is exceeded.
598
644
  #
599
- # * `maxReceiveCount` - The number of times a message is delivered to
645
+ # * `maxReceiveCount` The number of times a message is delivered to
600
646
  # the source queue before being moved to the dead-letter queue. When
601
647
  # the `ReceiveCount` for a message exceeds the `maxReceiveCount` for
602
648
  # a queue, Amazon SQS moves the message to the dead-letter-queue.
@@ -607,22 +653,22 @@ module Aws::SQS
607
653
  #
608
654
  # </note>
609
655
  #
610
- # * `VisibilityTimeout` - The visibility timeout for the queue, in
611
- # seconds. Valid values: an integer from 0 to 43,200 (12 hours).
656
+ # * `VisibilityTimeout` The visibility timeout for the queue, in
657
+ # seconds. Valid values: An integer from 0 to 43,200 (12 hours).
612
658
  # Default: 30. For more information about the visibility timeout, see
613
659
  # [Visibility Timeout][3] in the *Amazon Simple Queue Service
614
660
  # Developer Guide*.
615
661
  #
616
662
  # The following attributes apply only to [server-side-encryption][4]\:
617
663
  #
618
- # * `KmsMasterKeyId` - The ID of an AWS-managed customer master key
664
+ # * `KmsMasterKeyId` The ID of an AWS-managed customer master key
619
665
  # (CMK) for Amazon SQS or a custom CMK. For more information, see [Key
620
666
  # Terms][5]. While the alias of the AWS-managed CMK for Amazon SQS is
621
667
  # always `alias/aws/sqs`, the alias of a custom CMK can, for example,
622
668
  # be `alias/MyAlias `. For more examples, see [KeyId][6] in the *AWS
623
669
  # Key Management Service API Reference*.
624
670
  #
625
- # * `KmsDataKeyReusePeriodSeconds` - The length of time, in seconds, for
671
+ # * `KmsDataKeyReusePeriodSeconds` The length of time, in seconds, for
626
672
  # which Amazon SQS can reuse a [data key][7] to encrypt or decrypt
627
673
  # messages before calling AWS KMS again. An integer representing
628
674
  # seconds, between 60 seconds (1 minute) and 86,400 seconds (24
@@ -634,7 +680,7 @@ module Aws::SQS
634
680
  # The following attribute applies only to [FIFO (first-in-first-out)
635
681
  # queues][9]\:
636
682
  #
637
- # * `ContentBasedDeduplication` - Enables content-based deduplication.
683
+ # * `ContentBasedDeduplication` Enables content-based deduplication.
638
684
  # For more information, see [Exactly-Once Processing][10] in the
639
685
  # *Amazon Simple Queue Service Developer Guide*.
640
686
  #
@@ -668,16 +714,16 @@ module Aws::SQS
668
714
  #
669
715
  #
670
716
  #
671
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
672
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
673
- # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
674
- # [4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
675
- # [5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
676
- # [6]: http://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
677
- # [7]: http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
678
- # [8]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work
679
- # [9]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
680
- # [10]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
717
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
718
+ # [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
719
+ # [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
720
+ # [4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
721
+ # [5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
722
+ # [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
723
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
724
+ # [8]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work
725
+ # [9]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
726
+ # [10]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
681
727
  # @return [EmptyStructure]
682
728
  def set_attributes(options = {})
683
729
  options = options.merge(queue_url: @url)
@@ -694,16 +740,18 @@ module Aws::SQS
694
740
  # @return [Queue::Collection]
695
741
  def dead_letter_source_queues(options = {})
696
742
  batches = Enumerator.new do |y|
697
- batch = []
698
743
  options = options.merge(queue_url: @url)
699
744
  resp = @client.list_dead_letter_source_queues(options)
700
- resp.data.queue_urls.each do |q|
701
- batch << Queue.new(
702
- url: q,
703
- client: @client
704
- )
745
+ resp.each_page do |page|
746
+ batch = []
747
+ page.data.queue_urls.each do |q|
748
+ batch << Queue.new(
749
+ url: q,
750
+ client: @client
751
+ )
752
+ end
753
+ y.yield(batch)
705
754
  end
706
- y.yield(batch)
707
755
  end
708
756
  Queue::Collection.new(batches)
709
757
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module Aws
@@ -253,7 +255,7 @@ module Aws
253
255
  #
254
256
  # @return [void]
255
257
  def before_request(&block)
256
- @default_config = @default_config.with(before_request: Proc.new)
258
+ @default_config = @default_config.with(before_request: block) if block_given?
257
259
  end
258
260
 
259
261
  # Polls the queue, yielded a message, or an array of messages.
@@ -288,7 +290,7 @@ module Aws
288
290
  # @option options [Integer] :visibility_timeout (nil)
289
291
  # The number of seconds you have to process a message before
290
292
  # it is put back into the queue and can be received again.
291
- # By default, the queue's
293
+ # By default, the queue's visibility timeout is not set.
292
294
  #
293
295
  # @option options [Array<String>] :attribute_names ([])
294
296
  # The list of attributes that need to be returned along with each