akeyless 5.0.28 → 5.0.30

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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -1
  3. data/docs/AccountGeneralSettings.md +4 -0
  4. data/docs/AnthropicTargetDetails.md +20 -0
  5. data/docs/AuthMethod.md +3 -1
  6. data/docs/AuthMethodAccessInfo.md +2 -0
  7. data/docs/AuthMethodCreateSAML.md +3 -1
  8. data/docs/AuthMethodCreateUniversalIdentity.md +2 -0
  9. data/docs/AuthMethodUpdateSAML.md +3 -1
  10. data/docs/AuthMethodUpdateUniversalIdentity.md +2 -0
  11. data/docs/BedrockTargetDetails.md +20 -0
  12. data/docs/CreateAuthMethodSAML.md +3 -1
  13. data/docs/CreateAuthMethodUniversalIdentity.md +2 -0
  14. data/docs/CreateDBTarget.md +2 -0
  15. data/docs/CreateMcpSecretBearerToken.md +46 -0
  16. data/docs/CreateMcpSecretOAuthAuthCode.md +56 -0
  17. data/docs/CreateMcpSecretOAuthClientCreds.md +52 -0
  18. data/docs/CreatePKICertIssuer.md +1 -1
  19. data/docs/CustomDnsTargetDetails.md +20 -0
  20. data/docs/DSProducerDetails.md +2 -0
  21. data/docs/DbTargetDetails.md +2 -0
  22. data/docs/EmailCustomization.md +28 -0
  23. data/docs/EmailCustomizationAccountInformation.md +24 -0
  24. data/docs/EmailCustomizationAccountInformationValues.md +24 -0
  25. data/docs/EsmGetSecretOutput.md +4 -0
  26. data/docs/FileDownloadInstructions.md +20 -0
  27. data/docs/FileInfo.md +50 -0
  28. data/docs/GatewayCreateMigration.md +2 -0
  29. data/docs/GatewayUpdateMigration.md +2 -0
  30. data/docs/GetKubeExecCreds.md +1 -1
  31. data/docs/GetPKICertificate.md +1 -1
  32. data/docs/GrokTargetDetails.md +22 -0
  33. data/docs/HashiPayload.md +2 -0
  34. data/docs/Item.md +2 -0
  35. data/docs/KeycloakTargetDetails.md +24 -0
  36. data/docs/OktaTargetDetails.md +20 -0
  37. data/docs/RuntimeAuthorityCommand.md +4 -0
  38. data/docs/SAMLAccessRules.md +3 -1
  39. data/docs/StaticSecretDetailsInfo.md +2 -0
  40. data/docs/TargetCreateAnthropic.md +36 -0
  41. data/docs/TargetCreateBedrock.md +36 -0
  42. data/docs/TargetCreateCustomDns.md +36 -0
  43. data/docs/TargetCreateDB.md +2 -0
  44. data/docs/TargetCreateGrok.md +38 -0
  45. data/docs/TargetCreateKeycloak.md +40 -0
  46. data/docs/TargetCreateOkta.md +36 -0
  47. data/docs/TargetTypeDetailsInput.md +12 -0
  48. data/docs/TargetUpdateAnthropic.md +42 -0
  49. data/docs/TargetUpdateBedrock.md +42 -0
  50. data/docs/TargetUpdateCustomDns.md +40 -0
  51. data/docs/TargetUpdateDB.md +2 -0
  52. data/docs/TargetUpdateGrok.md +44 -0
  53. data/docs/TargetUpdateKeycloak.md +44 -0
  54. data/docs/TargetUpdateOkta.md +40 -0
  55. data/docs/UidExpirationEvent.md +18 -0
  56. data/docs/UpdateAuthMethodSAML.md +3 -1
  57. data/docs/UpdateAuthMethodUniversalIdentity.md +2 -0
  58. data/docs/UpdateDBTarget.md +2 -0
  59. data/docs/UpdateMcpSecretBearerToken.md +40 -0
  60. data/docs/UpdateMcpSecretOAuthAuthCode.md +50 -0
  61. data/docs/UpdateMcpSecretOAuthClientCreds.md +46 -0
  62. data/docs/UpdatePKICertIssuer.md +1 -1
  63. data/docs/UscGetSecretOutput.md +4 -0
  64. data/docs/V2Api.md +1134 -0
  65. data/lib/akeyless/api/v2_api.rb +1249 -97
  66. data/lib/akeyless/models/account_general_settings.rb +20 -1
  67. data/lib/akeyless/models/anthropic_target_details.rb +224 -0
  68. data/lib/akeyless/models/auth_method.rb +15 -4
  69. data/lib/akeyless/models/auth_method_access_info.rb +13 -1
  70. data/lib/akeyless/models/auth_method_create_saml.rb +14 -4
  71. data/lib/akeyless/models/auth_method_create_universal_identity.rb +13 -1
  72. data/lib/akeyless/models/auth_method_update_saml.rb +14 -4
  73. data/lib/akeyless/models/auth_method_update_universal_identity.rb +13 -1
  74. data/lib/akeyless/models/bedrock_target_details.rb +224 -0
  75. data/lib/akeyless/models/create_auth_method_saml.rb +14 -4
  76. data/lib/akeyless/models/create_auth_method_universal_identity.rb +13 -1
  77. data/lib/akeyless/models/create_db_target.rb +11 -1
  78. data/lib/akeyless/models/create_mcp_secret_bearer_token.rb +371 -0
  79. data/lib/akeyless/models/create_mcp_secret_o_auth_auth_code.rb +423 -0
  80. data/lib/akeyless/models/create_mcp_secret_o_auth_client_creds.rb +403 -0
  81. data/lib/akeyless/models/create_pki_cert_issuer.rb +1 -1
  82. data/lib/akeyless/models/custom_dns_target_details.rb +225 -0
  83. data/lib/akeyless/models/db_target_details.rb +11 -1
  84. data/lib/akeyless/models/ds_producer_details.rb +11 -1
  85. data/lib/akeyless/models/email_customization.rb +259 -0
  86. data/lib/akeyless/models/email_customization_account_information.rb +242 -0
  87. data/lib/akeyless/models/email_customization_account_information_values.rb +241 -0
  88. data/lib/akeyless/models/esm_get_secret_output.rb +19 -1
  89. data/lib/akeyless/models/file_download_instructions.rb +223 -0
  90. data/lib/akeyless/models/file_info.rb +358 -0
  91. data/lib/akeyless/models/gateway_create_migration.rb +11 -1
  92. data/lib/akeyless/models/gateway_update_migration.rb +11 -1
  93. data/lib/akeyless/models/get_kube_exec_creds.rb +1 -1
  94. data/lib/akeyless/models/get_pki_certificate.rb +1 -1
  95. data/lib/akeyless/models/grok_target_details.rb +234 -0
  96. data/lib/akeyless/models/hashi_payload.rb +10 -1
  97. data/lib/akeyless/models/item.rb +10 -1
  98. data/lib/akeyless/models/keycloak_target_details.rb +242 -0
  99. data/lib/akeyless/models/okta_target_details.rb +224 -0
  100. data/lib/akeyless/models/runtime_authority_command.rb +21 -1
  101. data/lib/akeyless/models/saml_access_rules.rb +14 -4
  102. data/lib/akeyless/models/static_secret_details_info.rb +10 -1
  103. data/lib/akeyless/models/target_create_anthropic.rb +317 -0
  104. data/lib/akeyless/models/target_create_bedrock.rb +317 -0
  105. data/lib/akeyless/models/target_create_custom_dns.rb +330 -0
  106. data/lib/akeyless/models/target_create_db.rb +11 -1
  107. data/lib/akeyless/models/target_create_grok.rb +327 -0
  108. data/lib/akeyless/models/target_create_keycloak.rb +334 -0
  109. data/lib/akeyless/models/target_create_okta.rb +314 -0
  110. data/lib/akeyless/models/target_type_details_input.rb +55 -1
  111. data/lib/akeyless/models/target_update_anthropic.rb +351 -0
  112. data/lib/akeyless/models/target_update_bedrock.rb +351 -0
  113. data/lib/akeyless/models/target_update_custom_dns.rb +350 -0
  114. data/lib/akeyless/models/target_update_db.rb +11 -1
  115. data/lib/akeyless/models/target_update_grok.rb +361 -0
  116. data/lib/akeyless/models/target_update_keycloak.rb +354 -0
  117. data/lib/akeyless/models/target_update_okta.rb +334 -0
  118. data/lib/akeyless/models/uid_expiration_event.rb +214 -0
  119. data/lib/akeyless/models/update_auth_method_saml.rb +14 -4
  120. data/lib/akeyless/models/update_auth_method_universal_identity.rb +13 -1
  121. data/lib/akeyless/models/update_db_target.rb +11 -1
  122. data/lib/akeyless/models/update_mcp_secret_bearer_token.rb +338 -0
  123. data/lib/akeyless/models/update_mcp_secret_o_auth_auth_code.rb +390 -0
  124. data/lib/akeyless/models/update_mcp_secret_o_auth_client_creds.rb +370 -0
  125. data/lib/akeyless/models/update_pki_cert_issuer.rb +1 -1
  126. data/lib/akeyless/models/usc_get_secret_output.rb +19 -1
  127. data/lib/akeyless/version.rb +1 -1
  128. data/lib/akeyless.rb +30 -0
  129. data/spec/models/anthropic_target_details_spec.rb +42 -0
  130. data/spec/models/bedrock_target_details_spec.rb +42 -0
  131. data/spec/models/create_mcp_secret_bearer_token_spec.rb +120 -0
  132. data/spec/models/create_mcp_secret_o_auth_auth_code_spec.rb +150 -0
  133. data/spec/models/create_mcp_secret_o_auth_client_creds_spec.rb +138 -0
  134. data/spec/models/custom_dns_target_details_spec.rb +42 -0
  135. data/spec/models/email_customization_account_information_spec.rb +54 -0
  136. data/spec/models/email_customization_account_information_values_spec.rb +54 -0
  137. data/spec/models/email_customization_spec.rb +66 -0
  138. data/spec/models/file_download_instructions_spec.rb +42 -0
  139. data/spec/models/file_info_spec.rb +132 -0
  140. data/spec/models/grok_target_details_spec.rb +48 -0
  141. data/spec/models/keycloak_target_details_spec.rb +54 -0
  142. data/spec/models/okta_target_details_spec.rb +42 -0
  143. data/spec/models/target_create_anthropic_spec.rb +90 -0
  144. data/spec/models/target_create_bedrock_spec.rb +90 -0
  145. data/spec/models/target_create_custom_dns_spec.rb +90 -0
  146. data/spec/models/target_create_grok_spec.rb +96 -0
  147. data/spec/models/target_create_keycloak_spec.rb +102 -0
  148. data/spec/models/target_create_okta_spec.rb +90 -0
  149. data/spec/models/target_update_anthropic_spec.rb +108 -0
  150. data/spec/models/target_update_bedrock_spec.rb +108 -0
  151. data/spec/models/target_update_custom_dns_spec.rb +102 -0
  152. data/spec/models/target_update_grok_spec.rb +114 -0
  153. data/spec/models/target_update_keycloak_spec.rb +114 -0
  154. data/spec/models/target_update_okta_spec.rb +102 -0
  155. data/spec/models/uid_expiration_event_spec.rb +36 -0
  156. data/spec/models/update_mcp_secret_bearer_token_spec.rb +102 -0
  157. data/spec/models/update_mcp_secret_o_auth_auth_code_spec.rb +132 -0
  158. data/spec/models/update_mcp_secret_o_auth_client_creds_spec.rb +120 -0
  159. metadata +1295 -1175
@@ -0,0 +1,423 @@
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 CreateMcpSecretOAuthAuthCode
18
+ # for personal password manager
19
+ attr_accessor :accessibility
20
+
21
+ # Protection from accidental deletion of this object [true/false]
22
+ attr_accessor :delete_protection
23
+
24
+ # Description of the object
25
+ attr_accessor :description
26
+
27
+ # Agentic input rule in name=...,rule=... format (e.g. name=rule1,rule=Sanitize input)
28
+ attr_accessor :input_rule
29
+
30
+ # Set output format to JSON
31
+ attr_accessor :json
32
+
33
+ # Set the maximum number of versions, limited by the account settings defaults.
34
+ attr_accessor :max_versions
35
+
36
+ # Deprecated - use description
37
+ attr_accessor :metadata
38
+
39
+ # Secret name
40
+ attr_accessor :name
41
+
42
+ # OAuth client ID
43
+ attr_accessor :oauth_client_id
44
+
45
+ # OAuth client secret
46
+ attr_accessor :oauth_client_secret
47
+
48
+ # OAuth redirect URI
49
+ attr_accessor :oauth_redirect_uri
50
+
51
+ # OAuth refresh token
52
+ attr_accessor :oauth_refresh_token
53
+
54
+ # OAuth scopes
55
+ attr_accessor :oauth_scopes
56
+
57
+ # OAuth token URL
58
+ attr_accessor :oauth_token_url
59
+
60
+ # Agentic output rule in name=...,rule=... format (e.g. name=rule1,rule=Mask secrets)
61
+ attr_accessor :output_rule
62
+
63
+ attr_accessor :protection_key
64
+
65
+ # Add tags attached to this object
66
+ attr_accessor :tags
67
+
68
+ # Authentication token (see `/auth` and `/configure`)
69
+ attr_accessor :token
70
+
71
+ # The universal identity token, Required only for universal_identity authentication
72
+ attr_accessor :uid_token
73
+
74
+ # URL of the service
75
+ attr_accessor :url
76
+
77
+ # Attribute mapping from ruby-style variable name to JSON key.
78
+ def self.attribute_map
79
+ {
80
+ :'accessibility' => :'accessibility',
81
+ :'delete_protection' => :'delete_protection',
82
+ :'description' => :'description',
83
+ :'input_rule' => :'input-rule',
84
+ :'json' => :'json',
85
+ :'max_versions' => :'max-versions',
86
+ :'metadata' => :'metadata',
87
+ :'name' => :'name',
88
+ :'oauth_client_id' => :'oauth-client-id',
89
+ :'oauth_client_secret' => :'oauth-client-secret',
90
+ :'oauth_redirect_uri' => :'oauth-redirect-uri',
91
+ :'oauth_refresh_token' => :'oauth-refresh-token',
92
+ :'oauth_scopes' => :'oauth-scopes',
93
+ :'oauth_token_url' => :'oauth-token-url',
94
+ :'output_rule' => :'output-rule',
95
+ :'protection_key' => :'protection_key',
96
+ :'tags' => :'tags',
97
+ :'token' => :'token',
98
+ :'uid_token' => :'uid-token',
99
+ :'url' => :'url'
100
+ }
101
+ end
102
+
103
+ # Returns all the JSON keys this model knows about
104
+ def self.acceptable_attributes
105
+ attribute_map.values
106
+ end
107
+
108
+ # Attribute type mapping.
109
+ def self.openapi_types
110
+ {
111
+ :'accessibility' => :'String',
112
+ :'delete_protection' => :'String',
113
+ :'description' => :'String',
114
+ :'input_rule' => :'Array<String>',
115
+ :'json' => :'Boolean',
116
+ :'max_versions' => :'String',
117
+ :'metadata' => :'String',
118
+ :'name' => :'String',
119
+ :'oauth_client_id' => :'String',
120
+ :'oauth_client_secret' => :'String',
121
+ :'oauth_redirect_uri' => :'String',
122
+ :'oauth_refresh_token' => :'String',
123
+ :'oauth_scopes' => :'Array<String>',
124
+ :'oauth_token_url' => :'String',
125
+ :'output_rule' => :'Array<String>',
126
+ :'protection_key' => :'String',
127
+ :'tags' => :'Array<String>',
128
+ :'token' => :'String',
129
+ :'uid_token' => :'String',
130
+ :'url' => :'String'
131
+ }
132
+ end
133
+
134
+ # List of attributes with nullable: true
135
+ def self.openapi_nullable
136
+ Set.new([
137
+ ])
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ if (!attributes.is_a?(Hash))
144
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::CreateMcpSecretOAuthAuthCode` initialize method"
145
+ end
146
+
147
+ # check to see if the attribute exists and convert string to symbol for hash key
148
+ attributes = attributes.each_with_object({}) { |(k, v), h|
149
+ if (!self.class.attribute_map.key?(k.to_sym))
150
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::CreateMcpSecretOAuthAuthCode`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
151
+ end
152
+ h[k.to_sym] = v
153
+ }
154
+
155
+ if attributes.key?(:'accessibility')
156
+ self.accessibility = attributes[:'accessibility']
157
+ else
158
+ self.accessibility = 'regular'
159
+ end
160
+
161
+ if attributes.key?(:'delete_protection')
162
+ self.delete_protection = attributes[:'delete_protection']
163
+ end
164
+
165
+ if attributes.key?(:'description')
166
+ self.description = attributes[:'description']
167
+ end
168
+
169
+ if attributes.key?(:'input_rule')
170
+ if (value = attributes[:'input_rule']).is_a?(Array)
171
+ self.input_rule = value
172
+ end
173
+ end
174
+
175
+ if attributes.key?(:'json')
176
+ self.json = attributes[:'json']
177
+ else
178
+ self.json = false
179
+ end
180
+
181
+ if attributes.key?(:'max_versions')
182
+ self.max_versions = attributes[:'max_versions']
183
+ end
184
+
185
+ if attributes.key?(:'metadata')
186
+ self.metadata = attributes[:'metadata']
187
+ end
188
+
189
+ if attributes.key?(:'name')
190
+ self.name = attributes[:'name']
191
+ else
192
+ self.name = nil
193
+ end
194
+
195
+ if attributes.key?(:'oauth_client_id')
196
+ self.oauth_client_id = attributes[:'oauth_client_id']
197
+ end
198
+
199
+ if attributes.key?(:'oauth_client_secret')
200
+ self.oauth_client_secret = attributes[:'oauth_client_secret']
201
+ end
202
+
203
+ if attributes.key?(:'oauth_redirect_uri')
204
+ self.oauth_redirect_uri = attributes[:'oauth_redirect_uri']
205
+ end
206
+
207
+ if attributes.key?(:'oauth_refresh_token')
208
+ self.oauth_refresh_token = attributes[:'oauth_refresh_token']
209
+ end
210
+
211
+ if attributes.key?(:'oauth_scopes')
212
+ if (value = attributes[:'oauth_scopes']).is_a?(Array)
213
+ self.oauth_scopes = value
214
+ end
215
+ end
216
+
217
+ if attributes.key?(:'oauth_token_url')
218
+ self.oauth_token_url = attributes[:'oauth_token_url']
219
+ end
220
+
221
+ if attributes.key?(:'output_rule')
222
+ if (value = attributes[:'output_rule']).is_a?(Array)
223
+ self.output_rule = value
224
+ end
225
+ end
226
+
227
+ if attributes.key?(:'protection_key')
228
+ self.protection_key = attributes[:'protection_key']
229
+ end
230
+
231
+ if attributes.key?(:'tags')
232
+ if (value = attributes[:'tags']).is_a?(Array)
233
+ self.tags = value
234
+ end
235
+ end
236
+
237
+ if attributes.key?(:'token')
238
+ self.token = attributes[:'token']
239
+ end
240
+
241
+ if attributes.key?(:'uid_token')
242
+ self.uid_token = attributes[:'uid_token']
243
+ end
244
+
245
+ if attributes.key?(:'url')
246
+ self.url = attributes[:'url']
247
+ end
248
+ end
249
+
250
+ # Show invalid properties with the reasons. Usually used together with valid?
251
+ # @return Array for valid properties with the reasons
252
+ def list_invalid_properties
253
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
254
+ invalid_properties = Array.new
255
+ if @name.nil?
256
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
257
+ end
258
+
259
+ invalid_properties
260
+ end
261
+
262
+ # Check to see if the all the properties in the model are valid
263
+ # @return true if the model is valid
264
+ def valid?
265
+ warn '[DEPRECATED] the `valid?` method is obsolete'
266
+ return false if @name.nil?
267
+ true
268
+ end
269
+
270
+ # Checks equality by comparing each attribute.
271
+ # @param [Object] Object to be compared
272
+ def ==(o)
273
+ return true if self.equal?(o)
274
+ self.class == o.class &&
275
+ accessibility == o.accessibility &&
276
+ delete_protection == o.delete_protection &&
277
+ description == o.description &&
278
+ input_rule == o.input_rule &&
279
+ json == o.json &&
280
+ max_versions == o.max_versions &&
281
+ metadata == o.metadata &&
282
+ name == o.name &&
283
+ oauth_client_id == o.oauth_client_id &&
284
+ oauth_client_secret == o.oauth_client_secret &&
285
+ oauth_redirect_uri == o.oauth_redirect_uri &&
286
+ oauth_refresh_token == o.oauth_refresh_token &&
287
+ oauth_scopes == o.oauth_scopes &&
288
+ oauth_token_url == o.oauth_token_url &&
289
+ output_rule == o.output_rule &&
290
+ protection_key == o.protection_key &&
291
+ tags == o.tags &&
292
+ token == o.token &&
293
+ uid_token == o.uid_token &&
294
+ url == o.url
295
+ end
296
+
297
+ # @see the `==` method
298
+ # @param [Object] Object to be compared
299
+ def eql?(o)
300
+ self == o
301
+ end
302
+
303
+ # Calculates hash code according to all attributes.
304
+ # @return [Integer] Hash code
305
+ def hash
306
+ [accessibility, delete_protection, description, input_rule, json, max_versions, metadata, name, oauth_client_id, oauth_client_secret, oauth_redirect_uri, oauth_refresh_token, oauth_scopes, oauth_token_url, output_rule, protection_key, tags, token, uid_token, url].hash
307
+ end
308
+
309
+ # Builds the object from hash
310
+ # @param [Hash] attributes Model attributes in the form of hash
311
+ # @return [Object] Returns the model itself
312
+ def self.build_from_hash(attributes)
313
+ return nil unless attributes.is_a?(Hash)
314
+ attributes = attributes.transform_keys(&:to_sym)
315
+ transformed_hash = {}
316
+ openapi_types.each_pair do |key, type|
317
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
318
+ transformed_hash["#{key}"] = nil
319
+ elsif type =~ /\AArray<(.*)>/i
320
+ # check to ensure the input is an array given that the attribute
321
+ # is documented as an array but the input is not
322
+ if attributes[attribute_map[key]].is_a?(Array)
323
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
324
+ end
325
+ elsif !attributes[attribute_map[key]].nil?
326
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
327
+ end
328
+ end
329
+ new(transformed_hash)
330
+ end
331
+
332
+ # Deserializes the data based on type
333
+ # @param string type Data type
334
+ # @param string value Value to be deserialized
335
+ # @return [Object] Deserialized data
336
+ def self._deserialize(type, value)
337
+ case type.to_sym
338
+ when :Time
339
+ Time.parse(value)
340
+ when :Date
341
+ Date.parse(value)
342
+ when :String
343
+ value.to_s
344
+ when :Integer
345
+ value.to_i
346
+ when :Float
347
+ value.to_f
348
+ when :Boolean
349
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
350
+ true
351
+ else
352
+ false
353
+ end
354
+ when :Object
355
+ # generic object (usually a Hash), return directly
356
+ value
357
+ when /\AArray<(?<inner_type>.+)>\z/
358
+ inner_type = Regexp.last_match[:inner_type]
359
+ value.map { |v| _deserialize(inner_type, v) }
360
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
361
+ k_type = Regexp.last_match[:k_type]
362
+ v_type = Regexp.last_match[:v_type]
363
+ {}.tap do |hash|
364
+ value.each do |k, v|
365
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
366
+ end
367
+ end
368
+ else # model
369
+ # models (e.g. Pet) or oneOf
370
+ klass = Akeyless.const_get(type)
371
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
372
+ end
373
+ end
374
+
375
+ # Returns the string representation of the object
376
+ # @return [String] String presentation of the object
377
+ def to_s
378
+ to_hash.to_s
379
+ end
380
+
381
+ # to_body is an alias to to_hash (backward compatibility)
382
+ # @return [Hash] Returns the object in the form of hash
383
+ def to_body
384
+ to_hash
385
+ end
386
+
387
+ # Returns the object in the form of hash
388
+ # @return [Hash] Returns the object in the form of hash
389
+ def to_hash
390
+ hash = {}
391
+ self.class.attribute_map.each_pair do |attr, param|
392
+ value = self.send(attr)
393
+ if value.nil?
394
+ is_nullable = self.class.openapi_nullable.include?(attr)
395
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
396
+ end
397
+
398
+ hash[param] = _to_hash(value)
399
+ end
400
+ hash
401
+ end
402
+
403
+ # Outputs non-array value in the form of hash
404
+ # For object, use to_hash. Otherwise, just return the value
405
+ # @param [Object] value Any valid value
406
+ # @return [Hash] Returns the value in the form of hash
407
+ def _to_hash(value)
408
+ if value.is_a?(Array)
409
+ value.compact.map { |v| _to_hash(v) }
410
+ elsif value.is_a?(Hash)
411
+ {}.tap do |hash|
412
+ value.each { |k, v| hash[k] = _to_hash(v) }
413
+ end
414
+ elsif value.respond_to? :to_hash
415
+ value.to_hash
416
+ else
417
+ value
418
+ end
419
+ end
420
+
421
+ end
422
+
423
+ end