akeyless 5.0.38 → 5.0.39

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.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -2
  3. data/docs/AssocTargetItem.md +5 -1
  4. data/docs/ClientEvent.md +26 -0
  5. data/docs/ClientEventOutput.md +18 -0
  6. data/docs/Connect.md +2 -0
  7. data/docs/CreateEventForwarder.md +1 -1
  8. data/docs/CreateLdapTarget.md +3 -1
  9. data/docs/CreatePKICertIssuer.md +6 -0
  10. data/docs/DSProducerDetails.md +2 -0
  11. data/docs/DigiCertTargetDetails.md +8 -0
  12. data/docs/EventForwarderCreateEmail.md +1 -1
  13. data/docs/EventForwarderCreateServiceNow.md +1 -1
  14. data/docs/EventForwarderCreateSlack.md +1 -1
  15. data/docs/EventForwarderCreateTeams.md +1 -1
  16. data/docs/EventForwarderCreateWebhook.md +1 -1
  17. data/docs/EventForwarderUpdateEmail.md +1 -1
  18. data/docs/EventForwarderUpdateServiceNow.md +1 -1
  19. data/docs/EventForwarderUpdateSlack.md +1 -1
  20. data/docs/EventForwarderUpdateTeams.md +1 -1
  21. data/docs/EventForwarderUpdateWebhook.md +1 -1
  22. data/docs/GatewayCreateAllowedAccess.md +1 -1
  23. data/docs/GatewayUpdateAllowedAccess.md +1 -1
  24. data/docs/GenerateIntermediateCA.md +48 -0
  25. data/docs/GenerateIntermediateCAOutput.md +26 -0
  26. data/docs/GoogleTrustTargetDetails.md +8 -0
  27. data/docs/InjectorCertificateEvent.md +28 -0
  28. data/docs/Item.md +2 -0
  29. data/docs/LdapTargetDetails.md +3 -1
  30. data/docs/LetsEncryptTargetDetails.md +8 -0
  31. data/docs/ListSRASessions.md +2 -0
  32. data/docs/ListSraSessionsOutput.md +3 -3
  33. data/docs/LockItem.md +1 -1
  34. data/docs/MigrationGeneral.md +6 -0
  35. data/docs/PKICertificateIssueDetails.md +4 -0
  36. data/docs/RequestAccess.md +2 -0
  37. data/docs/RotatedSecretCreateOkta.md +82 -0
  38. data/docs/RotatedSecretUpdateOkta.md +84 -0
  39. data/docs/Target.md +2 -0
  40. data/docs/TargetCreateDigiCert.md +8 -0
  41. data/docs/TargetCreateGoogleTrust.md +8 -0
  42. data/docs/TargetCreateLdap.md +3 -1
  43. data/docs/TargetCreateLetsEncrypt.md +8 -0
  44. data/docs/TargetUpdateDigiCert.md +8 -0
  45. data/docs/TargetUpdateGoogleTrust.md +8 -0
  46. data/docs/TargetUpdateLdap.md +3 -1
  47. data/docs/TargetUpdateLetsEncrypt.md +8 -0
  48. data/docs/UpdateLdapTarget.md +3 -1
  49. data/docs/UpdatePKICertIssuer.md +6 -0
  50. data/docs/V2Api.md +257 -3
  51. data/lib/akeyless/api/v2_api.rb +260 -0
  52. data/lib/akeyless/models/assoc_target_item.rb +24 -2
  53. data/lib/akeyless/models/client_event.rb +256 -0
  54. data/lib/akeyless/models/client_event_output.rb +214 -0
  55. data/lib/akeyless/models/connect.rb +11 -1
  56. data/lib/akeyless/models/create_event_forwarder.rb +1 -1
  57. data/lib/akeyless/models/create_ldap_target.rb +14 -4
  58. data/lib/akeyless/models/create_pki_cert_issuer.rb +31 -1
  59. data/lib/akeyless/models/digi_cert_target_details.rb +43 -1
  60. data/lib/akeyless/models/ds_producer_details.rb +10 -1
  61. data/lib/akeyless/models/event_forwarder_create_email.rb +1 -1
  62. data/lib/akeyless/models/event_forwarder_create_service_now.rb +1 -1
  63. data/lib/akeyless/models/event_forwarder_create_slack.rb +1 -1
  64. data/lib/akeyless/models/event_forwarder_create_teams.rb +1 -1
  65. data/lib/akeyless/models/event_forwarder_create_webhook.rb +1 -1
  66. data/lib/akeyless/models/event_forwarder_update_email.rb +1 -1
  67. data/lib/akeyless/models/event_forwarder_update_service_now.rb +1 -1
  68. data/lib/akeyless/models/event_forwarder_update_slack.rb +1 -1
  69. data/lib/akeyless/models/event_forwarder_update_teams.rb +1 -1
  70. data/lib/akeyless/models/event_forwarder_update_webhook.rb +1 -1
  71. data/lib/akeyless/models/gateway_create_allowed_access.rb +1 -1
  72. data/lib/akeyless/models/gateway_update_allowed_access.rb +1 -1
  73. data/lib/akeyless/models/generate_intermediate_ca.rb +379 -0
  74. data/lib/akeyless/models/generate_intermediate_ca_output.rb +250 -0
  75. data/lib/akeyless/models/google_trust_target_details.rb +43 -1
  76. data/lib/akeyless/models/injector_certificate_event.rb +259 -0
  77. data/lib/akeyless/models/item.rb +10 -1
  78. data/lib/akeyless/models/ldap_target_details.rb +13 -4
  79. data/lib/akeyless/models/lets_encrypt_target_details.rb +43 -1
  80. data/lib/akeyless/models/list_sra_sessions.rb +12 -2
  81. data/lib/akeyless/models/list_sra_sessions_output.rb +3 -0
  82. data/lib/akeyless/models/lock_item.rb +1 -1
  83. data/lib/akeyless/models/migration_general.rb +28 -1
  84. data/lib/akeyless/models/pki_certificate_issue_details.rb +21 -1
  85. data/lib/akeyless/models/request_access.rb +11 -1
  86. data/lib/akeyless/models/rotated_secret_create_okta.rb +556 -0
  87. data/lib/akeyless/models/rotated_secret_update_okta.rb +563 -0
  88. data/lib/akeyless/models/target.rb +10 -1
  89. data/lib/akeyless/models/target_create_digi_cert.rb +43 -1
  90. data/lib/akeyless/models/target_create_google_trust.rb +43 -1
  91. data/lib/akeyless/models/target_create_ldap.rb +14 -4
  92. data/lib/akeyless/models/target_create_lets_encrypt.rb +43 -1
  93. data/lib/akeyless/models/target_update_digi_cert.rb +43 -1
  94. data/lib/akeyless/models/target_update_google_trust.rb +43 -1
  95. data/lib/akeyless/models/target_update_ldap.rb +14 -4
  96. data/lib/akeyless/models/target_update_lets_encrypt.rb +43 -1
  97. data/lib/akeyless/models/update_ldap_target.rb +14 -4
  98. data/lib/akeyless/models/update_pki_cert_issuer.rb +31 -1
  99. data/lib/akeyless/version.rb +1 -1
  100. data/lib/akeyless.rb +7 -0
  101. data/spec/models/client_event_output_spec.rb +36 -0
  102. data/spec/models/client_event_spec.rb +60 -0
  103. data/spec/models/generate_intermediate_ca_output_spec.rb +60 -0
  104. data/spec/models/generate_intermediate_ca_spec.rb +126 -0
  105. data/spec/models/injector_certificate_event_spec.rb +66 -0
  106. data/spec/models/rotated_secret_create_okta_spec.rb +228 -0
  107. data/spec/models/rotated_secret_update_okta_spec.rb +234 -0
  108. metadata +30 -2
@@ -0,0 +1,379 @@
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: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GenerateIntermediateCA
18
+ attr_accessor :alg
19
+
20
+ # Allowed domains for future leaf issuance, not inherited into the SCEP subordinate CA certificate
21
+ attr_accessor :allowed_domains
22
+
23
+ # Optional Common Name for the intermediate CA certificate
24
+ attr_accessor :common_name
25
+
26
+ # Protection from accidental deletion of this object [true/false]
27
+ attr_accessor :delete_protection
28
+
29
+ # Destination path for SCEP-issued leaf certificates. Not derived from the CA certificate item path.
30
+ attr_accessor :destination_path
31
+
32
+ # Enable the fixed SCEP Stage 1 profile
33
+ attr_accessor :enable_scep
34
+
35
+ # Extended key usage for future leaf issuance (serverauth / clientauth / codesigning)
36
+ attr_accessor :extended_key_usage
37
+
38
+ # Set output format to JSON
39
+ attr_accessor :json
40
+
41
+ # The maximum path length of the generated intermediate CA certificate
42
+ attr_accessor :max_path_len
43
+
44
+ # Base path for derived intermediate CA resources
45
+ attr_accessor :name
46
+
47
+ # Parent PKI certificate issuer name
48
+ attr_accessor :parent_ca_name
49
+
50
+ # SCEP static challenge password. Request-only; never returned
51
+ attr_accessor :scep_password
52
+
53
+ # The number of fragments that the DFC key will be split into
54
+ attr_accessor :split_level
55
+
56
+ # Authentication token (see `/auth` and `/configure`)
57
+ attr_accessor :token
58
+
59
+ # Maximum TTL for certificates issued by the new intermediate issuer, supported formats are s,m,h,d
60
+ attr_accessor :ttl
61
+
62
+ # The universal identity token, Required only for universal_identity authentication
63
+ attr_accessor :uid_token
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'alg' => :'alg',
69
+ :'allowed_domains' => :'allowed-domains',
70
+ :'common_name' => :'common-name',
71
+ :'delete_protection' => :'delete_protection',
72
+ :'destination_path' => :'destination-path',
73
+ :'enable_scep' => :'enable-scep',
74
+ :'extended_key_usage' => :'extended-key-usage',
75
+ :'json' => :'json',
76
+ :'max_path_len' => :'max-path-len',
77
+ :'name' => :'name',
78
+ :'parent_ca_name' => :'parent-ca-name',
79
+ :'scep_password' => :'scep-password',
80
+ :'split_level' => :'split-level',
81
+ :'token' => :'token',
82
+ :'ttl' => :'ttl',
83
+ :'uid_token' => :'uid-token'
84
+ }
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'alg' => :'String',
96
+ :'allowed_domains' => :'String',
97
+ :'common_name' => :'String',
98
+ :'delete_protection' => :'String',
99
+ :'destination_path' => :'String',
100
+ :'enable_scep' => :'Boolean',
101
+ :'extended_key_usage' => :'String',
102
+ :'json' => :'Boolean',
103
+ :'max_path_len' => :'Integer',
104
+ :'name' => :'String',
105
+ :'parent_ca_name' => :'String',
106
+ :'scep_password' => :'String',
107
+ :'split_level' => :'Integer',
108
+ :'token' => :'String',
109
+ :'ttl' => :'String',
110
+ :'uid_token' => :'String'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ ])
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ if (!attributes.is_a?(Hash))
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GenerateIntermediateCA` initialize method"
125
+ end
126
+
127
+ # check to see if the attribute exists and convert string to symbol for hash key
128
+ attributes = attributes.each_with_object({}) { |(k, v), h|
129
+ if (!self.class.attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GenerateIntermediateCA`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ end
132
+ h[k.to_sym] = v
133
+ }
134
+
135
+ if attributes.key?(:'alg')
136
+ self.alg = attributes[:'alg']
137
+ end
138
+
139
+ if attributes.key?(:'allowed_domains')
140
+ self.allowed_domains = attributes[:'allowed_domains']
141
+ end
142
+
143
+ if attributes.key?(:'common_name')
144
+ self.common_name = attributes[:'common_name']
145
+ end
146
+
147
+ if attributes.key?(:'delete_protection')
148
+ self.delete_protection = attributes[:'delete_protection']
149
+ end
150
+
151
+ if attributes.key?(:'destination_path')
152
+ self.destination_path = attributes[:'destination_path']
153
+ end
154
+
155
+ if attributes.key?(:'enable_scep')
156
+ self.enable_scep = attributes[:'enable_scep']
157
+ end
158
+
159
+ if attributes.key?(:'extended_key_usage')
160
+ self.extended_key_usage = attributes[:'extended_key_usage']
161
+ else
162
+ self.extended_key_usage = 'serverauth,clientauth'
163
+ end
164
+
165
+ if attributes.key?(:'json')
166
+ self.json = attributes[:'json']
167
+ else
168
+ self.json = false
169
+ end
170
+
171
+ if attributes.key?(:'max_path_len')
172
+ self.max_path_len = attributes[:'max_path_len']
173
+ else
174
+ self.max_path_len = 0
175
+ end
176
+
177
+ if attributes.key?(:'name')
178
+ self.name = attributes[:'name']
179
+ else
180
+ self.name = nil
181
+ end
182
+
183
+ if attributes.key?(:'parent_ca_name')
184
+ self.parent_ca_name = attributes[:'parent_ca_name']
185
+ end
186
+
187
+ if attributes.key?(:'scep_password')
188
+ self.scep_password = attributes[:'scep_password']
189
+ end
190
+
191
+ if attributes.key?(:'split_level')
192
+ self.split_level = attributes[:'split_level']
193
+ else
194
+ self.split_level = 3
195
+ end
196
+
197
+ if attributes.key?(:'token')
198
+ self.token = attributes[:'token']
199
+ end
200
+
201
+ if attributes.key?(:'ttl')
202
+ self.ttl = attributes[:'ttl']
203
+ end
204
+
205
+ if attributes.key?(:'uid_token')
206
+ self.uid_token = attributes[:'uid_token']
207
+ end
208
+ end
209
+
210
+ # Show invalid properties with the reasons. Usually used together with valid?
211
+ # @return Array for valid properties with the reasons
212
+ def list_invalid_properties
213
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
214
+ invalid_properties = Array.new
215
+ if @name.nil?
216
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
217
+ end
218
+
219
+ invalid_properties
220
+ end
221
+
222
+ # Check to see if the all the properties in the model are valid
223
+ # @return true if the model is valid
224
+ def valid?
225
+ warn '[DEPRECATED] the `valid?` method is obsolete'
226
+ return false if @name.nil?
227
+ true
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ alg == o.alg &&
236
+ allowed_domains == o.allowed_domains &&
237
+ common_name == o.common_name &&
238
+ delete_protection == o.delete_protection &&
239
+ destination_path == o.destination_path &&
240
+ enable_scep == o.enable_scep &&
241
+ extended_key_usage == o.extended_key_usage &&
242
+ json == o.json &&
243
+ max_path_len == o.max_path_len &&
244
+ name == o.name &&
245
+ parent_ca_name == o.parent_ca_name &&
246
+ scep_password == o.scep_password &&
247
+ split_level == o.split_level &&
248
+ token == o.token &&
249
+ ttl == o.ttl &&
250
+ uid_token == o.uid_token
251
+ end
252
+
253
+ # @see the `==` method
254
+ # @param [Object] Object to be compared
255
+ def eql?(o)
256
+ self == o
257
+ end
258
+
259
+ # Calculates hash code according to all attributes.
260
+ # @return [Integer] Hash code
261
+ def hash
262
+ [alg, allowed_domains, common_name, delete_protection, destination_path, enable_scep, extended_key_usage, json, max_path_len, name, parent_ca_name, scep_password, split_level, token, ttl, uid_token].hash
263
+ end
264
+
265
+ # Builds the object from hash
266
+ # @param [Hash] attributes Model attributes in the form of hash
267
+ # @return [Object] Returns the model itself
268
+ def self.build_from_hash(attributes)
269
+ return nil unless attributes.is_a?(Hash)
270
+ attributes = attributes.transform_keys(&:to_sym)
271
+ transformed_hash = {}
272
+ openapi_types.each_pair do |key, type|
273
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = nil
275
+ elsif type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[attribute_map[key]].is_a?(Array)
279
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
280
+ end
281
+ elsif !attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
283
+ end
284
+ end
285
+ new(transformed_hash)
286
+ end
287
+
288
+ # Deserializes the data based on type
289
+ # @param string type Data type
290
+ # @param string value Value to be deserialized
291
+ # @return [Object] Deserialized data
292
+ def self._deserialize(type, value)
293
+ case type.to_sym
294
+ when :Time
295
+ Time.parse(value)
296
+ when :Date
297
+ Date.parse(value)
298
+ when :String
299
+ value.to_s
300
+ when :Integer
301
+ value.to_i
302
+ when :Float
303
+ value.to_f
304
+ when :Boolean
305
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
306
+ true
307
+ else
308
+ false
309
+ end
310
+ when :Object
311
+ # generic object (usually a Hash), return directly
312
+ value
313
+ when /\AArray<(?<inner_type>.+)>\z/
314
+ inner_type = Regexp.last_match[:inner_type]
315
+ value.map { |v| _deserialize(inner_type, v) }
316
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
317
+ k_type = Regexp.last_match[:k_type]
318
+ v_type = Regexp.last_match[:v_type]
319
+ {}.tap do |hash|
320
+ value.each do |k, v|
321
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
322
+ end
323
+ end
324
+ else # model
325
+ # models (e.g. Pet) or oneOf
326
+ klass = Akeyless.const_get(type)
327
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
328
+ end
329
+ end
330
+
331
+ # Returns the string representation of the object
332
+ # @return [String] String presentation of the object
333
+ def to_s
334
+ to_hash.to_s
335
+ end
336
+
337
+ # to_body is an alias to to_hash (backward compatibility)
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_body
340
+ to_hash
341
+ end
342
+
343
+ # Returns the object in the form of hash
344
+ # @return [Hash] Returns the object in the form of hash
345
+ def to_hash
346
+ hash = {}
347
+ self.class.attribute_map.each_pair do |attr, param|
348
+ value = self.send(attr)
349
+ if value.nil?
350
+ is_nullable = self.class.openapi_nullable.include?(attr)
351
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
352
+ end
353
+
354
+ hash[param] = _to_hash(value)
355
+ end
356
+ hash
357
+ end
358
+
359
+ # Outputs non-array value in the form of hash
360
+ # For object, use to_hash. Otherwise, just return the value
361
+ # @param [Object] value Any valid value
362
+ # @return [Hash] Returns the value in the form of hash
363
+ def _to_hash(value)
364
+ if value.is_a?(Array)
365
+ value.compact.map { |v| _to_hash(v) }
366
+ elsif value.is_a?(Hash)
367
+ {}.tap do |hash|
368
+ value.each { |k, v| hash[k] = _to_hash(v) }
369
+ end
370
+ elsif value.respond_to? :to_hash
371
+ value.to_hash
372
+ else
373
+ value
374
+ end
375
+ end
376
+
377
+ end
378
+
379
+ end
@@ -0,0 +1,250 @@
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: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GenerateIntermediateCAOutput
18
+ attr_accessor :certificate_name
19
+
20
+ attr_accessor :issuer_display_id
21
+
22
+ attr_accessor :issuer_name
23
+
24
+ attr_accessor :key_name
25
+
26
+ attr_accessor :scep_url
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'certificate_name' => :'certificate_name',
32
+ :'issuer_display_id' => :'issuer_display_id',
33
+ :'issuer_name' => :'issuer_name',
34
+ :'key_name' => :'key_name',
35
+ :'scep_url' => :'scep_url'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'certificate_name' => :'String',
48
+ :'issuer_display_id' => :'String',
49
+ :'issuer_name' => :'String',
50
+ :'key_name' => :'String',
51
+ :'scep_url' => :'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::GenerateIntermediateCAOutput` 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::GenerateIntermediateCAOutput`. 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?(:'certificate_name')
77
+ self.certificate_name = attributes[:'certificate_name']
78
+ end
79
+
80
+ if attributes.key?(:'issuer_display_id')
81
+ self.issuer_display_id = attributes[:'issuer_display_id']
82
+ end
83
+
84
+ if attributes.key?(:'issuer_name')
85
+ self.issuer_name = attributes[:'issuer_name']
86
+ end
87
+
88
+ if attributes.key?(:'key_name')
89
+ self.key_name = attributes[:'key_name']
90
+ end
91
+
92
+ if attributes.key?(:'scep_url')
93
+ self.scep_url = attributes[:'scep_url']
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
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ certificate_name == o.certificate_name &&
118
+ issuer_display_id == o.issuer_display_id &&
119
+ issuer_name == o.issuer_name &&
120
+ key_name == o.key_name &&
121
+ scep_url == o.scep_url
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [certificate_name, issuer_display_id, issuer_name, key_name, scep_url].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def self._deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = Akeyless.const_get(type)
198
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end