aws-sdk-iam 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,144 @@
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 SamlProvider
11
+
12
+ extend Aws::Deprecations
13
+
14
+ # @overload def initialize(arn, options = {})
15
+ # @param [String] arn
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :arn
19
+ # @option options [Client] :client
20
+ def initialize(*args)
21
+ options = Hash === args.last ? args.pop.dup : {}
22
+ @arn = extract_arn(args, options)
23
+ @data = options.delete(:data)
24
+ @client = options.delete(:client) || Client.new(options)
25
+ end
26
+
27
+ # @!group Read-Only Attributes
28
+
29
+ # @return [String]
30
+ def arn
31
+ @arn
32
+ end
33
+
34
+ # The XML metadata document that includes information about an identity
35
+ # provider.
36
+ # @return [String]
37
+ def saml_metadata_document
38
+ data.saml_metadata_document
39
+ end
40
+
41
+ # The date and time when the SAML provider was created.
42
+ # @return [Time]
43
+ def create_date
44
+ data.create_date
45
+ end
46
+
47
+ # The expiration date and time for the SAML provider.
48
+ # @return [Time]
49
+ def valid_until
50
+ data.valid_until
51
+ end
52
+
53
+ # @!endgroup
54
+
55
+ # @return [Client]
56
+ def client
57
+ @client
58
+ end
59
+
60
+ # Loads, or reloads {#data} for the current {SamlProvider}.
61
+ # Returns `self` making it possible to chain methods.
62
+ #
63
+ # saml_provider.reload.data
64
+ #
65
+ # @return [self]
66
+ def load
67
+ resp = @client.get_saml_provider(saml_provider_arn: @arn)
68
+ @data = resp.data
69
+ self
70
+ end
71
+ alias :reload :load
72
+
73
+ # @return [Types::GetSAMLProviderResponse]
74
+ # Returns the data for this {SamlProvider}. Calls
75
+ # {Client#get_saml_provider} if {#data_loaded?} is `false`.
76
+ def data
77
+ load unless @data
78
+ @data
79
+ end
80
+
81
+ # @return [Boolean]
82
+ # Returns `true` if this resource is loaded. Accessing attributes or
83
+ # {#data} on an unloaded resource will trigger a call to {#load}.
84
+ def data_loaded?
85
+ !!@data
86
+ end
87
+
88
+ # @!group Actions
89
+
90
+ # @example Request syntax with placeholder values
91
+ #
92
+ # saml_provider.delete()
93
+ # @param [Hash] options ({})
94
+ # @return [EmptyStructure]
95
+ def delete(options = {})
96
+ options = options.merge(saml_provider_arn: @arn)
97
+ resp = @client.delete_saml_provider(options)
98
+ resp.data
99
+ end
100
+
101
+ # @example Request syntax with placeholder values
102
+ #
103
+ # saml_provider.update({
104
+ # saml_metadata_document: "SAMLMetadataDocumentType", # required
105
+ # })
106
+ # @param [Hash] options ({})
107
+ # @option options [required, String] :saml_metadata_document
108
+ # An XML document generated by an identity provider (IdP) that supports
109
+ # SAML 2.0. The document includes the issuer's name, expiration
110
+ # information, and keys that can be used to validate the SAML
111
+ # authentication response (assertions) that are received from the IdP.
112
+ # You must generate the metadata document using the identity management
113
+ # software that is used as your organization's IdP.
114
+ # @return [Types::UpdateSAMLProviderResponse]
115
+ def update(options = {})
116
+ options = options.merge(saml_provider_arn: @arn)
117
+ resp = @client.update_saml_provider(options)
118
+ resp.data
119
+ end
120
+
121
+ # @deprecated
122
+ # @api private
123
+ def identifiers
124
+ { arn: @arn }
125
+ end
126
+ deprecated(:identifiers)
127
+
128
+ private
129
+
130
+ def extract_arn(args, options)
131
+ value = args[0] || options.delete(:arn)
132
+ case value
133
+ when String then value
134
+ when nil then raise ArgumentError, "missing required option :arn"
135
+ else
136
+ msg = "expected :arn to be a String, got #{value.class}"
137
+ raise ArgumentError, msg
138
+ end
139
+ end
140
+
141
+ class Collection < Aws::Resources::Collection; end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,167 @@
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 ServerCertificate
11
+
12
+ extend Aws::Deprecations
13
+
14
+ # @overload def initialize(name, options = {})
15
+ # @param [String] name
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :name
19
+ # @option options [Client] :client
20
+ def initialize(*args)
21
+ options = Hash === args.last ? args.pop.dup : {}
22
+ @name = extract_name(args, options)
23
+ @data = options.delete(:data)
24
+ @client = options.delete(:client) || Client.new(options)
25
+ end
26
+
27
+ # @!group Read-Only Attributes
28
+
29
+ # @return [String]
30
+ def name
31
+ @name
32
+ end
33
+
34
+ # The meta information of the server certificate, such as its name,
35
+ # path, ID, and ARN.
36
+ # @return [Types::ServerCertificateMetadata]
37
+ def server_certificate_metadata
38
+ data.server_certificate_metadata
39
+ end
40
+
41
+ # The contents of the public key certificate.
42
+ # @return [String]
43
+ def certificate_body
44
+ data.certificate_body
45
+ end
46
+
47
+ # The contents of the public key certificate chain.
48
+ # @return [String]
49
+ def certificate_chain
50
+ data.certificate_chain
51
+ end
52
+
53
+ # @!endgroup
54
+
55
+ # @return [Client]
56
+ def client
57
+ @client
58
+ end
59
+
60
+ # Loads, or reloads {#data} for the current {ServerCertificate}.
61
+ # Returns `self` making it possible to chain methods.
62
+ #
63
+ # server_certificate.reload.data
64
+ #
65
+ # @return [self]
66
+ def load
67
+ resp = @client.get_server_certificate(server_certificate_name: @name)
68
+ @data = resp.servercertificate
69
+ self
70
+ end
71
+ alias :reload :load
72
+
73
+ # @return [Types::ServerCertificate]
74
+ # Returns the data for this {ServerCertificate}. Calls
75
+ # {Client#get_server_certificate} if {#data_loaded?} is `false`.
76
+ def data
77
+ load unless @data
78
+ @data
79
+ end
80
+
81
+ # @return [Boolean]
82
+ # Returns `true` if this resource is loaded. Accessing attributes or
83
+ # {#data} on an unloaded resource will trigger a call to {#load}.
84
+ def data_loaded?
85
+ !!@data
86
+ end
87
+
88
+ # @!group Actions
89
+
90
+ # @example Request syntax with placeholder values
91
+ #
92
+ # server_certificate.delete()
93
+ # @param [Hash] options ({})
94
+ # @return [EmptyStructure]
95
+ def delete(options = {})
96
+ options = options.merge(server_certificate_name: @name)
97
+ resp = @client.delete_server_certificate(options)
98
+ resp.data
99
+ end
100
+
101
+ # @example Request syntax with placeholder values
102
+ #
103
+ # servercertificate = server_certificate.update({
104
+ # new_path: "pathType",
105
+ # new_server_certificate_name: "serverCertificateNameType",
106
+ # })
107
+ # @param [Hash] options ({})
108
+ # @option options [String] :new_path
109
+ # The new path for the server certificate. Include this only if you are
110
+ # updating the server certificate's path.
111
+ #
112
+ # The [regex pattern][1] for this parameter is a string of characters
113
+ # consisting of either a forward slash (/) by itself or a string that
114
+ # must begin and end with forward slashes, containing any ASCII
115
+ # character from the ! (\\u0021) thru the DEL character (\\u007F),
116
+ # including most punctuation characters, digits, and upper and
117
+ # lowercased letters.
118
+ #
119
+ #
120
+ #
121
+ # [1]: http://wikipedia.org/wiki/regex
122
+ # @option options [String] :new_server_certificate_name
123
+ # The new name for the server certificate. Include this only if you are
124
+ # updating the server certificate's name. The name of the certificate
125
+ # cannot contain any spaces.
126
+ #
127
+ # The [regex pattern][1] for this parameter is a string of characters
128
+ # consisting of upper and lowercase alphanumeric characters with no
129
+ # spaces. You can also include any of the following characters: =,.@-
130
+ #
131
+ #
132
+ #
133
+ # [1]: http://wikipedia.org/wiki/regex
134
+ # @return [ServerCertificate]
135
+ def update(options = {})
136
+ options = options.merge(server_certificate_name: @name)
137
+ resp = @client.update_server_certificate(options)
138
+ ServerCertificate.new(
139
+ name: options[:new_server_certificate_name],
140
+ client: @client
141
+ )
142
+ end
143
+
144
+ # @deprecated
145
+ # @api private
146
+ def identifiers
147
+ { name: @name }
148
+ end
149
+ deprecated(:identifiers)
150
+
151
+ private
152
+
153
+ def extract_name(args, options)
154
+ value = args[0] || options.delete(:name)
155
+ case value
156
+ when String then value
157
+ when nil then raise ArgumentError, "missing required option :name"
158
+ else
159
+ msg = "expected :name to be a String, got #{value.class}"
160
+ raise ArgumentError, msg
161
+ end
162
+ end
163
+
164
+ class Collection < Aws::Resources::Collection; end
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,185 @@
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 SigningCertificate
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 :certificate_id :id
42
+
43
+ # The contents of the signing certificate.
44
+ # @return [String]
45
+ def certificate_body
46
+ data.certificate_body
47
+ end
48
+
49
+ # The status of the signing certificate. `Active` means the key is valid
50
+ # for API calls, while `Inactive` means it is not.
51
+ # @return [String]
52
+ def status
53
+ data.status
54
+ end
55
+
56
+ # The date when the signing certificate was uploaded.
57
+ # @return [Time]
58
+ def upload_date
59
+ data.upload_date
60
+ end
61
+
62
+ # @!endgroup
63
+
64
+ # @return [Client]
65
+ def client
66
+ @client
67
+ end
68
+
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::SigningCertificate]
79
+ # Returns the data for this {SigningCertificate}.
80
+ def data
81
+ load unless @data
82
+ @data
83
+ end
84
+
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
91
+
92
+ # @!group Actions
93
+
94
+ # @example Request syntax with placeholder values
95
+ #
96
+ # signing_certificate.activate()
97
+ # @param [Hash] options ({})
98
+ # @return [EmptyStructure]
99
+ def activate(options = {})
100
+ options = options.merge(
101
+ user_name: @user_name,
102
+ certificate_id: @id,
103
+ status: "Active"
104
+ )
105
+ resp = @client.update_signing_certificate(options)
106
+ resp.data
107
+ end
108
+
109
+ # @example Request syntax with placeholder values
110
+ #
111
+ # signing_certificate.deactivate()
112
+ # @param [Hash] options ({})
113
+ # @return [EmptyStructure]
114
+ def deactivate(options = {})
115
+ options = options.merge(
116
+ user_name: @user_name,
117
+ certificate_id: @id,
118
+ status: "Inactive"
119
+ )
120
+ resp = @client.update_signing_certificate(options)
121
+ resp.data
122
+ end
123
+
124
+ # @example Request syntax with placeholder values
125
+ #
126
+ # signing_certificate.delete()
127
+ # @param [Hash] options ({})
128
+ # @return [EmptyStructure]
129
+ def delete(options = {})
130
+ options = options.merge(
131
+ user_name: @user_name,
132
+ certificate_id: @id
133
+ )
134
+ resp = @client.delete_signing_certificate(options)
135
+ resp.data
136
+ end
137
+
138
+ # @!group Associations
139
+
140
+ # @return [User]
141
+ def user
142
+ User.new(
143
+ name: @user_name,
144
+ client: @client
145
+ )
146
+ end
147
+
148
+ # @deprecated
149
+ # @api private
150
+ def identifiers
151
+ {
152
+ user_name: @user_name,
153
+ id: @id
154
+ }
155
+ end
156
+ deprecated(:identifiers)
157
+
158
+ private
159
+
160
+ def extract_user_name(args, options)
161
+ value = args[0] || options.delete(:user_name)
162
+ case value
163
+ when String then value
164
+ when nil then raise ArgumentError, "missing required option :user_name"
165
+ else
166
+ msg = "expected :user_name to be a String, got #{value.class}"
167
+ raise ArgumentError, msg
168
+ end
169
+ end
170
+
171
+ def extract_id(args, options)
172
+ value = args[1] || options.delete(:id)
173
+ case value
174
+ when String then value
175
+ when nil then raise ArgumentError, "missing required option :id"
176
+ else
177
+ msg = "expected :id to be a String, got #{value.class}"
178
+ raise ArgumentError, msg
179
+ end
180
+ end
181
+
182
+ class Collection < Aws::Resources::Collection; end
183
+ end
184
+ end
185
+ end