aws-sdk-iam 1.34.0 → 1.39.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.
@@ -205,7 +205,8 @@ module Aws::IAM
205
205
  # Waiter polls an API operation until a resource enters a desired
206
206
  # state.
207
207
  #
208
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
208
+ # @note The waiting operation is performed on a copy. The original resource
209
+ # remains unchanged.
209
210
  #
210
211
  # ## Basic Usage
211
212
  #
@@ -218,13 +219,15 @@ module Aws::IAM
218
219
  #
219
220
  # ## Example
220
221
  #
221
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
222
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
223
+ # instance.state.name == 'running'
224
+ # end
222
225
  #
223
226
  # ## Configuration
224
227
  #
225
228
  # You can configure the maximum number of polling attempts, and the
226
- # delay (in seconds) between each polling attempt. The waiting condition is set
227
- # by passing a block to {#wait_until}:
229
+ # delay (in seconds) between each polling attempt. The waiting condition is
230
+ # set by passing a block to {#wait_until}:
228
231
  #
229
232
  # # poll for ~25 seconds
230
233
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -255,17 +258,16 @@ module Aws::IAM
255
258
  # # resource did not enter the desired state in time
256
259
  # end
257
260
  #
261
+ # @yieldparam [Resource] resource to be used in the waiting condition.
258
262
  #
259
- # @yield param [Resource] resource to be used in the waiting condition
260
- #
261
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
262
- # because the waiter has entered a state that it will not transition
263
- # out of, preventing success.
263
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
264
+ # terminates because the waiter has entered a state that it will not
265
+ # transition out of, preventing success.
264
266
  #
265
267
  # yet successful.
266
268
  #
267
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
268
- # while polling for a resource that is not expected.
269
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
270
+ # encountered while polling for a resource that is not expected.
269
271
  #
270
272
  # @raise [NotImplementedError] Raised when the resource does not
271
273
  #
@@ -500,7 +502,7 @@ module Aws::IAM
500
502
  # @return [UserPolicy]
501
503
  def create_policy(options = {})
502
504
  options = options.merge(user_name: @name)
503
- resp = @client.put_user_policy(options)
505
+ @client.put_user_policy(options)
504
506
  UserPolicy.new(
505
507
  user_name: @name,
506
508
  name: options[:policy_name],
@@ -594,7 +596,7 @@ module Aws::IAM
594
596
  # @return [MfaDevice]
595
597
  def enable_mfa(options = {})
596
598
  options = options.merge(user_name: @name)
597
- resp = @client.enable_mfa_device(options)
599
+ @client.enable_mfa_device(options)
598
600
  MfaDevice.new(
599
601
  user_name: @name,
600
602
  serial_number: options[:serial_number],
@@ -657,7 +659,7 @@ module Aws::IAM
657
659
  # @return [User]
658
660
  def update(options = {})
659
661
  options = options.merge(user_name: @name)
660
- resp = @client.update_user(options)
662
+ @client.update_user(options)
661
663
  User.new(
662
664
  name: options[:new_user_name],
663
665
  client: @client
@@ -899,8 +901,8 @@ module Aws::IAM
899
901
 
900
902
  def yield_waiter_and_warn(waiter, &block)
901
903
  if !@waiter_block_warned
902
- msg = "pass options to configure the waiter; "
903
- msg << "yielding the waiter is deprecated"
904
+ msg = "pass options to configure the waiter; "\
905
+ "yielding the waiter is deprecated"
904
906
  warn(msg)
905
907
  @waiter_block_warned = true
906
908
  end
@@ -908,7 +910,9 @@ module Aws::IAM
908
910
  end
909
911
 
910
912
  def separate_params_and_options(options)
911
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
913
+ opts = Set.new(
914
+ [:client, :max_attempts, :delay, :before_attempt, :before_wait]
915
+ )
912
916
  waiter_opts = {}
913
917
  waiter_params = {}
914
918
  options.each_pair do |key, value|
@@ -95,7 +95,8 @@ module Aws::IAM
95
95
  # Waiter polls an API operation until a resource enters a desired
96
96
  # state.
97
97
  #
98
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
98
+ # @note The waiting operation is performed on a copy. The original resource
99
+ # remains unchanged.
99
100
  #
100
101
  # ## Basic Usage
101
102
  #
@@ -108,13 +109,15 @@ module Aws::IAM
108
109
  #
109
110
  # ## Example
110
111
  #
111
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
112
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
113
+ # instance.state.name == 'running'
114
+ # end
112
115
  #
113
116
  # ## Configuration
114
117
  #
115
118
  # You can configure the maximum number of polling attempts, and the
116
- # delay (in seconds) between each polling attempt. The waiting condition is set
117
- # by passing a block to {#wait_until}:
119
+ # delay (in seconds) between each polling attempt. The waiting condition is
120
+ # set by passing a block to {#wait_until}:
118
121
  #
119
122
  # # poll for ~25 seconds
120
123
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -145,17 +148,16 @@ module Aws::IAM
145
148
  # # resource did not enter the desired state in time
146
149
  # end
147
150
  #
151
+ # @yieldparam [Resource] resource to be used in the waiting condition.
148
152
  #
149
- # @yield param [Resource] resource to be used in the waiting condition
150
- #
151
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
152
- # because the waiter has entered a state that it will not transition
153
- # out of, preventing success.
153
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
154
+ # terminates because the waiter has entered a state that it will not
155
+ # transition out of, preventing success.
154
156
  #
155
157
  # yet successful.
156
158
  #
157
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
158
- # while polling for a resource that is not expected.
159
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
160
+ # encountered while polling for a resource that is not expected.
159
161
  #
160
162
  # @raise [NotImplementedError] Raised when the resource does not
161
163
  #
@@ -95,7 +95,8 @@ module Aws::IAM
95
95
  # Waiter polls an API operation until a resource enters a desired
96
96
  # state.
97
97
  #
98
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
98
+ # @note The waiting operation is performed on a copy. The original resource
99
+ # remains unchanged.
99
100
  #
100
101
  # ## Basic Usage
101
102
  #
@@ -108,13 +109,15 @@ module Aws::IAM
108
109
  #
109
110
  # ## Example
110
111
  #
111
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
112
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
113
+ # instance.state.name == 'running'
114
+ # end
112
115
  #
113
116
  # ## Configuration
114
117
  #
115
118
  # You can configure the maximum number of polling attempts, and the
116
- # delay (in seconds) between each polling attempt. The waiting condition is set
117
- # by passing a block to {#wait_until}:
119
+ # delay (in seconds) between each polling attempt. The waiting condition is
120
+ # set by passing a block to {#wait_until}:
118
121
  #
119
122
  # # poll for ~25 seconds
120
123
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -145,17 +148,16 @@ module Aws::IAM
145
148
  # # resource did not enter the desired state in time
146
149
  # end
147
150
  #
151
+ # @yieldparam [Resource] resource to be used in the waiting condition.
148
152
  #
149
- # @yield param [Resource] resource to be used in the waiting condition
150
- #
151
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
152
- # because the waiter has entered a state that it will not transition
153
- # out of, preventing success.
153
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
154
+ # terminates because the waiter has entered a state that it will not
155
+ # transition out of, preventing success.
154
156
  #
155
157
  # yet successful.
156
158
  #
157
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
158
- # while polling for a resource that is not expected.
159
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
160
+ # encountered while polling for a resource that is not expected.
159
161
  #
160
162
  # @raise [NotImplementedError] Raised when the resource does not
161
163
  #
@@ -8,6 +8,70 @@
8
8
  require 'aws-sdk-core/waiters'
9
9
 
10
10
  module Aws::IAM
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
+ # | instance_profile_exists | {Client#get_instance_profile} | 1 | 40 |
71
+ # | policy_exists | {Client#get_policy} | 1 | 20 |
72
+ # | role_exists | {Client#get_role} | 1 | 20 |
73
+ # | user_exists | {Client#get_user} | 1 | 20 |
74
+ #
11
75
  module Waiters
12
76
 
13
77
  class InstanceProfileExists
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-iam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.34.0
4
+ version: 1.39.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: 2020-03-09 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.5.2.3
107
+ rubygems_version: 2.7.6.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: AWS SDK for Ruby - IAM