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
@@ -120,6 +120,9 @@ module Akeyless
120
120
 
121
121
  attr_accessor :pwd
122
122
 
123
+ # (Optional) Skip server name verification
124
+ attr_accessor :skip_server_name_validation
125
+
123
126
  attr_accessor :snowflake_account
124
127
 
125
128
  # RSA Private key (base64 encoded)
@@ -182,6 +185,7 @@ module Akeyless
182
185
  :'parent_target_name' => :'parent-target-name',
183
186
  :'port' => :'port',
184
187
  :'pwd' => :'pwd',
188
+ :'skip_server_name_validation' => :'skip-server-name-validation',
185
189
  :'snowflake_account' => :'snowflake-account',
186
190
  :'snowflake_api_private_key' => :'snowflake-api-private-key',
187
191
  :'snowflake_api_private_key_password' => :'snowflake-api-private-key-password',
@@ -238,6 +242,7 @@ module Akeyless
238
242
  :'parent_target_name' => :'String',
239
243
  :'port' => :'String',
240
244
  :'pwd' => :'String',
245
+ :'skip_server_name_validation' => :'String',
241
246
  :'snowflake_account' => :'String',
242
247
  :'snowflake_api_private_key' => :'String',
243
248
  :'snowflake_api_private_key_password' => :'String',
@@ -426,6 +431,10 @@ module Akeyless
426
431
  self.pwd = attributes[:'pwd']
427
432
  end
428
433
 
434
+ if attributes.key?(:'skip_server_name_validation')
435
+ self.skip_server_name_validation = attributes[:'skip_server_name_validation']
436
+ end
437
+
429
438
  if attributes.key?(:'snowflake_account')
430
439
  self.snowflake_account = attributes[:'snowflake_account']
431
440
  end
@@ -533,6 +542,7 @@ module Akeyless
533
542
  parent_target_name == o.parent_target_name &&
534
543
  port == o.port &&
535
544
  pwd == o.pwd &&
545
+ skip_server_name_validation == o.skip_server_name_validation &&
536
546
  snowflake_account == o.snowflake_account &&
537
547
  snowflake_api_private_key == o.snowflake_api_private_key &&
538
548
  snowflake_api_private_key_password == o.snowflake_api_private_key_password &&
@@ -552,7 +562,7 @@ module Akeyless
552
562
  # Calculates hash code according to all attributes.
553
563
  # @return [Integer] Hash code
554
564
  def hash
555
- [azure_client_id, azure_client_secret, azure_tenant_id, client_certificate, client_key_passphrase, client_private_key, cloud_service_provider, cluster_mode, comment, connection_type, db_name, db_server_certificates, db_server_name, db_type, delete_protection, description, enable_mtls, host, json, keep_prev_version, key, max_versions, mongodb_atlas, mongodb_atlas_api_private_key, mongodb_atlas_api_public_key, mongodb_atlas_project_id, mongodb_default_auth_db, mongodb_uri_options, name, new_name, oracle_service_name, oracle_wallet_login_type, oracle_wallet_p12_file_data, oracle_wallet_sso_file_data, parent_target_name, port, pwd, snowflake_account, snowflake_api_private_key, snowflake_api_private_key_password, ssl, ssl_certificate, token, uid_token, user_name].hash
565
+ [azure_client_id, azure_client_secret, azure_tenant_id, client_certificate, client_key_passphrase, client_private_key, cloud_service_provider, cluster_mode, comment, connection_type, db_name, db_server_certificates, db_server_name, db_type, delete_protection, description, enable_mtls, host, json, keep_prev_version, key, max_versions, mongodb_atlas, mongodb_atlas_api_private_key, mongodb_atlas_api_public_key, mongodb_atlas_project_id, mongodb_default_auth_db, mongodb_uri_options, name, new_name, oracle_service_name, oracle_wallet_login_type, oracle_wallet_p12_file_data, oracle_wallet_sso_file_data, parent_target_name, port, pwd, skip_server_name_validation, snowflake_account, snowflake_api_private_key, snowflake_api_private_key_password, ssl, ssl_certificate, token, uid_token, user_name].hash
556
566
  end
557
567
 
558
568
  # Builds the object from hash
@@ -0,0 +1,361 @@
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
+ # targetUpdateGrok is a command that updates an existing grok (xAI) target
18
+ class TargetUpdateGrok
19
+ # API key for xAI (Grok)
20
+ attr_accessor :api_key
21
+
22
+ # Protection from accidental deletion of this object [true/false]
23
+ attr_accessor :delete_protection
24
+
25
+ # Description of the object
26
+ attr_accessor :description
27
+
28
+ # Base URL of the xAI API
29
+ attr_accessor :grok_url
30
+
31
+ # Set output format to JSON
32
+ attr_accessor :json
33
+
34
+ # Whether to keep previous version [true/false]. If not set, use default according to account settings
35
+ attr_accessor :keep_prev_version
36
+
37
+ # The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
38
+ attr_accessor :key
39
+
40
+ # Set the maximum number of versions, limited by the account settings defaults.
41
+ attr_accessor :max_versions
42
+
43
+ # Target name
44
+ attr_accessor :name
45
+
46
+ # Deprecated - use description
47
+ attr_accessor :new_comment
48
+
49
+ # New target name
50
+ attr_accessor :new_name
51
+
52
+ # ID of the team this API key belongs to
53
+ attr_accessor :team_id
54
+
55
+ # Authentication token (see `/auth` and `/configure`)
56
+ attr_accessor :token
57
+
58
+ # The universal identity token, Required only for universal_identity authentication
59
+ attr_accessor :uid_token
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'api_key' => :'api-key',
65
+ :'delete_protection' => :'delete_protection',
66
+ :'description' => :'description',
67
+ :'grok_url' => :'grok-url',
68
+ :'json' => :'json',
69
+ :'keep_prev_version' => :'keep-prev-version',
70
+ :'key' => :'key',
71
+ :'max_versions' => :'max-versions',
72
+ :'name' => :'name',
73
+ :'new_comment' => :'new-comment',
74
+ :'new_name' => :'new-name',
75
+ :'team_id' => :'team-id',
76
+ :'token' => :'token',
77
+ :'uid_token' => :'uid-token'
78
+ }
79
+ end
80
+
81
+ # Returns all the JSON keys this model knows about
82
+ def self.acceptable_attributes
83
+ attribute_map.values
84
+ end
85
+
86
+ # Attribute type mapping.
87
+ def self.openapi_types
88
+ {
89
+ :'api_key' => :'String',
90
+ :'delete_protection' => :'String',
91
+ :'description' => :'String',
92
+ :'grok_url' => :'String',
93
+ :'json' => :'Boolean',
94
+ :'keep_prev_version' => :'String',
95
+ :'key' => :'String',
96
+ :'max_versions' => :'String',
97
+ :'name' => :'String',
98
+ :'new_comment' => :'String',
99
+ :'new_name' => :'String',
100
+ :'team_id' => :'String',
101
+ :'token' => :'String',
102
+ :'uid_token' => :'String'
103
+ }
104
+ end
105
+
106
+ # List of attributes with nullable: true
107
+ def self.openapi_nullable
108
+ Set.new([
109
+ ])
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ if (!attributes.is_a?(Hash))
116
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::TargetUpdateGrok` initialize method"
117
+ end
118
+
119
+ # check to see if the attribute exists and convert string to symbol for hash key
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!self.class.attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::TargetUpdateGrok`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'api_key')
128
+ self.api_key = attributes[:'api_key']
129
+ end
130
+
131
+ if attributes.key?(:'delete_protection')
132
+ self.delete_protection = attributes[:'delete_protection']
133
+ end
134
+
135
+ if attributes.key?(:'description')
136
+ self.description = attributes[:'description']
137
+ else
138
+ self.description = 'default_comment'
139
+ end
140
+
141
+ if attributes.key?(:'grok_url')
142
+ self.grok_url = attributes[:'grok_url']
143
+ else
144
+ self.grok_url = 'https://api.x.ai/v1'
145
+ end
146
+
147
+ if attributes.key?(:'json')
148
+ self.json = attributes[:'json']
149
+ else
150
+ self.json = false
151
+ end
152
+
153
+ if attributes.key?(:'keep_prev_version')
154
+ self.keep_prev_version = attributes[:'keep_prev_version']
155
+ end
156
+
157
+ if attributes.key?(:'key')
158
+ self.key = attributes[:'key']
159
+ end
160
+
161
+ if attributes.key?(:'max_versions')
162
+ self.max_versions = attributes[:'max_versions']
163
+ end
164
+
165
+ if attributes.key?(:'name')
166
+ self.name = attributes[:'name']
167
+ else
168
+ self.name = nil
169
+ end
170
+
171
+ if attributes.key?(:'new_comment')
172
+ self.new_comment = attributes[:'new_comment']
173
+ else
174
+ self.new_comment = 'default_comment'
175
+ end
176
+
177
+ if attributes.key?(:'new_name')
178
+ self.new_name = attributes[:'new_name']
179
+ end
180
+
181
+ if attributes.key?(:'team_id')
182
+ self.team_id = attributes[:'team_id']
183
+ end
184
+
185
+ if attributes.key?(:'token')
186
+ self.token = attributes[:'token']
187
+ end
188
+
189
+ if attributes.key?(:'uid_token')
190
+ self.uid_token = attributes[:'uid_token']
191
+ end
192
+ end
193
+
194
+ # Show invalid properties with the reasons. Usually used together with valid?
195
+ # @return Array for valid properties with the reasons
196
+ def list_invalid_properties
197
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
198
+ invalid_properties = Array.new
199
+ if @name.nil?
200
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
201
+ end
202
+
203
+ invalid_properties
204
+ end
205
+
206
+ # Check to see if the all the properties in the model are valid
207
+ # @return true if the model is valid
208
+ def valid?
209
+ warn '[DEPRECATED] the `valid?` method is obsolete'
210
+ return false if @name.nil?
211
+ true
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ api_key == o.api_key &&
220
+ delete_protection == o.delete_protection &&
221
+ description == o.description &&
222
+ grok_url == o.grok_url &&
223
+ json == o.json &&
224
+ keep_prev_version == o.keep_prev_version &&
225
+ key == o.key &&
226
+ max_versions == o.max_versions &&
227
+ name == o.name &&
228
+ new_comment == o.new_comment &&
229
+ new_name == o.new_name &&
230
+ team_id == o.team_id &&
231
+ token == o.token &&
232
+ uid_token == o.uid_token
233
+ end
234
+
235
+ # @see the `==` method
236
+ # @param [Object] Object to be compared
237
+ def eql?(o)
238
+ self == o
239
+ end
240
+
241
+ # Calculates hash code according to all attributes.
242
+ # @return [Integer] Hash code
243
+ def hash
244
+ [api_key, delete_protection, description, grok_url, json, keep_prev_version, key, max_versions, name, new_comment, new_name, team_id, token, uid_token].hash
245
+ end
246
+
247
+ # Builds the object from hash
248
+ # @param [Hash] attributes Model attributes in the form of hash
249
+ # @return [Object] Returns the model itself
250
+ def self.build_from_hash(attributes)
251
+ return nil unless attributes.is_a?(Hash)
252
+ attributes = attributes.transform_keys(&:to_sym)
253
+ transformed_hash = {}
254
+ openapi_types.each_pair do |key, type|
255
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
256
+ transformed_hash["#{key}"] = nil
257
+ elsif type =~ /\AArray<(.*)>/i
258
+ # check to ensure the input is an array given that the attribute
259
+ # is documented as an array but the input is not
260
+ if attributes[attribute_map[key]].is_a?(Array)
261
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
262
+ end
263
+ elsif !attributes[attribute_map[key]].nil?
264
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
265
+ end
266
+ end
267
+ new(transformed_hash)
268
+ end
269
+
270
+ # Deserializes the data based on type
271
+ # @param string type Data type
272
+ # @param string value Value to be deserialized
273
+ # @return [Object] Deserialized data
274
+ def self._deserialize(type, value)
275
+ case type.to_sym
276
+ when :Time
277
+ Time.parse(value)
278
+ when :Date
279
+ Date.parse(value)
280
+ when :String
281
+ value.to_s
282
+ when :Integer
283
+ value.to_i
284
+ when :Float
285
+ value.to_f
286
+ when :Boolean
287
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
288
+ true
289
+ else
290
+ false
291
+ end
292
+ when :Object
293
+ # generic object (usually a Hash), return directly
294
+ value
295
+ when /\AArray<(?<inner_type>.+)>\z/
296
+ inner_type = Regexp.last_match[:inner_type]
297
+ value.map { |v| _deserialize(inner_type, v) }
298
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
299
+ k_type = Regexp.last_match[:k_type]
300
+ v_type = Regexp.last_match[:v_type]
301
+ {}.tap do |hash|
302
+ value.each do |k, v|
303
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
304
+ end
305
+ end
306
+ else # model
307
+ # models (e.g. Pet) or oneOf
308
+ klass = Akeyless.const_get(type)
309
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
310
+ end
311
+ end
312
+
313
+ # Returns the string representation of the object
314
+ # @return [String] String presentation of the object
315
+ def to_s
316
+ to_hash.to_s
317
+ end
318
+
319
+ # to_body is an alias to to_hash (backward compatibility)
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_body
322
+ to_hash
323
+ end
324
+
325
+ # Returns the object in the form of hash
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_hash
328
+ hash = {}
329
+ self.class.attribute_map.each_pair do |attr, param|
330
+ value = self.send(attr)
331
+ if value.nil?
332
+ is_nullable = self.class.openapi_nullable.include?(attr)
333
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
334
+ end
335
+
336
+ hash[param] = _to_hash(value)
337
+ end
338
+ hash
339
+ end
340
+
341
+ # Outputs non-array value in the form of hash
342
+ # For object, use to_hash. Otherwise, just return the value
343
+ # @param [Object] value Any valid value
344
+ # @return [Hash] Returns the value in the form of hash
345
+ def _to_hash(value)
346
+ if value.is_a?(Array)
347
+ value.compact.map { |v| _to_hash(v) }
348
+ elsif value.is_a?(Hash)
349
+ {}.tap do |hash|
350
+ value.each { |k, v| hash[k] = _to_hash(v) }
351
+ end
352
+ elsif value.respond_to? :to_hash
353
+ value.to_hash
354
+ else
355
+ value
356
+ end
357
+ end
358
+
359
+ end
360
+
361
+ end