aws-sdk-mediaconnect 1.29.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.
@@ -0,0 +1,266 @@
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::MediaConnect
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
+ # | flow_active | {Client#describe_flow} | 3 | 40 |
73
+ # | flow_deleted | {Client#describe_flow} | 3 | 40 |
74
+ # | flow_standby | {Client#describe_flow} | 3 | 40 |
75
+ #
76
+ module Waiters
77
+
78
+ # Wait until a flow is active
79
+ class FlowActive
80
+
81
+ # @param [Hash] options
82
+ # @option options [required, Client] :client
83
+ # @option options [Integer] :max_attempts (40)
84
+ # @option options [Integer] :delay (3)
85
+ # @option options [Proc] :before_attempt
86
+ # @option options [Proc] :before_wait
87
+ def initialize(options)
88
+ @client = options.fetch(:client)
89
+ @waiter = Aws::Waiters::Waiter.new({
90
+ max_attempts: 40,
91
+ delay: 3,
92
+ poller: Aws::Waiters::Poller.new(
93
+ operation_name: :describe_flow,
94
+ acceptors: [
95
+ {
96
+ "state" => "success",
97
+ "matcher" => "path",
98
+ "argument" => "flow.status",
99
+ "expected" => "ACTIVE"
100
+ },
101
+ {
102
+ "state" => "retry",
103
+ "matcher" => "path",
104
+ "argument" => "flow.status",
105
+ "expected" => "STARTING"
106
+ },
107
+ {
108
+ "state" => "retry",
109
+ "matcher" => "path",
110
+ "argument" => "flow.status",
111
+ "expected" => "UPDATING"
112
+ },
113
+ {
114
+ "state" => "retry",
115
+ "matcher" => "status",
116
+ "expected" => 500
117
+ },
118
+ {
119
+ "state" => "retry",
120
+ "matcher" => "status",
121
+ "expected" => 503
122
+ },
123
+ {
124
+ "state" => "failure",
125
+ "matcher" => "path",
126
+ "argument" => "flow.status",
127
+ "expected" => "ERROR"
128
+ }
129
+ ]
130
+ )
131
+ }.merge(options))
132
+ end
133
+
134
+ # @option (see Client#describe_flow)
135
+ # @return (see Client#describe_flow)
136
+ def wait(params = {})
137
+ @waiter.wait(client: @client, params: params)
138
+ end
139
+
140
+ # @api private
141
+ attr_reader :waiter
142
+
143
+ end
144
+
145
+ # Wait until a flow is deleted
146
+ class FlowDeleted
147
+
148
+ # @param [Hash] options
149
+ # @option options [required, Client] :client
150
+ # @option options [Integer] :max_attempts (40)
151
+ # @option options [Integer] :delay (3)
152
+ # @option options [Proc] :before_attempt
153
+ # @option options [Proc] :before_wait
154
+ def initialize(options)
155
+ @client = options.fetch(:client)
156
+ @waiter = Aws::Waiters::Waiter.new({
157
+ max_attempts: 40,
158
+ delay: 3,
159
+ poller: Aws::Waiters::Poller.new(
160
+ operation_name: :describe_flow,
161
+ acceptors: [
162
+ {
163
+ "state" => "success",
164
+ "matcher" => "status",
165
+ "expected" => 404
166
+ },
167
+ {
168
+ "state" => "retry",
169
+ "matcher" => "path",
170
+ "argument" => "flow.status",
171
+ "expected" => "DELETING"
172
+ },
173
+ {
174
+ "state" => "retry",
175
+ "matcher" => "status",
176
+ "expected" => 500
177
+ },
178
+ {
179
+ "state" => "retry",
180
+ "matcher" => "status",
181
+ "expected" => 503
182
+ },
183
+ {
184
+ "state" => "failure",
185
+ "matcher" => "path",
186
+ "argument" => "flow.status",
187
+ "expected" => "ERROR"
188
+ }
189
+ ]
190
+ )
191
+ }.merge(options))
192
+ end
193
+
194
+ # @option (see Client#describe_flow)
195
+ # @return (see Client#describe_flow)
196
+ def wait(params = {})
197
+ @waiter.wait(client: @client, params: params)
198
+ end
199
+
200
+ # @api private
201
+ attr_reader :waiter
202
+
203
+ end
204
+
205
+ # Wait until a flow is in standby mode
206
+ class FlowStandby
207
+
208
+ # @param [Hash] options
209
+ # @option options [required, Client] :client
210
+ # @option options [Integer] :max_attempts (40)
211
+ # @option options [Integer] :delay (3)
212
+ # @option options [Proc] :before_attempt
213
+ # @option options [Proc] :before_wait
214
+ def initialize(options)
215
+ @client = options.fetch(:client)
216
+ @waiter = Aws::Waiters::Waiter.new({
217
+ max_attempts: 40,
218
+ delay: 3,
219
+ poller: Aws::Waiters::Poller.new(
220
+ operation_name: :describe_flow,
221
+ acceptors: [
222
+ {
223
+ "state" => "success",
224
+ "matcher" => "path",
225
+ "argument" => "flow.status",
226
+ "expected" => "STANDBY"
227
+ },
228
+ {
229
+ "state" => "retry",
230
+ "matcher" => "path",
231
+ "argument" => "flow.status",
232
+ "expected" => "STOPPING"
233
+ },
234
+ {
235
+ "state" => "retry",
236
+ "matcher" => "status",
237
+ "expected" => 500
238
+ },
239
+ {
240
+ "state" => "retry",
241
+ "matcher" => "status",
242
+ "expected" => 503
243
+ },
244
+ {
245
+ "state" => "failure",
246
+ "matcher" => "path",
247
+ "argument" => "flow.status",
248
+ "expected" => "ERROR"
249
+ }
250
+ ]
251
+ )
252
+ }.merge(options))
253
+ end
254
+
255
+ # @option (see Client#describe_flow)
256
+ # @return (see Client#describe_flow)
257
+ def wait(params = {})
258
+ @waiter.wait(client: @client, params: params)
259
+ end
260
+
261
+ # @api private
262
+ attr_reader :waiter
263
+
264
+ end
265
+ end
266
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-mediaconnect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.29.0
4
+ version: 1.34.0
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: 2021-02-02 00:00:00.000000000 Z
11
+ date: 2021-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -47,11 +47,14 @@ dependencies:
47
47
  description: Official AWS Ruby gem for AWS MediaConnect. This gem is part of the AWS
48
48
  SDK for Ruby.
49
49
  email:
50
- - trevrowe@amazon.com
50
+ - aws-dr-rubygems@amazon.com
51
51
  executables: []
52
52
  extensions: []
53
53
  extra_rdoc_files: []
54
54
  files:
55
+ - CHANGELOG.md
56
+ - LICENSE.txt
57
+ - VERSION
55
58
  - lib/aws-sdk-mediaconnect.rb
56
59
  - lib/aws-sdk-mediaconnect/client.rb
57
60
  - lib/aws-sdk-mediaconnect/client_api.rb
@@ -59,12 +62,13 @@ files:
59
62
  - lib/aws-sdk-mediaconnect/errors.rb
60
63
  - lib/aws-sdk-mediaconnect/resource.rb
61
64
  - lib/aws-sdk-mediaconnect/types.rb
65
+ - lib/aws-sdk-mediaconnect/waiters.rb
62
66
  homepage: https://github.com/aws/aws-sdk-ruby
63
67
  licenses:
64
68
  - Apache-2.0
65
69
  metadata:
66
- source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-mediaconnect
67
- changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-mediaconnect/CHANGELOG.md
70
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-mediaconnect
71
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-mediaconnect/CHANGELOG.md
68
72
  post_install_message:
69
73
  rdoc_options: []
70
74
  require_paths:
@@ -80,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
84
  - !ruby/object:Gem::Version
81
85
  version: '0'
82
86
  requirements: []
83
- rubyforge_project:
84
- rubygems_version: 2.7.6.2
87
+ rubygems_version: 3.1.6
85
88
  signing_key:
86
89
  specification_version: 4
87
90
  summary: AWS SDK for Ruby - AWS MediaConnect