aws-sdk-lambdaweb 1.0.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.
@@ -0,0 +1,385 @@
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
+ require 'aws-sdk-core/waiters'
11
+
12
+ module Aws::LambdaWeb
13
+ # Waiters are utility methods that poll for a particular state to occur
14
+ # on a client. Waiters can fail after a number of attempts at a polling
15
+ # interval defined for the service client.
16
+ #
17
+ # For a list of operations that can be waited for and the
18
+ # client methods called for each operation, see the table below or the
19
+ # {Client#wait_until} field documentation for the {Client}.
20
+ #
21
+ # # Invoking a Waiter
22
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
23
+ # is the waiter name, which is specific to the service client and indicates
24
+ # which operation is being waited for. The second parameter is a hash of
25
+ # parameters that are passed to the client method called by the waiter,
26
+ # which varies according to the waiter name.
27
+ #
28
+ # # Wait Failures
29
+ # To catch errors in a waiter, use WaiterFailed,
30
+ # as shown in the following example.
31
+ #
32
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
33
+ # puts "failed waiting for instance running: #{error.message}
34
+ # end
35
+ #
36
+ # # Configuring a Waiter
37
+ # Each waiter has a default polling interval and a maximum number of
38
+ # attempts it will make before returning control to your program.
39
+ # To set these values, use the `max_attempts` and `delay` parameters
40
+ # in your `#wait_until` call.
41
+ # The following example waits for up to 25 seconds, polling every five seconds.
42
+ #
43
+ # client.wait_until(...) do |w|
44
+ # w.max_attempts = 5
45
+ # w.delay = 5
46
+ # end
47
+ #
48
+ # To disable wait failures, set the value of either of these parameters
49
+ # to `nil`.
50
+ #
51
+ # # Extending a Waiter
52
+ # To modify the behavior of waiters, you can register callbacks that are
53
+ # triggered before each polling attempt and before waiting.
54
+ #
55
+ # The following example implements an exponential backoff in a waiter
56
+ # by doubling the amount of time to wait on every attempt.
57
+ #
58
+ # client.wait_until(...) do |w|
59
+ # w.interval = 0 # disable normal sleep
60
+ # w.before_wait do |n, resp|
61
+ # sleep(n ** 2)
62
+ # end
63
+ # end
64
+ #
65
+ # # Available Waiters
66
+ #
67
+ # The following table lists the valid waiter names, the operations they call,
68
+ # and the default `:delay` and `:max_attempts` values.
69
+ #
70
+ # | waiter_name | params | :delay | :max_attempts |
71
+ # | ----------------------------- | ---------------------------------- | -------- | ------------- |
72
+ # | web_function_active | {Client#get_web_function} | 1 | 300 |
73
+ # | web_function_deleted | {Client#get_web_function} | 1 | 300 |
74
+ # | web_function_endpoint_active | {Client#get_web_function_endpoint} | 1 | 300 |
75
+ # | web_function_endpoint_deleted | {Client#get_web_function_endpoint} | 1 | 300 |
76
+ # | web_function_endpoint_updated | {Client#get_web_function_endpoint} | 1 | 300 |
77
+ # | web_function_revision_active | {Client#get_web_function_revision} | 1 | 300 |
78
+ #
79
+ module Waiters
80
+
81
+ # Waits for the web function's state to be Active. This should be used after new function creation.
82
+ class WebFunctionActive
83
+
84
+ # @param [Hash] options
85
+ # @option options [required, Client] :client
86
+ # @option options [Integer] :max_attempts (300)
87
+ # @option options [Integer] :delay (1)
88
+ # @option options [Proc] :before_attempt
89
+ # @option options [Proc] :before_wait
90
+ def initialize(options)
91
+ @client = options.fetch(:client)
92
+ @waiter = Aws::Waiters::Waiter.new({
93
+ max_attempts: 300,
94
+ delay: 1,
95
+ poller: Aws::Waiters::Poller.new(
96
+ operation_name: :get_web_function,
97
+ acceptors: [
98
+ {
99
+ "matcher" => "path",
100
+ "argument" => "state",
101
+ "state" => "success",
102
+ "expected" => "Active"
103
+ },
104
+ {
105
+ "matcher" => "path",
106
+ "argument" => "state",
107
+ "state" => "failure",
108
+ "expected" => "Failed"
109
+ },
110
+ {
111
+ "matcher" => "path",
112
+ "argument" => "state",
113
+ "state" => "failure",
114
+ "expected" => "Deleting"
115
+ },
116
+ {
117
+ "matcher" => "path",
118
+ "argument" => "state",
119
+ "state" => "retry",
120
+ "expected" => "Pending"
121
+ }
122
+ ]
123
+ )
124
+ }.merge(options))
125
+ end
126
+
127
+ # @option (see Client#get_web_function)
128
+ # @return (see Client#get_web_function)
129
+ def wait(params = {})
130
+ @waiter.wait(client: @client, params: params)
131
+ end
132
+
133
+ # @api private
134
+ attr_reader :waiter
135
+
136
+ end
137
+
138
+ # Waits for the web function to be deleted. This should be used after function deletion.
139
+ class WebFunctionDeleted
140
+
141
+ # @param [Hash] options
142
+ # @option options [required, Client] :client
143
+ # @option options [Integer] :max_attempts (300)
144
+ # @option options [Integer] :delay (1)
145
+ # @option options [Proc] :before_attempt
146
+ # @option options [Proc] :before_wait
147
+ def initialize(options)
148
+ @client = options.fetch(:client)
149
+ @waiter = Aws::Waiters::Waiter.new({
150
+ max_attempts: 300,
151
+ delay: 1,
152
+ poller: Aws::Waiters::Poller.new(
153
+ operation_name: :get_web_function,
154
+ acceptors: [
155
+ {
156
+ "matcher" => "error",
157
+ "state" => "success",
158
+ "expected" => "ResourceNotFoundException"
159
+ },
160
+ {
161
+ "matcher" => "path",
162
+ "argument" => "state",
163
+ "state" => "retry",
164
+ "expected" => "Deleting"
165
+ }
166
+ ]
167
+ )
168
+ }.merge(options))
169
+ end
170
+
171
+ # @option (see Client#get_web_function)
172
+ # @return (see Client#get_web_function)
173
+ def wait(params = {})
174
+ @waiter.wait(client: @client, params: params)
175
+ end
176
+
177
+ # @api private
178
+ attr_reader :waiter
179
+
180
+ end
181
+
182
+ # Waits for the web function endpoint's state to be Active. This should be used after new endpoint creation.
183
+ class WebFunctionEndpointActive
184
+
185
+ # @param [Hash] options
186
+ # @option options [required, Client] :client
187
+ # @option options [Integer] :max_attempts (300)
188
+ # @option options [Integer] :delay (1)
189
+ # @option options [Proc] :before_attempt
190
+ # @option options [Proc] :before_wait
191
+ def initialize(options)
192
+ @client = options.fetch(:client)
193
+ @waiter = Aws::Waiters::Waiter.new({
194
+ max_attempts: 300,
195
+ delay: 1,
196
+ poller: Aws::Waiters::Poller.new(
197
+ operation_name: :get_web_function_endpoint,
198
+ acceptors: [
199
+ {
200
+ "matcher" => "path",
201
+ "argument" => "state",
202
+ "state" => "success",
203
+ "expected" => "Active"
204
+ },
205
+ {
206
+ "matcher" => "path",
207
+ "argument" => "state",
208
+ "state" => "failure",
209
+ "expected" => "Failed"
210
+ },
211
+ {
212
+ "matcher" => "path",
213
+ "argument" => "state",
214
+ "state" => "failure",
215
+ "expected" => "Deleting"
216
+ },
217
+ {
218
+ "matcher" => "path",
219
+ "argument" => "state",
220
+ "state" => "retry",
221
+ "expected" => "Pending"
222
+ }
223
+ ]
224
+ )
225
+ }.merge(options))
226
+ end
227
+
228
+ # @option (see Client#get_web_function_endpoint)
229
+ # @return (see Client#get_web_function_endpoint)
230
+ def wait(params = {})
231
+ @waiter.wait(client: @client, params: params)
232
+ end
233
+
234
+ # @api private
235
+ attr_reader :waiter
236
+
237
+ end
238
+
239
+ # Waits for the web function endpoint to be deleted. This should be used after endpoint deletion.
240
+ class WebFunctionEndpointDeleted
241
+
242
+ # @param [Hash] options
243
+ # @option options [required, Client] :client
244
+ # @option options [Integer] :max_attempts (300)
245
+ # @option options [Integer] :delay (1)
246
+ # @option options [Proc] :before_attempt
247
+ # @option options [Proc] :before_wait
248
+ def initialize(options)
249
+ @client = options.fetch(:client)
250
+ @waiter = Aws::Waiters::Waiter.new({
251
+ max_attempts: 300,
252
+ delay: 1,
253
+ poller: Aws::Waiters::Poller.new(
254
+ operation_name: :get_web_function_endpoint,
255
+ acceptors: [
256
+ {
257
+ "matcher" => "error",
258
+ "state" => "success",
259
+ "expected" => "ResourceNotFoundException"
260
+ },
261
+ {
262
+ "matcher" => "path",
263
+ "argument" => "state",
264
+ "state" => "retry",
265
+ "expected" => "Deleting"
266
+ }
267
+ ]
268
+ )
269
+ }.merge(options))
270
+ end
271
+
272
+ # @option (see Client#get_web_function_endpoint)
273
+ # @return (see Client#get_web_function_endpoint)
274
+ def wait(params = {})
275
+ @waiter.wait(client: @client, params: params)
276
+ end
277
+
278
+ # @api private
279
+ attr_reader :waiter
280
+
281
+ end
282
+
283
+ # Waits for the web function endpoint's update status to be Successful. This should be used after endpoint updates.
284
+ class WebFunctionEndpointUpdated
285
+
286
+ # @param [Hash] options
287
+ # @option options [required, Client] :client
288
+ # @option options [Integer] :max_attempts (300)
289
+ # @option options [Integer] :delay (1)
290
+ # @option options [Proc] :before_attempt
291
+ # @option options [Proc] :before_wait
292
+ def initialize(options)
293
+ @client = options.fetch(:client)
294
+ @waiter = Aws::Waiters::Waiter.new({
295
+ max_attempts: 300,
296
+ delay: 1,
297
+ poller: Aws::Waiters::Poller.new(
298
+ operation_name: :get_web_function_endpoint,
299
+ acceptors: [
300
+ {
301
+ "matcher" => "path",
302
+ "argument" => "update_status",
303
+ "state" => "success",
304
+ "expected" => "Successful"
305
+ },
306
+ {
307
+ "matcher" => "path",
308
+ "argument" => "update_status",
309
+ "state" => "failure",
310
+ "expected" => "Failed"
311
+ },
312
+ {
313
+ "matcher" => "path",
314
+ "argument" => "update_status",
315
+ "state" => "retry",
316
+ "expected" => "InProgress"
317
+ }
318
+ ]
319
+ )
320
+ }.merge(options))
321
+ end
322
+
323
+ # @option (see Client#get_web_function_endpoint)
324
+ # @return (see Client#get_web_function_endpoint)
325
+ def wait(params = {})
326
+ @waiter.wait(client: @client, params: params)
327
+ end
328
+
329
+ # @api private
330
+ attr_reader :waiter
331
+
332
+ end
333
+
334
+ # Waits for the web function revision's state to be Active. This should be used after new revision creation.
335
+ class WebFunctionRevisionActive
336
+
337
+ # @param [Hash] options
338
+ # @option options [required, Client] :client
339
+ # @option options [Integer] :max_attempts (300)
340
+ # @option options [Integer] :delay (1)
341
+ # @option options [Proc] :before_attempt
342
+ # @option options [Proc] :before_wait
343
+ def initialize(options)
344
+ @client = options.fetch(:client)
345
+ @waiter = Aws::Waiters::Waiter.new({
346
+ max_attempts: 300,
347
+ delay: 1,
348
+ poller: Aws::Waiters::Poller.new(
349
+ operation_name: :get_web_function_revision,
350
+ acceptors: [
351
+ {
352
+ "matcher" => "path",
353
+ "argument" => "state",
354
+ "state" => "success",
355
+ "expected" => "Active"
356
+ },
357
+ {
358
+ "matcher" => "path",
359
+ "argument" => "state",
360
+ "state" => "failure",
361
+ "expected" => "Failed"
362
+ },
363
+ {
364
+ "matcher" => "path",
365
+ "argument" => "state",
366
+ "state" => "retry",
367
+ "expected" => "Pending"
368
+ }
369
+ ]
370
+ )
371
+ }.merge(options))
372
+ end
373
+
374
+ # @option (see Client#get_web_function_revision)
375
+ # @return (see Client#get_web_function_revision)
376
+ def wait(params = {})
377
+ @waiter.wait(client: @client, params: params)
378
+ end
379
+
380
+ # @api private
381
+ attr_reader :waiter
382
+
383
+ end
384
+ end
385
+ end
@@ -0,0 +1,62 @@
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
+ require 'aws-sdk-core'
12
+ require 'aws-sigv4'
13
+
14
+ Aws::Plugins::GlobalConfiguration.add_identifier(:lambdaweb)
15
+
16
+ # This module provides support for Lambda Web. This module is available in the
17
+ # `aws-sdk-lambdaweb` gem.
18
+ #
19
+ # # Client
20
+ #
21
+ # The {Client} class provides one method for each API operation. Operation
22
+ # methods each accept a hash of request parameters and return a response
23
+ # structure.
24
+ #
25
+ # lambda_web = Aws::LambdaWeb::Client.new
26
+ # resp = lambda_web.create_web_function(params)
27
+ #
28
+ # See {Client} for more information.
29
+ #
30
+ # # Errors
31
+ #
32
+ # Errors returned from Lambda Web are defined in the
33
+ # {Errors} module and all extend {Errors::ServiceError}.
34
+ #
35
+ # begin
36
+ # # do stuff
37
+ # rescue Aws::LambdaWeb::Errors::ServiceError
38
+ # # rescues all Lambda Web API errors
39
+ # end
40
+ #
41
+ # See {Errors} for more information.
42
+ #
43
+ # @!group service
44
+ module Aws::LambdaWeb
45
+ autoload :Types, 'aws-sdk-lambdaweb/types'
46
+ autoload :ClientApi, 'aws-sdk-lambdaweb/client_api'
47
+ module Plugins
48
+ autoload :Endpoints, 'aws-sdk-lambdaweb/plugins/endpoints.rb'
49
+ end
50
+ autoload :Client, 'aws-sdk-lambdaweb/client'
51
+ autoload :Errors, 'aws-sdk-lambdaweb/errors'
52
+ autoload :Waiters, 'aws-sdk-lambdaweb/waiters'
53
+ autoload :Resource, 'aws-sdk-lambdaweb/resource'
54
+ autoload :EndpointParameters, 'aws-sdk-lambdaweb/endpoint_parameters'
55
+ autoload :EndpointProvider, 'aws-sdk-lambdaweb/endpoint_provider'
56
+ autoload :Endpoints, 'aws-sdk-lambdaweb/endpoints'
57
+
58
+ GEM_VERSION = '1.0.0'
59
+
60
+ end
61
+
62
+ require_relative 'aws-sdk-lambdaweb/customizations'