akeyless 4.2.4 → 4.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -1
  3. data/docs/AcmeAccount.md +22 -0
  4. data/docs/AuthMethodRoleAssociation.md +2 -0
  5. data/docs/ChangeAdminAccountPassword.md +26 -0
  6. data/docs/CreatePKICertIssuer.md +5 -1
  7. data/docs/DeactivateAcmeAccount.md +28 -0
  8. data/docs/GenerateAcmeEab.md +24 -0
  9. data/docs/GenerateAcmeEabOutput.md +22 -0
  10. data/docs/GetGroupOutput.md +2 -0
  11. data/docs/GetKubeExecCreds.md +1 -1
  12. data/docs/GetPKICertificate.md +1 -1
  13. data/docs/Group.md +2 -0
  14. data/docs/ListAcmeAccounts.md +24 -0
  15. data/docs/ListAcmeAccountsOutput.md +18 -0
  16. data/docs/PKICertificateIssueDetails.md +4 -0
  17. data/docs/RoleAssociationDetails.md +2 -0
  18. data/docs/RoleAuthMethodAssociation.md +2 -0
  19. data/docs/UpdateClassicKeyCertificate.md +2 -0
  20. data/docs/UpdateItem.md +2 -0
  21. data/docs/UpdatePKICertIssuer.md +5 -1
  22. data/docs/V2Api.md +252 -0
  23. data/lib/akeyless/api/v2_api.rb +256 -0
  24. data/lib/akeyless/models/acme_account.rb +234 -0
  25. data/lib/akeyless/models/auth_method_role_association.rb +10 -1
  26. data/lib/akeyless/models/change_admin_account_password.rb +271 -0
  27. data/lib/akeyless/models/create_pki_cert_issuer.rb +24 -2
  28. data/lib/akeyless/models/deactivate_acme_account.rb +282 -0
  29. data/lib/akeyless/models/generate_acme_eab.rb +254 -0
  30. data/lib/akeyless/models/generate_acme_eab_output.rb +232 -0
  31. data/lib/akeyless/models/get_group_output.rb +10 -1
  32. data/lib/akeyless/models/get_kube_exec_creds.rb +1 -1
  33. data/lib/akeyless/models/get_pki_certificate.rb +1 -1
  34. data/lib/akeyless/models/group.rb +10 -1
  35. data/lib/akeyless/models/list_acme_accounts.rb +255 -0
  36. data/lib/akeyless/models/list_acme_accounts_output.rb +216 -0
  37. data/lib/akeyless/models/pki_certificate_issue_details.rb +19 -1
  38. data/lib/akeyless/models/role_association_details.rb +10 -1
  39. data/lib/akeyless/models/role_auth_method_association.rb +10 -1
  40. data/lib/akeyless/models/update_classic_key_certificate.rb +10 -1
  41. data/lib/akeyless/models/update_item.rb +10 -1
  42. data/lib/akeyless/models/update_pki_cert_issuer.rb +24 -2
  43. data/lib/akeyless/version.rb +1 -1
  44. data/lib/akeyless.rb +7 -0
  45. data/spec/models/acme_account_spec.rb +48 -0
  46. data/spec/models/change_admin_account_password_spec.rb +60 -0
  47. data/spec/models/deactivate_acme_account_spec.rb +66 -0
  48. data/spec/models/generate_acme_eab_output_spec.rb +48 -0
  49. data/spec/models/generate_acme_eab_spec.rb +54 -0
  50. data/spec/models/list_acme_accounts_output_spec.rb +36 -0
  51. data/spec/models/list_acme_accounts_spec.rb +54 -0
  52. metadata +30 -2
@@ -0,0 +1,282 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 2.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ # deactivateAcmeAccount is a command that Deactivates \\ Deletes an acme external account
18
+ class DeactivateAcmeAccount
19
+ # The acme account id to deactivate
20
+ attr_accessor :acme_account_id
21
+
22
+ # The name of the PKI certificate issuer
23
+ attr_accessor :cert_issuer_name
24
+
25
+ # Delete the account
26
+ attr_accessor :delete_account
27
+
28
+ # Set output format to JSON
29
+ attr_accessor :json
30
+
31
+ # Authentication token (see `/auth` and `/configure`)
32
+ attr_accessor :token
33
+
34
+ # The universal identity token, Required only for universal_identity authentication
35
+ attr_accessor :uid_token
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'acme_account_id' => :'acme-account-id',
41
+ :'cert_issuer_name' => :'cert-issuer-name',
42
+ :'delete_account' => :'delete-account',
43
+ :'json' => :'json',
44
+ :'token' => :'token',
45
+ :'uid_token' => :'uid-token'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'acme_account_id' => :'String',
58
+ :'cert_issuer_name' => :'String',
59
+ :'delete_account' => :'Boolean',
60
+ :'json' => :'Boolean',
61
+ :'token' => :'String',
62
+ :'uid_token' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::DeactivateAcmeAccount` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::DeactivateAcmeAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'acme_account_id')
88
+ self.acme_account_id = attributes[:'acme_account_id']
89
+ else
90
+ self.acme_account_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'cert_issuer_name')
94
+ self.cert_issuer_name = attributes[:'cert_issuer_name']
95
+ else
96
+ self.cert_issuer_name = nil
97
+ end
98
+
99
+ if attributes.key?(:'delete_account')
100
+ self.delete_account = attributes[:'delete_account']
101
+ end
102
+
103
+ if attributes.key?(:'json')
104
+ self.json = attributes[:'json']
105
+ else
106
+ self.json = false
107
+ end
108
+
109
+ if attributes.key?(:'token')
110
+ self.token = attributes[:'token']
111
+ end
112
+
113
+ if attributes.key?(:'uid_token')
114
+ self.uid_token = attributes[:'uid_token']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
+ invalid_properties = Array.new
123
+ if @acme_account_id.nil?
124
+ invalid_properties.push('invalid value for "acme_account_id", acme_account_id cannot be nil.')
125
+ end
126
+
127
+ if @cert_issuer_name.nil?
128
+ invalid_properties.push('invalid value for "cert_issuer_name", cert_issuer_name cannot be nil.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ return false if @acme_account_id.nil?
139
+ return false if @cert_issuer_name.nil?
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ acme_account_id == o.acme_account_id &&
149
+ cert_issuer_name == o.cert_issuer_name &&
150
+ delete_account == o.delete_account &&
151
+ json == o.json &&
152
+ token == o.token &&
153
+ uid_token == o.uid_token
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [acme_account_id, cert_issuer_name, delete_account, json, token, uid_token].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
183
+ end
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
187
+ end
188
+ new(transformed_hash)
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def self._deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = Akeyless.const_get(type)
230
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+
282
+ end
@@ -0,0 +1,254 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 2.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GenerateAcmeEab
18
+ # The name of the PKI certificate issuer
19
+ attr_accessor :cert_issuer_name
20
+
21
+ # Set output format to JSON
22
+ attr_accessor :json
23
+
24
+ # Authentication token (see `/auth` and `/configure`)
25
+ attr_accessor :token
26
+
27
+ # The universal identity token, Required only for universal_identity authentication
28
+ attr_accessor :uid_token
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'cert_issuer_name' => :'cert-issuer-name',
34
+ :'json' => :'json',
35
+ :'token' => :'token',
36
+ :'uid_token' => :'uid-token'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'cert_issuer_name' => :'String',
49
+ :'json' => :'Boolean',
50
+ :'token' => :'String',
51
+ :'uid_token' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GenerateAcmeEab` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GenerateAcmeEab`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'cert_issuer_name')
77
+ self.cert_issuer_name = attributes[:'cert_issuer_name']
78
+ else
79
+ self.cert_issuer_name = nil
80
+ end
81
+
82
+ if attributes.key?(:'json')
83
+ self.json = attributes[:'json']
84
+ else
85
+ self.json = false
86
+ end
87
+
88
+ if attributes.key?(:'token')
89
+ self.token = attributes[:'token']
90
+ end
91
+
92
+ if attributes.key?(:'uid_token')
93
+ self.uid_token = attributes[:'uid_token']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ if @cert_issuer_name.nil?
103
+ invalid_properties.push('invalid value for "cert_issuer_name", cert_issuer_name cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @cert_issuer_name.nil?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ cert_issuer_name == o.cert_issuer_name &&
123
+ json == o.json &&
124
+ token == o.token &&
125
+ uid_token == o.uid_token
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [cert_issuer_name, json, token, uid_token].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
146
+ transformed_hash = {}
147
+ openapi_types.each_pair do |key, type|
148
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = nil
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[attribute_map[key]].is_a?(Array)
154
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
+ end
156
+ elsif !attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
+ end
159
+ end
160
+ new(transformed_hash)
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def self._deserialize(type, value)
168
+ case type.to_sym
169
+ when :Time
170
+ Time.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ # models (e.g. Pet) or oneOf
201
+ klass = Akeyless.const_get(type)
202
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end