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.
@@ -1,4 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # utility classes
4
- require 'aws-sdk-sqs/queue_poller'
4
+ module Aws
5
+ module SQS
6
+ autoload :QueuePoller, 'aws-sdk-sqs/queue_poller'
7
+ end
8
+ end
@@ -0,0 +1,66 @@
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
+ module Aws::SQS
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute region
14
+ # The AWS region used to dispatch the request.
15
+ #
16
+ # @return [String]
17
+ #
18
+ # @!attribute use_dual_stack
19
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute use_fips
24
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
25
+ #
26
+ # @return [Boolean]
27
+ #
28
+ # @!attribute endpoint
29
+ # Override the endpoint used to send this request
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :region,
35
+ :use_dual_stack,
36
+ :use_fips,
37
+ :endpoint,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'Region' => :region,
45
+ 'UseDualStack' => :use_dual_stack,
46
+ 'UseFIPS' => :use_fips,
47
+ 'Endpoint' => :endpoint,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:region] = options[:region]
53
+ self[:use_dual_stack] = options[:use_dual_stack]
54
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
+ if self[:use_dual_stack].nil?
56
+ raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
57
+ end
58
+ self[:use_fips] = options[:use_fips]
59
+ self[:use_fips] = false if self[:use_fips].nil?
60
+ if self[:use_fips].nil?
61
+ raise ArgumentError, "Missing required EndpointParameter: :use_fips"
62
+ end
63
+ self[:endpoint] = options[:endpoint]
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,57 @@
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
+ module Aws::SQS
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ region = parameters.region
14
+ use_dual_stack = parameters.use_dual_stack
15
+ use_fips = parameters.use_fips
16
+ endpoint = parameters.endpoint
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
18
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
20
+ end
21
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
30
+ return Aws::Endpoints::Endpoint.new(url: "https://sqs-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
+ end
32
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
+ end
34
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
35
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
36
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov")
37
+ return Aws::Endpoints::Endpoint.new(url: "https://sqs.#{region}.amazonaws.com", headers: {}, properties: {})
38
+ end
39
+ return Aws::Endpoints::Endpoint.new(url: "https://sqs-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
40
+ end
41
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
42
+ end
43
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
44
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
45
+ return Aws::Endpoints::Endpoint.new(url: "https://sqs.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
46
+ end
47
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
48
+ end
49
+ return Aws::Endpoints::Endpoint.new(url: "https://sqs.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
50
+ end
51
+ end
52
+ raise ArgumentError, "Invalid Configuration: Missing Region"
53
+ raise ArgumentError, 'No endpoint could be resolved'
54
+
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,269 @@
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
+ # @api private
13
+ module Endpoints
14
+
15
+ class AddPermission
16
+ def self.build(context)
17
+ Aws::SQS::EndpointParameters.new(
18
+ region: context.config.region,
19
+ use_dual_stack: context.config.use_dualstack_endpoint,
20
+ use_fips: context.config.use_fips_endpoint,
21
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
22
+ )
23
+ end
24
+ end
25
+
26
+ class CancelMessageMoveTask
27
+ def self.build(context)
28
+ Aws::SQS::EndpointParameters.new(
29
+ region: context.config.region,
30
+ use_dual_stack: context.config.use_dualstack_endpoint,
31
+ use_fips: context.config.use_fips_endpoint,
32
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
33
+ )
34
+ end
35
+ end
36
+
37
+ class ChangeMessageVisibility
38
+ def self.build(context)
39
+ Aws::SQS::EndpointParameters.new(
40
+ region: context.config.region,
41
+ use_dual_stack: context.config.use_dualstack_endpoint,
42
+ use_fips: context.config.use_fips_endpoint,
43
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
44
+ )
45
+ end
46
+ end
47
+
48
+ class ChangeMessageVisibilityBatch
49
+ def self.build(context)
50
+ Aws::SQS::EndpointParameters.new(
51
+ region: context.config.region,
52
+ use_dual_stack: context.config.use_dualstack_endpoint,
53
+ use_fips: context.config.use_fips_endpoint,
54
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
55
+ )
56
+ end
57
+ end
58
+
59
+ class CreateQueue
60
+ def self.build(context)
61
+ Aws::SQS::EndpointParameters.new(
62
+ region: context.config.region,
63
+ use_dual_stack: context.config.use_dualstack_endpoint,
64
+ use_fips: context.config.use_fips_endpoint,
65
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
66
+ )
67
+ end
68
+ end
69
+
70
+ class DeleteMessage
71
+ def self.build(context)
72
+ Aws::SQS::EndpointParameters.new(
73
+ region: context.config.region,
74
+ use_dual_stack: context.config.use_dualstack_endpoint,
75
+ use_fips: context.config.use_fips_endpoint,
76
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
77
+ )
78
+ end
79
+ end
80
+
81
+ class DeleteMessageBatch
82
+ def self.build(context)
83
+ Aws::SQS::EndpointParameters.new(
84
+ region: context.config.region,
85
+ use_dual_stack: context.config.use_dualstack_endpoint,
86
+ use_fips: context.config.use_fips_endpoint,
87
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
88
+ )
89
+ end
90
+ end
91
+
92
+ class DeleteQueue
93
+ def self.build(context)
94
+ Aws::SQS::EndpointParameters.new(
95
+ region: context.config.region,
96
+ use_dual_stack: context.config.use_dualstack_endpoint,
97
+ use_fips: context.config.use_fips_endpoint,
98
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
99
+ )
100
+ end
101
+ end
102
+
103
+ class GetQueueAttributes
104
+ def self.build(context)
105
+ Aws::SQS::EndpointParameters.new(
106
+ region: context.config.region,
107
+ use_dual_stack: context.config.use_dualstack_endpoint,
108
+ use_fips: context.config.use_fips_endpoint,
109
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
110
+ )
111
+ end
112
+ end
113
+
114
+ class GetQueueUrl
115
+ def self.build(context)
116
+ Aws::SQS::EndpointParameters.new(
117
+ region: context.config.region,
118
+ use_dual_stack: context.config.use_dualstack_endpoint,
119
+ use_fips: context.config.use_fips_endpoint,
120
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
121
+ )
122
+ end
123
+ end
124
+
125
+ class ListDeadLetterSourceQueues
126
+ def self.build(context)
127
+ Aws::SQS::EndpointParameters.new(
128
+ region: context.config.region,
129
+ use_dual_stack: context.config.use_dualstack_endpoint,
130
+ use_fips: context.config.use_fips_endpoint,
131
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
132
+ )
133
+ end
134
+ end
135
+
136
+ class ListMessageMoveTasks
137
+ def self.build(context)
138
+ Aws::SQS::EndpointParameters.new(
139
+ region: context.config.region,
140
+ use_dual_stack: context.config.use_dualstack_endpoint,
141
+ use_fips: context.config.use_fips_endpoint,
142
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
143
+ )
144
+ end
145
+ end
146
+
147
+ class ListQueueTags
148
+ def self.build(context)
149
+ Aws::SQS::EndpointParameters.new(
150
+ region: context.config.region,
151
+ use_dual_stack: context.config.use_dualstack_endpoint,
152
+ use_fips: context.config.use_fips_endpoint,
153
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
154
+ )
155
+ end
156
+ end
157
+
158
+ class ListQueues
159
+ def self.build(context)
160
+ Aws::SQS::EndpointParameters.new(
161
+ region: context.config.region,
162
+ use_dual_stack: context.config.use_dualstack_endpoint,
163
+ use_fips: context.config.use_fips_endpoint,
164
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
165
+ )
166
+ end
167
+ end
168
+
169
+ class PurgeQueue
170
+ def self.build(context)
171
+ Aws::SQS::EndpointParameters.new(
172
+ region: context.config.region,
173
+ use_dual_stack: context.config.use_dualstack_endpoint,
174
+ use_fips: context.config.use_fips_endpoint,
175
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
176
+ )
177
+ end
178
+ end
179
+
180
+ class ReceiveMessage
181
+ def self.build(context)
182
+ Aws::SQS::EndpointParameters.new(
183
+ region: context.config.region,
184
+ use_dual_stack: context.config.use_dualstack_endpoint,
185
+ use_fips: context.config.use_fips_endpoint,
186
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
187
+ )
188
+ end
189
+ end
190
+
191
+ class RemovePermission
192
+ def self.build(context)
193
+ Aws::SQS::EndpointParameters.new(
194
+ region: context.config.region,
195
+ use_dual_stack: context.config.use_dualstack_endpoint,
196
+ use_fips: context.config.use_fips_endpoint,
197
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
198
+ )
199
+ end
200
+ end
201
+
202
+ class SendMessage
203
+ def self.build(context)
204
+ Aws::SQS::EndpointParameters.new(
205
+ region: context.config.region,
206
+ use_dual_stack: context.config.use_dualstack_endpoint,
207
+ use_fips: context.config.use_fips_endpoint,
208
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
209
+ )
210
+ end
211
+ end
212
+
213
+ class SendMessageBatch
214
+ def self.build(context)
215
+ Aws::SQS::EndpointParameters.new(
216
+ region: context.config.region,
217
+ use_dual_stack: context.config.use_dualstack_endpoint,
218
+ use_fips: context.config.use_fips_endpoint,
219
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
220
+ )
221
+ end
222
+ end
223
+
224
+ class SetQueueAttributes
225
+ def self.build(context)
226
+ Aws::SQS::EndpointParameters.new(
227
+ region: context.config.region,
228
+ use_dual_stack: context.config.use_dualstack_endpoint,
229
+ use_fips: context.config.use_fips_endpoint,
230
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
231
+ )
232
+ end
233
+ end
234
+
235
+ class StartMessageMoveTask
236
+ def self.build(context)
237
+ Aws::SQS::EndpointParameters.new(
238
+ region: context.config.region,
239
+ use_dual_stack: context.config.use_dualstack_endpoint,
240
+ use_fips: context.config.use_fips_endpoint,
241
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
242
+ )
243
+ end
244
+ end
245
+
246
+ class TagQueue
247
+ def self.build(context)
248
+ Aws::SQS::EndpointParameters.new(
249
+ region: context.config.region,
250
+ use_dual_stack: context.config.use_dualstack_endpoint,
251
+ use_fips: context.config.use_fips_endpoint,
252
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
253
+ )
254
+ end
255
+ end
256
+
257
+ class UntagQueue
258
+ def self.build(context)
259
+ Aws::SQS::EndpointParameters.new(
260
+ region: context.config.region,
261
+ use_dual_stack: context.config.use_dualstack_endpoint,
262
+ use_fips: context.config.use_fips_endpoint,
263
+ endpoint: context.config.regional_endpoint ? nil : context.config.endpoint.to_s,
264
+ )
265
+ end
266
+ end
267
+
268
+ end
269
+ end