aws-sdk-iam 1.0.0.rc1 → 1.0.0.rc2

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.
@@ -1,269 +1,270 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
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
- module IAM
10
- class CurrentUser
8
+ module Aws::IAM
9
+ class CurrentUser
11
10
 
12
- extend Aws::Deprecations
11
+ extend Aws::Deprecations
13
12
 
14
- # @overload def initialize(options = {})
15
- # @option options [Client] :client
16
- def initialize(*args)
17
- options = Hash === args.last ? args.pop.dup : {}
18
- @data = options.delete(:data)
19
- @client = options.delete(:client) || Client.new(options)
20
- end
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
- # @!group Read-Only Attributes
21
+ # @!group Read-Only Attributes
23
22
 
24
- # The path to the user. For more information about paths, see [IAM
25
- # Identifiers][1] in the *Using IAM* guide.
26
- #
27
- #
28
- #
29
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
30
- # @return [String]
31
- def path
32
- data.path
33
- end
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
- # The friendly name identifying the user.
36
- # @return [String]
37
- def user_name
38
- data.user_name
39
- end
34
+ # The friendly name identifying the user.
35
+ # @return [String]
36
+ def user_name
37
+ data.user_name
38
+ end
40
39
 
41
- # The stable and unique string identifying the user. For more
42
- # information about IDs, see [IAM Identifiers][1] in the *Using IAM*
43
- # guide.
44
- #
45
- #
46
- #
47
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
48
- # @return [String]
49
- def user_id
50
- data.user_id
51
- end
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
- # The Amazon Resource Name (ARN) that identifies the user. For more
54
- # information about ARNs and how to use ARNs in policies, see [IAM
55
- # Identifiers][1] in the *Using IAM* guide.
56
- #
57
- #
58
- #
59
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
60
- # @return [String]
61
- def arn
62
- data.arn
63
- end
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
- # The date and time, in [ISO 8601 date-time format][1], when the user
66
- # was created.
67
- #
68
- #
69
- #
70
- # [1]: http://www.iso.org/iso/iso8601
71
- # @return [Time]
72
- def create_date
73
- data.create_date
74
- end
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
- # The date and time, in [ISO 8601 date-time format][1], when the user's
77
- # password was last used to sign in to an AWS website. For a list of AWS
78
- # websites that capture a user's last sign-in time, see the [Credential
79
- # Reports][2] topic in the *Using IAM* guide. If a password is used more
80
- # than once in a five-minute span, only the first use is returned in
81
- # this field. This field is null (not present) when:
82
- #
83
- # * The user does not have a password
84
- #
85
- # * The password exists but has never been used (at least not since IAM
86
- # started tracking this information on October 20th, 2014
87
- #
88
- # * there is no sign-in data associated with the user
89
- #
90
- # This value is returned only in the GetUser and ListUsers actions.
91
- #
92
- #
93
- #
94
- # [1]: http://www.iso.org/iso/iso8601
95
- # [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html
96
- # @return [Time]
97
- def password_last_used
98
- data.password_last_used
99
- end
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
- # @!endgroup
100
+ # @!endgroup
102
101
 
103
- # @return [Client]
104
- def client
105
- @client
106
- end
102
+ # @return [Client]
103
+ def client
104
+ @client
105
+ end
107
106
 
108
- # Loads, or reloads {#data} for the current {CurrentUser}.
109
- # Returns `self` making it possible to chain methods.
110
- #
111
- # current_user.reload.data
112
- #
113
- # @return [self]
114
- def load
115
- resp = @client.get_user
116
- @data = resp.user
117
- self
118
- end
119
- alias :reload :load
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
- # @return [Types::User]
122
- # Returns the data for this {CurrentUser}. Calls
123
- # {Client#get_user} if {#data_loaded?} is `false`.
124
- def data
125
- load unless @data
126
- @data
127
- end
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
- # @return [Boolean]
130
- # Returns `true` if this resource is loaded. Accessing attributes or
131
- # {#data} on an unloaded resource will trigger a call to {#load}.
132
- def data_loaded?
133
- !!@data
134
- end
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
- # @!group Associations
135
+ # @!group Associations
137
136
 
138
- # @example Request syntax with placeholder values
139
- #
140
- # accesskeys = current_user.access_keys({
141
- # user_name: "existingUserNameType",
142
- # })
143
- # @param [Hash] options ({})
144
- # @option options [String] :user_name
145
- # The name of the user.
146
- #
147
- # The [regex pattern][1] for this parameter is a string of characters
148
- # consisting of upper and lowercase alphanumeric characters with no
149
- # spaces. You can also include any of the following characters: =,.@-
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
- )
167
- end
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
- # @example Request syntax with placeholder values
175
- #
176
- # mfadevices = 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
- # The [regex pattern][1] for this parameter is a string of characters
184
- # consisting of upper and lowercase alphanumeric characters with no
185
- # spaces. You can also include any of the following characters: =,.@-
186
- #
187
- #
188
- #
189
- # [1]: http://wikipedia.org/wiki/regex
190
- # @return [MfaDevice::Collection]
191
- def mfa_devices(options = {})
192
- batches = Enumerator.new do |y|
193
- resp = @client.list_mfa_devices(options)
194
- resp.each_page do |page|
195
- batch = []
196
- page.data.mfa_devices.each do |m|
197
- batch << MfaDevice.new(
198
- user_name: m.user_name,
199
- serial_number: m.serial_number,
200
- data: m,
201
- client: @client
202
- )
203
- end
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
- # @example Request syntax with placeholder values
211
- #
212
- # signingcertificates = current_user.signing_certificates({
213
- # user_name: "existingUserNameType",
214
- # })
215
- # @param [Hash] options ({})
216
- # @option options [String] :user_name
217
- # The name of the IAM user whose signing certificates you want to
218
- # examine.
219
- #
220
- # The [regex pattern][1] for this parameter is a string of characters
221
- # consisting of upper and lowercase alphanumeric characters with no
222
- # spaces. You can also include any of the following characters: =,.@-
223
- #
224
- #
225
- #
226
- # [1]: http://wikipedia.org/wiki/regex
227
- # @return [SigningCertificate::Collection]
228
- def signing_certificates(options = {})
229
- batches = Enumerator.new do |y|
230
- resp = @client.list_signing_certificates(options)
231
- resp.each_page do |page|
232
- batch = []
233
- page.data.certificates.each do |c|
234
- batch << SigningCertificate.new(
235
- user_name: c.user_name,
236
- id: c.certificate_id,
237
- data: c,
238
- client: @client
239
- )
240
- end
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
- end
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
- # @deprecated
260
- # @api private
261
- def identifiers
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
- deprecated(:identifiers)
259
+ end
265
260
 
266
- class Collection < Aws::Resources::Collection; end
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