akeyless 3.1.2 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -1
  3. data/docs/CreatePingTarget.md +38 -0
  4. data/docs/CreatePingTargetOutput.md +18 -0
  5. data/docs/CreateRotatedSecret.md +2 -0
  6. data/docs/DSProducerDetails.md +40 -0
  7. data/docs/GatewayCreateProducerPing.md +66 -0
  8. data/docs/GatewayCreateProducerPingOutput.md +18 -0
  9. data/docs/GatewayUpdateProducerPing.md +68 -0
  10. data/docs/GatewayUpdateProducerPingOutput.md +18 -0
  11. data/docs/GetKubeExecCreds.md +5 -3
  12. data/docs/GetPKICertificate.md +5 -3
  13. data/docs/SecureRemoteAccess.md +2 -0
  14. data/docs/TargetTypeDetailsInput.md +10 -0
  15. data/docs/UpdatePingTarget.md +44 -0
  16. data/docs/UpdateRotatedSecret.md +2 -0
  17. data/docs/V2Api.md +252 -0
  18. data/lib/akeyless/api/v2_api.rb +256 -0
  19. data/lib/akeyless/models/create_ping_target.rb +329 -0
  20. data/lib/akeyless/models/create_ping_target_output.rb +219 -0
  21. data/lib/akeyless/models/create_rotated_secret.rb +13 -1
  22. data/lib/akeyless/models/ds_producer_details.rb +196 -1
  23. data/lib/akeyless/models/gateway_create_producer_ping.rb +482 -0
  24. data/lib/akeyless/models/gateway_create_producer_ping_output.rb +219 -0
  25. data/lib/akeyless/models/gateway_update_producer_ping.rb +492 -0
  26. data/lib/akeyless/models/gateway_update_producer_ping_output.rb +219 -0
  27. data/lib/akeyless/models/get_kube_exec_creds.rb +14 -4
  28. data/lib/akeyless/models/get_pki_certificate.rb +14 -4
  29. data/lib/akeyless/models/secure_remote_access.rb +10 -1
  30. data/lib/akeyless/models/target_type_details_input.rb +46 -1
  31. data/lib/akeyless/models/update_ping_target.rb +358 -0
  32. data/lib/akeyless/models/update_rotated_secret.rb +13 -1
  33. data/lib/akeyless/version.rb +1 -1
  34. data/lib/akeyless.rb +7 -0
  35. data/spec/models/create_ping_target_output_spec.rb +34 -0
  36. data/spec/models/create_ping_target_spec.rb +94 -0
  37. data/spec/models/gateway_create_producer_ping_output_spec.rb +34 -0
  38. data/spec/models/gateway_create_producer_ping_spec.rb +178 -0
  39. data/spec/models/gateway_update_producer_ping_output_spec.rb +34 -0
  40. data/spec/models/gateway_update_producer_ping_spec.rb +184 -0
  41. data/spec/models/update_ping_target_spec.rb +112 -0
  42. metadata +590 -562
@@ -0,0 +1,492 @@
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
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ # gatewayUpdateProducerPing is a command that updates Ping producer
18
+ class GatewayUpdateProducerPing
19
+ # Protection from accidental deletion of this item
20
+ attr_accessor :delete_protection
21
+
22
+ # Set output format to JSON
23
+ attr_accessor :json
24
+
25
+ # Producer name
26
+ attr_accessor :name
27
+
28
+ # Producer New name
29
+ attr_accessor :new_name
30
+
31
+ # Ping Federate administrative port
32
+ attr_accessor :ping_administrative_port
33
+
34
+ # Set a specific Access Token Management (ATM) instance for the created OAuth Client by providing the ATM Id. If no explicit value is given, the default pingfederate server ATM will be set.
35
+ attr_accessor :ping_atm_id
36
+
37
+ # Ping Federate authorization port
38
+ attr_accessor :ping_authorization_port
39
+
40
+ # The subject DN of the client certificate. If no explicit value is given, the producer will create CA certificate and matched client certificate and return it as value. Used in conjunction with ping-issuer-dn (relevant for CLIENT_TLS_CERTIFICATE authentication method)
41
+ attr_accessor :ping_cert_subject_dn
42
+
43
+ # OAuth Client Authentication Type [CLIENT_SECRET, PRIVATE_KEY_JWT, CLIENT_TLS_CERTIFICATE]
44
+ attr_accessor :ping_client_authentication_type
45
+
46
+ # Determines whether PingFederate requires a unique signed JWT from the client for each action (relevant for PRIVATE_KEY_JWT authentication method)
47
+ attr_accessor :ping_enforce_replay_prevention
48
+
49
+ # List of OAuth client grant types [IMPLICIT, AUTHORIZATION_CODE, CLIENT_CREDENTIALS, TOKEN_EXCHANGE, REFRESH_TOKEN, ASSERTION_GRANTS, PASSWORD, RESOURCE_OWNER_CREDENTIALS]. If no explicit value is given, AUTHORIZATION_CODE will be selected as default.
50
+ attr_accessor :ping_grant_types
51
+
52
+ # Issuer DN of trusted CA certificate that imported into Ping Federate server. You may select \\\"Trust Any\\\" to trust all the existing issuers in Ping Federate server. Used in conjunction with ping-cert-subject-dn (relevant for CLIENT_TLS_CERTIFICATE authentication method)
53
+ attr_accessor :ping_issuer_dn
54
+
55
+ # Base64-encoded JSON Web Key Set (JWKS). If no explicit value is given, the producer will create JWKs and matched signed JWT (Sign Algo: RS256) and return it as value (relevant for PRIVATE_KEY_JWT authentication method)
56
+ attr_accessor :ping_jwks
57
+
58
+ # The URL of the JSON Web Key Set (JWKS). If no explicit value is given, the producer will create JWKs and matched signed JWT and return it as value (relevant for PRIVATE_KEY_JWT authentication method)
59
+ attr_accessor :ping_jwks_url
60
+
61
+ # Ping Federate privileged user password
62
+ attr_accessor :ping_password
63
+
64
+ # Ping Federate privileged user
65
+ attr_accessor :ping_privileged_user
66
+
67
+ # List of URIs to which the OAuth authorization server may redirect the resource owner's user agent after authorization is obtained. At least one redirection URI is required for the AUTHORIZATION_CODE and IMPLICIT grant types.
68
+ attr_accessor :ping_redirect_uris
69
+
70
+ # Limit the OAuth client to specific scopes list
71
+ attr_accessor :ping_restricted_scopes
72
+
73
+ # The signing algorithm that the client must use to sign its request objects [RS256,RS384,RS512,ES256,ES384,ES512,PS256,PS384,PS512] If no explicit value is given, the client can use any of the supported signing algorithms (relevant for PRIVATE_KEY_JWT authentication method)
74
+ attr_accessor :ping_signing_algo
75
+
76
+ # Ping URL
77
+ attr_accessor :ping_url
78
+
79
+ # Dynamic producer encryption key
80
+ attr_accessor :producer_encryption_key_name
81
+
82
+ # List of the tags attached to this secret
83
+ attr_accessor :tags
84
+
85
+ # Target name
86
+ attr_accessor :target_name
87
+
88
+ # Authentication token (see `/auth` and `/configure`)
89
+ attr_accessor :token
90
+
91
+ # The universal identity token, Required only for universal_identity authentication
92
+ attr_accessor :uid_token
93
+
94
+ # The time from dynamic secret creation to expiration.
95
+ attr_accessor :user_ttl
96
+
97
+ # Attribute mapping from ruby-style variable name to JSON key.
98
+ def self.attribute_map
99
+ {
100
+ :'delete_protection' => :'delete_protection',
101
+ :'json' => :'json',
102
+ :'name' => :'name',
103
+ :'new_name' => :'new-name',
104
+ :'ping_administrative_port' => :'ping-administrative-port',
105
+ :'ping_atm_id' => :'ping-atm-id',
106
+ :'ping_authorization_port' => :'ping-authorization-port',
107
+ :'ping_cert_subject_dn' => :'ping-cert-subject-dn',
108
+ :'ping_client_authentication_type' => :'ping-client-authentication-type',
109
+ :'ping_enforce_replay_prevention' => :'ping-enforce-replay-prevention',
110
+ :'ping_grant_types' => :'ping-grant-types',
111
+ :'ping_issuer_dn' => :'ping-issuer-dn',
112
+ :'ping_jwks' => :'ping-jwks',
113
+ :'ping_jwks_url' => :'ping-jwks-url',
114
+ :'ping_password' => :'ping-password',
115
+ :'ping_privileged_user' => :'ping-privileged-user',
116
+ :'ping_redirect_uris' => :'ping-redirect-uris',
117
+ :'ping_restricted_scopes' => :'ping-restricted-scopes',
118
+ :'ping_signing_algo' => :'ping-signing-algo',
119
+ :'ping_url' => :'ping-url',
120
+ :'producer_encryption_key_name' => :'producer-encryption-key-name',
121
+ :'tags' => :'tags',
122
+ :'target_name' => :'target-name',
123
+ :'token' => :'token',
124
+ :'uid_token' => :'uid-token',
125
+ :'user_ttl' => :'user-ttl'
126
+ }
127
+ end
128
+
129
+ # Returns all the JSON keys this model knows about
130
+ def self.acceptable_attributes
131
+ attribute_map.values
132
+ end
133
+
134
+ # Attribute type mapping.
135
+ def self.openapi_types
136
+ {
137
+ :'delete_protection' => :'String',
138
+ :'json' => :'Boolean',
139
+ :'name' => :'String',
140
+ :'new_name' => :'String',
141
+ :'ping_administrative_port' => :'String',
142
+ :'ping_atm_id' => :'String',
143
+ :'ping_authorization_port' => :'String',
144
+ :'ping_cert_subject_dn' => :'String',
145
+ :'ping_client_authentication_type' => :'String',
146
+ :'ping_enforce_replay_prevention' => :'String',
147
+ :'ping_grant_types' => :'Array<String>',
148
+ :'ping_issuer_dn' => :'String',
149
+ :'ping_jwks' => :'String',
150
+ :'ping_jwks_url' => :'String',
151
+ :'ping_password' => :'String',
152
+ :'ping_privileged_user' => :'String',
153
+ :'ping_redirect_uris' => :'Array<String>',
154
+ :'ping_restricted_scopes' => :'Array<String>',
155
+ :'ping_signing_algo' => :'String',
156
+ :'ping_url' => :'String',
157
+ :'producer_encryption_key_name' => :'String',
158
+ :'tags' => :'Array<String>',
159
+ :'target_name' => :'String',
160
+ :'token' => :'String',
161
+ :'uid_token' => :'String',
162
+ :'user_ttl' => :'String'
163
+ }
164
+ end
165
+
166
+ # List of attributes with nullable: true
167
+ def self.openapi_nullable
168
+ Set.new([
169
+ ])
170
+ end
171
+
172
+ # Initializes the object
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ def initialize(attributes = {})
175
+ if (!attributes.is_a?(Hash))
176
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GatewayUpdateProducerPing` initialize method"
177
+ end
178
+
179
+ # check to see if the attribute exists and convert string to symbol for hash key
180
+ attributes = attributes.each_with_object({}) { |(k, v), h|
181
+ if (!self.class.attribute_map.key?(k.to_sym))
182
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GatewayUpdateProducerPing`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
183
+ end
184
+ h[k.to_sym] = v
185
+ }
186
+
187
+ if attributes.key?(:'delete_protection')
188
+ self.delete_protection = attributes[:'delete_protection']
189
+ end
190
+
191
+ if attributes.key?(:'json')
192
+ self.json = attributes[:'json']
193
+ end
194
+
195
+ if attributes.key?(:'name')
196
+ self.name = attributes[:'name']
197
+ end
198
+
199
+ if attributes.key?(:'new_name')
200
+ self.new_name = attributes[:'new_name']
201
+ end
202
+
203
+ if attributes.key?(:'ping_administrative_port')
204
+ self.ping_administrative_port = attributes[:'ping_administrative_port']
205
+ else
206
+ self.ping_administrative_port = '9999'
207
+ end
208
+
209
+ if attributes.key?(:'ping_atm_id')
210
+ self.ping_atm_id = attributes[:'ping_atm_id']
211
+ end
212
+
213
+ if attributes.key?(:'ping_authorization_port')
214
+ self.ping_authorization_port = attributes[:'ping_authorization_port']
215
+ else
216
+ self.ping_authorization_port = '9031'
217
+ end
218
+
219
+ if attributes.key?(:'ping_cert_subject_dn')
220
+ self.ping_cert_subject_dn = attributes[:'ping_cert_subject_dn']
221
+ end
222
+
223
+ if attributes.key?(:'ping_client_authentication_type')
224
+ self.ping_client_authentication_type = attributes[:'ping_client_authentication_type']
225
+ else
226
+ self.ping_client_authentication_type = 'CLIENT_SECRET'
227
+ end
228
+
229
+ if attributes.key?(:'ping_enforce_replay_prevention')
230
+ self.ping_enforce_replay_prevention = attributes[:'ping_enforce_replay_prevention']
231
+ end
232
+
233
+ if attributes.key?(:'ping_grant_types')
234
+ if (value = attributes[:'ping_grant_types']).is_a?(Array)
235
+ self.ping_grant_types = value
236
+ end
237
+ end
238
+
239
+ if attributes.key?(:'ping_issuer_dn')
240
+ self.ping_issuer_dn = attributes[:'ping_issuer_dn']
241
+ end
242
+
243
+ if attributes.key?(:'ping_jwks')
244
+ self.ping_jwks = attributes[:'ping_jwks']
245
+ end
246
+
247
+ if attributes.key?(:'ping_jwks_url')
248
+ self.ping_jwks_url = attributes[:'ping_jwks_url']
249
+ end
250
+
251
+ if attributes.key?(:'ping_password')
252
+ self.ping_password = attributes[:'ping_password']
253
+ end
254
+
255
+ if attributes.key?(:'ping_privileged_user')
256
+ self.ping_privileged_user = attributes[:'ping_privileged_user']
257
+ end
258
+
259
+ if attributes.key?(:'ping_redirect_uris')
260
+ if (value = attributes[:'ping_redirect_uris']).is_a?(Array)
261
+ self.ping_redirect_uris = value
262
+ end
263
+ end
264
+
265
+ if attributes.key?(:'ping_restricted_scopes')
266
+ if (value = attributes[:'ping_restricted_scopes']).is_a?(Array)
267
+ self.ping_restricted_scopes = value
268
+ end
269
+ end
270
+
271
+ if attributes.key?(:'ping_signing_algo')
272
+ self.ping_signing_algo = attributes[:'ping_signing_algo']
273
+ end
274
+
275
+ if attributes.key?(:'ping_url')
276
+ self.ping_url = attributes[:'ping_url']
277
+ end
278
+
279
+ if attributes.key?(:'producer_encryption_key_name')
280
+ self.producer_encryption_key_name = attributes[:'producer_encryption_key_name']
281
+ end
282
+
283
+ if attributes.key?(:'tags')
284
+ if (value = attributes[:'tags']).is_a?(Array)
285
+ self.tags = value
286
+ end
287
+ end
288
+
289
+ if attributes.key?(:'target_name')
290
+ self.target_name = attributes[:'target_name']
291
+ end
292
+
293
+ if attributes.key?(:'token')
294
+ self.token = attributes[:'token']
295
+ end
296
+
297
+ if attributes.key?(:'uid_token')
298
+ self.uid_token = attributes[:'uid_token']
299
+ end
300
+
301
+ if attributes.key?(:'user_ttl')
302
+ self.user_ttl = attributes[:'user_ttl']
303
+ else
304
+ self.user_ttl = '60m'
305
+ end
306
+ end
307
+
308
+ # Show invalid properties with the reasons. Usually used together with valid?
309
+ # @return Array for valid properties with the reasons
310
+ def list_invalid_properties
311
+ invalid_properties = Array.new
312
+ if @name.nil?
313
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
314
+ end
315
+
316
+ invalid_properties
317
+ end
318
+
319
+ # Check to see if the all the properties in the model are valid
320
+ # @return true if the model is valid
321
+ def valid?
322
+ return false if @name.nil?
323
+ true
324
+ end
325
+
326
+ # Checks equality by comparing each attribute.
327
+ # @param [Object] Object to be compared
328
+ def ==(o)
329
+ return true if self.equal?(o)
330
+ self.class == o.class &&
331
+ delete_protection == o.delete_protection &&
332
+ json == o.json &&
333
+ name == o.name &&
334
+ new_name == o.new_name &&
335
+ ping_administrative_port == o.ping_administrative_port &&
336
+ ping_atm_id == o.ping_atm_id &&
337
+ ping_authorization_port == o.ping_authorization_port &&
338
+ ping_cert_subject_dn == o.ping_cert_subject_dn &&
339
+ ping_client_authentication_type == o.ping_client_authentication_type &&
340
+ ping_enforce_replay_prevention == o.ping_enforce_replay_prevention &&
341
+ ping_grant_types == o.ping_grant_types &&
342
+ ping_issuer_dn == o.ping_issuer_dn &&
343
+ ping_jwks == o.ping_jwks &&
344
+ ping_jwks_url == o.ping_jwks_url &&
345
+ ping_password == o.ping_password &&
346
+ ping_privileged_user == o.ping_privileged_user &&
347
+ ping_redirect_uris == o.ping_redirect_uris &&
348
+ ping_restricted_scopes == o.ping_restricted_scopes &&
349
+ ping_signing_algo == o.ping_signing_algo &&
350
+ ping_url == o.ping_url &&
351
+ producer_encryption_key_name == o.producer_encryption_key_name &&
352
+ tags == o.tags &&
353
+ target_name == o.target_name &&
354
+ token == o.token &&
355
+ uid_token == o.uid_token &&
356
+ user_ttl == o.user_ttl
357
+ end
358
+
359
+ # @see the `==` method
360
+ # @param [Object] Object to be compared
361
+ def eql?(o)
362
+ self == o
363
+ end
364
+
365
+ # Calculates hash code according to all attributes.
366
+ # @return [Integer] Hash code
367
+ def hash
368
+ [delete_protection, json, name, new_name, ping_administrative_port, ping_atm_id, ping_authorization_port, ping_cert_subject_dn, ping_client_authentication_type, ping_enforce_replay_prevention, ping_grant_types, ping_issuer_dn, ping_jwks, ping_jwks_url, ping_password, ping_privileged_user, ping_redirect_uris, ping_restricted_scopes, ping_signing_algo, ping_url, producer_encryption_key_name, tags, target_name, token, uid_token, user_ttl].hash
369
+ end
370
+
371
+ # Builds the object from hash
372
+ # @param [Hash] attributes Model attributes in the form of hash
373
+ # @return [Object] Returns the model itself
374
+ def self.build_from_hash(attributes)
375
+ new.build_from_hash(attributes)
376
+ end
377
+
378
+ # Builds the object from hash
379
+ # @param [Hash] attributes Model attributes in the form of hash
380
+ # @return [Object] Returns the model itself
381
+ def build_from_hash(attributes)
382
+ return nil unless attributes.is_a?(Hash)
383
+ attributes = attributes.transform_keys(&:to_sym)
384
+ self.class.openapi_types.each_pair do |key, type|
385
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
386
+ self.send("#{key}=", nil)
387
+ elsif type =~ /\AArray<(.*)>/i
388
+ # check to ensure the input is an array given that the attribute
389
+ # is documented as an array but the input is not
390
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
391
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
392
+ end
393
+ elsif !attributes[self.class.attribute_map[key]].nil?
394
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
395
+ end
396
+ end
397
+
398
+ self
399
+ end
400
+
401
+ # Deserializes the data based on type
402
+ # @param string type Data type
403
+ # @param string value Value to be deserialized
404
+ # @return [Object] Deserialized data
405
+ def _deserialize(type, value)
406
+ case type.to_sym
407
+ when :Time
408
+ Time.parse(value)
409
+ when :Date
410
+ Date.parse(value)
411
+ when :String
412
+ value.to_s
413
+ when :Integer
414
+ value.to_i
415
+ when :Float
416
+ value.to_f
417
+ when :Boolean
418
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
419
+ true
420
+ else
421
+ false
422
+ end
423
+ when :Object
424
+ # generic object (usually a Hash), return directly
425
+ value
426
+ when /\AArray<(?<inner_type>.+)>\z/
427
+ inner_type = Regexp.last_match[:inner_type]
428
+ value.map { |v| _deserialize(inner_type, v) }
429
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
430
+ k_type = Regexp.last_match[:k_type]
431
+ v_type = Regexp.last_match[:v_type]
432
+ {}.tap do |hash|
433
+ value.each do |k, v|
434
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
435
+ end
436
+ end
437
+ else # model
438
+ # models (e.g. Pet) or oneOf
439
+ klass = Akeyless.const_get(type)
440
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
441
+ end
442
+ end
443
+
444
+ # Returns the string representation of the object
445
+ # @return [String] String presentation of the object
446
+ def to_s
447
+ to_hash.to_s
448
+ end
449
+
450
+ # to_body is an alias to to_hash (backward compatibility)
451
+ # @return [Hash] Returns the object in the form of hash
452
+ def to_body
453
+ to_hash
454
+ end
455
+
456
+ # Returns the object in the form of hash
457
+ # @return [Hash] Returns the object in the form of hash
458
+ def to_hash
459
+ hash = {}
460
+ self.class.attribute_map.each_pair do |attr, param|
461
+ value = self.send(attr)
462
+ if value.nil?
463
+ is_nullable = self.class.openapi_nullable.include?(attr)
464
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
465
+ end
466
+
467
+ hash[param] = _to_hash(value)
468
+ end
469
+ hash
470
+ end
471
+
472
+ # Outputs non-array value in the form of hash
473
+ # For object, use to_hash. Otherwise, just return the value
474
+ # @param [Object] value Any valid value
475
+ # @return [Hash] Returns the value in the form of hash
476
+ def _to_hash(value)
477
+ if value.is_a?(Array)
478
+ value.compact.map { |v| _to_hash(v) }
479
+ elsif value.is_a?(Hash)
480
+ {}.tap do |hash|
481
+ value.each { |k, v| hash[k] = _to_hash(v) }
482
+ end
483
+ elsif value.respond_to? :to_hash
484
+ value.to_hash
485
+ else
486
+ value
487
+ end
488
+ end
489
+
490
+ end
491
+
492
+ end
@@ -0,0 +1,219 @@
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
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class GatewayUpdateProducerPingOutput
18
+ attr_accessor :producer_details
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'producer_details' => :'producer_details'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'producer_details' => :'DSProducerDetails'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GatewayUpdateProducerPingOutput` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GatewayUpdateProducerPingOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'producer_details')
61
+ self.producer_details = attributes[:'producer_details']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ producer_details == o.producer_details
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [producer_details].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = Akeyless.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end