akeyless 5.0.30 → 5.0.31

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.
@@ -30186,6 +30186,70 @@ module Akeyless
30186
30186
  return data, status_code, headers
30187
30187
  end
30188
30188
 
30189
+ # @param target_create_aerospike [TargetCreateAerospike]
30190
+ # @param [Hash] opts the optional parameters
30191
+ # @return [TargetCreateOutput]
30192
+ def target_create_aerospike(target_create_aerospike, opts = {})
30193
+ data, _status_code, _headers = target_create_aerospike_with_http_info(target_create_aerospike, opts)
30194
+ data
30195
+ end
30196
+
30197
+ # @param target_create_aerospike [TargetCreateAerospike]
30198
+ # @param [Hash] opts the optional parameters
30199
+ # @return [Array<(TargetCreateOutput, Integer, Hash)>] TargetCreateOutput data, response status code and response headers
30200
+ def target_create_aerospike_with_http_info(target_create_aerospike, opts = {})
30201
+ if @api_client.config.debugging
30202
+ @api_client.config.logger.debug 'Calling API: V2Api.target_create_aerospike ...'
30203
+ end
30204
+ # verify the required parameter 'target_create_aerospike' is set
30205
+ if @api_client.config.client_side_validation && target_create_aerospike.nil?
30206
+ fail ArgumentError, "Missing the required parameter 'target_create_aerospike' when calling V2Api.target_create_aerospike"
30207
+ end
30208
+ # resource path
30209
+ local_var_path = '/target-create-aerospike'
30210
+
30211
+ # query parameters
30212
+ query_params = opts[:query_params] || {}
30213
+
30214
+ # header parameters
30215
+ header_params = opts[:header_params] || {}
30216
+ # HTTP header 'Accept' (if needed)
30217
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
30218
+ # HTTP header 'Content-Type'
30219
+ content_type = @api_client.select_header_content_type(['application/json'])
30220
+ if !content_type.nil?
30221
+ header_params['Content-Type'] = content_type
30222
+ end
30223
+
30224
+ # form parameters
30225
+ form_params = opts[:form_params] || {}
30226
+
30227
+ # http body (model)
30228
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(target_create_aerospike)
30229
+
30230
+ # return_type
30231
+ return_type = opts[:debug_return_type] || 'TargetCreateOutput'
30232
+
30233
+ # auth_names
30234
+ auth_names = opts[:debug_auth_names] || []
30235
+
30236
+ new_options = opts.merge(
30237
+ :operation => :"V2Api.target_create_aerospike",
30238
+ :header_params => header_params,
30239
+ :query_params => query_params,
30240
+ :form_params => form_params,
30241
+ :body => post_body,
30242
+ :auth_names => auth_names,
30243
+ :return_type => return_type
30244
+ )
30245
+
30246
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
30247
+ if @api_client.config.debugging
30248
+ @api_client.config.logger.debug "API called: V2Api#target_create_aerospike\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
30249
+ end
30250
+ return data, status_code, headers
30251
+ end
30252
+
30189
30253
  # @param target_create_anthropic [TargetCreateAnthropic]
30190
30254
  # @param [Hash] opts the optional parameters
30191
30255
  # @return [TargetCreateOutput]
@@ -32874,6 +32938,70 @@ module Akeyless
32874
32938
  return data, status_code, headers
32875
32939
  end
32876
32940
 
32941
+ # @param target_update_aerospike [TargetUpdateAerospike]
32942
+ # @param [Hash] opts the optional parameters
32943
+ # @return [TargetUpdateOutput]
32944
+ def target_update_aerospike(target_update_aerospike, opts = {})
32945
+ data, _status_code, _headers = target_update_aerospike_with_http_info(target_update_aerospike, opts)
32946
+ data
32947
+ end
32948
+
32949
+ # @param target_update_aerospike [TargetUpdateAerospike]
32950
+ # @param [Hash] opts the optional parameters
32951
+ # @return [Array<(TargetUpdateOutput, Integer, Hash)>] TargetUpdateOutput data, response status code and response headers
32952
+ def target_update_aerospike_with_http_info(target_update_aerospike, opts = {})
32953
+ if @api_client.config.debugging
32954
+ @api_client.config.logger.debug 'Calling API: V2Api.target_update_aerospike ...'
32955
+ end
32956
+ # verify the required parameter 'target_update_aerospike' is set
32957
+ if @api_client.config.client_side_validation && target_update_aerospike.nil?
32958
+ fail ArgumentError, "Missing the required parameter 'target_update_aerospike' when calling V2Api.target_update_aerospike"
32959
+ end
32960
+ # resource path
32961
+ local_var_path = '/target-update-aerospike'
32962
+
32963
+ # query parameters
32964
+ query_params = opts[:query_params] || {}
32965
+
32966
+ # header parameters
32967
+ header_params = opts[:header_params] || {}
32968
+ # HTTP header 'Accept' (if needed)
32969
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
32970
+ # HTTP header 'Content-Type'
32971
+ content_type = @api_client.select_header_content_type(['application/json'])
32972
+ if !content_type.nil?
32973
+ header_params['Content-Type'] = content_type
32974
+ end
32975
+
32976
+ # form parameters
32977
+ form_params = opts[:form_params] || {}
32978
+
32979
+ # http body (model)
32980
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(target_update_aerospike)
32981
+
32982
+ # return_type
32983
+ return_type = opts[:debug_return_type] || 'TargetUpdateOutput'
32984
+
32985
+ # auth_names
32986
+ auth_names = opts[:debug_auth_names] || []
32987
+
32988
+ new_options = opts.merge(
32989
+ :operation => :"V2Api.target_update_aerospike",
32990
+ :header_params => header_params,
32991
+ :query_params => query_params,
32992
+ :form_params => form_params,
32993
+ :body => post_body,
32994
+ :auth_names => auth_names,
32995
+ :return_type => return_type
32996
+ )
32997
+
32998
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
32999
+ if @api_client.config.debugging
33000
+ @api_client.config.logger.debug "API called: V2Api#target_update_aerospike\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
33001
+ end
33002
+ return data, status_code, headers
33003
+ end
33004
+
32877
33005
  # @param target_update_anthropic [TargetUpdateAnthropic]
32878
33006
  # @param [Hash] opts the optional parameters
32879
33007
  # @return [TargetUpdateOutput]
@@ -0,0 +1,512 @@
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 AerospikeTargetDetails
18
+ attr_accessor :aerospike_admin_username
19
+
20
+ attr_accessor :aerospike_client_id
21
+
22
+ attr_accessor :aerospike_client_secret
23
+
24
+ attr_accessor :aerospike_cloud
25
+
26
+ attr_accessor :aerospike_cluster_id
27
+
28
+ attr_accessor :aerospike_hostname
29
+
30
+ attr_accessor :aerospike_namespace
31
+
32
+ attr_accessor :aerospike_password
33
+
34
+ attr_accessor :aerospike_port
35
+
36
+ # (Optional) ClientCertificate defines the client certificate for mutual TLS. Must be base64 certificate loaded by UI using file loader field
37
+ attr_accessor :client_certificate
38
+
39
+ # (Optional) ClientKeyPassphrase defines the passphrase for the client private key
40
+ attr_accessor :client_key_passphrase
41
+
42
+ # (Optional) ClientPrivateKey defines the client private key for mutual TLS. Must be base64 private key loaded by UI using file loader field
43
+ attr_accessor :client_private_key
44
+
45
+ attr_accessor :cloud_service_provider
46
+
47
+ attr_accessor :cluster_mode
48
+
49
+ attr_accessor :connection_type
50
+
51
+ attr_accessor :db_client_id
52
+
53
+ attr_accessor :db_client_secret
54
+
55
+ attr_accessor :db_host_name
56
+
57
+ attr_accessor :db_name
58
+
59
+ attr_accessor :db_port
60
+
61
+ # (Optional) Private Key in PEM format
62
+ attr_accessor :db_private_key
63
+
64
+ attr_accessor :db_private_key_passphrase
65
+
66
+ attr_accessor :db_pwd
67
+
68
+ # (Optional) DBServerCertificates defines the set of root certificate authorities that clients use when verifying server certificates. If DBServerCertificates is empty, TLS uses the host's root CA set.
69
+ attr_accessor :db_server_certificates
70
+
71
+ # (Optional) ServerName is used to verify the hostname on the returned certificates unless InsecureSkipVerify is given. It is also included in the client's handshake to support virtual hosting unless it is an IP address.
72
+ attr_accessor :db_server_name
73
+
74
+ attr_accessor :db_tenant_id
75
+
76
+ attr_accessor :db_user_name
77
+
78
+ # (Optional) EnableMTLS defines if mutual TLS will be used to connect to DB
79
+ attr_accessor :enable_mtls
80
+
81
+ attr_accessor :oracle_wallet_details
82
+
83
+ attr_accessor :sf_account
84
+
85
+ # (Optional) SkipServerNameValidation disables server name verification while still validating the certificate chain. Postgres treats empty as legacy \"skip hostname validation\"; MySQL treats empty as false.
86
+ attr_accessor :skip_server_name_validation
87
+
88
+ # (Optional) SSLConnectionCertificate defines the certificate for SSL connection. Must be base64 certificate loaded by UI using file loader field
89
+ attr_accessor :ssl_connection_certificate
90
+
91
+ # (Optional) SSLConnectionMode defines if SSL mode will be used to connect to DB
92
+ attr_accessor :ssl_connection_mode
93
+
94
+ # Attribute mapping from ruby-style variable name to JSON key.
95
+ def self.attribute_map
96
+ {
97
+ :'aerospike_admin_username' => :'aerospike_admin_username',
98
+ :'aerospike_client_id' => :'aerospike_client_id',
99
+ :'aerospike_client_secret' => :'aerospike_client_secret',
100
+ :'aerospike_cloud' => :'aerospike_cloud',
101
+ :'aerospike_cluster_id' => :'aerospike_cluster_id',
102
+ :'aerospike_hostname' => :'aerospike_hostname',
103
+ :'aerospike_namespace' => :'aerospike_namespace',
104
+ :'aerospike_password' => :'aerospike_password',
105
+ :'aerospike_port' => :'aerospike_port',
106
+ :'client_certificate' => :'client_certificate',
107
+ :'client_key_passphrase' => :'client_key_passphrase',
108
+ :'client_private_key' => :'client_private_key',
109
+ :'cloud_service_provider' => :'cloud_service_provider',
110
+ :'cluster_mode' => :'cluster_mode',
111
+ :'connection_type' => :'connection_type',
112
+ :'db_client_id' => :'db_client_id',
113
+ :'db_client_secret' => :'db_client_secret',
114
+ :'db_host_name' => :'db_host_name',
115
+ :'db_name' => :'db_name',
116
+ :'db_port' => :'db_port',
117
+ :'db_private_key' => :'db_private_key',
118
+ :'db_private_key_passphrase' => :'db_private_key_passphrase',
119
+ :'db_pwd' => :'db_pwd',
120
+ :'db_server_certificates' => :'db_server_certificates',
121
+ :'db_server_name' => :'db_server_name',
122
+ :'db_tenant_id' => :'db_tenant_id',
123
+ :'db_user_name' => :'db_user_name',
124
+ :'enable_mtls' => :'enable_mtls',
125
+ :'oracle_wallet_details' => :'oracle_wallet_details',
126
+ :'sf_account' => :'sf_account',
127
+ :'skip_server_name_validation' => :'skip_server_name_validation',
128
+ :'ssl_connection_certificate' => :'ssl_connection_certificate',
129
+ :'ssl_connection_mode' => :'ssl_connection_mode'
130
+ }
131
+ end
132
+
133
+ # Returns all the JSON keys this model knows about
134
+ def self.acceptable_attributes
135
+ attribute_map.values
136
+ end
137
+
138
+ # Attribute type mapping.
139
+ def self.openapi_types
140
+ {
141
+ :'aerospike_admin_username' => :'String',
142
+ :'aerospike_client_id' => :'String',
143
+ :'aerospike_client_secret' => :'String',
144
+ :'aerospike_cloud' => :'Boolean',
145
+ :'aerospike_cluster_id' => :'String',
146
+ :'aerospike_hostname' => :'String',
147
+ :'aerospike_namespace' => :'String',
148
+ :'aerospike_password' => :'String',
149
+ :'aerospike_port' => :'String',
150
+ :'client_certificate' => :'String',
151
+ :'client_key_passphrase' => :'String',
152
+ :'client_private_key' => :'String',
153
+ :'cloud_service_provider' => :'String',
154
+ :'cluster_mode' => :'Boolean',
155
+ :'connection_type' => :'String',
156
+ :'db_client_id' => :'String',
157
+ :'db_client_secret' => :'String',
158
+ :'db_host_name' => :'String',
159
+ :'db_name' => :'String',
160
+ :'db_port' => :'String',
161
+ :'db_private_key' => :'String',
162
+ :'db_private_key_passphrase' => :'String',
163
+ :'db_pwd' => :'String',
164
+ :'db_server_certificates' => :'String',
165
+ :'db_server_name' => :'String',
166
+ :'db_tenant_id' => :'String',
167
+ :'db_user_name' => :'String',
168
+ :'enable_mtls' => :'Boolean',
169
+ :'oracle_wallet_details' => :'WalletDetails',
170
+ :'sf_account' => :'String',
171
+ :'skip_server_name_validation' => :'String',
172
+ :'ssl_connection_certificate' => :'String',
173
+ :'ssl_connection_mode' => :'Boolean'
174
+ }
175
+ end
176
+
177
+ # List of attributes with nullable: true
178
+ def self.openapi_nullable
179
+ Set.new([
180
+ ])
181
+ end
182
+
183
+ # Initializes the object
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ def initialize(attributes = {})
186
+ if (!attributes.is_a?(Hash))
187
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::AerospikeTargetDetails` initialize method"
188
+ end
189
+
190
+ # check to see if the attribute exists and convert string to symbol for hash key
191
+ attributes = attributes.each_with_object({}) { |(k, v), h|
192
+ if (!self.class.attribute_map.key?(k.to_sym))
193
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::AerospikeTargetDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
194
+ end
195
+ h[k.to_sym] = v
196
+ }
197
+
198
+ if attributes.key?(:'aerospike_admin_username')
199
+ self.aerospike_admin_username = attributes[:'aerospike_admin_username']
200
+ end
201
+
202
+ if attributes.key?(:'aerospike_client_id')
203
+ self.aerospike_client_id = attributes[:'aerospike_client_id']
204
+ end
205
+
206
+ if attributes.key?(:'aerospike_client_secret')
207
+ self.aerospike_client_secret = attributes[:'aerospike_client_secret']
208
+ end
209
+
210
+ if attributes.key?(:'aerospike_cloud')
211
+ self.aerospike_cloud = attributes[:'aerospike_cloud']
212
+ end
213
+
214
+ if attributes.key?(:'aerospike_cluster_id')
215
+ self.aerospike_cluster_id = attributes[:'aerospike_cluster_id']
216
+ end
217
+
218
+ if attributes.key?(:'aerospike_hostname')
219
+ self.aerospike_hostname = attributes[:'aerospike_hostname']
220
+ end
221
+
222
+ if attributes.key?(:'aerospike_namespace')
223
+ self.aerospike_namespace = attributes[:'aerospike_namespace']
224
+ end
225
+
226
+ if attributes.key?(:'aerospike_password')
227
+ self.aerospike_password = attributes[:'aerospike_password']
228
+ end
229
+
230
+ if attributes.key?(:'aerospike_port')
231
+ self.aerospike_port = attributes[:'aerospike_port']
232
+ end
233
+
234
+ if attributes.key?(:'client_certificate')
235
+ self.client_certificate = attributes[:'client_certificate']
236
+ end
237
+
238
+ if attributes.key?(:'client_key_passphrase')
239
+ self.client_key_passphrase = attributes[:'client_key_passphrase']
240
+ end
241
+
242
+ if attributes.key?(:'client_private_key')
243
+ self.client_private_key = attributes[:'client_private_key']
244
+ end
245
+
246
+ if attributes.key?(:'cloud_service_provider')
247
+ self.cloud_service_provider = attributes[:'cloud_service_provider']
248
+ end
249
+
250
+ if attributes.key?(:'cluster_mode')
251
+ self.cluster_mode = attributes[:'cluster_mode']
252
+ end
253
+
254
+ if attributes.key?(:'connection_type')
255
+ self.connection_type = attributes[:'connection_type']
256
+ end
257
+
258
+ if attributes.key?(:'db_client_id')
259
+ self.db_client_id = attributes[:'db_client_id']
260
+ end
261
+
262
+ if attributes.key?(:'db_client_secret')
263
+ self.db_client_secret = attributes[:'db_client_secret']
264
+ end
265
+
266
+ if attributes.key?(:'db_host_name')
267
+ self.db_host_name = attributes[:'db_host_name']
268
+ end
269
+
270
+ if attributes.key?(:'db_name')
271
+ self.db_name = attributes[:'db_name']
272
+ end
273
+
274
+ if attributes.key?(:'db_port')
275
+ self.db_port = attributes[:'db_port']
276
+ end
277
+
278
+ if attributes.key?(:'db_private_key')
279
+ self.db_private_key = attributes[:'db_private_key']
280
+ end
281
+
282
+ if attributes.key?(:'db_private_key_passphrase')
283
+ self.db_private_key_passphrase = attributes[:'db_private_key_passphrase']
284
+ end
285
+
286
+ if attributes.key?(:'db_pwd')
287
+ self.db_pwd = attributes[:'db_pwd']
288
+ end
289
+
290
+ if attributes.key?(:'db_server_certificates')
291
+ self.db_server_certificates = attributes[:'db_server_certificates']
292
+ end
293
+
294
+ if attributes.key?(:'db_server_name')
295
+ self.db_server_name = attributes[:'db_server_name']
296
+ end
297
+
298
+ if attributes.key?(:'db_tenant_id')
299
+ self.db_tenant_id = attributes[:'db_tenant_id']
300
+ end
301
+
302
+ if attributes.key?(:'db_user_name')
303
+ self.db_user_name = attributes[:'db_user_name']
304
+ end
305
+
306
+ if attributes.key?(:'enable_mtls')
307
+ self.enable_mtls = attributes[:'enable_mtls']
308
+ end
309
+
310
+ if attributes.key?(:'oracle_wallet_details')
311
+ self.oracle_wallet_details = attributes[:'oracle_wallet_details']
312
+ end
313
+
314
+ if attributes.key?(:'sf_account')
315
+ self.sf_account = attributes[:'sf_account']
316
+ end
317
+
318
+ if attributes.key?(:'skip_server_name_validation')
319
+ self.skip_server_name_validation = attributes[:'skip_server_name_validation']
320
+ end
321
+
322
+ if attributes.key?(:'ssl_connection_certificate')
323
+ self.ssl_connection_certificate = attributes[:'ssl_connection_certificate']
324
+ end
325
+
326
+ if attributes.key?(:'ssl_connection_mode')
327
+ self.ssl_connection_mode = attributes[:'ssl_connection_mode']
328
+ end
329
+ end
330
+
331
+ # Show invalid properties with the reasons. Usually used together with valid?
332
+ # @return Array for valid properties with the reasons
333
+ def list_invalid_properties
334
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
335
+ invalid_properties = Array.new
336
+ invalid_properties
337
+ end
338
+
339
+ # Check to see if the all the properties in the model are valid
340
+ # @return true if the model is valid
341
+ def valid?
342
+ warn '[DEPRECATED] the `valid?` method is obsolete'
343
+ true
344
+ end
345
+
346
+ # Checks equality by comparing each attribute.
347
+ # @param [Object] Object to be compared
348
+ def ==(o)
349
+ return true if self.equal?(o)
350
+ self.class == o.class &&
351
+ aerospike_admin_username == o.aerospike_admin_username &&
352
+ aerospike_client_id == o.aerospike_client_id &&
353
+ aerospike_client_secret == o.aerospike_client_secret &&
354
+ aerospike_cloud == o.aerospike_cloud &&
355
+ aerospike_cluster_id == o.aerospike_cluster_id &&
356
+ aerospike_hostname == o.aerospike_hostname &&
357
+ aerospike_namespace == o.aerospike_namespace &&
358
+ aerospike_password == o.aerospike_password &&
359
+ aerospike_port == o.aerospike_port &&
360
+ client_certificate == o.client_certificate &&
361
+ client_key_passphrase == o.client_key_passphrase &&
362
+ client_private_key == o.client_private_key &&
363
+ cloud_service_provider == o.cloud_service_provider &&
364
+ cluster_mode == o.cluster_mode &&
365
+ connection_type == o.connection_type &&
366
+ db_client_id == o.db_client_id &&
367
+ db_client_secret == o.db_client_secret &&
368
+ db_host_name == o.db_host_name &&
369
+ db_name == o.db_name &&
370
+ db_port == o.db_port &&
371
+ db_private_key == o.db_private_key &&
372
+ db_private_key_passphrase == o.db_private_key_passphrase &&
373
+ db_pwd == o.db_pwd &&
374
+ db_server_certificates == o.db_server_certificates &&
375
+ db_server_name == o.db_server_name &&
376
+ db_tenant_id == o.db_tenant_id &&
377
+ db_user_name == o.db_user_name &&
378
+ enable_mtls == o.enable_mtls &&
379
+ oracle_wallet_details == o.oracle_wallet_details &&
380
+ sf_account == o.sf_account &&
381
+ skip_server_name_validation == o.skip_server_name_validation &&
382
+ ssl_connection_certificate == o.ssl_connection_certificate &&
383
+ ssl_connection_mode == o.ssl_connection_mode
384
+ end
385
+
386
+ # @see the `==` method
387
+ # @param [Object] Object to be compared
388
+ def eql?(o)
389
+ self == o
390
+ end
391
+
392
+ # Calculates hash code according to all attributes.
393
+ # @return [Integer] Hash code
394
+ def hash
395
+ [aerospike_admin_username, aerospike_client_id, aerospike_client_secret, aerospike_cloud, aerospike_cluster_id, aerospike_hostname, aerospike_namespace, aerospike_password, aerospike_port, client_certificate, client_key_passphrase, client_private_key, cloud_service_provider, cluster_mode, connection_type, db_client_id, db_client_secret, db_host_name, db_name, db_port, db_private_key, db_private_key_passphrase, db_pwd, db_server_certificates, db_server_name, db_tenant_id, db_user_name, enable_mtls, oracle_wallet_details, sf_account, skip_server_name_validation, ssl_connection_certificate, ssl_connection_mode].hash
396
+ end
397
+
398
+ # Builds the object from hash
399
+ # @param [Hash] attributes Model attributes in the form of hash
400
+ # @return [Object] Returns the model itself
401
+ def self.build_from_hash(attributes)
402
+ return nil unless attributes.is_a?(Hash)
403
+ attributes = attributes.transform_keys(&:to_sym)
404
+ transformed_hash = {}
405
+ openapi_types.each_pair do |key, type|
406
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
407
+ transformed_hash["#{key}"] = nil
408
+ elsif type =~ /\AArray<(.*)>/i
409
+ # check to ensure the input is an array given that the attribute
410
+ # is documented as an array but the input is not
411
+ if attributes[attribute_map[key]].is_a?(Array)
412
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
413
+ end
414
+ elsif !attributes[attribute_map[key]].nil?
415
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
416
+ end
417
+ end
418
+ new(transformed_hash)
419
+ end
420
+
421
+ # Deserializes the data based on type
422
+ # @param string type Data type
423
+ # @param string value Value to be deserialized
424
+ # @return [Object] Deserialized data
425
+ def self._deserialize(type, value)
426
+ case type.to_sym
427
+ when :Time
428
+ Time.parse(value)
429
+ when :Date
430
+ Date.parse(value)
431
+ when :String
432
+ value.to_s
433
+ when :Integer
434
+ value.to_i
435
+ when :Float
436
+ value.to_f
437
+ when :Boolean
438
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
439
+ true
440
+ else
441
+ false
442
+ end
443
+ when :Object
444
+ # generic object (usually a Hash), return directly
445
+ value
446
+ when /\AArray<(?<inner_type>.+)>\z/
447
+ inner_type = Regexp.last_match[:inner_type]
448
+ value.map { |v| _deserialize(inner_type, v) }
449
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
450
+ k_type = Regexp.last_match[:k_type]
451
+ v_type = Regexp.last_match[:v_type]
452
+ {}.tap do |hash|
453
+ value.each do |k, v|
454
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
455
+ end
456
+ end
457
+ else # model
458
+ # models (e.g. Pet) or oneOf
459
+ klass = Akeyless.const_get(type)
460
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
461
+ end
462
+ end
463
+
464
+ # Returns the string representation of the object
465
+ # @return [String] String presentation of the object
466
+ def to_s
467
+ to_hash.to_s
468
+ end
469
+
470
+ # to_body is an alias to to_hash (backward compatibility)
471
+ # @return [Hash] Returns the object in the form of hash
472
+ def to_body
473
+ to_hash
474
+ end
475
+
476
+ # Returns the object in the form of hash
477
+ # @return [Hash] Returns the object in the form of hash
478
+ def to_hash
479
+ hash = {}
480
+ self.class.attribute_map.each_pair do |attr, param|
481
+ value = self.send(attr)
482
+ if value.nil?
483
+ is_nullable = self.class.openapi_nullable.include?(attr)
484
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
485
+ end
486
+
487
+ hash[param] = _to_hash(value)
488
+ end
489
+ hash
490
+ end
491
+
492
+ # Outputs non-array value in the form of hash
493
+ # For object, use to_hash. Otherwise, just return the value
494
+ # @param [Object] value Any valid value
495
+ # @return [Hash] Returns the value in the form of hash
496
+ def _to_hash(value)
497
+ if value.is_a?(Array)
498
+ value.compact.map { |v| _to_hash(v) }
499
+ elsif value.is_a?(Hash)
500
+ {}.tap do |hash|
501
+ value.each { |k, v| hash[k] = _to_hash(v) }
502
+ end
503
+ elsif value.respond_to? :to_hash
504
+ value.to_hash
505
+ else
506
+ value
507
+ end
508
+ end
509
+
510
+ end
511
+
512
+ end