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,232 @@
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 GenerateAcmeEabOutput
18
+ attr_accessor :expires_at
19
+
20
+ attr_accessor :kid
21
+
22
+ attr_accessor :mac_key
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'expires_at' => :'expires_at',
28
+ :'kid' => :'kid',
29
+ :'mac_key' => :'mac_key'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'expires_at' => :'Time',
42
+ :'kid' => :'String',
43
+ :'mac_key' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GenerateAcmeEabOutput` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GenerateAcmeEabOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'expires_at')
69
+ self.expires_at = attributes[:'expires_at']
70
+ end
71
+
72
+ if attributes.key?(:'kid')
73
+ self.kid = attributes[:'kid']
74
+ end
75
+
76
+ if attributes.key?(:'mac_key')
77
+ self.mac_key = attributes[:'mac_key']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ expires_at == o.expires_at &&
102
+ kid == o.kid &&
103
+ mac_key == o.mac_key
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [expires_at, kid, mac_key].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = Akeyless.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -27,6 +27,8 @@ module Akeyless
27
27
 
28
28
  attr_accessor :group_name
29
29
 
30
+ attr_accessor :is_subclaims_with_operator
31
+
30
32
  attr_accessor :modification_date
31
33
 
32
34
  attr_accessor :user_assignments
@@ -40,6 +42,7 @@ module Akeyless
40
42
  :'group_alias' => :'group_alias',
41
43
  :'group_id' => :'group_id',
42
44
  :'group_name' => :'group_name',
45
+ :'is_subclaims_with_operator' => :'is_subclaims_with_operator',
43
46
  :'modification_date' => :'modification_date',
44
47
  :'user_assignments' => :'user_assignments'
45
48
  }
@@ -59,6 +62,7 @@ module Akeyless
59
62
  :'group_alias' => :'String',
60
63
  :'group_id' => :'String',
61
64
  :'group_name' => :'String',
65
+ :'is_subclaims_with_operator' => :'Boolean',
62
66
  :'modification_date' => :'Time',
63
67
  :'user_assignments' => :'Array<AccessPermissionAssignment>'
64
68
  }
@@ -109,6 +113,10 @@ module Akeyless
109
113
  self.group_name = attributes[:'group_name']
110
114
  end
111
115
 
116
+ if attributes.key?(:'is_subclaims_with_operator')
117
+ self.is_subclaims_with_operator = attributes[:'is_subclaims_with_operator']
118
+ end
119
+
112
120
  if attributes.key?(:'modification_date')
113
121
  self.modification_date = attributes[:'modification_date']
114
122
  end
@@ -146,6 +154,7 @@ module Akeyless
146
154
  group_alias == o.group_alias &&
147
155
  group_id == o.group_id &&
148
156
  group_name == o.group_name &&
157
+ is_subclaims_with_operator == o.is_subclaims_with_operator &&
149
158
  modification_date == o.modification_date &&
150
159
  user_assignments == o.user_assignments
151
160
  end
@@ -159,7 +168,7 @@ module Akeyless
159
168
  # Calculates hash code according to all attributes.
160
169
  # @return [Integer] Hash code
161
170
  def hash
162
- [account_id, creation_date, description, group_alias, group_id, group_name, modification_date, user_assignments].hash
171
+ [account_id, creation_date, description, group_alias, group_id, group_name, is_subclaims_with_operator, modification_date, user_assignments].hash
163
172
  end
164
173
 
165
174
  # Builds the object from hash
@@ -31,7 +31,7 @@ module Akeyless
31
31
  # Certificate Signing Request contents encoded in base64 to generate the certificate with
32
32
  attr_accessor :csr_data_base64
33
33
 
34
- # A comma-separated list of extended key usage requests which will be used for certificate issuance. Supported values: 'clientauth', 'serverauth'.
34
+ # A comma-separated list of extended key usage requests which will be used for certificate issuance. Supported values: 'clientauth', 'serverauth'. If critical is present the extension will be marked as critical
35
35
  attr_accessor :extended_key_usage
36
36
 
37
37
  # A json string that defines the requested extra extensions for the certificate
@@ -27,7 +27,7 @@ module Akeyless
27
27
  # Certificate Signing Request contents encoded in base64 to generate the certificate with
28
28
  attr_accessor :csr_data_base64
29
29
 
30
- # A comma-separated list of extended key usage requests which will be used for certificate issuance. Supported values: 'clientauth', 'serverauth'.
30
+ # A comma-separated list of extended key usage requests which will be used for certificate issuance. Supported values: 'clientauth', 'serverauth'. If critical is present the extension will be marked as critical
31
31
  attr_accessor :extended_key_usage
32
32
 
33
33
  # A json string that defines the requested extra extensions for the certificate
@@ -27,6 +27,8 @@ module Akeyless
27
27
 
28
28
  attr_accessor :group_name
29
29
 
30
+ attr_accessor :is_subclaims_with_operator
31
+
30
32
  attr_accessor :modification_date
31
33
 
32
34
  attr_accessor :user_assignments
@@ -40,6 +42,7 @@ module Akeyless
40
42
  :'group_alias' => :'group_alias',
41
43
  :'group_id' => :'group_id',
42
44
  :'group_name' => :'group_name',
45
+ :'is_subclaims_with_operator' => :'is_subclaims_with_operator',
43
46
  :'modification_date' => :'modification_date',
44
47
  :'user_assignments' => :'user_assignments'
45
48
  }
@@ -59,6 +62,7 @@ module Akeyless
59
62
  :'group_alias' => :'String',
60
63
  :'group_id' => :'String',
61
64
  :'group_name' => :'String',
65
+ :'is_subclaims_with_operator' => :'Boolean',
62
66
  :'modification_date' => :'Time',
63
67
  :'user_assignments' => :'Array<AccessPermissionAssignment>'
64
68
  }
@@ -109,6 +113,10 @@ module Akeyless
109
113
  self.group_name = attributes[:'group_name']
110
114
  end
111
115
 
116
+ if attributes.key?(:'is_subclaims_with_operator')
117
+ self.is_subclaims_with_operator = attributes[:'is_subclaims_with_operator']
118
+ end
119
+
112
120
  if attributes.key?(:'modification_date')
113
121
  self.modification_date = attributes[:'modification_date']
114
122
  end
@@ -146,6 +154,7 @@ module Akeyless
146
154
  group_alias == o.group_alias &&
147
155
  group_id == o.group_id &&
148
156
  group_name == o.group_name &&
157
+ is_subclaims_with_operator == o.is_subclaims_with_operator &&
149
158
  modification_date == o.modification_date &&
150
159
  user_assignments == o.user_assignments
151
160
  end
@@ -159,7 +168,7 @@ module Akeyless
159
168
  # Calculates hash code according to all attributes.
160
169
  # @return [Integer] Hash code
161
170
  def hash
162
- [account_id, creation_date, description, group_alias, group_id, group_name, modification_date, user_assignments].hash
171
+ [account_id, creation_date, description, group_alias, group_id, group_name, is_subclaims_with_operator, modification_date, user_assignments].hash
163
172
  end
164
173
 
165
174
  # Builds the object from hash
@@ -0,0 +1,255 @@
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
+ # listAcmeAccounts is a command lists acme external accounts for a cert issuer
18
+ class ListAcmeAccounts
19
+ # The name of the PKI certificate issuer
20
+ attr_accessor :cert_issuer_name
21
+
22
+ # Set output format to JSON
23
+ attr_accessor :json
24
+
25
+ # Authentication token (see `/auth` and `/configure`)
26
+ attr_accessor :token
27
+
28
+ # The universal identity token, Required only for universal_identity authentication
29
+ attr_accessor :uid_token
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'cert_issuer_name' => :'cert-issuer-name',
35
+ :'json' => :'json',
36
+ :'token' => :'token',
37
+ :'uid_token' => :'uid-token'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'cert_issuer_name' => :'String',
50
+ :'json' => :'Boolean',
51
+ :'token' => :'String',
52
+ :'uid_token' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::ListAcmeAccounts` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::ListAcmeAccounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'cert_issuer_name')
78
+ self.cert_issuer_name = attributes[:'cert_issuer_name']
79
+ else
80
+ self.cert_issuer_name = nil
81
+ end
82
+
83
+ if attributes.key?(:'json')
84
+ self.json = attributes[:'json']
85
+ else
86
+ self.json = false
87
+ end
88
+
89
+ if attributes.key?(:'token')
90
+ self.token = attributes[:'token']
91
+ end
92
+
93
+ if attributes.key?(:'uid_token')
94
+ self.uid_token = attributes[:'uid_token']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ if @cert_issuer_name.nil?
104
+ invalid_properties.push('invalid value for "cert_issuer_name", cert_issuer_name cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ return false if @cert_issuer_name.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ cert_issuer_name == o.cert_issuer_name &&
124
+ json == o.json &&
125
+ token == o.token &&
126
+ uid_token == o.uid_token
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [cert_issuer_name, json, token, uid_token].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = Akeyless.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end