akeyless 3.3.4 → 3.3.6

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -1
  3. data/docs/CertificateTemplateInfo.md +32 -0
  4. data/docs/CreateClassicKey.md +16 -0
  5. data/docs/CreateDFCKey.md +16 -0
  6. data/docs/CreateKey.md +16 -0
  7. data/docs/DSProducerDetails.md +8 -2
  8. data/docs/DeriveKey.md +40 -0
  9. data/docs/DeriveKeyOutput.md +20 -0
  10. data/docs/EventAction.md +26 -0
  11. data/docs/GatewayCreateProducerCertificateAutomation.md +6 -4
  12. data/docs/GatewayUpdateProducerCertificateAutomation.md +6 -4
  13. data/docs/ItemGeneralInfo.md +2 -0
  14. data/docs/SignDataWithClassicKey.md +34 -0
  15. data/docs/SignOutput.md +18 -0
  16. data/docs/TargetTypeDetailsInput.md +8 -2
  17. data/docs/V2Api.md +252 -0
  18. data/docs/VerifyDataWithClassicKey.md +36 -0
  19. data/lib/akeyless/api/v2_api.rb +256 -0
  20. data/lib/akeyless/models/certificate_template_info.rb +282 -0
  21. data/lib/akeyless/models/create_classic_key.rb +81 -1
  22. data/lib/akeyless/models/create_dfc_key.rb +81 -1
  23. data/lib/akeyless/models/create_key.rb +81 -1
  24. data/lib/akeyless/models/derive_key.rb +362 -0
  25. data/lib/akeyless/models/derive_key_output.rb +228 -0
  26. data/lib/akeyless/models/ds_producer_details.rb +30 -1
  27. data/lib/akeyless/models/event_action.rb +272 -0
  28. data/lib/akeyless/models/gateway_create_producer_certificate_automation.rb +30 -18
  29. data/lib/akeyless/models/gateway_update_producer_certificate_automation.rb +30 -18
  30. data/lib/akeyless/models/item_general_info.rb +10 -1
  31. data/lib/akeyless/models/sign_data_with_classic_key.rb +326 -0
  32. data/lib/akeyless/models/sign_output.rb +219 -0
  33. data/lib/akeyless/models/target_type_details_input.rb +30 -1
  34. data/lib/akeyless/models/verify_data_with_classic_key.rb +336 -0
  35. data/lib/akeyless/version.rb +1 -1
  36. data/lib/akeyless.rb +7 -0
  37. data/spec/models/certificate_template_info_spec.rb +76 -0
  38. data/spec/models/derive_key_output_spec.rb +40 -0
  39. data/spec/models/derive_key_spec.rb +100 -0
  40. data/spec/models/event_action_spec.rb +58 -0
  41. data/spec/models/sign_data_with_classic_key_spec.rb +82 -0
  42. data/spec/models/sign_output_spec.rb +34 -0
  43. data/spec/models/verify_data_with_classic_key_spec.rb +88 -0
  44. metadata +30 -2
@@ -70,21 +70,24 @@ module Akeyless
70
70
  # User TTL in time.Duration format (2160h / 129600m / etc...). When using sign-using-akeyless-pki certificates created will have this validity period, otherwise the user-ttl is taken from the Validity Period field of the Zone's' Issuing Template. When using cert-manager it is advised to have a TTL of above 60 days (1440h). For more information - https://cert-manager.io/docs/usage/certificate/
71
71
  attr_accessor :user_ttl
72
72
 
73
+ # Venafi Access Token to use to access the TPP environment (Relevant when using TPP)
74
+ attr_accessor :venafi_access_token
75
+
73
76
  # Venafi API key
74
77
  attr_accessor :venafi_api_key
75
78
 
76
79
  # Venafi Baseurl
77
80
  attr_accessor :venafi_baseurl
78
81
 
79
- # Venafi Password
80
- attr_accessor :venafi_password
82
+ # Venafi Client ID that was used when the access token was generated
83
+ attr_accessor :venafi_client_id
84
+
85
+ # Venafi Refresh Token to use when the Access Token is expired (Relevant when using TPP)
86
+ attr_accessor :venafi_refresh_token
81
87
 
82
88
  # Venafi using TPP
83
89
  attr_accessor :venafi_use_tpp
84
90
 
85
- # Venafi Username
86
- attr_accessor :venafi_username
87
-
88
91
  # Venafi Zone
89
92
  attr_accessor :venafi_zone
90
93
 
@@ -109,11 +112,12 @@ module Akeyless
109
112
  :'token' => :'token',
110
113
  :'uid_token' => :'uid-token',
111
114
  :'user_ttl' => :'user-ttl',
115
+ :'venafi_access_token' => :'venafi-access-token',
112
116
  :'venafi_api_key' => :'venafi-api-key',
113
117
  :'venafi_baseurl' => :'venafi-baseurl',
114
- :'venafi_password' => :'venafi-password',
118
+ :'venafi_client_id' => :'venafi-client-id',
119
+ :'venafi_refresh_token' => :'venafi-refresh-token',
115
120
  :'venafi_use_tpp' => :'venafi-use-tpp',
116
- :'venafi_username' => :'venafi-username',
117
121
  :'venafi_zone' => :'venafi-zone'
118
122
  }
119
123
  end
@@ -144,11 +148,12 @@ module Akeyless
144
148
  :'token' => :'String',
145
149
  :'uid_token' => :'String',
146
150
  :'user_ttl' => :'String',
151
+ :'venafi_access_token' => :'String',
147
152
  :'venafi_api_key' => :'String',
148
153
  :'venafi_baseurl' => :'String',
149
- :'venafi_password' => :'String',
154
+ :'venafi_client_id' => :'String',
155
+ :'venafi_refresh_token' => :'String',
150
156
  :'venafi_use_tpp' => :'Boolean',
151
- :'venafi_username' => :'String',
152
157
  :'venafi_zone' => :'String'
153
158
  }
154
159
  end
@@ -258,6 +263,10 @@ module Akeyless
258
263
  self.user_ttl = '2160h'
259
264
  end
260
265
 
266
+ if attributes.key?(:'venafi_access_token')
267
+ self.venafi_access_token = attributes[:'venafi_access_token']
268
+ end
269
+
261
270
  if attributes.key?(:'venafi_api_key')
262
271
  self.venafi_api_key = attributes[:'venafi_api_key']
263
272
  end
@@ -266,16 +275,18 @@ module Akeyless
266
275
  self.venafi_baseurl = attributes[:'venafi_baseurl']
267
276
  end
268
277
 
269
- if attributes.key?(:'venafi_password')
270
- self.venafi_password = attributes[:'venafi_password']
278
+ if attributes.key?(:'venafi_client_id')
279
+ self.venafi_client_id = attributes[:'venafi_client_id']
280
+ else
281
+ self.venafi_client_id = 'akeyless'
271
282
  end
272
283
 
273
- if attributes.key?(:'venafi_use_tpp')
274
- self.venafi_use_tpp = attributes[:'venafi_use_tpp']
284
+ if attributes.key?(:'venafi_refresh_token')
285
+ self.venafi_refresh_token = attributes[:'venafi_refresh_token']
275
286
  end
276
287
 
277
- if attributes.key?(:'venafi_username')
278
- self.venafi_username = attributes[:'venafi_username']
288
+ if attributes.key?(:'venafi_use_tpp')
289
+ self.venafi_use_tpp = attributes[:'venafi_use_tpp']
279
290
  end
280
291
 
281
292
  if attributes.key?(:'venafi_zone')
@@ -324,11 +335,12 @@ module Akeyless
324
335
  token == o.token &&
325
336
  uid_token == o.uid_token &&
326
337
  user_ttl == o.user_ttl &&
338
+ venafi_access_token == o.venafi_access_token &&
327
339
  venafi_api_key == o.venafi_api_key &&
328
340
  venafi_baseurl == o.venafi_baseurl &&
329
- venafi_password == o.venafi_password &&
341
+ venafi_client_id == o.venafi_client_id &&
342
+ venafi_refresh_token == o.venafi_refresh_token &&
330
343
  venafi_use_tpp == o.venafi_use_tpp &&
331
- venafi_username == o.venafi_username &&
332
344
  venafi_zone == o.venafi_zone
333
345
  end
334
346
 
@@ -341,7 +353,7 @@ module Akeyless
341
353
  # Calculates hash code according to all attributes.
342
354
  # @return [Integer] Hash code
343
355
  def hash
344
- [admin_rotation_interval_days, allow_subdomains, allowed_domains, auto_generated_folder, delete_protection, enable_admin_rotation, json, name, producer_encryption_key_name, root_first_in_chain, sign_using_akeyless_pki, signer_key_name, store_private_key, tags, target_name, token, uid_token, user_ttl, venafi_api_key, venafi_baseurl, venafi_password, venafi_use_tpp, venafi_username, venafi_zone].hash
356
+ [admin_rotation_interval_days, allow_subdomains, allowed_domains, auto_generated_folder, delete_protection, enable_admin_rotation, json, name, producer_encryption_key_name, root_first_in_chain, sign_using_akeyless_pki, signer_key_name, store_private_key, tags, target_name, token, uid_token, user_ttl, venafi_access_token, venafi_api_key, venafi_baseurl, venafi_client_id, venafi_refresh_token, venafi_use_tpp, venafi_zone].hash
345
357
  end
346
358
 
347
359
  # Builds the object from hash
@@ -73,21 +73,24 @@ module Akeyless
73
73
  # User TTL in time.Duration format (2160h / 129600m / etc...). When using sign-using-akeyless-pki certificates created will have this validity period, otherwise the user-ttl is taken from the Validity Period field of the Zone's' Issuing Template. When using cert-manager it is advised to have a TTL of above 60 days (1440h). For more information - https://cert-manager.io/docs/usage/certificate/
74
74
  attr_accessor :user_ttl
75
75
 
76
+ # Venafi Access Token to use to access the TPP environment (Relevant when using TPP)
77
+ attr_accessor :venafi_access_token
78
+
76
79
  # Venafi API key
77
80
  attr_accessor :venafi_api_key
78
81
 
79
82
  # Venafi Baseurl
80
83
  attr_accessor :venafi_baseurl
81
84
 
82
- # Venafi Password
83
- attr_accessor :venafi_password
85
+ # Venafi Client ID that was used when the access token was generated
86
+ attr_accessor :venafi_client_id
87
+
88
+ # Venafi Refresh Token to use when the Access Token is expired (Relevant when using TPP)
89
+ attr_accessor :venafi_refresh_token
84
90
 
85
91
  # Venafi using TPP
86
92
  attr_accessor :venafi_use_tpp
87
93
 
88
- # Venafi Username
89
- attr_accessor :venafi_username
90
-
91
94
  # Venafi Zone
92
95
  attr_accessor :venafi_zone
93
96
 
@@ -113,11 +116,12 @@ module Akeyless
113
116
  :'token' => :'token',
114
117
  :'uid_token' => :'uid-token',
115
118
  :'user_ttl' => :'user-ttl',
119
+ :'venafi_access_token' => :'venafi-access-token',
116
120
  :'venafi_api_key' => :'venafi-api-key',
117
121
  :'venafi_baseurl' => :'venafi-baseurl',
118
- :'venafi_password' => :'venafi-password',
122
+ :'venafi_client_id' => :'venafi-client-id',
123
+ :'venafi_refresh_token' => :'venafi-refresh-token',
119
124
  :'venafi_use_tpp' => :'venafi-use-tpp',
120
- :'venafi_username' => :'venafi-username',
121
125
  :'venafi_zone' => :'venafi-zone'
122
126
  }
123
127
  end
@@ -149,11 +153,12 @@ module Akeyless
149
153
  :'token' => :'String',
150
154
  :'uid_token' => :'String',
151
155
  :'user_ttl' => :'String',
156
+ :'venafi_access_token' => :'String',
152
157
  :'venafi_api_key' => :'String',
153
158
  :'venafi_baseurl' => :'String',
154
- :'venafi_password' => :'String',
159
+ :'venafi_client_id' => :'String',
160
+ :'venafi_refresh_token' => :'String',
155
161
  :'venafi_use_tpp' => :'Boolean',
156
- :'venafi_username' => :'String',
157
162
  :'venafi_zone' => :'String'
158
163
  }
159
164
  end
@@ -267,6 +272,10 @@ module Akeyless
267
272
  self.user_ttl = '2160h'
268
273
  end
269
274
 
275
+ if attributes.key?(:'venafi_access_token')
276
+ self.venafi_access_token = attributes[:'venafi_access_token']
277
+ end
278
+
270
279
  if attributes.key?(:'venafi_api_key')
271
280
  self.venafi_api_key = attributes[:'venafi_api_key']
272
281
  end
@@ -275,16 +284,18 @@ module Akeyless
275
284
  self.venafi_baseurl = attributes[:'venafi_baseurl']
276
285
  end
277
286
 
278
- if attributes.key?(:'venafi_password')
279
- self.venafi_password = attributes[:'venafi_password']
287
+ if attributes.key?(:'venafi_client_id')
288
+ self.venafi_client_id = attributes[:'venafi_client_id']
289
+ else
290
+ self.venafi_client_id = 'akeyless'
280
291
  end
281
292
 
282
- if attributes.key?(:'venafi_use_tpp')
283
- self.venafi_use_tpp = attributes[:'venafi_use_tpp']
293
+ if attributes.key?(:'venafi_refresh_token')
294
+ self.venafi_refresh_token = attributes[:'venafi_refresh_token']
284
295
  end
285
296
 
286
- if attributes.key?(:'venafi_username')
287
- self.venafi_username = attributes[:'venafi_username']
297
+ if attributes.key?(:'venafi_use_tpp')
298
+ self.venafi_use_tpp = attributes[:'venafi_use_tpp']
288
299
  end
289
300
 
290
301
  if attributes.key?(:'venafi_zone')
@@ -334,11 +345,12 @@ module Akeyless
334
345
  token == o.token &&
335
346
  uid_token == o.uid_token &&
336
347
  user_ttl == o.user_ttl &&
348
+ venafi_access_token == o.venafi_access_token &&
337
349
  venafi_api_key == o.venafi_api_key &&
338
350
  venafi_baseurl == o.venafi_baseurl &&
339
- venafi_password == o.venafi_password &&
351
+ venafi_client_id == o.venafi_client_id &&
352
+ venafi_refresh_token == o.venafi_refresh_token &&
340
353
  venafi_use_tpp == o.venafi_use_tpp &&
341
- venafi_username == o.venafi_username &&
342
354
  venafi_zone == o.venafi_zone
343
355
  end
344
356
 
@@ -351,7 +363,7 @@ module Akeyless
351
363
  # Calculates hash code according to all attributes.
352
364
  # @return [Integer] Hash code
353
365
  def hash
354
- [admin_rotation_interval_days, allow_subdomains, allowed_domains, auto_generated_folder, delete_protection, enable_admin_rotation, json, name, new_name, producer_encryption_key_name, root_first_in_chain, sign_using_akeyless_pki, signer_key_name, store_private_key, tags, target_name, token, uid_token, user_ttl, venafi_api_key, venafi_baseurl, venafi_password, venafi_use_tpp, venafi_username, venafi_zone].hash
366
+ [admin_rotation_interval_days, allow_subdomains, allowed_domains, auto_generated_folder, delete_protection, enable_admin_rotation, json, name, new_name, producer_encryption_key_name, root_first_in_chain, sign_using_akeyless_pki, signer_key_name, store_private_key, tags, target_name, token, uid_token, user_ttl, venafi_access_token, venafi_api_key, venafi_baseurl, venafi_client_id, venafi_refresh_token, venafi_use_tpp, venafi_zone].hash
355
367
  end
356
368
 
357
369
  # Builds the object from hash
@@ -19,6 +19,8 @@ module Akeyless
19
19
 
20
20
  attr_accessor :certificate_chain_info
21
21
 
22
+ attr_accessor :certificates_template_info
23
+
22
24
  attr_accessor :classic_key_details
23
25
 
24
26
  attr_accessor :cluster_gw_url
@@ -44,6 +46,7 @@ module Akeyless
44
46
  {
45
47
  :'cert_issue_details' => :'cert_issue_details',
46
48
  :'certificate_chain_info' => :'certificate_chain_info',
49
+ :'certificates_template_info' => :'certificates_template_info',
47
50
  :'classic_key_details' => :'classic_key_details',
48
51
  :'cluster_gw_url' => :'cluster_gw_url',
49
52
  :'display_metadata' => :'display_metadata',
@@ -67,6 +70,7 @@ module Akeyless
67
70
  {
68
71
  :'cert_issue_details' => :'CertificateIssueInfo',
69
72
  :'certificate_chain_info' => :'CertificateChainInfo',
73
+ :'certificates_template_info' => :'CertificateTemplateInfo',
70
74
  :'classic_key_details' => :'ClassicKeyDetailsInfo',
71
75
  :'cluster_gw_url' => :'String',
72
76
  :'display_metadata' => :'String',
@@ -109,6 +113,10 @@ module Akeyless
109
113
  self.certificate_chain_info = attributes[:'certificate_chain_info']
110
114
  end
111
115
 
116
+ if attributes.key?(:'certificates_template_info')
117
+ self.certificates_template_info = attributes[:'certificates_template_info']
118
+ end
119
+
112
120
  if attributes.key?(:'classic_key_details')
113
121
  self.classic_key_details = attributes[:'classic_key_details']
114
122
  end
@@ -170,6 +178,7 @@ module Akeyless
170
178
  self.class == o.class &&
171
179
  cert_issue_details == o.cert_issue_details &&
172
180
  certificate_chain_info == o.certificate_chain_info &&
181
+ certificates_template_info == o.certificates_template_info &&
173
182
  classic_key_details == o.classic_key_details &&
174
183
  cluster_gw_url == o.cluster_gw_url &&
175
184
  display_metadata == o.display_metadata &&
@@ -191,7 +200,7 @@ module Akeyless
191
200
  # Calculates hash code according to all attributes.
192
201
  # @return [Integer] Hash code
193
202
  def hash
194
- [cert_issue_details, certificate_chain_info, classic_key_details, cluster_gw_url, display_metadata, dynamic_secret_producer_details, importer_info, password_policy, rotated_secret_details, secure_remote_access_details, static_secret_info, tokenizer_info].hash
203
+ [cert_issue_details, certificate_chain_info, certificates_template_info, classic_key_details, cluster_gw_url, display_metadata, dynamic_secret_producer_details, importer_info, password_policy, rotated_secret_details, secure_remote_access_details, static_secret_info, tokenizer_info].hash
195
204
  end
196
205
 
197
206
  # Builds the object from hash
@@ -0,0 +1,326 @@
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: 7.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class SignDataWithClassicKey
18
+ # Data
19
+ attr_accessor :data
20
+
21
+ # The name of the key to use in the sign data process
22
+ attr_accessor :display_id
23
+
24
+ # Defines whether the data should be hashed as part of the signing. If true, the data will not be hashed
25
+ attr_accessor :hashed
26
+
27
+ # HashingMethod
28
+ attr_accessor :hashing_method
29
+
30
+ # Set output format to JSON
31
+ attr_accessor :json
32
+
33
+ # ClassicKey name
34
+ attr_accessor :name
35
+
36
+ # Authentication token (see `/auth` and `/configure`)
37
+ attr_accessor :token
38
+
39
+ # The universal identity token, Required only for universal_identity authentication
40
+ attr_accessor :uid_token
41
+
42
+ # classic key version
43
+ attr_accessor :version
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'data' => :'data',
49
+ :'display_id' => :'display-id',
50
+ :'hashed' => :'hashed',
51
+ :'hashing_method' => :'hashing-method',
52
+ :'json' => :'json',
53
+ :'name' => :'name',
54
+ :'token' => :'token',
55
+ :'uid_token' => :'uid-token',
56
+ :'version' => :'version'
57
+ }
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'data' => :'String',
69
+ :'display_id' => :'String',
70
+ :'hashed' => :'Boolean',
71
+ :'hashing_method' => :'String',
72
+ :'json' => :'Boolean',
73
+ :'name' => :'String',
74
+ :'token' => :'String',
75
+ :'uid_token' => :'String',
76
+ :'version' => :'Integer'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::SignDataWithClassicKey` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!self.class.attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::SignDataWithClassicKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'data')
102
+ self.data = attributes[:'data']
103
+ end
104
+
105
+ if attributes.key?(:'display_id')
106
+ self.display_id = attributes[:'display_id']
107
+ end
108
+
109
+ if attributes.key?(:'hashed')
110
+ self.hashed = attributes[:'hashed']
111
+ else
112
+ self.hashed = false
113
+ end
114
+
115
+ if attributes.key?(:'hashing_method')
116
+ self.hashing_method = attributes[:'hashing_method']
117
+ else
118
+ self.hashing_method = 'SHA256'
119
+ end
120
+
121
+ if attributes.key?(:'json')
122
+ self.json = attributes[:'json']
123
+ else
124
+ self.json = false
125
+ end
126
+
127
+ if attributes.key?(:'name')
128
+ self.name = attributes[:'name']
129
+ end
130
+
131
+ if attributes.key?(:'token')
132
+ self.token = attributes[:'token']
133
+ end
134
+
135
+ if attributes.key?(:'uid_token')
136
+ self.uid_token = attributes[:'uid_token']
137
+ end
138
+
139
+ if attributes.key?(:'version')
140
+ self.version = attributes[:'version']
141
+ end
142
+ end
143
+
144
+ # Show invalid properties with the reasons. Usually used together with valid?
145
+ # @return Array for valid properties with the reasons
146
+ def list_invalid_properties
147
+ invalid_properties = Array.new
148
+ if @data.nil?
149
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
150
+ end
151
+
152
+ if @display_id.nil?
153
+ invalid_properties.push('invalid value for "display_id", display_id cannot be nil.')
154
+ end
155
+
156
+ if @name.nil?
157
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
158
+ end
159
+
160
+ if @version.nil?
161
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
162
+ end
163
+
164
+ invalid_properties
165
+ end
166
+
167
+ # Check to see if the all the properties in the model are valid
168
+ # @return true if the model is valid
169
+ def valid?
170
+ return false if @data.nil?
171
+ return false if @display_id.nil?
172
+ return false if @name.nil?
173
+ return false if @version.nil?
174
+ true
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ data == o.data &&
183
+ display_id == o.display_id &&
184
+ hashed == o.hashed &&
185
+ hashing_method == o.hashing_method &&
186
+ json == o.json &&
187
+ name == o.name &&
188
+ token == o.token &&
189
+ uid_token == o.uid_token &&
190
+ version == o.version
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(o)
196
+ self == o
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ def hash
202
+ [data, display_id, hashed, hashing_method, json, name, token, uid_token, version].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def self.build_from_hash(attributes)
209
+ new.build_from_hash(attributes)
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ attributes = attributes.transform_keys(&:to_sym)
218
+ self.class.openapi_types.each_pair do |key, type|
219
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
220
+ self.send("#{key}=", nil)
221
+ elsif type =~ /\AArray<(.*)>/i
222
+ # check to ensure the input is an array given that the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
225
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
226
+ end
227
+ elsif !attributes[self.class.attribute_map[key]].nil?
228
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
229
+ end
230
+ end
231
+
232
+ self
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def _deserialize(type, value)
240
+ case type.to_sym
241
+ when :Time
242
+ Time.parse(value)
243
+ when :Date
244
+ Date.parse(value)
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :Boolean
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else # model
272
+ # models (e.g. Pet) or oneOf
273
+ klass = Akeyless.const_get(type)
274
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
275
+ end
276
+ end
277
+
278
+ # Returns the string representation of the object
279
+ # @return [String] String presentation of the object
280
+ def to_s
281
+ to_hash.to_s
282
+ end
283
+
284
+ # to_body is an alias to to_hash (backward compatibility)
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_body
287
+ to_hash
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ if value.nil?
297
+ is_nullable = self.class.openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map { |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+
324
+ end
325
+
326
+ end