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,226 @@
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
+ # OCIAccessRules contains access rules specific to Oracle cloud instance / user authentication
18
+ class OCIAccessRules
19
+ attr_accessor :group_ocids
20
+
21
+ attr_accessor :tenant_ocid
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'group_ocids' => :'group_ocids',
27
+ :'tenant_ocid' => :'tenant_ocid'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'group_ocids' => :'Array<String>',
40
+ :'tenant_ocid' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::OCIAccessRules` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::OCIAccessRules`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'group_ocids')
66
+ if (value = attributes[:'group_ocids']).is_a?(Array)
67
+ self.group_ocids = value
68
+ end
69
+ end
70
+
71
+ if attributes.key?(:'tenant_ocid')
72
+ self.tenant_ocid = attributes[:'tenant_ocid']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ group_ocids == o.group_ocids &&
97
+ tenant_ocid == o.tenant_ocid
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [group_ocids, tenant_ocid].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ attributes = attributes.transform_keys(&:to_sym)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash["#{key}"] = nil
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[attribute_map[key]].is_a?(Array)
126
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ end
128
+ elsif !attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ end
131
+ end
132
+ new(transformed_hash)
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def self._deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = Akeyless.const_get(type)
174
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -0,0 +1,275 @@
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
+ # provisionCertificate is a command that provisions a certificate content to a target
18
+ class ProvisionCertificate
19
+ # Certificate display ID
20
+ attr_accessor :display_id
21
+
22
+ # Certificate item ID
23
+ attr_accessor :item_id
24
+
25
+ # Set output format to JSON
26
+ attr_accessor :json
27
+
28
+ # Certificate name
29
+ attr_accessor :name
30
+
31
+ # Authentication token (see `/auth` and `/configure`)
32
+ attr_accessor :token
33
+
34
+ # The universal identity token, Required only for universal_identity authentication
35
+ attr_accessor :uid_token
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'display_id' => :'display-id',
41
+ :'item_id' => :'item-id',
42
+ :'json' => :'json',
43
+ :'name' => :'name',
44
+ :'token' => :'token',
45
+ :'uid_token' => :'uid-token'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'display_id' => :'String',
58
+ :'item_id' => :'Integer',
59
+ :'json' => :'Boolean',
60
+ :'name' => :'String',
61
+ :'token' => :'String',
62
+ :'uid_token' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::ProvisionCertificate` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::ProvisionCertificate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'display_id')
88
+ self.display_id = attributes[:'display_id']
89
+ end
90
+
91
+ if attributes.key?(:'item_id')
92
+ self.item_id = attributes[:'item_id']
93
+ end
94
+
95
+ if attributes.key?(:'json')
96
+ self.json = attributes[:'json']
97
+ else
98
+ self.json = false
99
+ end
100
+
101
+ if attributes.key?(:'name')
102
+ self.name = attributes[:'name']
103
+ else
104
+ self.name = nil
105
+ end
106
+
107
+ if attributes.key?(:'token')
108
+ self.token = attributes[:'token']
109
+ end
110
+
111
+ if attributes.key?(:'uid_token')
112
+ self.uid_token = attributes[:'uid_token']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ if @name.nil?
122
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ return false if @name.nil?
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ display_id == o.display_id &&
142
+ item_id == o.item_id &&
143
+ json == o.json &&
144
+ name == o.name &&
145
+ token == o.token &&
146
+ uid_token == o.uid_token
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [display_id, item_id, json, name, token, uid_token].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def self._deserialize(type, value)
189
+ case type.to_sym
190
+ when :Time
191
+ Time.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ # models (e.g. Pet) or oneOf
222
+ klass = Akeyless.const_get(type)
223
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+
275
+ end