aws-sdk-sqs 1.0.0.rc1 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,201 @@ module Aws
20
20
  @client
21
21
  end
22
22
 
23
+ # @!group Actions
24
+
25
+ # @example Request syntax with placeholder values
26
+ #
27
+ # queue = sqs.create_queue({
28
+ # queue_name: "String", # required
29
+ # attributes: {
30
+ # "All" => "String",
31
+ # },
32
+ # })
33
+ # @param [Hash] options ({})
34
+ # @option options [required, String] :queue_name
35
+ # The name of the new queue. The following limits apply to this name:
36
+ #
37
+ # * A queue name can have up to 80 characters.
38
+ #
39
+ # * The following are accepted: alphanumeric chatacters, hyphens (`-`),
40
+ # and underscores (`_`).
41
+ #
42
+ # * A FIFO queue name must end with the `.fifo` suffix.
43
+ #
44
+ # Queue names are case-sensitive.
45
+ # @option options [Hash<String,String>] :attributes
46
+ # A map of attributes with their corresponding values.
47
+ #
48
+ # The following lists the names, descriptions, and values of the special
49
+ # request parameters that the `CreateQueue` action uses:
50
+ #
51
+ # * `DelaySeconds` - The number of seconds for which the delivery of all
52
+ # messages in the queue is delayed. An integer from 0 to 900 (15
53
+ # minutes). The default is 0 (zero).
54
+ #
55
+ # * `MaximumMessageSize` - The limit of how many bytes a message can
56
+ # contain before Amazon SQS rejects it. An integer from 1,024 bytes (1
57
+ # KiB) up to 262,144 bytes (256 KiB). The default is 262,144 (256
58
+ # KiB).
59
+ #
60
+ # * `MessageRetentionPeriod` - The number of seconds for which Amazon
61
+ # SQS retains a message. An integer representing seconds, from 60 (1
62
+ # minute) to 120,9600 (14 days). The default is 345,600 (4 days).
63
+ #
64
+ # * `Policy` - The queue's policy. A valid AWS policy. For more
65
+ # information about policy structure, see [Overview of AWS IAM
66
+ # Policies][1] in the *Amazon IAM User Guide*.
67
+ #
68
+ # * `ReceiveMessageWaitTimeSeconds` - The number of seconds for which a
69
+ # ReceiveMessage action will wait for a message to arrive. An integer
70
+ # from 0 to 20 (seconds). The default is 0.
71
+ #
72
+ # * `RedrivePolicy` - The parameters for the dead letter queue
73
+ # functionality of the source queue. For more information about the
74
+ # redrive policy and dead letter queues, see [Using Amazon SQS Dead
75
+ # Letter Queues][2] in the *Amazon SQS Developer Guide*.
76
+ #
77
+ # <note markdown="1"> The dead letter queue of a FIFO queue must also be a FIFO queue.
78
+ # Similarly, the dead letter queue of a standard queue must also be a
79
+ # standard queue.
80
+ #
81
+ # </note>
82
+ #
83
+ # * `VisibilityTimeout` - The visibility timeout for the queue. An
84
+ # integer from 0 to 43200 (12 hours). The default is 30. For more
85
+ # information about the visibility timeout, see [Visibility
86
+ # Timeout][3] in the *Amazon SQS Developer Guide*.
87
+ #
88
+ # The following attributes apply only to [FIFO (first-in-first-out)
89
+ # queues][4]\:
90
+ #
91
+ # * `FifoQueue` - Designates a queue as FIFO. You can provide this
92
+ # attribute only during queue creation; you can't change it for an
93
+ # existing queue. When you set this attribute, you must provide a
94
+ # `MessageGroupId` explicitly.
95
+ #
96
+ # For more information, see [FIFO Queue Logic][5] in the *Amazon SQS
97
+ # Developer Guide*.
98
+ #
99
+ # * `ContentBasedDeduplication` - Enables content-based deduplication.
100
+ # For more information, see [Exactly-Once Processing][6] in the
101
+ # *Amazon SQS Developer Guide*.
102
+ #
103
+ # * Every message must have a unique `MessageDeduplicationId`,
104
+ #
105
+ # * You may provide a `MessageDeduplicationId` explicitly.
106
+ #
107
+ # * If you aren't able to provide a `MessageDeduplicationId` and
108
+ # you enable `ContentBasedDeduplication` for your queue, Amazon
109
+ # SQS uses a SHA-256 hash to generate the `MessageDeduplicationId`
110
+ # using the body of the message (but not the attributes of the
111
+ # message).
112
+ #
113
+ # * If you don't provide a `MessageDeduplicationId` and the queue
114
+ # doesn't have `ContentBasedDeduplication` set, the action fails
115
+ # with an error.
116
+ #
117
+ # * If the queue has `ContentBasedDeduplication` set, your
118
+ # `MessageDeduplicationId` overrides the generated one.
119
+ #
120
+ # * When `ContentBasedDeduplication` is in effect, messages with
121
+ # identical content sent within the deduplication interval are
122
+ # treated as duplicates and only one copy of the message is
123
+ # delivered.
124
+ #
125
+ # * You can also use `ContentBasedDeduplication` for messages with
126
+ # identical content to be treated as duplicates.
127
+ #
128
+ # * If you send one message with `ContentBasedDeduplication` enabled
129
+ # and then another message with a `MessageDeduplicationId` that is
130
+ # the same as the one generated for the first
131
+ # `MessageDeduplicationId`, the two messages are treated as
132
+ # duplicates and only one copy of the message is delivered.
133
+ #
134
+ # Any other valid special request parameters that are specified (such as
135
+ # `ApproximateNumberOfMessages`, `ApproximateNumberOfMessagesDelayed`,
136
+ # `ApproximateNumberOfMessagesNotVisible`, `CreatedTimestamp`,
137
+ # `LastModifiedTimestamp`, and `QueueArn`) will be ignored.
138
+ #
139
+ #
140
+ #
141
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
142
+ # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
143
+ # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
144
+ # [4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
145
+ # [5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic
146
+ # [6]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
147
+ # @return [Queue]
148
+ def create_queue(options = {})
149
+ resp = @client.create_queue(options)
150
+ Queue.new(
151
+ url: resp.data.queue_url,
152
+ client: @client
153
+ )
154
+ end
155
+
156
+ # @example Request syntax with placeholder values
157
+ #
158
+ # queue = sqs.get_queue_by_name({
159
+ # queue_name: "String", # required
160
+ # queue_owner_aws_account_id: "String",
161
+ # })
162
+ # @param [Hash] options ({})
163
+ # @option options [required, String] :queue_name
164
+ # The name of the queue whose URL must be fetched. Maximum 80
165
+ # characters; alphanumeric characters, hyphens (-), and underscores (\_)
166
+ # are allowed.
167
+ #
168
+ # Queue names are case-sensitive.
169
+ # @option options [String] :queue_owner_aws_account_id
170
+ # The AWS account ID of the account that created the queue.
171
+ # @return [Queue]
172
+ def get_queue_by_name(options = {})
173
+ resp = @client.get_queue_url(options)
174
+ Queue.new(
175
+ url: resp.data.queue_url,
176
+ client: @client
177
+ )
178
+ end
179
+
180
+ # @!group Associations
181
+
182
+ # @param [String] url
183
+ # @return [Queue]
184
+ def queue(url)
185
+ Queue.new(
186
+ url: url,
187
+ client: @client
188
+ )
189
+ end
190
+
191
+ # @example Request syntax with placeholder values
192
+ #
193
+ # queues = sqs.queues({
194
+ # queue_name_prefix: "String",
195
+ # })
196
+ # @param [Hash] options ({})
197
+ # @option options [String] :queue_name_prefix
198
+ # A string to use for filtering the list results. Only those queues
199
+ # whose name begins with the specified string are returned.
200
+ #
201
+ # Queue names are case-sensitive.
202
+ # @return [Queue::Collection]
203
+ def queues(options = {})
204
+ batches = Enumerator.new do |y|
205
+ batch = []
206
+ resp = @client.list_queues(options)
207
+ resp.data.queue_urls.each do |q|
208
+ batch << Queue.new(
209
+ url: q,
210
+ client: @client
211
+ )
212
+ end
213
+ y.yield(batch)
214
+ end
215
+ Queue::Collection.new(batches)
216
+ end
217
+
23
218
  end
24
219
  end
25
220
  end
@@ -341,8 +341,8 @@ module Aws
341
341
  #
342
342
  #
343
343
  # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
344
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html
345
- # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html
344
+ # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
345
+ # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
346
346
  # [4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
347
347
  # [5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic
348
348
  # [6]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
@@ -558,9 +558,9 @@ module Aws
558
558
  #
559
559
  #
560
560
  #
561
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ApproximateNumber.html
562
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html
563
- # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html
561
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-resources-required-process-messages.html
562
+ # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
563
+ # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
564
564
  # [4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
565
565
  # [5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic
566
566
  # [6]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
@@ -715,12 +715,12 @@ module Aws
715
715
  #
716
716
  # @!attribute [rw] message_attributes
717
717
  # Each message attribute consists of a Name, Type, and Value. For more
718
- # information, see [Message Attribute Items][1] in the *Amazon SQS
719
- # Developer Guide*.
718
+ # information, see [Message Attribute Items and Validation][1] in the
719
+ # *Amazon SQS Developer Guide*.
720
720
  #
721
721
  #
722
722
  #
723
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributesNTV
723
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation
724
724
  # @return [Hash<String,Types::MessageAttributeValue>]
725
725
  class Message < Struct.new(
726
726
  :message_id,
@@ -779,12 +779,12 @@ module Aws
779
779
  # StringValue.
780
780
  #
781
781
  # You can also append custom labels. For more information, see
782
- # [Message Attribute Data Types][1] in the *Amazon SQS Developer
783
- # Guide*.
782
+ # [Message Attribute Data Types and Validation][1] in the *Amazon SQS
783
+ # Developer Guide*.
784
784
  #
785
785
  #
786
786
  #
787
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributes.DataTypes
787
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-data-types-validation
788
788
  # @return [String]
789
789
  class MessageAttributeValue < Struct.new(
790
790
  :string_value,
@@ -998,7 +998,7 @@ module Aws
998
998
  #
999
999
  #
1000
1000
  #
1001
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html
1001
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
1002
1002
  # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-receiverequestattemptid-request-parameter
1003
1003
  # @return [String]
1004
1004
  class ReceiveMessageRequest < Struct.new(
@@ -1127,12 +1127,12 @@ module Aws
1127
1127
  #
1128
1128
  # @!attribute [rw] message_attributes
1129
1129
  # Each message attribute consists of a Name, Type, and Value. For more
1130
- # information, see [Message Attribute Items][1] in the *Amazon SQS
1131
- # Developer Guide*.
1130
+ # information, see [Message Attribute Items and Validation][1] in the
1131
+ # *Amazon SQS Developer Guide*.
1132
1132
  #
1133
1133
  #
1134
1134
  #
1135
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributesNTV
1135
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation
1136
1136
  # @return [Hash<String,Types::MessageAttributeValue>]
1137
1137
  #
1138
1138
  # @!attribute [rw] message_deduplication_id
@@ -1354,12 +1354,12 @@ module Aws
1354
1354
  #
1355
1355
  # @!attribute [rw] message_attributes
1356
1356
  # Each message attribute consists of a Name, Type, and Value. For more
1357
- # information, see [Message Attribute Items][1] in the *Amazon SQS
1358
- # Developer Guide*.
1357
+ # information, see [Message Attribute Items and Validation][1] in the
1358
+ # *Amazon SQS Developer Guide*.
1359
1359
  #
1360
1360
  #
1361
1361
  #
1362
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html#SQSMessageAttributesNTV
1362
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation
1363
1363
  # @return [Hash<String,Types::MessageAttributeValue>]
1364
1364
  #
1365
1365
  # @!attribute [rw] message_deduplication_id
@@ -1500,7 +1500,7 @@ module Aws
1500
1500
  #
1501
1501
  #
1502
1502
  #
1503
- # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ImportantIdentifiers.html
1503
+ # [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html
1504
1504
  # @return [String]
1505
1505
  #
1506
1506
  # @!attribute [rw] sequence_number
@@ -1626,8 +1626,8 @@ module Aws
1626
1626
  #
1627
1627
  #
1628
1628
  # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
1629
- # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html
1630
- # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html
1629
+ # [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
1630
+ # [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
1631
1631
  # [4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
1632
1632
  # [5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
1633
1633
  # @return [Hash<String,String>]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2016-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -51,8 +51,10 @@ files:
51
51
  - lib/aws-sdk-sqs/client_api.rb
52
52
  - lib/aws-sdk-sqs/customizations.rb
53
53
  - lib/aws-sdk-sqs/errors.rb
54
+ - lib/aws-sdk-sqs/message.rb
54
55
  - lib/aws-sdk-sqs/plugins/md5s.rb
55
56
  - lib/aws-sdk-sqs/plugins/queue_urls.rb
57
+ - lib/aws-sdk-sqs/queue.rb
56
58
  - lib/aws-sdk-sqs/queue_poller.rb
57
59
  - lib/aws-sdk-sqs/resource.rb
58
60
  - lib/aws-sdk-sqs/types.rb