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.
@@ -1,196 +1,195 @@
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 LoginProfile
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(user_name, options = {})
15
- # @param [String] user_name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :user_name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @user_name = extract_user_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::IAM
9
+ class LoginProfile
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(user_name, options = {})
14
+ # @param [String] user_name
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :user_name
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @user_name = extract_user_name(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def user_name
31
- @user_name
32
- end
28
+ # @return [String]
29
+ def user_name
30
+ @user_name
31
+ end
33
32
 
34
- # The date when the password for the user was created.
35
- # @return [Time]
36
- def create_date
37
- data.create_date
38
- end
33
+ # The date when the password for the user was created.
34
+ # @return [Time]
35
+ def create_date
36
+ data.create_date
37
+ end
39
38
 
40
- # Specifies whether the user is required to set a new password on next
41
- # sign-in.
42
- # @return [Boolean]
43
- def password_reset_required
44
- data.password_reset_required
45
- end
39
+ # Specifies whether the user is required to set a new password on next
40
+ # sign-in.
41
+ # @return [Boolean]
42
+ def password_reset_required
43
+ data.password_reset_required
44
+ end
46
45
 
47
- # @!endgroup
46
+ # @!endgroup
48
47
 
49
- # @return [Client]
50
- def client
51
- @client
52
- end
48
+ # @return [Client]
49
+ def client
50
+ @client
51
+ end
53
52
 
54
- # Loads, or reloads {#data} for the current {LoginProfile}.
55
- # Returns `self` making it possible to chain methods.
56
- #
57
- # login_profile.reload.data
58
- #
59
- # @return [self]
60
- def load
61
- resp = @client.get_login_profile(user_name: @user_name)
62
- @data = resp.loginprofile
63
- self
64
- end
65
- alias :reload :load
66
-
67
- # @return [Types::LoginProfile]
68
- # Returns the data for this {LoginProfile}. Calls
69
- # {Client#get_login_profile} if {#data_loaded?} is `false`.
70
- def data
71
- load unless @data
72
- @data
73
- end
53
+ # Loads, or reloads {#data} for the current {LoginProfile}.
54
+ # Returns `self` making it possible to chain methods.
55
+ #
56
+ # login_profile.reload.data
57
+ #
58
+ # @return [self]
59
+ def load
60
+ resp = @client.get_login_profile(user_name: @user_name)
61
+ @data = resp.loginprofile
62
+ self
63
+ end
64
+ alias :reload :load
65
+
66
+ # @return [Types::LoginProfile]
67
+ # Returns the data for this {LoginProfile}. Calls
68
+ # {Client#get_login_profile} if {#data_loaded?} is `false`.
69
+ def data
70
+ load unless @data
71
+ @data
72
+ end
74
73
 
75
- # @return [Boolean]
76
- # Returns `true` if this resource is loaded. Accessing attributes or
77
- # {#data} on an unloaded resource will trigger a call to {#load}.
78
- def data_loaded?
79
- !!@data
80
- end
74
+ # @return [Boolean]
75
+ # Returns `true` if this resource is loaded. Accessing attributes or
76
+ # {#data} on an unloaded resource will trigger a call to {#load}.
77
+ def data_loaded?
78
+ !!@data
79
+ end
81
80
 
82
- # @!group Actions
83
-
84
- # @example Request syntax with placeholder values
85
- #
86
- # loginprofile = login_profile.create({
87
- # password: "passwordType", # required
88
- # password_reset_required: false,
89
- # })
90
- # @param [Hash] options ({})
91
- # @option options [required, String] :password
92
- # The new password for the user.
93
- #
94
- # The [regex pattern][1] for this parameter is a string of characters
95
- # consisting of almost any printable ASCII character from the space
96
- # (\\u0020) through the end of the ASCII character range (\\u00FF). You
97
- # can also include the tab (\\u0009), line feed (\\u000A), and carriage
98
- # return (\\u000D) characters. Although any of these characters are
99
- # valid in a password, note that many tools, such as the AWS Management
100
- # Console, might restrict the ability to enter certain characters
101
- # because they have special meaning within that tool.
102
- #
103
- #
104
- #
105
- # [1]: http://wikipedia.org/wiki/regex
106
- # @option options [Boolean] :password_reset_required
107
- # Specifies whether the user is required to set a new password on next
108
- # sign-in.
109
- # @return [LoginProfile]
110
- def create(options = {})
111
- options = options.merge(user_name: @user_name)
112
- resp = @client.create_login_profile(options)
113
- LoginProfile.new(
114
- user_name: resp.data.login_profile.user_name,
115
- data: resp.data.login_profile,
116
- client: @client
117
- )
118
- end
81
+ # @!group Actions
82
+
83
+ # @example Request syntax with placeholder values
84
+ #
85
+ # loginprofile = login_profile.create({
86
+ # password: "passwordType", # required
87
+ # password_reset_required: false,
88
+ # })
89
+ # @param [Hash] options ({})
90
+ # @option options [required, String] :password
91
+ # The new password for the user.
92
+ #
93
+ # The [regex pattern][1] used to validate this parameter is a string of
94
+ # characters consisting of almost any printable ASCII character from the
95
+ # space (\\u0020) through the end of the ASCII character range
96
+ # (\\u00FF). You can also include the tab (\\u0009), line feed
97
+ # (\\u000A), and carriage return (\\u000D) characters. Although any of
98
+ # these characters are valid in a password, note that many tools, such
99
+ # as the AWS Management Console, might restrict the ability to enter
100
+ # certain characters because they have special meaning within that tool.
101
+ #
102
+ #
103
+ #
104
+ # [1]: http://wikipedia.org/wiki/regex
105
+ # @option options [Boolean] :password_reset_required
106
+ # Specifies whether the user is required to set a new password on next
107
+ # sign-in.
108
+ # @return [LoginProfile]
109
+ def create(options = {})
110
+ options = options.merge(user_name: @user_name)
111
+ resp = @client.create_login_profile(options)
112
+ LoginProfile.new(
113
+ user_name: resp.data.login_profile.user_name,
114
+ data: resp.data.login_profile,
115
+ client: @client
116
+ )
117
+ end
119
118
 
120
- # @example Request syntax with placeholder values
121
- #
122
- # login_profile.delete()
123
- # @param [Hash] options ({})
124
- # @return [EmptyStructure]
125
- def delete(options = {})
126
- options = options.merge(user_name: @user_name)
127
- resp = @client.delete_login_profile(options)
128
- resp.data
129
- end
119
+ # @example Request syntax with placeholder values
120
+ #
121
+ # login_profile.delete()
122
+ # @param [Hash] options ({})
123
+ # @return [EmptyStructure]
124
+ def delete(options = {})
125
+ options = options.merge(user_name: @user_name)
126
+ resp = @client.delete_login_profile(options)
127
+ resp.data
128
+ end
130
129
 
131
- # @example Request syntax with placeholder values
132
- #
133
- # login_profile.update({
134
- # password: "passwordType",
135
- # password_reset_required: false,
136
- # })
137
- # @param [Hash] options ({})
138
- # @option options [String] :password
139
- # The new password for the specified IAM user.
140
- #
141
- # The [regex pattern][1] for this parameter is a string of characters
142
- # consisting of any printable ASCII character ranging from the space
143
- # character (\\u0020) through end of the ASCII character range
144
- # (\\u00FF). It also includes the special characters tab (\\u0009), line
145
- # feed (\\u000A), and carriage return (\\u000D). However, the format can
146
- # be further restricted by the account administrator by setting a
147
- # password policy on the AWS account. For more information, see
148
- # UpdateAccountPasswordPolicy.
149
- #
150
- #
151
- #
152
- # [1]: http://wikipedia.org/wiki/regex
153
- # @option options [Boolean] :password_reset_required
154
- # Allows this new password to be used only once by requiring the
155
- # specified IAM user to set a new password on next sign-in.
156
- # @return [EmptyStructure]
157
- def update(options = {})
158
- options = options.merge(user_name: @user_name)
159
- resp = @client.update_login_profile(options)
160
- resp.data
161
- end
130
+ # @example Request syntax with placeholder values
131
+ #
132
+ # login_profile.update({
133
+ # password: "passwordType",
134
+ # password_reset_required: false,
135
+ # })
136
+ # @param [Hash] options ({})
137
+ # @option options [String] :password
138
+ # The new password for the specified IAM user.
139
+ #
140
+ # The [regex pattern][1] used to validate this parameter is a string of
141
+ # characters consisting of any printable ASCII character ranging from
142
+ # the space character (\\u0020) through end of the ASCII character range
143
+ # as well as the printable characters in the Basic Latin and Latin-1
144
+ # Supplement character set (through \\u00FF). It also includes the
145
+ # special characters tab (\\u0009), line feed (\\u000A), and carriage
146
+ # return (\\u000D). However, the format can be further restricted by the
147
+ # account administrator by setting a password policy on the AWS account.
148
+ # For more information, see UpdateAccountPasswordPolicy.
149
+ #
150
+ #
151
+ #
152
+ # [1]: http://wikipedia.org/wiki/regex
153
+ # @option options [Boolean] :password_reset_required
154
+ # Allows this new password to be used only once by requiring the
155
+ # specified IAM user to set a new password on next sign-in.
156
+ # @return [EmptyStructure]
157
+ def update(options = {})
158
+ options = options.merge(user_name: @user_name)
159
+ resp = @client.update_login_profile(options)
160
+ resp.data
161
+ end
162
162
 
163
- # @!group Associations
163
+ # @!group Associations
164
164
 
165
- # @return [User]
166
- def user
167
- User.new(
168
- name: @user_name,
169
- client: @client
170
- )
171
- end
165
+ # @return [User]
166
+ def user
167
+ User.new(
168
+ name: @user_name,
169
+ client: @client
170
+ )
171
+ end
172
172
 
173
- # @deprecated
174
- # @api private
175
- def identifiers
176
- { user_name: @user_name }
177
- end
178
- deprecated(:identifiers)
179
-
180
- private
181
-
182
- def extract_user_name(args, options)
183
- value = args[0] || options.delete(:user_name)
184
- case value
185
- when String then value
186
- when nil then raise ArgumentError, "missing required option :user_name"
187
- else
188
- msg = "expected :user_name to be a String, got #{value.class}"
189
- raise ArgumentError, msg
190
- end
173
+ # @deprecated
174
+ # @api private
175
+ def identifiers
176
+ { user_name: @user_name }
177
+ end
178
+ deprecated(:identifiers)
179
+
180
+ private
181
+
182
+ def extract_user_name(args, options)
183
+ value = args[0] || options.delete(:user_name)
184
+ case value
185
+ when String then value
186
+ when nil then raise ArgumentError, "missing required option :user_name"
187
+ else
188
+ msg = "expected :user_name to be a String, got #{value.class}"
189
+ raise ArgumentError, msg
191
190
  end
192
-
193
- class Collection < Aws::Resources::Collection; end
194
191
  end
192
+
193
+ class Collection < Aws::Resources::Collection; end
195
194
  end
196
195
  end
@@ -1,191 +1,189 @@
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 MfaDevice
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(user_name, serial_number, options = {})
15
- # @param [String] user_name
16
- # @param [String] serial_number
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :user_name
20
- # @option options [required, String] :serial_number
21
- # @option options [Client] :client
22
- def initialize(*args)
23
- options = Hash === args.last ? args.pop.dup : {}
24
- @user_name = extract_user_name(args, options)
25
- @serial_number = extract_serial_number(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
28
- end
8
+ module Aws::IAM
9
+ class MfaDevice
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(user_name, serial_number, options = {})
14
+ # @param [String] user_name
15
+ # @param [String] serial_number
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :user_name
19
+ # @option options [required, String] :serial_number
20
+ # @option options [Client] :client
21
+ def initialize(*args)
22
+ options = Hash === args.last ? args.pop.dup : {}
23
+ @user_name = extract_user_name(args, options)
24
+ @serial_number = extract_serial_number(args, options)
25
+ @data = options.delete(:data)
26
+ @client = options.delete(:client) || Client.new(options)
27
+ end
29
28
 
30
- # @!group Read-Only Attributes
29
+ # @!group Read-Only Attributes
31
30
 
32
- # @return [String]
33
- def user_name
34
- @user_name
35
- end
31
+ # @return [String]
32
+ def user_name
33
+ @user_name
34
+ end
36
35
 
37
- # @return [String]
38
- def serial_number
39
- @serial_number
40
- end
36
+ # @return [String]
37
+ def serial_number
38
+ @serial_number
39
+ end
41
40
 
42
- # The date when the MFA device was enabled for the user.
43
- # @return [Time]
44
- def enable_date
45
- data.enable_date
46
- end
41
+ # The date when the MFA device was enabled for the user.
42
+ # @return [Time]
43
+ def enable_date
44
+ data.enable_date
45
+ end
47
46
 
48
- # @!endgroup
47
+ # @!endgroup
49
48
 
50
- # @return [Client]
51
- def client
52
- @client
53
- end
49
+ # @return [Client]
50
+ def client
51
+ @client
52
+ end
54
53
 
55
- # @raise [Errors::ResourceNotLoadable]
56
- # @api private
57
- def load
58
- msg = "#load is not implemented, data only available via enumeration"
59
- raise Errors::ResourceNotLoadable, msg
60
- end
61
- alias :reload :load
62
-
63
- # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
64
- # @return [Types::MFADevice]
65
- # Returns the data for this {MfaDevice}.
66
- def data
67
- load unless @data
68
- @data
69
- end
54
+ # @raise [NotImplementedError]
55
+ # @api private
56
+ def load
57
+ msg = "#load is not implemented, data only available via enumeration"
58
+ raise NotImplementedError, msg
59
+ end
60
+ alias :reload :load
61
+
62
+ # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
63
+ # @return [Types::MFADevice]
64
+ # Returns the data for this {MfaDevice}.
65
+ def data
66
+ load unless @data
67
+ @data
68
+ end
70
69
 
71
- # @return [Boolean]
72
- # Returns `true` if this resource is loaded. Accessing attributes or
73
- # {#data} on an unloaded resource will trigger a call to {#load}.
74
- def data_loaded?
75
- !!@data
76
- end
70
+ # @return [Boolean]
71
+ # Returns `true` if this resource is loaded. Accessing attributes or
72
+ # {#data} on an unloaded resource will trigger a call to {#load}.
73
+ def data_loaded?
74
+ !!@data
75
+ end
77
76
 
78
- # @!group Actions
79
-
80
- # @example Request syntax with placeholder values
81
- #
82
- # mfa_device.associate({
83
- # authentication_code_1: "authenticationCodeType", # required
84
- # authentication_code_2: "authenticationCodeType", # required
85
- # })
86
- # @param [Hash] options ({})
87
- # @option options [required, String] :authentication_code_1
88
- # An authentication code emitted by the device.
89
- #
90
- # The format for this parameter is a string of 6 digits.
91
- # @option options [required, String] :authentication_code_2
92
- # A subsequent authentication code emitted by the device.
93
- #
94
- # The format for this parameter is a string of 6 digits.
95
- # @return [EmptyStructure]
96
- def associate(options = {})
97
- options = options.merge(
98
- user_name: @user_name,
99
- serial_number: @serial_number
100
- )
101
- resp = @client.enable_mfa_device(options)
102
- resp.data
103
- end
77
+ # @!group Actions
78
+
79
+ # @example Request syntax with placeholder values
80
+ #
81
+ # mfa_device.associate({
82
+ # authentication_code_1: "authenticationCodeType", # required
83
+ # authentication_code_2: "authenticationCodeType", # required
84
+ # })
85
+ # @param [Hash] options ({})
86
+ # @option options [required, String] :authentication_code_1
87
+ # An authentication code emitted by the device.
88
+ #
89
+ # The format for this parameter is a string of 6 digits.
90
+ # @option options [required, String] :authentication_code_2
91
+ # A subsequent authentication code emitted by the device.
92
+ #
93
+ # The format for this parameter is a string of 6 digits.
94
+ # @return [EmptyStructure]
95
+ def associate(options = {})
96
+ options = options.merge(
97
+ user_name: @user_name,
98
+ serial_number: @serial_number
99
+ )
100
+ resp = @client.enable_mfa_device(options)
101
+ resp.data
102
+ end
104
103
 
105
- # @example Request syntax with placeholder values
106
- #
107
- # mfa_device.disassociate()
108
- # @param [Hash] options ({})
109
- # @return [EmptyStructure]
110
- def disassociate(options = {})
111
- options = options.merge(
112
- user_name: @user_name,
113
- serial_number: @serial_number
114
- )
115
- resp = @client.deactivate_mfa_device(options)
116
- resp.data
117
- end
104
+ # @example Request syntax with placeholder values
105
+ #
106
+ # mfa_device.disassociate()
107
+ # @param [Hash] options ({})
108
+ # @return [EmptyStructure]
109
+ def disassociate(options = {})
110
+ options = options.merge(
111
+ user_name: @user_name,
112
+ serial_number: @serial_number
113
+ )
114
+ resp = @client.deactivate_mfa_device(options)
115
+ resp.data
116
+ end
118
117
 
119
- # @example Request syntax with placeholder values
120
- #
121
- # mfa_device.resync({
122
- # authentication_code_1: "authenticationCodeType", # required
123
- # authentication_code_2: "authenticationCodeType", # required
124
- # })
125
- # @param [Hash] options ({})
126
- # @option options [required, String] :authentication_code_1
127
- # An authentication code emitted by the device.
128
- #
129
- # The format for this parameter is a sequence of six digits.
130
- # @option options [required, String] :authentication_code_2
131
- # A subsequent authentication code emitted by the device.
132
- #
133
- # The format for this parameter is a sequence of six digits.
134
- # @return [EmptyStructure]
135
- def resync(options = {})
136
- options = options.merge(
137
- user_name: @user_name,
138
- serial_number: @serial_number
139
- )
140
- resp = @client.resync_mfa_device(options)
141
- resp.data
142
- end
118
+ # @example Request syntax with placeholder values
119
+ #
120
+ # mfa_device.resync({
121
+ # authentication_code_1: "authenticationCodeType", # required
122
+ # authentication_code_2: "authenticationCodeType", # required
123
+ # })
124
+ # @param [Hash] options ({})
125
+ # @option options [required, String] :authentication_code_1
126
+ # An authentication code emitted by the device.
127
+ #
128
+ # The format for this parameter is a sequence of six digits.
129
+ # @option options [required, String] :authentication_code_2
130
+ # A subsequent authentication code emitted by the device.
131
+ #
132
+ # The format for this parameter is a sequence of six digits.
133
+ # @return [EmptyStructure]
134
+ def resync(options = {})
135
+ options = options.merge(
136
+ user_name: @user_name,
137
+ serial_number: @serial_number
138
+ )
139
+ resp = @client.resync_mfa_device(options)
140
+ resp.data
141
+ end
143
142
 
144
- # @!group Associations
143
+ # @!group Associations
145
144
 
146
- # @return [User]
147
- def user
148
- User.new(
149
- name: @user_name,
150
- client: @client
151
- )
152
- end
145
+ # @return [User]
146
+ def user
147
+ User.new(
148
+ name: @user_name,
149
+ client: @client
150
+ )
151
+ end
153
152
 
154
- # @deprecated
155
- # @api private
156
- def identifiers
157
- {
158
- user_name: @user_name,
159
- serial_number: @serial_number
160
- }
161
- end
162
- deprecated(:identifiers)
163
-
164
- private
165
-
166
- def extract_user_name(args, options)
167
- value = args[0] || options.delete(:user_name)
168
- case value
169
- when String then value
170
- when nil then raise ArgumentError, "missing required option :user_name"
171
- else
172
- msg = "expected :user_name to be a String, got #{value.class}"
173
- raise ArgumentError, msg
174
- end
153
+ # @deprecated
154
+ # @api private
155
+ def identifiers
156
+ {
157
+ user_name: @user_name,
158
+ serial_number: @serial_number
159
+ }
160
+ end
161
+ deprecated(:identifiers)
162
+
163
+ private
164
+
165
+ def extract_user_name(args, options)
166
+ value = args[0] || options.delete(:user_name)
167
+ case value
168
+ when String then value
169
+ when nil then raise ArgumentError, "missing required option :user_name"
170
+ else
171
+ msg = "expected :user_name to be a String, got #{value.class}"
172
+ raise ArgumentError, msg
175
173
  end
174
+ end
176
175
 
177
- def extract_serial_number(args, options)
178
- value = args[1] || options.delete(:serial_number)
179
- case value
180
- when String then value
181
- when nil then raise ArgumentError, "missing required option :serial_number"
182
- else
183
- msg = "expected :serial_number to be a String, got #{value.class}"
184
- raise ArgumentError, msg
185
- end
176
+ def extract_serial_number(args, options)
177
+ value = args[1] || options.delete(:serial_number)
178
+ case value
179
+ when String then value
180
+ when nil then raise ArgumentError, "missing required option :serial_number"
181
+ else
182
+ msg = "expected :serial_number to be a String, got #{value.class}"
183
+ raise ArgumentError, msg
186
184
  end
187
-
188
- class Collection < Aws::Resources::Collection; end
189
185
  end
186
+
187
+ class Collection < Aws::Resources::Collection; end
190
188
  end
191
189
  end