akeyless 3.5.4 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -2
  3. data/docs/AssocTargetItem.md +8 -0
  4. data/docs/Auth.md +4 -0
  5. data/docs/AuthMethod.md +2 -0
  6. data/docs/AuthMethodAccessInfo.md +2 -0
  7. data/docs/CertificateChainInfo.md +4 -0
  8. data/docs/CertificateVersionInfo.md +22 -0
  9. data/docs/Configure.md +5 -1
  10. data/docs/Connect.md +1 -1
  11. data/docs/CreateAuthMethod.md +2 -0
  12. data/docs/CreateAuthMethodAWSIAM.md +2 -0
  13. data/docs/CreateAuthMethodAzureAD.md +3 -1
  14. data/docs/CreateAuthMethodCert.md +2 -0
  15. data/docs/CreateAuthMethodEmail.md +2 -0
  16. data/docs/CreateAuthMethodGCP.md +2 -0
  17. data/docs/CreateAuthMethodHuawei.md +2 -0
  18. data/docs/CreateAuthMethodK8S.md +2 -0
  19. data/docs/CreateAuthMethodLDAP.md +2 -0
  20. data/docs/CreateAuthMethodOAuth2.md +2 -0
  21. data/docs/CreateAuthMethodOCI.md +40 -0
  22. data/docs/CreateAuthMethodOCIOutput.md +18 -0
  23. data/docs/CreateAuthMethodOIDC.md +2 -0
  24. data/docs/CreateAuthMethodSAML.md +2 -0
  25. data/docs/CreateAuthMethodUniversalIdentity.md +2 -0
  26. data/docs/CreateEventForwarder.md +1 -1
  27. data/docs/CreateLinkedTarget.md +2 -0
  28. data/docs/CreateRole.md +4 -0
  29. data/docs/CreateRotatedSecret.md +7 -1
  30. data/docs/CreateSSHCertIssuer.md +4 -4
  31. data/docs/CreateSecret.md +2 -0
  32. data/docs/GatewayCreateMigration.md +2 -0
  33. data/docs/GatewayCreateProducerCassandra.md +4 -0
  34. data/docs/GatewayUpdateItem.md +2 -0
  35. data/docs/GatewayUpdateMigration.md +2 -0
  36. data/docs/GatewayUpdateProducerCassandra.md +4 -0
  37. data/docs/GenerateCsr.md +1 -1
  38. data/docs/GwClusterIdentity.md +2 -0
  39. data/docs/ImportPasswords.md +3 -1
  40. data/docs/ImportPasswordsOutput.md +3 -1
  41. data/docs/ItemVersion.md +2 -0
  42. data/docs/OCIAccessRules.md +20 -0
  43. data/docs/ProvisionCertificate.md +28 -0
  44. data/docs/ProvisionCertificateOutput.md +24 -0
  45. data/docs/RenewCertificate.md +28 -0
  46. data/docs/RenewCertificateOutput.md +28 -0
  47. data/docs/SecureRemoteAccess.md +2 -0
  48. data/docs/ServerInventoryPayload.md +2 -0
  49. data/docs/SetRoleRule.md +1 -1
  50. data/docs/SignDataWithClassicKey.md +2 -0
  51. data/docs/SignEcDsa.md +5 -1
  52. data/docs/SignPKCS1.md +9 -1
  53. data/docs/SignPKCS1Output.md +1 -1
  54. data/docs/SignRsaSsaPss.md +5 -1
  55. data/docs/StaticSecretDetailsInfo.md +2 -0
  56. data/docs/TargetItemVersion.md +2 -0
  57. data/docs/UpdateAuthMethod.md +2 -0
  58. data/docs/UpdateAuthMethodAWSIAM.md +2 -0
  59. data/docs/UpdateAuthMethodAzureAD.md +3 -1
  60. data/docs/UpdateAuthMethodCert.md +2 -0
  61. data/docs/UpdateAuthMethodGCP.md +2 -0
  62. data/docs/UpdateAuthMethodK8S.md +2 -0
  63. data/docs/UpdateAuthMethodLDAP.md +2 -0
  64. data/docs/UpdateAuthMethodOAuth2.md +2 -0
  65. data/docs/UpdateAuthMethodOCI.md +42 -0
  66. data/docs/UpdateAuthMethodOCIOutput.md +18 -0
  67. data/docs/UpdateAuthMethodOIDC.md +2 -0
  68. data/docs/UpdateAuthMethodSAML.md +2 -0
  69. data/docs/UpdateAuthMethodUniversalIdentity.md +2 -0
  70. data/docs/UpdateCertificateValue.md +2 -0
  71. data/docs/UpdateItem.md +6 -0
  72. data/docs/UpdateLinkedTarget.md +2 -0
  73. data/docs/UpdateRole.md +4 -0
  74. data/docs/UpdateSSHCertIssuer.md +3 -3
  75. data/docs/UpdateSecretVal.md +2 -0
  76. data/docs/V2Api.md +264 -9
  77. data/docs/VerifyEcDsa.md +5 -1
  78. data/docs/VerifyPKCS1.md +9 -1
  79. data/docs/VerifyRsaSsaPss.md +5 -1
  80. data/lib/akeyless/api/v2_api.rb +274 -7
  81. data/lib/akeyless/models/assoc_target_item.rb +43 -1
  82. data/lib/akeyless/models/auth.rb +25 -1
  83. data/lib/akeyless/models/auth_method.rb +10 -1
  84. data/lib/akeyless/models/auth_method_access_info.rb +10 -1
  85. data/lib/akeyless/models/certificate_chain_info.rb +19 -1
  86. data/lib/akeyless/models/certificate_version_info.rb +232 -0
  87. data/lib/akeyless/models/configure.rb +28 -4
  88. data/lib/akeyless/models/connect.rb +1 -1
  89. data/lib/akeyless/models/create_auth_method.rb +11 -1
  90. data/lib/akeyless/models/create_auth_method_awsiam.rb +11 -1
  91. data/lib/akeyless/models/create_auth_method_azure_ad.rb +12 -2
  92. data/lib/akeyless/models/create_auth_method_cert.rb +11 -1
  93. data/lib/akeyless/models/create_auth_method_email.rb +11 -1
  94. data/lib/akeyless/models/create_auth_method_gcp.rb +11 -1
  95. data/lib/akeyless/models/create_auth_method_huawei.rb +11 -1
  96. data/lib/akeyless/models/create_auth_method_k8_s.rb +11 -1
  97. data/lib/akeyless/models/create_auth_method_ldap.rb +11 -1
  98. data/lib/akeyless/models/create_auth_method_o_auth2.rb +11 -1
  99. data/lib/akeyless/models/create_auth_method_oci.rb +359 -0
  100. data/lib/akeyless/models/create_auth_method_oci_output.rb +214 -0
  101. data/lib/akeyless/models/create_auth_method_oidc.rb +11 -1
  102. data/lib/akeyless/models/create_auth_method_saml.rb +11 -1
  103. data/lib/akeyless/models/create_auth_method_universal_identity.rb +11 -1
  104. data/lib/akeyless/models/create_event_forwarder.rb +1 -1
  105. data/lib/akeyless/models/create_linked_target.rb +11 -1
  106. data/lib/akeyless/models/create_role.rb +21 -1
  107. data/lib/akeyless/models/create_rotated_secret.rb +35 -2
  108. data/lib/akeyless/models/create_secret.rb +11 -1
  109. data/lib/akeyless/models/create_ssh_cert_issuer.rb +9 -9
  110. data/lib/akeyless/models/gateway_create_migration.rb +11 -1
  111. data/lib/akeyless/models/gateway_create_producer_cassandra.rb +23 -1
  112. data/lib/akeyless/models/gateway_update_item.rb +11 -1
  113. data/lib/akeyless/models/gateway_update_migration.rb +11 -1
  114. data/lib/akeyless/models/gateway_update_producer_cassandra.rb +23 -1
  115. data/lib/akeyless/models/generate_csr.rb +1 -1
  116. data/lib/akeyless/models/gw_cluster_identity.rb +10 -1
  117. data/lib/akeyless/models/import_passwords.rb +13 -4
  118. data/lib/akeyless/models/import_passwords_output.rb +13 -4
  119. data/lib/akeyless/models/item_version.rb +10 -1
  120. data/lib/akeyless/models/oci_access_rules.rb +226 -0
  121. data/lib/akeyless/models/provision_certificate.rb +275 -0
  122. data/lib/akeyless/models/provision_certificate_output.rb +243 -0
  123. data/lib/akeyless/models/renew_certificate.rb +267 -0
  124. data/lib/akeyless/models/renew_certificate_output.rb +259 -0
  125. data/lib/akeyless/models/secure_remote_access.rb +12 -1
  126. data/lib/akeyless/models/server_inventory_payload.rb +12 -1
  127. data/lib/akeyless/models/set_role_rule.rb +1 -1
  128. data/lib/akeyless/models/sign_data_with_classic_key.rb +13 -1
  129. data/lib/akeyless/models/sign_ec_dsa.rb +24 -4
  130. data/lib/akeyless/models/sign_pkcs1.rb +44 -4
  131. data/lib/akeyless/models/sign_pkcs1_output.rb +2 -4
  132. data/lib/akeyless/models/sign_rsa_ssa_pss.rb +24 -4
  133. data/lib/akeyless/models/static_secret_details_info.rb +10 -1
  134. data/lib/akeyless/models/target_item_version.rb +10 -1
  135. data/lib/akeyless/models/update_auth_method.rb +11 -1
  136. data/lib/akeyless/models/update_auth_method_awsiam.rb +11 -1
  137. data/lib/akeyless/models/update_auth_method_azure_ad.rb +12 -2
  138. data/lib/akeyless/models/update_auth_method_cert.rb +11 -1
  139. data/lib/akeyless/models/update_auth_method_gcp.rb +11 -1
  140. data/lib/akeyless/models/update_auth_method_k8_s.rb +11 -1
  141. data/lib/akeyless/models/update_auth_method_ldap.rb +11 -1
  142. data/lib/akeyless/models/update_auth_method_o_auth2.rb +11 -1
  143. data/lib/akeyless/models/update_auth_method_oci.rb +369 -0
  144. data/lib/akeyless/models/update_auth_method_oci_output.rb +214 -0
  145. data/lib/akeyless/models/update_auth_method_oidc.rb +11 -1
  146. data/lib/akeyless/models/update_auth_method_saml.rb +11 -1
  147. data/lib/akeyless/models/update_auth_method_universal_identity.rb +11 -1
  148. data/lib/akeyless/models/update_certificate_value.rb +11 -1
  149. data/lib/akeyless/models/update_item.rb +32 -1
  150. data/lib/akeyless/models/update_linked_target.rb +11 -1
  151. data/lib/akeyless/models/update_role.rb +21 -1
  152. data/lib/akeyless/models/update_secret_val.rb +11 -1
  153. data/lib/akeyless/models/update_ssh_cert_issuer.rb +8 -8
  154. data/lib/akeyless/models/verify_ec_dsa.rb +24 -4
  155. data/lib/akeyless/models/verify_pkcs1.rb +44 -4
  156. data/lib/akeyless/models/verify_rsa_ssa_pss.rb +24 -4
  157. data/lib/akeyless/version.rb +1 -1
  158. data/lib/akeyless.rb +10 -0
  159. data/spec/models/certificate_version_info_spec.rb +48 -0
  160. data/spec/models/create_auth_method_oci_output_spec.rb +36 -0
  161. data/spec/models/create_auth_method_oci_spec.rb +102 -0
  162. data/spec/models/oci_access_rules_spec.rb +42 -0
  163. data/spec/models/provision_certificate_output_spec.rb +54 -0
  164. data/spec/models/provision_certificate_spec.rb +66 -0
  165. data/spec/models/renew_certificate_output_spec.rb +66 -0
  166. data/spec/models/renew_certificate_spec.rb +66 -0
  167. data/spec/models/update_auth_method_oci_output_spec.rb +36 -0
  168. data/spec/models/update_auth_method_oci_spec.rb +108 -0
  169. metadata +43 -3
@@ -0,0 +1,243 @@
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.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class ProvisionCertificateOutput
18
+ attr_accessor :fail_message
19
+
20
+ attr_accessor :success_message
21
+
22
+ attr_accessor :host_names
23
+
24
+ attr_accessor :provisioned_at
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'fail_message' => :'FailMessage',
30
+ :'success_message' => :'SuccessMessage',
31
+ :'host_names' => :'host_names',
32
+ :'provisioned_at' => :'provisioned_at'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'fail_message' => :'String',
45
+ :'success_message' => :'String',
46
+ :'host_names' => :'Array<String>',
47
+ :'provisioned_at' => :'Time'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::ProvisionCertificateOutput` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::ProvisionCertificateOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'fail_message')
73
+ self.fail_message = attributes[:'fail_message']
74
+ end
75
+
76
+ if attributes.key?(:'success_message')
77
+ self.success_message = attributes[:'success_message']
78
+ end
79
+
80
+ if attributes.key?(:'host_names')
81
+ if (value = attributes[:'host_names']).is_a?(Array)
82
+ self.host_names = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'provisioned_at')
87
+ self.provisioned_at = attributes[:'provisioned_at']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ fail_message == o.fail_message &&
112
+ success_message == o.success_message &&
113
+ host_names == o.host_names &&
114
+ provisioned_at == o.provisioned_at
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [fail_message, success_message, host_names, provisioned_at].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
135
+ transformed_hash = {}
136
+ openapi_types.each_pair do |key, type|
137
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[attribute_map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
144
+ end
145
+ elsif !attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
147
+ end
148
+ end
149
+ new(transformed_hash)
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def self._deserialize(type, value)
157
+ case type.to_sym
158
+ when :Time
159
+ Time.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ # models (e.g. Pet) or oneOf
190
+ klass = Akeyless.const_get(type)
191
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+
243
+ end
@@ -0,0 +1,267 @@
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.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class RenewCertificate
18
+ # Generate a new key as part of the certificate renewal
19
+ attr_accessor :generate_key
20
+
21
+ # Certificate item id
22
+ attr_accessor :item_id
23
+
24
+ # Set output format to JSON
25
+ attr_accessor :json
26
+
27
+ # Certificate name
28
+ attr_accessor :name
29
+
30
+ # Authentication token (see `/auth` and `/configure`)
31
+ attr_accessor :token
32
+
33
+ # The universal identity token, Required only for universal_identity authentication
34
+ attr_accessor :uid_token
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'generate_key' => :'generate-key',
40
+ :'item_id' => :'item-id',
41
+ :'json' => :'json',
42
+ :'name' => :'name',
43
+ :'token' => :'token',
44
+ :'uid_token' => :'uid-token'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'generate_key' => :'Boolean',
57
+ :'item_id' => :'Integer',
58
+ :'json' => :'Boolean',
59
+ :'name' => :'String',
60
+ :'token' => :'String',
61
+ :'uid_token' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::RenewCertificate` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::RenewCertificate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'generate_key')
87
+ self.generate_key = attributes[:'generate_key']
88
+ end
89
+
90
+ if attributes.key?(:'item_id')
91
+ self.item_id = attributes[:'item_id']
92
+ end
93
+
94
+ if attributes.key?(:'json')
95
+ self.json = attributes[:'json']
96
+ else
97
+ self.json = false
98
+ end
99
+
100
+ if attributes.key?(:'name')
101
+ self.name = attributes[:'name']
102
+ end
103
+
104
+ if attributes.key?(:'token')
105
+ self.token = attributes[:'token']
106
+ end
107
+
108
+ if attributes.key?(:'uid_token')
109
+ self.uid_token = attributes[:'uid_token']
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
117
+ invalid_properties = Array.new
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ true
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ generate_key == o.generate_key &&
134
+ item_id == o.item_id &&
135
+ json == o.json &&
136
+ name == o.name &&
137
+ token == o.token &&
138
+ uid_token == o.uid_token
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [generate_key, item_id, json, name, token, uid_token].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ attributes = attributes.transform_keys(&:to_sym)
159
+ transformed_hash = {}
160
+ openapi_types.each_pair do |key, type|
161
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = nil
163
+ elsif type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[attribute_map[key]].is_a?(Array)
167
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
168
+ end
169
+ elsif !attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
171
+ end
172
+ end
173
+ new(transformed_hash)
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def self._deserialize(type, value)
181
+ case type.to_sym
182
+ when :Time
183
+ Time.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :Boolean
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ # models (e.g. Pet) or oneOf
214
+ klass = Akeyless.const_get(type)
215
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+
265
+ end
266
+
267
+ end