aws-sdk-iam 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,19 +34,19 @@ module Aws::IAM
34
34
  # path, ID, and ARN.
35
35
  # @return [Types::ServerCertificateMetadata]
36
36
  def server_certificate_metadata
37
- data.server_certificate_metadata
37
+ data[:server_certificate_metadata]
38
38
  end
39
39
 
40
40
  # The contents of the public key certificate.
41
41
  # @return [String]
42
42
  def certificate_body
43
- data.certificate_body
43
+ data[:certificate_body]
44
44
  end
45
45
 
46
46
  # The contents of the public key certificate chain.
47
47
  # @return [String]
48
48
  def certificate_chain
49
- data.certificate_chain
49
+ data[:certificate_chain]
50
50
  end
51
51
 
52
52
  # @!endgroup
@@ -84,6 +84,101 @@ module Aws::IAM
84
84
  !!@data
85
85
  end
86
86
 
87
+ # @deprecated Use [Aws::IAM::Client] #wait_until instead
88
+ #
89
+ # Waiter polls an API operation until a resource enters a desired
90
+ # state.
91
+ #
92
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
93
+ #
94
+ # ## Basic Usage
95
+ #
96
+ # Waiter will polls until it is successful, it fails by
97
+ # entering a terminal state, or until a maximum number of attempts
98
+ # are made.
99
+ #
100
+ # # polls in a loop until condition is true
101
+ # resource.wait_until(options) {|resource| condition}
102
+ #
103
+ # ## Example
104
+ #
105
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
106
+ #
107
+ # ## Configuration
108
+ #
109
+ # You can configure the maximum number of polling attempts, and the
110
+ # delay (in seconds) between each polling attempt. The waiting condition is set
111
+ # by passing a block to {#wait_until}:
112
+ #
113
+ # # poll for ~25 seconds
114
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
115
+ #
116
+ # ## Callbacks
117
+ #
118
+ # You can be notified before each polling attempt and before each
119
+ # delay. If you throw `:success` or `:failure` from these callbacks,
120
+ # it will terminate the waiter.
121
+ #
122
+ # started_at = Time.now
123
+ # # poll for 1 hour, instead of a number of attempts
124
+ # proc = Proc.new do |attempts, response|
125
+ # throw :failure if Time.now - started_at > 3600
126
+ # end
127
+ #
128
+ # # disable max attempts
129
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
130
+ #
131
+ # ## Handling Errors
132
+ #
133
+ # When a waiter is successful, it returns the Resource. When a waiter
134
+ # fails, it raises an error.
135
+ #
136
+ # begin
137
+ # resource.wait_until(...)
138
+ # rescue Aws::Waiters::Errors::WaiterFailed
139
+ # # resource did not enter the desired state in time
140
+ # end
141
+ #
142
+ #
143
+ # @yield param [Resource] resource to be used in the waiting condition
144
+ #
145
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
146
+ # because the waiter has entered a state that it will not transition
147
+ # out of, preventing success.
148
+ #
149
+ # yet successful.
150
+ #
151
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
152
+ # while polling for a resource that is not expected.
153
+ #
154
+ # @raise [NotImplementedError] Raised when the resource does not
155
+ #
156
+ # @option options [Integer] :max_attempts (10) Maximum number of
157
+ # attempts
158
+ # @option options [Integer] :delay (10) Delay between each
159
+ # attempt in seconds
160
+ # @option options [Proc] :before_attempt (nil) Callback
161
+ # invoked before each attempt
162
+ # @option options [Proc] :before_wait (nil) Callback
163
+ # invoked before each wait
164
+ # @return [Resource] if the waiter was successful
165
+ def wait_until(options = {}, &block)
166
+ self_copy = self.dup
167
+ attempts = 0
168
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
169
+ options[:delay] ||= 10
170
+ options[:poller] = Proc.new do
171
+ attempts += 1
172
+ if block.call(self_copy)
173
+ [:success, self_copy]
174
+ else
175
+ self_copy.reload unless attempts == options[:max_attempts]
176
+ :retry
177
+ end
178
+ end
179
+ Aws::Waiters::Waiter.new(options).wait({})
180
+ end
181
+
87
182
  # @!group Actions
88
183
 
89
184
  # @example Request syntax with placeholder values
@@ -42,20 +42,20 @@ module Aws::IAM
42
42
  # The contents of the signing certificate.
43
43
  # @return [String]
44
44
  def certificate_body
45
- data.certificate_body
45
+ data[:certificate_body]
46
46
  end
47
47
 
48
48
  # The status of the signing certificate. `Active` means the key is valid
49
49
  # for API calls, while `Inactive` means it is not.
50
50
  # @return [String]
51
51
  def status
52
- data.status
52
+ data[:status]
53
53
  end
54
54
 
55
55
  # The date when the signing certificate was uploaded.
56
56
  # @return [Time]
57
57
  def upload_date
58
- data.upload_date
58
+ data[:upload_date]
59
59
  end
60
60
 
61
61
  # @!endgroup
@@ -88,6 +88,101 @@ module Aws::IAM
88
88
  !!@data
89
89
  end
90
90
 
91
+ # @deprecated Use [Aws::IAM::Client] #wait_until instead
92
+ #
93
+ # Waiter polls an API operation until a resource enters a desired
94
+ # state.
95
+ #
96
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
97
+ #
98
+ # ## Basic Usage
99
+ #
100
+ # Waiter will polls until it is successful, it fails by
101
+ # entering a terminal state, or until a maximum number of attempts
102
+ # are made.
103
+ #
104
+ # # polls in a loop until condition is true
105
+ # resource.wait_until(options) {|resource| condition}
106
+ #
107
+ # ## Example
108
+ #
109
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
110
+ #
111
+ # ## Configuration
112
+ #
113
+ # You can configure the maximum number of polling attempts, and the
114
+ # delay (in seconds) between each polling attempt. The waiting condition is set
115
+ # by passing a block to {#wait_until}:
116
+ #
117
+ # # poll for ~25 seconds
118
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
119
+ #
120
+ # ## Callbacks
121
+ #
122
+ # You can be notified before each polling attempt and before each
123
+ # delay. If you throw `:success` or `:failure` from these callbacks,
124
+ # it will terminate the waiter.
125
+ #
126
+ # started_at = Time.now
127
+ # # poll for 1 hour, instead of a number of attempts
128
+ # proc = Proc.new do |attempts, response|
129
+ # throw :failure if Time.now - started_at > 3600
130
+ # end
131
+ #
132
+ # # disable max attempts
133
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
134
+ #
135
+ # ## Handling Errors
136
+ #
137
+ # When a waiter is successful, it returns the Resource. When a waiter
138
+ # fails, it raises an error.
139
+ #
140
+ # begin
141
+ # resource.wait_until(...)
142
+ # rescue Aws::Waiters::Errors::WaiterFailed
143
+ # # resource did not enter the desired state in time
144
+ # end
145
+ #
146
+ #
147
+ # @yield param [Resource] resource to be used in the waiting condition
148
+ #
149
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
150
+ # because the waiter has entered a state that it will not transition
151
+ # out of, preventing success.
152
+ #
153
+ # yet successful.
154
+ #
155
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
156
+ # while polling for a resource that is not expected.
157
+ #
158
+ # @raise [NotImplementedError] Raised when the resource does not
159
+ #
160
+ # @option options [Integer] :max_attempts (10) Maximum number of
161
+ # attempts
162
+ # @option options [Integer] :delay (10) Delay between each
163
+ # attempt in seconds
164
+ # @option options [Proc] :before_attempt (nil) Callback
165
+ # invoked before each attempt
166
+ # @option options [Proc] :before_wait (nil) Callback
167
+ # invoked before each wait
168
+ # @return [Resource] if the waiter was successful
169
+ def wait_until(options = {}, &block)
170
+ self_copy = self.dup
171
+ attempts = 0
172
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
173
+ options[:delay] ||= 10
174
+ options[:poller] = Proc.new do
175
+ attempts += 1
176
+ if block.call(self_copy)
177
+ [:success, self_copy]
178
+ else
179
+ self_copy.reload unless attempts == options[:max_attempts]
180
+ :retry
181
+ end
182
+ end
183
+ Aws::Waiters::Waiter.new(options).wait({})
184
+ end
185
+
91
186
  # @!group Actions
92
187
 
93
188
  # @example Request syntax with placeholder values
@@ -39,7 +39,7 @@ module Aws::IAM
39
39
  # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
40
40
  # @return [String]
41
41
  def path
42
- data.path
42
+ data[:path]
43
43
  end
44
44
 
45
45
  # The stable and unique string identifying the user. For more
@@ -51,7 +51,7 @@ module Aws::IAM
51
51
  # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
52
52
  # @return [String]
53
53
  def user_id
54
- data.user_id
54
+ data[:user_id]
55
55
  end
56
56
 
57
57
  # The Amazon Resource Name (ARN) that identifies the user. For more
@@ -63,7 +63,7 @@ module Aws::IAM
63
63
  # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
64
64
  # @return [String]
65
65
  def arn
66
- data.arn
66
+ data[:arn]
67
67
  end
68
68
 
69
69
  # The date and time, in [ISO 8601 date-time format][1], when the user
@@ -74,7 +74,7 @@ module Aws::IAM
74
74
  # [1]: http://www.iso.org/iso/iso8601
75
75
  # @return [Time]
76
76
  def create_date
77
- data.create_date
77
+ data[:create_date]
78
78
  end
79
79
 
80
80
  # The date and time, in [ISO 8601 date-time format][1], when the user's
@@ -99,7 +99,7 @@ module Aws::IAM
99
99
  # [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html
100
100
  # @return [Time]
101
101
  def password_last_used
102
- data.password_last_used
102
+ data[:password_last_used]
103
103
  end
104
104
 
105
105
  # @!endgroup
@@ -168,6 +168,101 @@ module Aws::IAM
168
168
  })
169
169
  end
170
170
 
171
+ # @deprecated Use [Aws::IAM::Client] #wait_until instead
172
+ #
173
+ # Waiter polls an API operation until a resource enters a desired
174
+ # state.
175
+ #
176
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
177
+ #
178
+ # ## Basic Usage
179
+ #
180
+ # Waiter will polls until it is successful, it fails by
181
+ # entering a terminal state, or until a maximum number of attempts
182
+ # are made.
183
+ #
184
+ # # polls in a loop until condition is true
185
+ # resource.wait_until(options) {|resource| condition}
186
+ #
187
+ # ## Example
188
+ #
189
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
190
+ #
191
+ # ## Configuration
192
+ #
193
+ # You can configure the maximum number of polling attempts, and the
194
+ # delay (in seconds) between each polling attempt. The waiting condition is set
195
+ # by passing a block to {#wait_until}:
196
+ #
197
+ # # poll for ~25 seconds
198
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
199
+ #
200
+ # ## Callbacks
201
+ #
202
+ # You can be notified before each polling attempt and before each
203
+ # delay. If you throw `:success` or `:failure` from these callbacks,
204
+ # it will terminate the waiter.
205
+ #
206
+ # started_at = Time.now
207
+ # # poll for 1 hour, instead of a number of attempts
208
+ # proc = Proc.new do |attempts, response|
209
+ # throw :failure if Time.now - started_at > 3600
210
+ # end
211
+ #
212
+ # # disable max attempts
213
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
214
+ #
215
+ # ## Handling Errors
216
+ #
217
+ # When a waiter is successful, it returns the Resource. When a waiter
218
+ # fails, it raises an error.
219
+ #
220
+ # begin
221
+ # resource.wait_until(...)
222
+ # rescue Aws::Waiters::Errors::WaiterFailed
223
+ # # resource did not enter the desired state in time
224
+ # end
225
+ #
226
+ #
227
+ # @yield param [Resource] resource to be used in the waiting condition
228
+ #
229
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
230
+ # because the waiter has entered a state that it will not transition
231
+ # out of, preventing success.
232
+ #
233
+ # yet successful.
234
+ #
235
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
236
+ # while polling for a resource that is not expected.
237
+ #
238
+ # @raise [NotImplementedError] Raised when the resource does not
239
+ #
240
+ # @option options [Integer] :max_attempts (10) Maximum number of
241
+ # attempts
242
+ # @option options [Integer] :delay (10) Delay between each
243
+ # attempt in seconds
244
+ # @option options [Proc] :before_attempt (nil) Callback
245
+ # invoked before each attempt
246
+ # @option options [Proc] :before_wait (nil) Callback
247
+ # invoked before each wait
248
+ # @return [Resource] if the waiter was successful
249
+ def wait_until(options = {}, &block)
250
+ self_copy = self.dup
251
+ attempts = 0
252
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
253
+ options[:delay] ||= 10
254
+ options[:poller] = Proc.new do
255
+ attempts += 1
256
+ if block.call(self_copy)
257
+ [:success, self_copy]
258
+ else
259
+ self_copy.reload unless attempts == options[:max_attempts]
260
+ :retry
261
+ end
262
+ end
263
+ Aws::Waiters::Waiter.new(options).wait({})
264
+ end
265
+
171
266
  # @!group Actions
172
267
 
173
268
  # @example Request syntax with placeholder values
@@ -42,7 +42,7 @@ module Aws::IAM
42
42
  # The policy document.
43
43
  # @return [String]
44
44
  def policy_document
45
- data.policy_document
45
+ data[:policy_document]
46
46
  end
47
47
 
48
48
  # @!endgroup
@@ -83,6 +83,101 @@ module Aws::IAM
83
83
  !!@data
84
84
  end
85
85
 
86
+ # @deprecated Use [Aws::IAM::Client] #wait_until instead
87
+ #
88
+ # Waiter polls an API operation until a resource enters a desired
89
+ # state.
90
+ #
91
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
92
+ #
93
+ # ## Basic Usage
94
+ #
95
+ # Waiter will polls until it is successful, it fails by
96
+ # entering a terminal state, or until a maximum number of attempts
97
+ # are made.
98
+ #
99
+ # # polls in a loop until condition is true
100
+ # resource.wait_until(options) {|resource| condition}
101
+ #
102
+ # ## Example
103
+ #
104
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
105
+ #
106
+ # ## Configuration
107
+ #
108
+ # You can configure the maximum number of polling attempts, and the
109
+ # delay (in seconds) between each polling attempt. The waiting condition is set
110
+ # by passing a block to {#wait_until}:
111
+ #
112
+ # # poll for ~25 seconds
113
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
114
+ #
115
+ # ## Callbacks
116
+ #
117
+ # You can be notified before each polling attempt and before each
118
+ # delay. If you throw `:success` or `:failure` from these callbacks,
119
+ # it will terminate the waiter.
120
+ #
121
+ # started_at = Time.now
122
+ # # poll for 1 hour, instead of a number of attempts
123
+ # proc = Proc.new do |attempts, response|
124
+ # throw :failure if Time.now - started_at > 3600
125
+ # end
126
+ #
127
+ # # disable max attempts
128
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
129
+ #
130
+ # ## Handling Errors
131
+ #
132
+ # When a waiter is successful, it returns the Resource. When a waiter
133
+ # fails, it raises an error.
134
+ #
135
+ # begin
136
+ # resource.wait_until(...)
137
+ # rescue Aws::Waiters::Errors::WaiterFailed
138
+ # # resource did not enter the desired state in time
139
+ # end
140
+ #
141
+ #
142
+ # @yield param [Resource] resource to be used in the waiting condition
143
+ #
144
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
145
+ # because the waiter has entered a state that it will not transition
146
+ # out of, preventing success.
147
+ #
148
+ # yet successful.
149
+ #
150
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
151
+ # while polling for a resource that is not expected.
152
+ #
153
+ # @raise [NotImplementedError] Raised when the resource does not
154
+ #
155
+ # @option options [Integer] :max_attempts (10) Maximum number of
156
+ # attempts
157
+ # @option options [Integer] :delay (10) Delay between each
158
+ # attempt in seconds
159
+ # @option options [Proc] :before_attempt (nil) Callback
160
+ # invoked before each attempt
161
+ # @option options [Proc] :before_wait (nil) Callback
162
+ # invoked before each wait
163
+ # @return [Resource] if the waiter was successful
164
+ def wait_until(options = {}, &block)
165
+ self_copy = self.dup
166
+ attempts = 0
167
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
168
+ options[:delay] ||= 10
169
+ options[:poller] = Proc.new do
170
+ attempts += 1
171
+ if block.call(self_copy)
172
+ [:success, self_copy]
173
+ else
174
+ self_copy.reload unless attempts == options[:max_attempts]
175
+ :retry
176
+ end
177
+ end
178
+ Aws::Waiters::Waiter.new(options).wait({})
179
+ end
180
+
86
181
  # @!group Actions
87
182
 
88
183
  # @example Request syntax with placeholder values