aws-sdk-iam 1.0.0.rc1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 711f2481a1d492ed7fab806a633115360ec79049
4
+ data.tar.gz: ed1dd9b7de5cf542e58f7989c0581ccae0f16b16
5
+ SHA512:
6
+ metadata.gz: 02b78a0f51c3ce2e90947b1b0d4c08902debc7611acf5bb06a7432db617a7102d35cb243cb2808356dbad3c4f93797be09856d6497f17989c8954bcee02266f1
7
+ data.tar.gz: af26e2326edeb2068e7b56bc6dc57bbd7d49ef3cd8c7e094183ca06cb4ed76a4fc7009aab9f02ebd9af557b6a3266cfeedbbaa480f92528f415d10c15ed8017f
@@ -0,0 +1,69 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-iam/types'
12
+ require_relative 'aws-sdk-iam/client_api'
13
+ require_relative 'aws-sdk-iam/client'
14
+ require_relative 'aws-sdk-iam/errors'
15
+ require_relative 'aws-sdk-iam/waiters'
16
+ require_relative 'aws-sdk-iam/resource'
17
+ require_relative 'aws-sdk-iam/access_key'
18
+ require_relative 'aws-sdk-iam/access_key_pair'
19
+ require_relative 'aws-sdk-iam/account_password_policy'
20
+ require_relative 'aws-sdk-iam/account_summary'
21
+ require_relative 'aws-sdk-iam/assume_role_policy'
22
+ require_relative 'aws-sdk-iam/current_user'
23
+ require_relative 'aws-sdk-iam/group'
24
+ require_relative 'aws-sdk-iam/group_policy'
25
+ require_relative 'aws-sdk-iam/instance_profile'
26
+ require_relative 'aws-sdk-iam/login_profile'
27
+ require_relative 'aws-sdk-iam/mfa_device'
28
+ require_relative 'aws-sdk-iam/policy'
29
+ require_relative 'aws-sdk-iam/policy_version'
30
+ require_relative 'aws-sdk-iam/role'
31
+ require_relative 'aws-sdk-iam/role_policy'
32
+ require_relative 'aws-sdk-iam/saml_provider'
33
+ require_relative 'aws-sdk-iam/server_certificate'
34
+ require_relative 'aws-sdk-iam/signing_certificate'
35
+ require_relative 'aws-sdk-iam/user'
36
+ require_relative 'aws-sdk-iam/user_policy'
37
+ require_relative 'aws-sdk-iam/virtual_mfa_device'
38
+ require_relative 'aws-sdk-iam/customizations'
39
+
40
+ # This module provides support for AWS Identity and Access Management. This module is available in the
41
+ # `aws-sdk-iam` gem.
42
+ #
43
+ # # Client
44
+ #
45
+ # The {Client} class provides one method for each API operation. Operation
46
+ # methods each accept a hash of request parameters and return a response
47
+ # structure.
48
+ #
49
+ # See {Client} for more information.
50
+ #
51
+ # # Errors
52
+ #
53
+ # Errors returned from AWS Identity and Access Management all
54
+ # extend {Errors::ServiceError}.
55
+ #
56
+ # begin
57
+ # # do stuff
58
+ # rescue Aws::IAM::Errors::ServiceError
59
+ # # rescues all service API errors
60
+ # end
61
+ #
62
+ # See {Errors} for more information.
63
+ #
64
+ # @service
65
+ module Aws::IAM
66
+
67
+ GEM_VERSION = '1.0.0.rc1'
68
+
69
+ end
@@ -0,0 +1,179 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module IAM
10
+ class AccessKey
11
+
12
+ extend Aws::Deprecations
13
+
14
+ # @overload def initialize(user_name, id, options = {})
15
+ # @param [String] user_name
16
+ # @param [String] id
17
+ # @option options [Client] :client
18
+ # @overload def initialize(options = {})
19
+ # @option options [required, String] :user_name
20
+ # @option options [required, String] :id
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
+ @id = extract_id(args, options)
26
+ @data = options.delete(:data)
27
+ @client = options.delete(:client) || Client.new(options)
28
+ end
29
+
30
+ # @!group Read-Only Attributes
31
+
32
+ # @return [String]
33
+ def user_name
34
+ @user_name
35
+ end
36
+
37
+ # @return [String]
38
+ def id
39
+ @id
40
+ end
41
+ alias :access_key_id :id
42
+
43
+ # The status of the access key. `Active` means the key is valid for API
44
+ # calls; `Inactive` means it is not.
45
+ # @return [String]
46
+ def status
47
+ data.status
48
+ end
49
+
50
+ # The date when the access key was created.
51
+ # @return [Time]
52
+ def create_date
53
+ data.create_date
54
+ end
55
+
56
+ # @!endgroup
57
+
58
+ # @return [Client]
59
+ def client
60
+ @client
61
+ end
62
+
63
+ # @raise [Errors::ResourceNotLoadable]
64
+ # @api private
65
+ def load
66
+ msg = "#load is not implemented, data only available via enumeration"
67
+ raise Errors::ResourceNotLoadable, msg
68
+ end
69
+ alias :reload :load
70
+
71
+ # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
72
+ # @return [Types::AccessKeyMetadata]
73
+ # Returns the data for this {AccessKey}.
74
+ def data
75
+ load unless @data
76
+ @data
77
+ end
78
+
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
85
+
86
+ # @!group Actions
87
+
88
+ # @example Request syntax with placeholder values
89
+ #
90
+ # access_key.activate()
91
+ # @param [Hash] options ({})
92
+ # @return [EmptyStructure]
93
+ def activate(options = {})
94
+ options = options.merge(
95
+ user_name: @user_name,
96
+ access_key_id: @id,
97
+ status: "Active"
98
+ )
99
+ resp = @client.update_access_key(options)
100
+ resp.data
101
+ end
102
+
103
+ # @example Request syntax with placeholder values
104
+ #
105
+ # access_key.deactivate()
106
+ # @param [Hash] options ({})
107
+ # @return [EmptyStructure]
108
+ def deactivate(options = {})
109
+ options = options.merge(
110
+ user_name: @user_name,
111
+ access_key_id: @id,
112
+ status: "Inactive"
113
+ )
114
+ resp = @client.update_access_key(options)
115
+ resp.data
116
+ end
117
+
118
+ # @example Request syntax with placeholder values
119
+ #
120
+ # access_key.delete()
121
+ # @param [Hash] options ({})
122
+ # @return [EmptyStructure]
123
+ def delete(options = {})
124
+ options = options.merge(
125
+ user_name: @user_name,
126
+ access_key_id: @id
127
+ )
128
+ resp = @client.delete_access_key(options)
129
+ resp.data
130
+ end
131
+
132
+ # @!group Associations
133
+
134
+ # @return [User]
135
+ def user
136
+ User.new(
137
+ name: @user_name,
138
+ client: @client
139
+ )
140
+ end
141
+
142
+ # @deprecated
143
+ # @api private
144
+ def identifiers
145
+ {
146
+ user_name: @user_name,
147
+ id: @id
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
+ end
163
+ end
164
+
165
+ def extract_id(args, options)
166
+ value = args[1] || options.delete(:id)
167
+ case value
168
+ when String then value
169
+ when nil then raise ArgumentError, "missing required option :id"
170
+ else
171
+ msg = "expected :id to be a String, got #{value.class}"
172
+ raise ArgumentError, msg
173
+ end
174
+ end
175
+
176
+ class Collection < Aws::Resources::Collection; end
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,190 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module IAM
10
+ class AccessKeyPair
11
+
12
+ extend Aws::Deprecations
13
+
14
+ # @overload def initialize(user_name, id, secret, options = {})
15
+ # @param [String] user_name
16
+ # @param [String] id
17
+ # @param [String] secret
18
+ # @option options [Client] :client
19
+ # @overload def initialize(options = {})
20
+ # @option options [required, String] :user_name
21
+ # @option options [required, String] :id
22
+ # @option options [required, String] :secret
23
+ # @option options [Client] :client
24
+ def initialize(*args)
25
+ options = Hash === args.last ? args.pop.dup : {}
26
+ @user_name = extract_user_name(args, options)
27
+ @id = extract_id(args, options)
28
+ @secret = extract_secret(args, options)
29
+ @data = options.delete(:data)
30
+ @client = options.delete(:client) || Client.new(options)
31
+ end
32
+
33
+ # @!group Read-Only Attributes
34
+
35
+ # @return [String]
36
+ def user_name
37
+ @user_name
38
+ end
39
+
40
+ # @return [String]
41
+ def id
42
+ @id
43
+ end
44
+ alias :access_key_id :id
45
+
46
+ # @return [String]
47
+ def secret
48
+ @secret
49
+ end
50
+ alias :secret_access_key :secret
51
+
52
+ # The status of the access key. `Active` means the key is valid for API
53
+ # calls, while `Inactive` means it is not.
54
+ # @return [String]
55
+ def status
56
+ data.status
57
+ end
58
+
59
+ # The date when the access key was created.
60
+ # @return [Time]
61
+ def create_date
62
+ data.create_date
63
+ end
64
+
65
+ # @!endgroup
66
+
67
+ # @return [Client]
68
+ def client
69
+ @client
70
+ end
71
+
72
+ # @raise [Errors::ResourceNotLoadable]
73
+ # @api private
74
+ def load
75
+ msg = "#load is not implemented, data only available via enumeration"
76
+ raise Errors::ResourceNotLoadable, msg
77
+ end
78
+ alias :reload :load
79
+
80
+ # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
81
+ # @return [Types::AccessKey]
82
+ # Returns the data for this {AccessKeyPair}.
83
+ def data
84
+ load unless @data
85
+ @data
86
+ end
87
+
88
+ # @return [Boolean]
89
+ # Returns `true` if this resource is loaded. Accessing attributes or
90
+ # {#data} on an unloaded resource will trigger a call to {#load}.
91
+ def data_loaded?
92
+ !!@data
93
+ end
94
+
95
+ # @!group Actions
96
+
97
+ # @example Request syntax with placeholder values
98
+ #
99
+ # access_key_pair.activate()
100
+ # @param [Hash] options ({})
101
+ # @return [EmptyStructure]
102
+ def activate(options = {})
103
+ options = options.merge(
104
+ user_name: @user_name,
105
+ access_key_id: @id,
106
+ status: "Active"
107
+ )
108
+ resp = @client.update_access_key(options)
109
+ resp.data
110
+ end
111
+
112
+ # @example Request syntax with placeholder values
113
+ #
114
+ # access_key_pair.deactivate()
115
+ # @param [Hash] options ({})
116
+ # @return [EmptyStructure]
117
+ def deactivate(options = {})
118
+ options = options.merge(
119
+ user_name: @user_name,
120
+ access_key_id: @id,
121
+ status: "Inactive"
122
+ )
123
+ resp = @client.update_access_key(options)
124
+ resp.data
125
+ end
126
+
127
+ # @example Request syntax with placeholder values
128
+ #
129
+ # access_key_pair.delete()
130
+ # @param [Hash] options ({})
131
+ # @return [EmptyStructure]
132
+ def delete(options = {})
133
+ options = options.merge(
134
+ user_name: @user_name,
135
+ access_key_id: @id
136
+ )
137
+ resp = @client.delete_access_key(options)
138
+ resp.data
139
+ end
140
+
141
+ # @deprecated
142
+ # @api private
143
+ def identifiers
144
+ {
145
+ user_name: @user_name,
146
+ id: @id,
147
+ secret: @secret
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
+ end
163
+ end
164
+
165
+ def extract_id(args, options)
166
+ value = args[1] || options.delete(:id)
167
+ case value
168
+ when String then value
169
+ when nil then raise ArgumentError, "missing required option :id"
170
+ else
171
+ msg = "expected :id to be a String, got #{value.class}"
172
+ raise ArgumentError, msg
173
+ end
174
+ end
175
+
176
+ def extract_secret(args, options)
177
+ value = args[2] || options.delete(:secret)
178
+ case value
179
+ when String then value
180
+ when nil then raise ArgumentError, "missing required option :secret"
181
+ else
182
+ msg = "expected :secret to be a String, got #{value.class}"
183
+ raise ArgumentError, msg
184
+ end
185
+ end
186
+
187
+ class Collection < Aws::Resources::Collection; end
188
+ end
189
+ end
190
+ end