aws-sdk-iam 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-iam.rb +1 -1
- data/lib/aws-sdk-iam/access_key.rb +150 -152
- data/lib/aws-sdk-iam/access_key_pair.rb +160 -162
- data/lib/aws-sdk-iam/account_password_policy.rb +208 -207
- data/lib/aws-sdk-iam/account_summary.rb +55 -57
- data/lib/aws-sdk-iam/assume_role_policy.rb +101 -101
- data/lib/aws-sdk-iam/client.rb +7849 -6742
- data/lib/aws-sdk-iam/client_api.rb +2896 -2784
- data/lib/aws-sdk-iam/current_user.rb +231 -230
- data/lib/aws-sdk-iam/errors.rb +4 -13
- data/lib/aws-sdk-iam/group.rb +422 -418
- data/lib/aws-sdk-iam/group_policy.rb +153 -153
- data/lib/aws-sdk-iam/instance_profile.rb +223 -223
- data/lib/aws-sdk-iam/login_profile.rb +171 -172
- data/lib/aws-sdk-iam/mfa_device.rb +163 -165
- data/lib/aws-sdk-iam/policy.rb +508 -502
- data/lib/aws-sdk-iam/policy_version.rb +149 -151
- data/lib/aws-sdk-iam/resource.rb +986 -969
- data/lib/aws-sdk-iam/role.rb +262 -264
- data/lib/aws-sdk-iam/role_policy.rb +153 -153
- data/lib/aws-sdk-iam/saml_provider.rb +120 -122
- data/lib/aws-sdk-iam/server_certificate.rb +144 -145
- data/lib/aws-sdk-iam/signing_certificate.rb +155 -157
- data/lib/aws-sdk-iam/types.rb +8333 -7476
- data/lib/aws-sdk-iam/user.rb +677 -672
- data/lib/aws-sdk-iam/user_policy.rb +153 -153
- data/lib/aws-sdk-iam/virtual_mfa_device.rb +117 -119
- data/lib/aws-sdk-iam/waiters.rb +76 -77
- metadata +2 -2
@@ -1,269 +1,270 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class CurrentUser
|
8
|
+
module Aws::IAM
|
9
|
+
class CurrentUser
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
# @overload def initialize(options = {})
|
14
|
+
# @option options [Client] :client
|
15
|
+
def initialize(*args)
|
16
|
+
options = Hash === args.last ? args.pop.dup : {}
|
17
|
+
@data = options.delete(:data)
|
18
|
+
@client = options.delete(:client) || Client.new(options)
|
19
|
+
end
|
21
20
|
|
22
|
-
|
21
|
+
# @!group Read-Only Attributes
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
# The path to the user. For more information about paths, see [IAM
|
24
|
+
# Identifiers][1] in the *Using IAM* guide.
|
25
|
+
#
|
26
|
+
#
|
27
|
+
#
|
28
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
29
|
+
# @return [String]
|
30
|
+
def path
|
31
|
+
data.path
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The friendly name identifying the user.
|
35
|
+
# @return [String]
|
36
|
+
def user_name
|
37
|
+
data.user_name
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
# The stable and unique string identifying the user. For more
|
41
|
+
# information about IDs, see [IAM Identifiers][1] in the *Using IAM*
|
42
|
+
# guide.
|
43
|
+
#
|
44
|
+
#
|
45
|
+
#
|
46
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
47
|
+
# @return [String]
|
48
|
+
def user_id
|
49
|
+
data.user_id
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
52
|
+
# The Amazon Resource Name (ARN) that identifies the user. For more
|
53
|
+
# information about ARNs and how to use ARNs in policies, see [IAM
|
54
|
+
# Identifiers][1] in the *Using IAM* guide.
|
55
|
+
#
|
56
|
+
#
|
57
|
+
#
|
58
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
59
|
+
# @return [String]
|
60
|
+
def arn
|
61
|
+
data.arn
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
64
|
+
# The date and time, in [ISO 8601 date-time format][1], when the user
|
65
|
+
# was created.
|
66
|
+
#
|
67
|
+
#
|
68
|
+
#
|
69
|
+
# [1]: http://www.iso.org/iso/iso8601
|
70
|
+
# @return [Time]
|
71
|
+
def create_date
|
72
|
+
data.create_date
|
73
|
+
end
|
75
74
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
75
|
+
# The date and time, in [ISO 8601 date-time format][1], when the user's
|
76
|
+
# password was last used to sign in to an AWS website. For a list of AWS
|
77
|
+
# websites that capture a user's last sign-in time, see the [Credential
|
78
|
+
# Reports][2] topic in the *Using IAM* guide. If a password is used more
|
79
|
+
# than once in a five-minute span, only the first use is returned in
|
80
|
+
# this field. This field is null (not present) when:
|
81
|
+
#
|
82
|
+
# * The user does not have a password
|
83
|
+
#
|
84
|
+
# * The password exists but has never been used (at least not since IAM
|
85
|
+
# started tracking this information on October 20th, 2014
|
86
|
+
#
|
87
|
+
# * there is no sign-in data associated with the user
|
88
|
+
#
|
89
|
+
# This value is returned only in the GetUser and ListUsers actions.
|
90
|
+
#
|
91
|
+
#
|
92
|
+
#
|
93
|
+
# [1]: http://www.iso.org/iso/iso8601
|
94
|
+
# [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html
|
95
|
+
# @return [Time]
|
96
|
+
def password_last_used
|
97
|
+
data.password_last_used
|
98
|
+
end
|
100
99
|
|
101
|
-
|
100
|
+
# @!endgroup
|
102
101
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
# @return [Client]
|
103
|
+
def client
|
104
|
+
@client
|
105
|
+
end
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
107
|
+
# Loads, or reloads {#data} for the current {CurrentUser}.
|
108
|
+
# Returns `self` making it possible to chain methods.
|
109
|
+
#
|
110
|
+
# current_user.reload.data
|
111
|
+
#
|
112
|
+
# @return [self]
|
113
|
+
def load
|
114
|
+
resp = @client.get_user
|
115
|
+
@data = resp.user
|
116
|
+
self
|
117
|
+
end
|
118
|
+
alias :reload :load
|
120
119
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
120
|
+
# @return [Types::User]
|
121
|
+
# Returns the data for this {CurrentUser}. Calls
|
122
|
+
# {Client#get_user} if {#data_loaded?} is `false`.
|
123
|
+
def data
|
124
|
+
load unless @data
|
125
|
+
@data
|
126
|
+
end
|
128
127
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
128
|
+
# @return [Boolean]
|
129
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
130
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
131
|
+
def data_loaded?
|
132
|
+
!!@data
|
133
|
+
end
|
135
134
|
|
136
|
-
|
135
|
+
# @!group Associations
|
137
136
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
y.yield(batch)
|
137
|
+
# @example Request syntax with placeholder values
|
138
|
+
#
|
139
|
+
# access_keys = current_user.access_keys({
|
140
|
+
# user_name: "existingUserNameType",
|
141
|
+
# })
|
142
|
+
# @param [Hash] options ({})
|
143
|
+
# @option options [String] :user_name
|
144
|
+
# The name of the user.
|
145
|
+
#
|
146
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
147
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
148
|
+
# with no spaces. You can also include any of the following characters:
|
149
|
+
# =,.@-
|
150
|
+
#
|
151
|
+
#
|
152
|
+
#
|
153
|
+
# [1]: http://wikipedia.org/wiki/regex
|
154
|
+
# @return [AccessKey::Collection]
|
155
|
+
def access_keys(options = {})
|
156
|
+
batches = Enumerator.new do |y|
|
157
|
+
resp = @client.list_access_keys(options)
|
158
|
+
resp.each_page do |page|
|
159
|
+
batch = []
|
160
|
+
page.data.access_key_metadata.each do |a|
|
161
|
+
batch << AccessKey.new(
|
162
|
+
user_name: a.user_name,
|
163
|
+
id: a.access_key_id,
|
164
|
+
data: a,
|
165
|
+
client: @client
|
166
|
+
)
|
169
167
|
end
|
168
|
+
y.yield(batch)
|
170
169
|
end
|
171
|
-
AccessKey::Collection.new(batches)
|
172
170
|
end
|
171
|
+
AccessKey::Collection.new(batches)
|
172
|
+
end
|
173
173
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
y.yield(batch)
|
174
|
+
# @example Request syntax with placeholder values
|
175
|
+
#
|
176
|
+
# mfa_devices = current_user.mfa_devices({
|
177
|
+
# user_name: "existingUserNameType",
|
178
|
+
# })
|
179
|
+
# @param [Hash] options ({})
|
180
|
+
# @option options [String] :user_name
|
181
|
+
# The name of the user whose MFA devices you want to list.
|
182
|
+
#
|
183
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
184
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
185
|
+
# with no spaces. You can also include any of the following characters:
|
186
|
+
# =,.@-
|
187
|
+
#
|
188
|
+
#
|
189
|
+
#
|
190
|
+
# [1]: http://wikipedia.org/wiki/regex
|
191
|
+
# @return [MfaDevice::Collection]
|
192
|
+
def mfa_devices(options = {})
|
193
|
+
batches = Enumerator.new do |y|
|
194
|
+
resp = @client.list_mfa_devices(options)
|
195
|
+
resp.each_page do |page|
|
196
|
+
batch = []
|
197
|
+
page.data.mfa_devices.each do |m|
|
198
|
+
batch << MfaDevice.new(
|
199
|
+
user_name: m.user_name,
|
200
|
+
serial_number: m.serial_number,
|
201
|
+
data: m,
|
202
|
+
client: @client
|
203
|
+
)
|
205
204
|
end
|
205
|
+
y.yield(batch)
|
206
206
|
end
|
207
|
-
MfaDevice::Collection.new(batches)
|
208
207
|
end
|
208
|
+
MfaDevice::Collection.new(batches)
|
209
|
+
end
|
209
210
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
y.yield(batch)
|
211
|
+
# @example Request syntax with placeholder values
|
212
|
+
#
|
213
|
+
# signing_certificates = current_user.signing_certificates({
|
214
|
+
# user_name: "existingUserNameType",
|
215
|
+
# })
|
216
|
+
# @param [Hash] options ({})
|
217
|
+
# @option options [String] :user_name
|
218
|
+
# The name of the IAM user whose signing certificates you want to
|
219
|
+
# examine.
|
220
|
+
#
|
221
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
222
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
223
|
+
# with no spaces. You can also include any of the following characters:
|
224
|
+
# =,.@-
|
225
|
+
#
|
226
|
+
#
|
227
|
+
#
|
228
|
+
# [1]: http://wikipedia.org/wiki/regex
|
229
|
+
# @return [SigningCertificate::Collection]
|
230
|
+
def signing_certificates(options = {})
|
231
|
+
batches = Enumerator.new do |y|
|
232
|
+
resp = @client.list_signing_certificates(options)
|
233
|
+
resp.each_page do |page|
|
234
|
+
batch = []
|
235
|
+
page.data.certificates.each do |c|
|
236
|
+
batch << SigningCertificate.new(
|
237
|
+
user_name: c.user_name,
|
238
|
+
id: c.certificate_id,
|
239
|
+
data: c,
|
240
|
+
client: @client
|
241
|
+
)
|
242
242
|
end
|
243
|
-
|
244
|
-
SigningCertificate::Collection.new(batches)
|
245
|
-
end
|
246
|
-
|
247
|
-
# @return [User, nil]
|
248
|
-
def user
|
249
|
-
if data.user_name
|
250
|
-
User.new(
|
251
|
-
name: data.user_name,
|
252
|
-
client: @client
|
253
|
-
)
|
254
|
-
else
|
255
|
-
nil
|
243
|
+
y.yield(batch)
|
256
244
|
end
|
257
245
|
end
|
246
|
+
SigningCertificate::Collection.new(batches)
|
247
|
+
end
|
258
248
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
249
|
+
# @return [User, nil]
|
250
|
+
def user
|
251
|
+
if data.user_name
|
252
|
+
User.new(
|
253
|
+
name: data.user_name,
|
254
|
+
client: @client
|
255
|
+
)
|
256
|
+
else
|
257
|
+
nil
|
263
258
|
end
|
264
|
-
|
259
|
+
end
|
265
260
|
|
266
|
-
|
261
|
+
# @deprecated
|
262
|
+
# @api private
|
263
|
+
def identifiers
|
264
|
+
{}
|
267
265
|
end
|
266
|
+
deprecated(:identifiers)
|
267
|
+
|
268
|
+
class Collection < Aws::Resources::Collection; end
|
268
269
|
end
|
269
270
|
end
|