aws-sdk-iotsitewise 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,308 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core/waiters'
9
+
10
+ module Aws::IoTSiteWise
11
+ # Waiters are utility methods that poll for a particular state to occur
12
+ # on a client. Waiters can fail after a number of attempts at a polling
13
+ # interval defined for the service client.
14
+ #
15
+ # For a list of operations that can be waited for and the
16
+ # client methods called for each operation, see the table below or the
17
+ # {Client#wait_until} field documentation for the {Client}.
18
+ #
19
+ # # Invoking a Waiter
20
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
21
+ # is the waiter name, which is specific to the service client and indicates
22
+ # which operation is being waited for. The second parameter is a hash of
23
+ # parameters that are passed to the client method called by the waiter,
24
+ # which varies according to the waiter name.
25
+ #
26
+ # # Wait Failures
27
+ # To catch errors in a waiter, use WaiterFailed,
28
+ # as shown in the following example.
29
+ #
30
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
31
+ # puts "failed waiting for instance running: #{error.message}
32
+ # end
33
+ #
34
+ # # Configuring a Waiter
35
+ # Each waiter has a default polling interval and a maximum number of
36
+ # attempts it will make before returning control to your program.
37
+ # To set these values, use the `max_attempts` and `delay` parameters
38
+ # in your `#wait_until` call.
39
+ # The following example waits for up to 25 seconds, polling every five seconds.
40
+ #
41
+ # client.wait_until(...) do |w|
42
+ # w.max_attempts = 5
43
+ # w.delay = 5
44
+ # end
45
+ #
46
+ # To disable wait failures, set the value of either of these parameters
47
+ # to `nil`.
48
+ #
49
+ # # Extending a Waiter
50
+ # To modify the behavior of waiters, you can register callbacks that are
51
+ # triggered before each polling attempt and before waiting.
52
+ #
53
+ # The following example implements an exponential backoff in a waiter
54
+ # by doubling the amount of time to wait on every attempt.
55
+ #
56
+ # client.wait_until(...) do |w|
57
+ # w.interval = 0 # disable normal sleep
58
+ # w.before_wait do |n, resp|
59
+ # sleep(n ** 2)
60
+ # end
61
+ # end
62
+ #
63
+ # # Available Waiters
64
+ #
65
+ # The following table lists the valid waiter names, the operations they call,
66
+ # and the default `:delay` and `:max_attempts` values.
67
+ #
68
+ # | waiter_name | params | :delay | :max_attempts |
69
+ # | ---------------------- | ----------------------------- | -------- | ------------- |
70
+ # | asset_active | {Client#describe_asset} | 3 | 20 |
71
+ # | asset_model_active | {Client#describe_asset_model} | 3 | 20 |
72
+ # | asset_model_not_exists | {Client#describe_asset_model} | 3 | 20 |
73
+ # | asset_not_exists | {Client#describe_asset} | 3 | 20 |
74
+ # | portal_active | {Client#describe_portal} | 3 | 20 |
75
+ # | portal_not_exists | {Client#describe_portal} | 3 | 20 |
76
+ #
77
+ module Waiters
78
+
79
+ class AssetActive
80
+
81
+ # @param [Hash] options
82
+ # @option options [required, Client] :client
83
+ # @option options [Integer] :max_attempts (20)
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: 20,
91
+ delay: 3,
92
+ poller: Aws::Waiters::Poller.new(
93
+ operation_name: :describe_asset,
94
+ acceptors: [
95
+ {
96
+ "state" => "success",
97
+ "matcher" => "path",
98
+ "argument" => "asset_status.state",
99
+ "expected" => "ACTIVE"
100
+ },
101
+ {
102
+ "state" => "failure",
103
+ "matcher" => "path",
104
+ "argument" => "asset_status.state",
105
+ "expected" => "FAILED"
106
+ }
107
+ ]
108
+ )
109
+ }.merge(options))
110
+ end
111
+
112
+ # @option (see Client#describe_asset)
113
+ # @return (see Client#describe_asset)
114
+ def wait(params = {})
115
+ @waiter.wait(client: @client, params: params)
116
+ end
117
+
118
+ # @api private
119
+ attr_reader :waiter
120
+
121
+ end
122
+
123
+ class AssetModelActive
124
+
125
+ # @param [Hash] options
126
+ # @option options [required, Client] :client
127
+ # @option options [Integer] :max_attempts (20)
128
+ # @option options [Integer] :delay (3)
129
+ # @option options [Proc] :before_attempt
130
+ # @option options [Proc] :before_wait
131
+ def initialize(options)
132
+ @client = options.fetch(:client)
133
+ @waiter = Aws::Waiters::Waiter.new({
134
+ max_attempts: 20,
135
+ delay: 3,
136
+ poller: Aws::Waiters::Poller.new(
137
+ operation_name: :describe_asset_model,
138
+ acceptors: [
139
+ {
140
+ "state" => "success",
141
+ "matcher" => "path",
142
+ "argument" => "asset_model_status.state",
143
+ "expected" => "ACTIVE"
144
+ },
145
+ {
146
+ "state" => "failure",
147
+ "matcher" => "path",
148
+ "argument" => "asset_model_status.state",
149
+ "expected" => "FAILED"
150
+ }
151
+ ]
152
+ )
153
+ }.merge(options))
154
+ end
155
+
156
+ # @option (see Client#describe_asset_model)
157
+ # @return (see Client#describe_asset_model)
158
+ def wait(params = {})
159
+ @waiter.wait(client: @client, params: params)
160
+ end
161
+
162
+ # @api private
163
+ attr_reader :waiter
164
+
165
+ end
166
+
167
+ class AssetModelNotExists
168
+
169
+ # @param [Hash] options
170
+ # @option options [required, Client] :client
171
+ # @option options [Integer] :max_attempts (20)
172
+ # @option options [Integer] :delay (3)
173
+ # @option options [Proc] :before_attempt
174
+ # @option options [Proc] :before_wait
175
+ def initialize(options)
176
+ @client = options.fetch(:client)
177
+ @waiter = Aws::Waiters::Waiter.new({
178
+ max_attempts: 20,
179
+ delay: 3,
180
+ poller: Aws::Waiters::Poller.new(
181
+ operation_name: :describe_asset_model,
182
+ acceptors: [{
183
+ "state" => "success",
184
+ "matcher" => "error",
185
+ "expected" => "ResourceNotFoundException"
186
+ }]
187
+ )
188
+ }.merge(options))
189
+ end
190
+
191
+ # @option (see Client#describe_asset_model)
192
+ # @return (see Client#describe_asset_model)
193
+ def wait(params = {})
194
+ @waiter.wait(client: @client, params: params)
195
+ end
196
+
197
+ # @api private
198
+ attr_reader :waiter
199
+
200
+ end
201
+
202
+ class AssetNotExists
203
+
204
+ # @param [Hash] options
205
+ # @option options [required, Client] :client
206
+ # @option options [Integer] :max_attempts (20)
207
+ # @option options [Integer] :delay (3)
208
+ # @option options [Proc] :before_attempt
209
+ # @option options [Proc] :before_wait
210
+ def initialize(options)
211
+ @client = options.fetch(:client)
212
+ @waiter = Aws::Waiters::Waiter.new({
213
+ max_attempts: 20,
214
+ delay: 3,
215
+ poller: Aws::Waiters::Poller.new(
216
+ operation_name: :describe_asset,
217
+ acceptors: [{
218
+ "state" => "success",
219
+ "matcher" => "error",
220
+ "expected" => "ResourceNotFoundException"
221
+ }]
222
+ )
223
+ }.merge(options))
224
+ end
225
+
226
+ # @option (see Client#describe_asset)
227
+ # @return (see Client#describe_asset)
228
+ def wait(params = {})
229
+ @waiter.wait(client: @client, params: params)
230
+ end
231
+
232
+ # @api private
233
+ attr_reader :waiter
234
+
235
+ end
236
+
237
+ class PortalActive
238
+
239
+ # @param [Hash] options
240
+ # @option options [required, Client] :client
241
+ # @option options [Integer] :max_attempts (20)
242
+ # @option options [Integer] :delay (3)
243
+ # @option options [Proc] :before_attempt
244
+ # @option options [Proc] :before_wait
245
+ def initialize(options)
246
+ @client = options.fetch(:client)
247
+ @waiter = Aws::Waiters::Waiter.new({
248
+ max_attempts: 20,
249
+ delay: 3,
250
+ poller: Aws::Waiters::Poller.new(
251
+ operation_name: :describe_portal,
252
+ acceptors: [{
253
+ "state" => "success",
254
+ "matcher" => "path",
255
+ "argument" => "portal_status.state",
256
+ "expected" => "ACTIVE"
257
+ }]
258
+ )
259
+ }.merge(options))
260
+ end
261
+
262
+ # @option (see Client#describe_portal)
263
+ # @return (see Client#describe_portal)
264
+ def wait(params = {})
265
+ @waiter.wait(client: @client, params: params)
266
+ end
267
+
268
+ # @api private
269
+ attr_reader :waiter
270
+
271
+ end
272
+
273
+ class PortalNotExists
274
+
275
+ # @param [Hash] options
276
+ # @option options [required, Client] :client
277
+ # @option options [Integer] :max_attempts (20)
278
+ # @option options [Integer] :delay (3)
279
+ # @option options [Proc] :before_attempt
280
+ # @option options [Proc] :before_wait
281
+ def initialize(options)
282
+ @client = options.fetch(:client)
283
+ @waiter = Aws::Waiters::Waiter.new({
284
+ max_attempts: 20,
285
+ delay: 3,
286
+ poller: Aws::Waiters::Poller.new(
287
+ operation_name: :describe_portal,
288
+ acceptors: [{
289
+ "state" => "success",
290
+ "matcher" => "error",
291
+ "expected" => "ResourceNotFoundException"
292
+ }]
293
+ )
294
+ }.merge(options))
295
+ end
296
+
297
+ # @option (see Client#describe_portal)
298
+ # @return (see Client#describe_portal)
299
+ def wait(params = {})
300
+ @waiter.wait(client: @client, params: params)
301
+ end
302
+
303
+ # @api private
304
+ attr_reader :waiter
305
+
306
+ end
307
+ end
308
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-iotsitewise
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.71.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.71.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: aws-sigv4
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.1'
47
+ description: Official AWS Ruby gem for AWS IoT SiteWise. This gem is part of the AWS
48
+ SDK for Ruby.
49
+ email:
50
+ - trevrowe@amazon.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - lib/aws-sdk-iotsitewise.rb
56
+ - lib/aws-sdk-iotsitewise/client.rb
57
+ - lib/aws-sdk-iotsitewise/client_api.rb
58
+ - lib/aws-sdk-iotsitewise/customizations.rb
59
+ - lib/aws-sdk-iotsitewise/errors.rb
60
+ - lib/aws-sdk-iotsitewise/resource.rb
61
+ - lib/aws-sdk-iotsitewise/types.rb
62
+ - lib/aws-sdk-iotsitewise/waiters.rb
63
+ homepage: https://github.com/aws/aws-sdk-ruby
64
+ licenses:
65
+ - Apache-2.0
66
+ metadata:
67
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-iotsitewise
68
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-iotsitewise/CHANGELOG.md
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.7.6.2
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: AWS SDK for Ruby - AWS IoT SiteWise
89
+ test_files: []