aws-sdk-lexmodelsv2 1.5.0 → 1.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df49853c552b1f57b85d1b5d55f36262cc20a3c26cfed2b052754a822cfb1063
4
- data.tar.gz: 87e3f47f883152ed32a678fdcd4cf478316e63a0027ac6a6b5595cc9eb1e0906
3
+ metadata.gz: fe46ef50f8fa1e7868047c7520a2aa1288aa99a2bea899f89082f79a1699f476
4
+ data.tar.gz: e3f11d12dfd4986d433ce79dc40dddebac50d370803512b28db3b3fc4e0efa20
5
5
  SHA512:
6
- metadata.gz: 6eefb79965dc75737a1b2ac33dea94c33e6dca7a700d7b9a68947ebbe189b13ec9de5cceb32771b2e0068d70bec7062cb32ac1c8b64817d019f2723a87e698bc
7
- data.tar.gz: 40d1be2efaf54a0f0be7856ec2afda01d0f5ac7d3647502357aae5aab19319a55a6fd96d8e09c14104575f3540f8622591abfba29ccf95c2a42ba46f3d1f1e1a
6
+ metadata.gz: 63baeb71a40ca7639d5fe7bf00798f6a490892517a78e7db1ef6d7ef62ee440879d985764fbf0b430f3edbf83789a9972f132cd7a61cfe06a042f4d322c4f299
7
+ data.tar.gz: 4a2cf684ac1c50ed5d39576f722f8c1f2509ce364ba77c7045b9a7cd6e27510c191a8dcbbd07b8313e3e5438603b95a147f1f8fec97fe0c10513ee3d4e14c002
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.6.0 (2021-07-27)
5
+ ------------------
6
+
7
+ * Feature - Add waiters that automatically poll for resource status for asynchronous operations, such as building a bot
8
+
4
9
  1.5.0 (2021-06-15)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.0
1
+ 1.6.0
@@ -15,6 +15,7 @@ require_relative 'aws-sdk-lexmodelsv2/types'
15
15
  require_relative 'aws-sdk-lexmodelsv2/client_api'
16
16
  require_relative 'aws-sdk-lexmodelsv2/client'
17
17
  require_relative 'aws-sdk-lexmodelsv2/errors'
18
+ require_relative 'aws-sdk-lexmodelsv2/waiters'
18
19
  require_relative 'aws-sdk-lexmodelsv2/resource'
19
20
  require_relative 'aws-sdk-lexmodelsv2/customizations'
20
21
 
@@ -48,6 +49,6 @@ require_relative 'aws-sdk-lexmodelsv2/customizations'
48
49
  # @!group service
49
50
  module Aws::LexModelsV2
50
51
 
51
- GEM_VERSION = '1.5.0'
52
+ GEM_VERSION = '1.6.0'
52
53
 
53
54
  end
@@ -2541,6 +2541,11 @@ module Aws::LexModelsV2
2541
2541
  # resp.creation_date_time #=> Time
2542
2542
  # resp.last_updated_date_time #=> Time
2543
2543
  #
2544
+ #
2545
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2546
+ #
2547
+ # * bot_available
2548
+ #
2544
2549
  # @see http://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/DescribeBot AWS API Documentation
2545
2550
  #
2546
2551
  # @overload describe_bot(params = {})
@@ -2609,6 +2614,11 @@ module Aws::LexModelsV2
2609
2614
  # resp.creation_date_time #=> Time
2610
2615
  # resp.last_updated_date_time #=> Time
2611
2616
  #
2617
+ #
2618
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2619
+ #
2620
+ # * bot_alias_available
2621
+ #
2612
2622
  # @see http://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/DescribeBotAlias AWS API Documentation
2613
2623
  #
2614
2624
  # @overload describe_bot_alias(params = {})
@@ -2682,6 +2692,13 @@ module Aws::LexModelsV2
2682
2692
  # resp.bot_locale_history_events[0].event #=> String
2683
2693
  # resp.bot_locale_history_events[0].event_date #=> Time
2684
2694
  #
2695
+ #
2696
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2697
+ #
2698
+ # * bot_locale_built
2699
+ # * bot_locale_created
2700
+ # * bot_locale_express_testing_available
2701
+ #
2685
2702
  # @see http://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/DescribeBotLocale AWS API Documentation
2686
2703
  #
2687
2704
  # @overload describe_bot_locale(params = {})
@@ -2734,6 +2751,11 @@ module Aws::LexModelsV2
2734
2751
  # resp.failure_reasons[0] #=> String
2735
2752
  # resp.creation_date_time #=> Time
2736
2753
  #
2754
+ #
2755
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2756
+ #
2757
+ # * bot_version_available
2758
+ #
2737
2759
  # @see http://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/DescribeBotVersion AWS API Documentation
2738
2760
  #
2739
2761
  # @overload describe_bot_version(params = {})
@@ -2781,6 +2803,11 @@ module Aws::LexModelsV2
2781
2803
  # resp.creation_date_time #=> Time
2782
2804
  # resp.last_updated_date_time #=> Time
2783
2805
  #
2806
+ #
2807
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2808
+ #
2809
+ # * bot_export_completed
2810
+ #
2784
2811
  # @see http://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/DescribeExport AWS API Documentation
2785
2812
  #
2786
2813
  # @overload describe_export(params = {})
@@ -2838,6 +2865,11 @@ module Aws::LexModelsV2
2838
2865
  # resp.creation_date_time #=> Time
2839
2866
  # resp.last_updated_date_time #=> Time
2840
2867
  #
2868
+ #
2869
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2870
+ #
2871
+ # * bot_import_completed
2872
+ #
2841
2873
  # @see http://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/DescribeImport AWS API Documentation
2842
2874
  #
2843
2875
  # @overload describe_import(params = {})
@@ -5666,14 +5698,141 @@ module Aws::LexModelsV2
5666
5698
  params: params,
5667
5699
  config: config)
5668
5700
  context[:gem_name] = 'aws-sdk-lexmodelsv2'
5669
- context[:gem_version] = '1.5.0'
5701
+ context[:gem_version] = '1.6.0'
5670
5702
  Seahorse::Client::Request.new(handlers, context)
5671
5703
  end
5672
5704
 
5705
+ # Polls an API operation until a resource enters a desired state.
5706
+ #
5707
+ # ## Basic Usage
5708
+ #
5709
+ # A waiter will call an API operation until:
5710
+ #
5711
+ # * It is successful
5712
+ # * It enters a terminal state
5713
+ # * It makes the maximum number of attempts
5714
+ #
5715
+ # In between attempts, the waiter will sleep.
5716
+ #
5717
+ # # polls in a loop, sleeping between attempts
5718
+ # client.wait_until(waiter_name, params)
5719
+ #
5720
+ # ## Configuration
5721
+ #
5722
+ # You can configure the maximum number of polling attempts, and the
5723
+ # delay (in seconds) between each polling attempt. You can pass
5724
+ # configuration as the final arguments hash.
5725
+ #
5726
+ # # poll for ~25 seconds
5727
+ # client.wait_until(waiter_name, params, {
5728
+ # max_attempts: 5,
5729
+ # delay: 5,
5730
+ # })
5731
+ #
5732
+ # ## Callbacks
5733
+ #
5734
+ # You can be notified before each polling attempt and before each
5735
+ # delay. If you throw `:success` or `:failure` from these callbacks,
5736
+ # it will terminate the waiter.
5737
+ #
5738
+ # started_at = Time.now
5739
+ # client.wait_until(waiter_name, params, {
5740
+ #
5741
+ # # disable max attempts
5742
+ # max_attempts: nil,
5743
+ #
5744
+ # # poll for 1 hour, instead of a number of attempts
5745
+ # before_wait: -> (attempts, response) do
5746
+ # throw :failure if Time.now - started_at > 3600
5747
+ # end
5748
+ # })
5749
+ #
5750
+ # ## Handling Errors
5751
+ #
5752
+ # When a waiter is unsuccessful, it will raise an error.
5753
+ # All of the failure errors extend from
5754
+ # {Aws::Waiters::Errors::WaiterFailed}.
5755
+ #
5756
+ # begin
5757
+ # client.wait_until(...)
5758
+ # rescue Aws::Waiters::Errors::WaiterFailed
5759
+ # # resource did not enter the desired state in time
5760
+ # end
5761
+ #
5762
+ # ## Valid Waiters
5763
+ #
5764
+ # The following table lists the valid waiter names, the operations they call,
5765
+ # and the default `:delay` and `:max_attempts` values.
5766
+ #
5767
+ # | waiter_name | params | :delay | :max_attempts |
5768
+ # | ------------------------------------ | ----------------------------- | -------- | ------------- |
5769
+ # | bot_alias_available | {Client#describe_bot_alias} | 10 | 35 |
5770
+ # | bot_available | {Client#describe_bot} | 10 | 35 |
5771
+ # | bot_export_completed | {Client#describe_export} | 10 | 35 |
5772
+ # | bot_import_completed | {Client#describe_import} | 10 | 35 |
5773
+ # | bot_locale_built | {Client#describe_bot_locale} | 10 | 35 |
5774
+ # | bot_locale_created | {Client#describe_bot_locale} | 10 | 35 |
5775
+ # | bot_locale_express_testing_available | {Client#describe_bot_locale} | 10 | 35 |
5776
+ # | bot_version_available | {Client#describe_bot_version} | 10 | 35 |
5777
+ #
5778
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
5779
+ # because the waiter has entered a state that it will not transition
5780
+ # out of, preventing success.
5781
+ #
5782
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
5783
+ # maximum number of attempts have been made, and the waiter is not
5784
+ # yet successful.
5785
+ #
5786
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
5787
+ # while polling for a resource that is not expected.
5788
+ #
5789
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
5790
+ # for an unknown state.
5791
+ #
5792
+ # @return [Boolean] Returns `true` if the waiter was successful.
5793
+ # @param [Symbol] waiter_name
5794
+ # @param [Hash] params ({})
5795
+ # @param [Hash] options ({})
5796
+ # @option options [Integer] :max_attempts
5797
+ # @option options [Integer] :delay
5798
+ # @option options [Proc] :before_attempt
5799
+ # @option options [Proc] :before_wait
5800
+ def wait_until(waiter_name, params = {}, options = {})
5801
+ w = waiter(waiter_name, options)
5802
+ yield(w.waiter) if block_given? # deprecated
5803
+ w.wait(params)
5804
+ end
5805
+
5673
5806
  # @api private
5674
5807
  # @deprecated
5675
5808
  def waiter_names
5676
- []
5809
+ waiters.keys
5810
+ end
5811
+
5812
+ private
5813
+
5814
+ # @param [Symbol] waiter_name
5815
+ # @param [Hash] options ({})
5816
+ def waiter(waiter_name, options = {})
5817
+ waiter_class = waiters[waiter_name]
5818
+ if waiter_class
5819
+ waiter_class.new(options.merge(client: self))
5820
+ else
5821
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
5822
+ end
5823
+ end
5824
+
5825
+ def waiters
5826
+ {
5827
+ bot_alias_available: Waiters::BotAliasAvailable,
5828
+ bot_available: Waiters::BotAvailable,
5829
+ bot_export_completed: Waiters::BotExportCompleted,
5830
+ bot_import_completed: Waiters::BotImportCompleted,
5831
+ bot_locale_built: Waiters::BotLocaleBuilt,
5832
+ bot_locale_created: Waiters::BotLocaleCreated,
5833
+ bot_locale_express_testing_available: Waiters::BotLocaleExpressTestingAvailable,
5834
+ bot_version_available: Waiters::BotVersionAvailable
5835
+ }
5677
5836
  end
5678
5837
 
5679
5838
  class << self
@@ -0,0 +1,532 @@
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::LexModelsV2
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
+ # | bot_alias_available | {Client#describe_bot_alias} | 10 | 35 |
73
+ # | bot_available | {Client#describe_bot} | 10 | 35 |
74
+ # | bot_export_completed | {Client#describe_export} | 10 | 35 |
75
+ # | bot_import_completed | {Client#describe_import} | 10 | 35 |
76
+ # | bot_locale_built | {Client#describe_bot_locale} | 10 | 35 |
77
+ # | bot_locale_created | {Client#describe_bot_locale} | 10 | 35 |
78
+ # | bot_locale_express_testing_available | {Client#describe_bot_locale} | 10 | 35 |
79
+ # | bot_version_available | {Client#describe_bot_version} | 10 | 35 |
80
+ #
81
+ module Waiters
82
+
83
+ # Wait until a bot alias is available
84
+ class BotAliasAvailable
85
+
86
+ # @param [Hash] options
87
+ # @option options [required, Client] :client
88
+ # @option options [Integer] :max_attempts (35)
89
+ # @option options [Integer] :delay (10)
90
+ # @option options [Proc] :before_attempt
91
+ # @option options [Proc] :before_wait
92
+ def initialize(options)
93
+ @client = options.fetch(:client)
94
+ @waiter = Aws::Waiters::Waiter.new({
95
+ max_attempts: 35,
96
+ delay: 10,
97
+ poller: Aws::Waiters::Poller.new(
98
+ operation_name: :describe_bot_alias,
99
+ acceptors: [
100
+ {
101
+ "expected" => "Available",
102
+ "matcher" => "path",
103
+ "state" => "success",
104
+ "argument" => "bot_alias_status"
105
+ },
106
+ {
107
+ "expected" => "Failed",
108
+ "matcher" => "path",
109
+ "state" => "failure",
110
+ "argument" => "bot_alias_status"
111
+ },
112
+ {
113
+ "expected" => "Deleting",
114
+ "matcher" => "path",
115
+ "state" => "failure",
116
+ "argument" => "bot_alias_status"
117
+ }
118
+ ]
119
+ )
120
+ }.merge(options))
121
+ end
122
+
123
+ # @option (see Client#describe_bot_alias)
124
+ # @return (see Client#describe_bot_alias)
125
+ def wait(params = {})
126
+ @waiter.wait(client: @client, params: params)
127
+ end
128
+
129
+ # @api private
130
+ attr_reader :waiter
131
+
132
+ end
133
+
134
+ # Wait until a bot is available
135
+ class BotAvailable
136
+
137
+ # @param [Hash] options
138
+ # @option options [required, Client] :client
139
+ # @option options [Integer] :max_attempts (35)
140
+ # @option options [Integer] :delay (10)
141
+ # @option options [Proc] :before_attempt
142
+ # @option options [Proc] :before_wait
143
+ def initialize(options)
144
+ @client = options.fetch(:client)
145
+ @waiter = Aws::Waiters::Waiter.new({
146
+ max_attempts: 35,
147
+ delay: 10,
148
+ poller: Aws::Waiters::Poller.new(
149
+ operation_name: :describe_bot,
150
+ acceptors: [
151
+ {
152
+ "expected" => "Available",
153
+ "matcher" => "path",
154
+ "state" => "success",
155
+ "argument" => "bot_status"
156
+ },
157
+ {
158
+ "expected" => "Deleting",
159
+ "matcher" => "path",
160
+ "state" => "failure",
161
+ "argument" => "bot_status"
162
+ },
163
+ {
164
+ "expected" => "Failed",
165
+ "matcher" => "path",
166
+ "state" => "failure",
167
+ "argument" => "bot_status"
168
+ },
169
+ {
170
+ "expected" => "Inactive",
171
+ "matcher" => "path",
172
+ "state" => "failure",
173
+ "argument" => "bot_status"
174
+ }
175
+ ]
176
+ )
177
+ }.merge(options))
178
+ end
179
+
180
+ # @option (see Client#describe_bot)
181
+ # @return (see Client#describe_bot)
182
+ def wait(params = {})
183
+ @waiter.wait(client: @client, params: params)
184
+ end
185
+
186
+ # @api private
187
+ attr_reader :waiter
188
+
189
+ end
190
+
191
+ # Wait until a bot has been exported
192
+ class BotExportCompleted
193
+
194
+ # @param [Hash] options
195
+ # @option options [required, Client] :client
196
+ # @option options [Integer] :max_attempts (35)
197
+ # @option options [Integer] :delay (10)
198
+ # @option options [Proc] :before_attempt
199
+ # @option options [Proc] :before_wait
200
+ def initialize(options)
201
+ @client = options.fetch(:client)
202
+ @waiter = Aws::Waiters::Waiter.new({
203
+ max_attempts: 35,
204
+ delay: 10,
205
+ poller: Aws::Waiters::Poller.new(
206
+ operation_name: :describe_export,
207
+ acceptors: [
208
+ {
209
+ "expected" => "Completed",
210
+ "matcher" => "path",
211
+ "state" => "success",
212
+ "argument" => "export_status"
213
+ },
214
+ {
215
+ "expected" => "Deleting",
216
+ "matcher" => "path",
217
+ "state" => "failure",
218
+ "argument" => "export_status"
219
+ },
220
+ {
221
+ "expected" => "Failed",
222
+ "matcher" => "path",
223
+ "state" => "failure",
224
+ "argument" => "export_status"
225
+ }
226
+ ]
227
+ )
228
+ }.merge(options))
229
+ end
230
+
231
+ # @option (see Client#describe_export)
232
+ # @return (see Client#describe_export)
233
+ def wait(params = {})
234
+ @waiter.wait(client: @client, params: params)
235
+ end
236
+
237
+ # @api private
238
+ attr_reader :waiter
239
+
240
+ end
241
+
242
+ # Wait until a bot has been imported
243
+ class BotImportCompleted
244
+
245
+ # @param [Hash] options
246
+ # @option options [required, Client] :client
247
+ # @option options [Integer] :max_attempts (35)
248
+ # @option options [Integer] :delay (10)
249
+ # @option options [Proc] :before_attempt
250
+ # @option options [Proc] :before_wait
251
+ def initialize(options)
252
+ @client = options.fetch(:client)
253
+ @waiter = Aws::Waiters::Waiter.new({
254
+ max_attempts: 35,
255
+ delay: 10,
256
+ poller: Aws::Waiters::Poller.new(
257
+ operation_name: :describe_import,
258
+ acceptors: [
259
+ {
260
+ "expected" => "Completed",
261
+ "matcher" => "path",
262
+ "state" => "success",
263
+ "argument" => "import_status"
264
+ },
265
+ {
266
+ "expected" => "Deleting",
267
+ "matcher" => "path",
268
+ "state" => "failure",
269
+ "argument" => "import_status"
270
+ },
271
+ {
272
+ "expected" => "Failed",
273
+ "matcher" => "path",
274
+ "state" => "failure",
275
+ "argument" => "import_status"
276
+ }
277
+ ]
278
+ )
279
+ }.merge(options))
280
+ end
281
+
282
+ # @option (see Client#describe_import)
283
+ # @return (see Client#describe_import)
284
+ def wait(params = {})
285
+ @waiter.wait(client: @client, params: params)
286
+ end
287
+
288
+ # @api private
289
+ attr_reader :waiter
290
+
291
+ end
292
+
293
+ # Wait until a bot locale is built
294
+ class BotLocaleBuilt
295
+
296
+ # @param [Hash] options
297
+ # @option options [required, Client] :client
298
+ # @option options [Integer] :max_attempts (35)
299
+ # @option options [Integer] :delay (10)
300
+ # @option options [Proc] :before_attempt
301
+ # @option options [Proc] :before_wait
302
+ def initialize(options)
303
+ @client = options.fetch(:client)
304
+ @waiter = Aws::Waiters::Waiter.new({
305
+ max_attempts: 35,
306
+ delay: 10,
307
+ poller: Aws::Waiters::Poller.new(
308
+ operation_name: :describe_bot_locale,
309
+ acceptors: [
310
+ {
311
+ "expected" => "Built",
312
+ "matcher" => "path",
313
+ "state" => "success",
314
+ "argument" => "bot_locale_status"
315
+ },
316
+ {
317
+ "expected" => "Deleting",
318
+ "matcher" => "path",
319
+ "state" => "failure",
320
+ "argument" => "bot_locale_status"
321
+ },
322
+ {
323
+ "expected" => "Failed",
324
+ "matcher" => "path",
325
+ "state" => "failure",
326
+ "argument" => "bot_locale_status"
327
+ },
328
+ {
329
+ "expected" => "NotBuilt",
330
+ "matcher" => "path",
331
+ "state" => "failure",
332
+ "argument" => "bot_locale_status"
333
+ }
334
+ ]
335
+ )
336
+ }.merge(options))
337
+ end
338
+
339
+ # @option (see Client#describe_bot_locale)
340
+ # @return (see Client#describe_bot_locale)
341
+ def wait(params = {})
342
+ @waiter.wait(client: @client, params: params)
343
+ end
344
+
345
+ # @api private
346
+ attr_reader :waiter
347
+
348
+ end
349
+
350
+ # Wait unit a bot locale is created
351
+ class BotLocaleCreated
352
+
353
+ # @param [Hash] options
354
+ # @option options [required, Client] :client
355
+ # @option options [Integer] :max_attempts (35)
356
+ # @option options [Integer] :delay (10)
357
+ # @option options [Proc] :before_attempt
358
+ # @option options [Proc] :before_wait
359
+ def initialize(options)
360
+ @client = options.fetch(:client)
361
+ @waiter = Aws::Waiters::Waiter.new({
362
+ max_attempts: 35,
363
+ delay: 10,
364
+ poller: Aws::Waiters::Poller.new(
365
+ operation_name: :describe_bot_locale,
366
+ acceptors: [
367
+ {
368
+ "expected" => "Built",
369
+ "matcher" => "path",
370
+ "state" => "success",
371
+ "argument" => "bot_locale_status"
372
+ },
373
+ {
374
+ "expected" => "ReadyExpressTesting",
375
+ "matcher" => "path",
376
+ "state" => "success",
377
+ "argument" => "bot_locale_status"
378
+ },
379
+ {
380
+ "expected" => "NotBuilt",
381
+ "matcher" => "path",
382
+ "state" => "success",
383
+ "argument" => "bot_locale_status"
384
+ },
385
+ {
386
+ "expected" => "Deleting",
387
+ "matcher" => "path",
388
+ "state" => "failure",
389
+ "argument" => "bot_locale_status"
390
+ },
391
+ {
392
+ "expected" => "Failed",
393
+ "matcher" => "path",
394
+ "state" => "failure",
395
+ "argument" => "bot_locale_status"
396
+ }
397
+ ]
398
+ )
399
+ }.merge(options))
400
+ end
401
+
402
+ # @option (see Client#describe_bot_locale)
403
+ # @return (see Client#describe_bot_locale)
404
+ def wait(params = {})
405
+ @waiter.wait(client: @client, params: params)
406
+ end
407
+
408
+ # @api private
409
+ attr_reader :waiter
410
+
411
+ end
412
+
413
+ # Wait until a bot locale build is ready for express testing
414
+ class BotLocaleExpressTestingAvailable
415
+
416
+ # @param [Hash] options
417
+ # @option options [required, Client] :client
418
+ # @option options [Integer] :max_attempts (35)
419
+ # @option options [Integer] :delay (10)
420
+ # @option options [Proc] :before_attempt
421
+ # @option options [Proc] :before_wait
422
+ def initialize(options)
423
+ @client = options.fetch(:client)
424
+ @waiter = Aws::Waiters::Waiter.new({
425
+ max_attempts: 35,
426
+ delay: 10,
427
+ poller: Aws::Waiters::Poller.new(
428
+ operation_name: :describe_bot_locale,
429
+ acceptors: [
430
+ {
431
+ "expected" => "Built",
432
+ "matcher" => "path",
433
+ "state" => "success",
434
+ "argument" => "bot_locale_status"
435
+ },
436
+ {
437
+ "expected" => "ReadyExpressTesting",
438
+ "matcher" => "path",
439
+ "state" => "success",
440
+ "argument" => "bot_locale_status"
441
+ },
442
+ {
443
+ "expected" => "Deleting",
444
+ "matcher" => "path",
445
+ "state" => "failure",
446
+ "argument" => "bot_locale_status"
447
+ },
448
+ {
449
+ "expected" => "Failed",
450
+ "matcher" => "path",
451
+ "state" => "failure",
452
+ "argument" => "bot_locale_status"
453
+ },
454
+ {
455
+ "expected" => "NotBuilt",
456
+ "matcher" => "path",
457
+ "state" => "failure",
458
+ "argument" => "bot_locale_status"
459
+ }
460
+ ]
461
+ )
462
+ }.merge(options))
463
+ end
464
+
465
+ # @option (see Client#describe_bot_locale)
466
+ # @return (see Client#describe_bot_locale)
467
+ def wait(params = {})
468
+ @waiter.wait(client: @client, params: params)
469
+ end
470
+
471
+ # @api private
472
+ attr_reader :waiter
473
+
474
+ end
475
+
476
+ # Wait until a bot version is available
477
+ class BotVersionAvailable
478
+
479
+ # @param [Hash] options
480
+ # @option options [required, Client] :client
481
+ # @option options [Integer] :max_attempts (35)
482
+ # @option options [Integer] :delay (10)
483
+ # @option options [Proc] :before_attempt
484
+ # @option options [Proc] :before_wait
485
+ def initialize(options)
486
+ @client = options.fetch(:client)
487
+ @waiter = Aws::Waiters::Waiter.new({
488
+ max_attempts: 35,
489
+ delay: 10,
490
+ poller: Aws::Waiters::Poller.new(
491
+ operation_name: :describe_bot_version,
492
+ acceptors: [
493
+ {
494
+ "expected" => "Available",
495
+ "matcher" => "path",
496
+ "state" => "success",
497
+ "argument" => "bot_status"
498
+ },
499
+ {
500
+ "expected" => "Deleting",
501
+ "matcher" => "path",
502
+ "state" => "failure",
503
+ "argument" => "bot_status"
504
+ },
505
+ {
506
+ "expected" => "Failed",
507
+ "matcher" => "path",
508
+ "state" => "failure",
509
+ "argument" => "bot_status"
510
+ },
511
+ {
512
+ "state" => "retry",
513
+ "matcher" => "status",
514
+ "expected" => 404
515
+ }
516
+ ]
517
+ )
518
+ }.merge(options))
519
+ end
520
+
521
+ # @option (see Client#describe_bot_version)
522
+ # @return (see Client#describe_bot_version)
523
+ def wait(params = {})
524
+ @waiter.wait(client: @client, params: params)
525
+ end
526
+
527
+ # @api private
528
+ attr_reader :waiter
529
+
530
+ end
531
+ end
532
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-lexmodelsv2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.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-06-15 00:00:00.000000000 Z
11
+ date: 2021-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -63,6 +63,7 @@ files:
63
63
  - lib/aws-sdk-lexmodelsv2/plugins/content_type.rb
64
64
  - lib/aws-sdk-lexmodelsv2/resource.rb
65
65
  - lib/aws-sdk-lexmodelsv2/types.rb
66
+ - lib/aws-sdk-lexmodelsv2/waiters.rb
66
67
  homepage: https://github.com/aws/aws-sdk-ruby
67
68
  licenses:
68
69
  - Apache-2.0