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,178 +1,178 @@
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 UserPolicy
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(user_name, name, options = {})
15
- # @param [String] user_name
16
- # @param [String] name
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :user_name
20
- # @option options [required, String] :name
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
- @name = extract_name(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
28
- end
8
+ module Aws::IAM
9
+ class UserPolicy
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(user_name, name, options = {})
14
+ # @param [String] user_name
15
+ # @param [String] name
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :user_name
19
+ # @option options [required, String] :name
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
+ @name = extract_name(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 name
39
- @name
40
- end
41
- alias :policy_name :name
36
+ # @return [String]
37
+ def name
38
+ @name
39
+ end
40
+ alias :policy_name :name
42
41
 
43
- # The policy document.
44
- # @return [String]
45
- def policy_document
46
- data.policy_document
47
- end
42
+ # The policy document.
43
+ # @return [String]
44
+ def policy_document
45
+ data.policy_document
46
+ end
48
47
 
49
- # @!endgroup
48
+ # @!endgroup
50
49
 
51
- # @return [Client]
52
- def client
53
- @client
54
- end
50
+ # @return [Client]
51
+ def client
52
+ @client
53
+ end
55
54
 
56
- # Loads, or reloads {#data} for the current {UserPolicy}.
57
- # Returns `self` making it possible to chain methods.
58
- #
59
- # user_policy.reload.data
60
- #
61
- # @return [self]
62
- def load
63
- resp = @client.get_user_policy(
64
- user_name: @user_name,
65
- policy_name: @name
66
- )
67
- @data = resp.data
68
- self
69
- end
70
- alias :reload :load
71
-
72
- # @return [Types::GetUserPolicyResponse]
73
- # Returns the data for this {UserPolicy}. Calls
74
- # {Client#get_user_policy} if {#data_loaded?} is `false`.
75
- def data
76
- load unless @data
77
- @data
78
- end
55
+ # Loads, or reloads {#data} for the current {UserPolicy}.
56
+ # Returns `self` making it possible to chain methods.
57
+ #
58
+ # user_policy.reload.data
59
+ #
60
+ # @return [self]
61
+ def load
62
+ resp = @client.get_user_policy(
63
+ user_name: @user_name,
64
+ policy_name: @name
65
+ )
66
+ @data = resp.data
67
+ self
68
+ end
69
+ alias :reload :load
70
+
71
+ # @return [Types::GetUserPolicyResponse]
72
+ # Returns the data for this {UserPolicy}. Calls
73
+ # {Client#get_user_policy} if {#data_loaded?} is `false`.
74
+ def data
75
+ load unless @data
76
+ @data
77
+ end
79
78
 
80
- # @return [Boolean]
81
- # Returns `true` if this resource is loaded. Accessing attributes or
82
- # {#data} on an unloaded resource will trigger a call to {#load}.
83
- def data_loaded?
84
- !!@data
85
- end
79
+ # @return [Boolean]
80
+ # Returns `true` if this resource is loaded. Accessing attributes or
81
+ # {#data} on an unloaded resource will trigger a call to {#load}.
82
+ def data_loaded?
83
+ !!@data
84
+ end
86
85
 
87
- # @!group Actions
88
-
89
- # @example Request syntax with placeholder values
90
- #
91
- # user_policy.delete()
92
- # @param [Hash] options ({})
93
- # @return [EmptyStructure]
94
- def delete(options = {})
95
- options = options.merge(
96
- user_name: @user_name,
97
- policy_name: @name
98
- )
99
- resp = @client.delete_user_policy(options)
100
- resp.data
101
- end
86
+ # @!group Actions
87
+
88
+ # @example Request syntax with placeholder values
89
+ #
90
+ # user_policy.delete()
91
+ # @param [Hash] options ({})
92
+ # @return [EmptyStructure]
93
+ def delete(options = {})
94
+ options = options.merge(
95
+ user_name: @user_name,
96
+ policy_name: @name
97
+ )
98
+ resp = @client.delete_user_policy(options)
99
+ resp.data
100
+ end
102
101
 
103
- # @example Request syntax with placeholder values
104
- #
105
- # user_policy.put({
106
- # policy_document: "policyDocumentType", # required
107
- # })
108
- # @param [Hash] options ({})
109
- # @option options [required, String] :policy_document
110
- # The policy document.
111
- #
112
- # The [regex pattern][1] for this parameter is a string of characters
113
- # consisting of any printable ASCII character ranging from the space
114
- # character (\\u0020) through end of the ASCII character range
115
- # (\\u00FF). It also includes the special characters tab (\\u0009), line
116
- # feed (\\u000A), and carriage return (\\u000D).
117
- #
118
- #
119
- #
120
- # [1]: http://wikipedia.org/wiki/regex
121
- # @return [EmptyStructure]
122
- def put(options = {})
123
- options = options.merge(
124
- user_name: @user_name,
125
- policy_name: @name
126
- )
127
- resp = @client.put_user_policy(options)
128
- resp.data
129
- end
102
+ # @example Request syntax with placeholder values
103
+ #
104
+ # user_policy.put({
105
+ # policy_document: "policyDocumentType", # required
106
+ # })
107
+ # @param [Hash] options ({})
108
+ # @option options [required, String] :policy_document
109
+ # The policy document.
110
+ #
111
+ # The [regex pattern][1] used to validate this parameter is a string of
112
+ # characters consisting of any printable ASCII character ranging from
113
+ # the space character (\\u0020) through end of the ASCII character range
114
+ # as well as the printable characters in the Basic Latin and Latin-1
115
+ # Supplement character set (through \\u00FF). It also includes the
116
+ # special characters tab (\\u0009), line feed (\\u000A), and carriage
117
+ # return (\\u000D).
118
+ #
119
+ #
120
+ #
121
+ # [1]: http://wikipedia.org/wiki/regex
122
+ # @return [EmptyStructure]
123
+ def put(options = {})
124
+ options = options.merge(
125
+ user_name: @user_name,
126
+ policy_name: @name
127
+ )
128
+ resp = @client.put_user_policy(options)
129
+ resp.data
130
+ end
130
131
 
131
- # @!group Associations
132
+ # @!group Associations
132
133
 
133
- # @return [User]
134
- def user
135
- User.new(
136
- name: @user_name,
137
- client: @client
138
- )
139
- end
134
+ # @return [User]
135
+ def user
136
+ User.new(
137
+ name: @user_name,
138
+ client: @client
139
+ )
140
+ end
140
141
 
141
- # @deprecated
142
- # @api private
143
- def identifiers
144
- {
145
- user_name: @user_name,
146
- name: @name
147
- }
148
- end
149
- deprecated(:identifiers)
150
-
151
- private
152
-
153
- def extract_user_name(args, options)
154
- value = args[0] || options.delete(:user_name)
155
- case value
156
- when String then value
157
- when nil then raise ArgumentError, "missing required option :user_name"
158
- else
159
- msg = "expected :user_name to be a String, got #{value.class}"
160
- raise ArgumentError, msg
161
- end
142
+ # @deprecated
143
+ # @api private
144
+ def identifiers
145
+ {
146
+ user_name: @user_name,
147
+ name: @name
148
+ }
149
+ end
150
+ deprecated(:identifiers)
151
+
152
+ private
153
+
154
+ def extract_user_name(args, options)
155
+ value = args[0] || options.delete(:user_name)
156
+ case value
157
+ when String then value
158
+ when nil then raise ArgumentError, "missing required option :user_name"
159
+ else
160
+ msg = "expected :user_name to be a String, got #{value.class}"
161
+ raise ArgumentError, msg
162
162
  end
163
+ end
163
164
 
164
- def extract_name(args, options)
165
- value = args[1] || options.delete(:name)
166
- case value
167
- when String then value
168
- when nil then raise ArgumentError, "missing required option :name"
169
- else
170
- msg = "expected :name to be a String, got #{value.class}"
171
- raise ArgumentError, msg
172
- end
165
+ def extract_name(args, options)
166
+ value = args[1] || options.delete(:name)
167
+ case value
168
+ when String then value
169
+ when nil then raise ArgumentError, "missing required option :name"
170
+ else
171
+ msg = "expected :name to be a String, got #{value.class}"
172
+ raise ArgumentError, msg
173
173
  end
174
-
175
- class Collection < Aws::Resources::Collection; end
176
174
  end
175
+
176
+ class Collection < Aws::Resources::Collection; end
177
177
  end
178
178
  end
@@ -1,142 +1,140 @@
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 VirtualMfaDevice
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(serial_number, options = {})
15
- # @param [String] serial_number
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :serial_number
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @serial_number = extract_serial_number(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::IAM
9
+ class VirtualMfaDevice
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(serial_number, options = {})
14
+ # @param [String] serial_number
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :serial_number
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @serial_number = extract_serial_number(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 serial_number
31
- @serial_number
32
- end
28
+ # @return [String]
29
+ def serial_number
30
+ @serial_number
31
+ end
33
32
 
34
- # The Base32 seed defined as specified in [RFC3548][1]. The
35
- # `Base32StringSeed` is Base64-encoded.
36
- #
37
- #
38
- #
39
- # [1]: http://www.ietf.org/rfc/rfc3548.txt
40
- # @return [String]
41
- def base_32_string_seed
42
- data.base_32_string_seed
43
- end
33
+ # The Base32 seed defined as specified in [RFC3548][1]. The
34
+ # `Base32StringSeed` is Base64-encoded.
35
+ #
36
+ #
37
+ #
38
+ # [1]: https://tools.ietf.org/html/rfc3548.txt
39
+ # @return [String]
40
+ def base_32_string_seed
41
+ data.base_32_string_seed
42
+ end
44
43
 
45
- # A QR code PNG image that encodes
46
- # `otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String`
47
- # where `$virtualMFADeviceName` is one of the create call arguments,
48
- # `AccountName` is the user name if set (otherwise, the account ID
49
- # otherwise), and `Base32String` is the seed in Base32 format. The
50
- # `Base32String` value is Base64-encoded.
51
- # @return [String]
52
- def qr_code_png
53
- data.qr_code_png
54
- end
44
+ # A QR code PNG image that encodes
45
+ # `otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String`
46
+ # where `$virtualMFADeviceName` is one of the create call arguments,
47
+ # `AccountName` is the user name if set (otherwise, the account ID
48
+ # otherwise), and `Base32String` is the seed in Base32 format. The
49
+ # `Base32String` value is Base64-encoded.
50
+ # @return [String]
51
+ def qr_code_png
52
+ data.qr_code_png
53
+ end
55
54
 
56
- # The date and time on which the virtual MFA device was enabled.
57
- # @return [Time]
58
- def enable_date
59
- data.enable_date
60
- end
55
+ # The date and time on which the virtual MFA device was enabled.
56
+ # @return [Time]
57
+ def enable_date
58
+ data.enable_date
59
+ end
61
60
 
62
- # @!endgroup
61
+ # @!endgroup
63
62
 
64
- # @return [Client]
65
- def client
66
- @client
67
- end
63
+ # @return [Client]
64
+ def client
65
+ @client
66
+ end
68
67
 
69
- # @raise [Errors::ResourceNotLoadable]
70
- # @api private
71
- def load
72
- msg = "#load is not implemented, data only available via enumeration"
73
- raise Errors::ResourceNotLoadable, msg
74
- end
75
- alias :reload :load
76
-
77
- # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
78
- # @return [Types::VirtualMFADevice]
79
- # Returns the data for this {VirtualMfaDevice}.
80
- def data
81
- load unless @data
82
- @data
83
- end
68
+ # @raise [NotImplementedError]
69
+ # @api private
70
+ def load
71
+ msg = "#load is not implemented, data only available via enumeration"
72
+ raise NotImplementedError, msg
73
+ end
74
+ alias :reload :load
75
+
76
+ # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
77
+ # @return [Types::VirtualMFADevice]
78
+ # Returns the data for this {VirtualMfaDevice}.
79
+ def data
80
+ load unless @data
81
+ @data
82
+ end
84
83
 
85
- # @return [Boolean]
86
- # Returns `true` if this resource is loaded. Accessing attributes or
87
- # {#data} on an unloaded resource will trigger a call to {#load}.
88
- def data_loaded?
89
- !!@data
90
- end
84
+ # @return [Boolean]
85
+ # Returns `true` if this resource is loaded. Accessing attributes or
86
+ # {#data} on an unloaded resource will trigger a call to {#load}.
87
+ def data_loaded?
88
+ !!@data
89
+ end
91
90
 
92
- # @!group Actions
93
-
94
- # @example Request syntax with placeholder values
95
- #
96
- # virtual_mfa_device.delete()
97
- # @param [Hash] options ({})
98
- # @return [EmptyStructure]
99
- def delete(options = {})
100
- options = options.merge(serial_number: @serial_number)
101
- resp = @client.delete_virtual_mfa_device(options)
102
- resp.data
103
- end
91
+ # @!group Actions
92
+
93
+ # @example Request syntax with placeholder values
94
+ #
95
+ # virtual_mfa_device.delete()
96
+ # @param [Hash] options ({})
97
+ # @return [EmptyStructure]
98
+ def delete(options = {})
99
+ options = options.merge(serial_number: @serial_number)
100
+ resp = @client.delete_virtual_mfa_device(options)
101
+ resp.data
102
+ end
104
103
 
105
- # @!group Associations
106
-
107
- # @return [User, nil]
108
- def user
109
- if data.user.user_name
110
- User.new(
111
- name: data.user.user_name,
112
- client: @client
113
- )
114
- else
115
- nil
116
- end
104
+ # @!group Associations
105
+
106
+ # @return [User, nil]
107
+ def user
108
+ if data.user.user_name
109
+ User.new(
110
+ name: data.user.user_name,
111
+ client: @client
112
+ )
113
+ else
114
+ nil
117
115
  end
116
+ end
118
117
 
119
- # @deprecated
120
- # @api private
121
- def identifiers
122
- { serial_number: @serial_number }
123
- end
124
- deprecated(:identifiers)
125
-
126
- private
127
-
128
- def extract_serial_number(args, options)
129
- value = args[0] || options.delete(:serial_number)
130
- case value
131
- when String then value
132
- when nil then raise ArgumentError, "missing required option :serial_number"
133
- else
134
- msg = "expected :serial_number to be a String, got #{value.class}"
135
- raise ArgumentError, msg
136
- end
118
+ # @deprecated
119
+ # @api private
120
+ def identifiers
121
+ { serial_number: @serial_number }
122
+ end
123
+ deprecated(:identifiers)
124
+
125
+ private
126
+
127
+ def extract_serial_number(args, options)
128
+ value = args[0] || options.delete(:serial_number)
129
+ case value
130
+ when String then value
131
+ when nil then raise ArgumentError, "missing required option :serial_number"
132
+ else
133
+ msg = "expected :serial_number to be a String, got #{value.class}"
134
+ raise ArgumentError, msg
137
135
  end
138
-
139
- class Collection < Aws::Resources::Collection; end
140
136
  end
137
+
138
+ class Collection < Aws::Resources::Collection; end
141
139
  end
142
140
  end