trulioo_sdk 1.0.3

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 (92) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +155 -0
  3. data/docs/Address.md +44 -0
  4. data/docs/AppendedField.md +20 -0
  5. data/docs/Business.md +36 -0
  6. data/docs/BusinessApi.md +155 -0
  7. data/docs/BusinessRecord.md +24 -0
  8. data/docs/BusinessRegistrationNumber.md +30 -0
  9. data/docs/BusinessRegistrationNumberMask.md +22 -0
  10. data/docs/BusinessResult.md +22 -0
  11. data/docs/BusinessSearchRequest.md +28 -0
  12. data/docs/BusinessSearchRequestBusinessSearchModel.md +26 -0
  13. data/docs/BusinessSearchResponse.md +28 -0
  14. data/docs/BusinessSearchResponseIndustryCode.md +20 -0
  15. data/docs/Communication.md +24 -0
  16. data/docs/ConfigurationApi.md +761 -0
  17. data/docs/ConnectionApi.md +213 -0
  18. data/docs/Consent.md +22 -0
  19. data/docs/CountrySubdivision.md +22 -0
  20. data/docs/DataField.md +22 -0
  21. data/docs/DataFields.md +34 -0
  22. data/docs/DatasourceField.md +24 -0
  23. data/docs/DatasourceResult.md +28 -0
  24. data/docs/Document.md +28 -0
  25. data/docs/DriverLicence.md +26 -0
  26. data/docs/Location.md +42 -0
  27. data/docs/LocationAdditionalFields.md +18 -0
  28. data/docs/NationalId.md +28 -0
  29. data/docs/NormalizedDatasourceField.md +20 -0
  30. data/docs/NormalizedDatasourceGroupCountry.md +34 -0
  31. data/docs/Passport.md +28 -0
  32. data/docs/PersonInfo.md +38 -0
  33. data/docs/PersonInfoAdditionalFields.md +18 -0
  34. data/docs/Record.md +26 -0
  35. data/docs/RecordRule.md +20 -0
  36. data/docs/Result.md +62 -0
  37. data/docs/ServiceError.md +20 -0
  38. data/docs/TestEntityDataFields.md +36 -0
  39. data/docs/TransactionRecordResult.md +32 -0
  40. data/docs/TransactionRecordResultAllOf.md +18 -0
  41. data/docs/TransactionStatus.md +26 -0
  42. data/docs/VerificationsApi.md +529 -0
  43. data/docs/VerifyRequest.md +38 -0
  44. data/docs/VerifyResult.md +30 -0
  45. data/lib/trulioo_sdk.rb +77 -0
  46. data/lib/trulioo_sdk/api/business_api.rb +158 -0
  47. data/lib/trulioo_sdk/api/configuration_api.rb +750 -0
  48. data/lib/trulioo_sdk/api/connection_api.rb +221 -0
  49. data/lib/trulioo_sdk/api/verifications_api.rb +515 -0
  50. data/lib/trulioo_sdk/api_client.rb +391 -0
  51. data/lib/trulioo_sdk/api_error.rb +53 -0
  52. data/lib/trulioo_sdk/configuration.rb +268 -0
  53. data/lib/trulioo_sdk/models/address.rb +356 -0
  54. data/lib/trulioo_sdk/models/appended_field.rb +237 -0
  55. data/lib/trulioo_sdk/models/business.rb +318 -0
  56. data/lib/trulioo_sdk/models/business_record.rb +261 -0
  57. data/lib/trulioo_sdk/models/business_registration_number.rb +410 -0
  58. data/lib/trulioo_sdk/models/business_registration_number_mask.rb +272 -0
  59. data/lib/trulioo_sdk/models/business_result.rb +249 -0
  60. data/lib/trulioo_sdk/models/business_search_request.rb +306 -0
  61. data/lib/trulioo_sdk/models/business_search_request_business_search_model.rb +364 -0
  62. data/lib/trulioo_sdk/models/business_search_response.rb +279 -0
  63. data/lib/trulioo_sdk/models/business_search_response_industry_code.rb +236 -0
  64. data/lib/trulioo_sdk/models/communication.rb +354 -0
  65. data/lib/trulioo_sdk/models/consent.rb +249 -0
  66. data/lib/trulioo_sdk/models/country_subdivision.rb +320 -0
  67. data/lib/trulioo_sdk/models/data_field.rb +245 -0
  68. data/lib/trulioo_sdk/models/data_fields.rb +306 -0
  69. data/lib/trulioo_sdk/models/datasource_field.rb +254 -0
  70. data/lib/trulioo_sdk/models/datasource_result.rb +281 -0
  71. data/lib/trulioo_sdk/models/document.rb +278 -0
  72. data/lib/trulioo_sdk/models/driver_licence.rb +268 -0
  73. data/lib/trulioo_sdk/models/location.rb +347 -0
  74. data/lib/trulioo_sdk/models/location_additional_fields.rb +229 -0
  75. data/lib/trulioo_sdk/models/national_id.rb +277 -0
  76. data/lib/trulioo_sdk/models/normalized_datasource_field.rb +286 -0
  77. data/lib/trulioo_sdk/models/normalized_datasource_group_country.rb +437 -0
  78. data/lib/trulioo_sdk/models/passport.rb +326 -0
  79. data/lib/trulioo_sdk/models/person_info.rb +448 -0
  80. data/lib/trulioo_sdk/models/person_info_additional_fields.rb +228 -0
  81. data/lib/trulioo_sdk/models/record.rb +270 -0
  82. data/lib/trulioo_sdk/models/record_rule.rb +239 -0
  83. data/lib/trulioo_sdk/models/result.rb +440 -0
  84. data/lib/trulioo_sdk/models/service_error.rb +236 -0
  85. data/lib/trulioo_sdk/models/test_entity_data_fields.rb +315 -0
  86. data/lib/trulioo_sdk/models/transaction_record_result.rb +307 -0
  87. data/lib/trulioo_sdk/models/transaction_record_result_all_of.rb +229 -0
  88. data/lib/trulioo_sdk/models/transaction_status.rb +341 -0
  89. data/lib/trulioo_sdk/models/verify_request.rb +410 -0
  90. data/lib/trulioo_sdk/models/verify_result.rb +288 -0
  91. data/lib/trulioo_sdk/version.rb +11 -0
  92. metadata +223 -0
@@ -0,0 +1,364 @@
1
+ =begin
2
+ Trulioo Ruby SDK
3
+
4
+ Gem version: 1.0.3
5
+ Trulioo OpenAPI version: v1
6
+ Generated by OpenAPI Generator version: 5.0.1
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Trulioo
13
+ # Business Object
14
+ class BusinessSearchRequestBusinessSearchModel
15
+ # Name of the business to be verified
16
+ attr_accessor :business_name
17
+
18
+ # Website of the business
19
+ attr_accessor :website
20
+
21
+ # Jurisdiction Of Incorporation of the business to be verified
22
+ attr_accessor :jurisdiction_of_incorporation
23
+
24
+ # DUNS number of the business to be verified
25
+ attr_accessor :duns_number
26
+
27
+ attr_accessor :location
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'business_name' => :'BusinessName',
33
+ :'website' => :'Website',
34
+ :'jurisdiction_of_incorporation' => :'JurisdictionOfIncorporation',
35
+ :'duns_number' => :'DUNSNumber',
36
+ :'location' => :'Location'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'business_name' => :'String',
49
+ :'website' => :'String',
50
+ :'jurisdiction_of_incorporation' => :'String',
51
+ :'duns_number' => :'String',
52
+ :'location' => :'Location'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::BusinessSearchRequestBusinessSearchModel` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::BusinessSearchRequestBusinessSearchModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'business_name')
78
+ self.business_name = attributes[:'business_name']
79
+ end
80
+
81
+ if attributes.key?(:'website')
82
+ self.website = attributes[:'website']
83
+ end
84
+
85
+ if attributes.key?(:'jurisdiction_of_incorporation')
86
+ self.jurisdiction_of_incorporation = attributes[:'jurisdiction_of_incorporation']
87
+ end
88
+
89
+ if attributes.key?(:'duns_number')
90
+ self.duns_number = attributes[:'duns_number']
91
+ end
92
+
93
+ if attributes.key?(:'location')
94
+ self.location = attributes[:'location']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ if !@business_name.nil? && @business_name.to_s.length > 250
103
+ invalid_properties.push('invalid value for "business_name", the character length must be smaller than or equal to 250.')
104
+ end
105
+
106
+ if !@business_name.nil? && @business_name.to_s.length < 0
107
+ invalid_properties.push('invalid value for "business_name", the character length must be great than or equal to 0.')
108
+ end
109
+
110
+ if !@website.nil? && @website.to_s.length > 250
111
+ invalid_properties.push('invalid value for "website", the character length must be smaller than or equal to 250.')
112
+ end
113
+
114
+ if !@website.nil? && @website.to_s.length < 0
115
+ invalid_properties.push('invalid value for "website", the character length must be great than or equal to 0.')
116
+ end
117
+
118
+ if !@jurisdiction_of_incorporation.nil? && @jurisdiction_of_incorporation.to_s.length > 250
119
+ invalid_properties.push('invalid value for "jurisdiction_of_incorporation", the character length must be smaller than or equal to 250.')
120
+ end
121
+
122
+ if !@jurisdiction_of_incorporation.nil? && @jurisdiction_of_incorporation.to_s.length < 0
123
+ invalid_properties.push('invalid value for "jurisdiction_of_incorporation", the character length must be great than or equal to 0.')
124
+ end
125
+
126
+ if !@duns_number.nil? && @duns_number.to_s.length > 250
127
+ invalid_properties.push('invalid value for "duns_number", the character length must be smaller than or equal to 250.')
128
+ end
129
+
130
+ if !@duns_number.nil? && @duns_number.to_s.length < 0
131
+ invalid_properties.push('invalid value for "duns_number", the character length must be great than or equal to 0.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ return false if !@business_name.nil? && @business_name.to_s.length > 250
141
+ return false if !@business_name.nil? && @business_name.to_s.length < 0
142
+ return false if !@website.nil? && @website.to_s.length > 250
143
+ return false if !@website.nil? && @website.to_s.length < 0
144
+ return false if !@jurisdiction_of_incorporation.nil? && @jurisdiction_of_incorporation.to_s.length > 250
145
+ return false if !@jurisdiction_of_incorporation.nil? && @jurisdiction_of_incorporation.to_s.length < 0
146
+ return false if !@duns_number.nil? && @duns_number.to_s.length > 250
147
+ return false if !@duns_number.nil? && @duns_number.to_s.length < 0
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] business_name Value to be assigned
153
+ def business_name=(business_name)
154
+ if !business_name.nil? && business_name.to_s.length > 250
155
+ fail ArgumentError, 'invalid value for "business_name", the character length must be smaller than or equal to 250.'
156
+ end
157
+
158
+ if !business_name.nil? && business_name.to_s.length < 0
159
+ fail ArgumentError, 'invalid value for "business_name", the character length must be great than or equal to 0.'
160
+ end
161
+
162
+ @business_name = business_name
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] website Value to be assigned
167
+ def website=(website)
168
+ if !website.nil? && website.to_s.length > 250
169
+ fail ArgumentError, 'invalid value for "website", the character length must be smaller than or equal to 250.'
170
+ end
171
+
172
+ if !website.nil? && website.to_s.length < 0
173
+ fail ArgumentError, 'invalid value for "website", the character length must be great than or equal to 0.'
174
+ end
175
+
176
+ @website = website
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] jurisdiction_of_incorporation Value to be assigned
181
+ def jurisdiction_of_incorporation=(jurisdiction_of_incorporation)
182
+ if !jurisdiction_of_incorporation.nil? && jurisdiction_of_incorporation.to_s.length > 250
183
+ fail ArgumentError, 'invalid value for "jurisdiction_of_incorporation", the character length must be smaller than or equal to 250.'
184
+ end
185
+
186
+ if !jurisdiction_of_incorporation.nil? && jurisdiction_of_incorporation.to_s.length < 0
187
+ fail ArgumentError, 'invalid value for "jurisdiction_of_incorporation", the character length must be great than or equal to 0.'
188
+ end
189
+
190
+ @jurisdiction_of_incorporation = jurisdiction_of_incorporation
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] duns_number Value to be assigned
195
+ def duns_number=(duns_number)
196
+ if !duns_number.nil? && duns_number.to_s.length > 250
197
+ fail ArgumentError, 'invalid value for "duns_number", the character length must be smaller than or equal to 250.'
198
+ end
199
+
200
+ if !duns_number.nil? && duns_number.to_s.length < 0
201
+ fail ArgumentError, 'invalid value for "duns_number", the character length must be great than or equal to 0.'
202
+ end
203
+
204
+ @duns_number = duns_number
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ business_name == o.business_name &&
213
+ website == o.website &&
214
+ jurisdiction_of_incorporation == o.jurisdiction_of_incorporation &&
215
+ duns_number == o.duns_number &&
216
+ location == o.location
217
+ end
218
+
219
+ # @see the `==` method
220
+ # @param [Object] Object to be compared
221
+ def eql?(o)
222
+ self == o
223
+ end
224
+
225
+ # Calculates hash code according to all attributes.
226
+ # @return [Integer] Hash code
227
+ def hash
228
+ [business_name, website, jurisdiction_of_incorporation, duns_number, location].hash
229
+ end
230
+
231
+ # :nocov:
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def self.build_from_hash(attributes)
236
+ new.build_from_hash(attributes)
237
+ end
238
+ # :nocov:
239
+
240
+ # :nocov:
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ self.class.openapi_types.each_pair do |key, type|
247
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
248
+ self.send("#{key}=", nil)
249
+ elsif type =~ /\AArray<(.*)>/i
250
+ # check to ensure the input is an array given that the attribute
251
+ # is documented as an array but the input is not
252
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
253
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
254
+ end
255
+ elsif !attributes[self.class.attribute_map[key]].nil?
256
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
257
+ end
258
+ end
259
+
260
+ self
261
+ end
262
+ # :nocov:
263
+
264
+ # :nocov:
265
+ # Deserializes the data based on type
266
+ # @param string type Data type
267
+ # @param string value Value to be deserialized
268
+ # @return [Object] Deserialized data
269
+ def _deserialize(type, value)
270
+ case type.to_sym
271
+ when :Time
272
+ Time.parse(value)
273
+ when :Date
274
+ Date.parse(value)
275
+ when :String
276
+ value.to_s
277
+ when :Integer
278
+ value.to_i
279
+ when :Float
280
+ value.to_f
281
+ when :Boolean
282
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
283
+ true
284
+ else
285
+ false
286
+ end
287
+ when :Object
288
+ # generic object (usually a Hash), return directly
289
+ value
290
+ when /\AArray<(?<inner_type>.+)>\z/
291
+ inner_type = Regexp.last_match[:inner_type]
292
+ value.map { |v| _deserialize(inner_type, v) }
293
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
294
+ k_type = Regexp.last_match[:k_type]
295
+ v_type = Regexp.last_match[:v_type]
296
+ {}.tap do |hash|
297
+ value.each do |k, v|
298
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
299
+ end
300
+ end
301
+ else # model
302
+ # models (e.g. Pet) or oneOf
303
+ klass = Trulioo.const_get(type)
304
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
305
+ end
306
+ end
307
+ # :nocov:
308
+
309
+ # :nocov:
310
+ # Returns the string representation of the object
311
+ # @return [String] String presentation of the object
312
+ def to_s
313
+ to_hash.to_s
314
+ end
315
+ # :nocov:
316
+
317
+ # :nocov:
318
+ # to_body is an alias to to_hash (backward compatibility)
319
+ # @return [Hash] Returns the object in the form of hash
320
+ def to_body
321
+ to_hash
322
+ end
323
+ # :nocov:
324
+
325
+ # :nocov:
326
+ # Returns the object in the form of hash
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_hash
329
+ hash = {}
330
+ self.class.attribute_map.each_pair do |attr, param|
331
+ value = self.send(attr)
332
+ if value.nil?
333
+ is_nullable = self.class.openapi_nullable.include?(attr)
334
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
335
+ end
336
+
337
+ hash[param] = _to_hash(value)
338
+ end
339
+ hash
340
+ end
341
+ # :nocov:
342
+
343
+ # :nocov:
344
+ # Outputs non-array value in the form of hash
345
+ # For object, use to_hash. Otherwise, just return the value
346
+ # @param [Object] value Any valid value
347
+ # @return [Hash] Returns the value in the form of hash
348
+ def _to_hash(value)
349
+ if value.is_a?(Array)
350
+ value.compact.map { |v| _to_hash(v) }
351
+ elsif value.is_a?(Hash)
352
+ {}.tap do |hash|
353
+ value.each { |k, v| hash[k] = _to_hash(v) }
354
+ end
355
+ elsif value.respond_to? :to_hash
356
+ value.to_hash
357
+ else
358
+ value
359
+ end
360
+ end
361
+ # :nocov:
362
+ end
363
+
364
+ end
@@ -0,0 +1,279 @@
1
+ =begin
2
+ Trulioo Ruby SDK
3
+
4
+ Gem version: 1.0.3
5
+ Trulioo OpenAPI version: v1
6
+ Generated by OpenAPI Generator version: 5.0.1
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Trulioo
13
+ class BusinessSearchResponse
14
+ # The id for the transaction it will be a GUID
15
+ attr_accessor :transaction_id
16
+
17
+ # Time in UTC
18
+ attr_accessor :uploaded_dt
19
+
20
+ # The country code for which the verification was performed.
21
+ attr_accessor :country_code
22
+
23
+ # Product Name
24
+ attr_accessor :product_name
25
+
26
+ attr_accessor :record
27
+
28
+ # Collection of record errors
29
+ attr_accessor :errors
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'transaction_id' => :'TransactionID',
35
+ :'uploaded_dt' => :'UploadedDt',
36
+ :'country_code' => :'CountryCode',
37
+ :'product_name' => :'ProductName',
38
+ :'record' => :'Record',
39
+ :'errors' => :'Errors'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'transaction_id' => :'String',
52
+ :'uploaded_dt' => :'Time',
53
+ :'country_code' => :'String',
54
+ :'product_name' => :'String',
55
+ :'record' => :'BusinessRecord',
56
+ :'errors' => :'Array<ServiceError>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::BusinessSearchResponse` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::BusinessSearchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'transaction_id')
82
+ self.transaction_id = attributes[:'transaction_id']
83
+ end
84
+
85
+ if attributes.key?(:'uploaded_dt')
86
+ self.uploaded_dt = attributes[:'uploaded_dt']
87
+ end
88
+
89
+ if attributes.key?(:'country_code')
90
+ self.country_code = attributes[:'country_code']
91
+ end
92
+
93
+ if attributes.key?(:'product_name')
94
+ self.product_name = attributes[:'product_name']
95
+ end
96
+
97
+ if attributes.key?(:'record')
98
+ self.record = attributes[:'record']
99
+ end
100
+
101
+ if attributes.key?(:'errors')
102
+ if (value = attributes[:'errors']).is_a?(Array)
103
+ self.errors = value
104
+ end
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ transaction_id == o.transaction_id &&
127
+ uploaded_dt == o.uploaded_dt &&
128
+ country_code == o.country_code &&
129
+ product_name == o.product_name &&
130
+ record == o.record &&
131
+ errors == o.errors
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [transaction_id, uploaded_dt, country_code, product_name, record, errors].hash
144
+ end
145
+
146
+ # :nocov:
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ new.build_from_hash(attributes)
152
+ end
153
+ # :nocov:
154
+
155
+ # :nocov:
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.openapi_types.each_pair do |key, type|
162
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
+ self.send("#{key}=", nil)
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+ # :nocov:
178
+
179
+ # :nocov:
180
+ # Deserializes the data based on type
181
+ # @param string type Data type
182
+ # @param string value Value to be deserialized
183
+ # @return [Object] Deserialized data
184
+ def _deserialize(type, value)
185
+ case type.to_sym
186
+ when :Time
187
+ Time.parse(value)
188
+ when :Date
189
+ Date.parse(value)
190
+ when :String
191
+ value.to_s
192
+ when :Integer
193
+ value.to_i
194
+ when :Float
195
+ value.to_f
196
+ when :Boolean
197
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
198
+ true
199
+ else
200
+ false
201
+ end
202
+ when :Object
203
+ # generic object (usually a Hash), return directly
204
+ value
205
+ when /\AArray<(?<inner_type>.+)>\z/
206
+ inner_type = Regexp.last_match[:inner_type]
207
+ value.map { |v| _deserialize(inner_type, v) }
208
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
209
+ k_type = Regexp.last_match[:k_type]
210
+ v_type = Regexp.last_match[:v_type]
211
+ {}.tap do |hash|
212
+ value.each do |k, v|
213
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
+ end
215
+ end
216
+ else # model
217
+ # models (e.g. Pet) or oneOf
218
+ klass = Trulioo.const_get(type)
219
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
220
+ end
221
+ end
222
+ # :nocov:
223
+
224
+ # :nocov:
225
+ # Returns the string representation of the object
226
+ # @return [String] String presentation of the object
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+ # :nocov:
231
+
232
+ # :nocov:
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
+ # :nocov:
239
+
240
+ # :nocov:
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+ # :nocov:
257
+
258
+ # :nocov:
259
+ # Outputs non-array value in the form of hash
260
+ # For object, use to_hash. Otherwise, just return the value
261
+ # @param [Object] value Any valid value
262
+ # @return [Hash] Returns the value in the form of hash
263
+ def _to_hash(value)
264
+ if value.is_a?(Array)
265
+ value.compact.map { |v| _to_hash(v) }
266
+ elsif value.is_a?(Hash)
267
+ {}.tap do |hash|
268
+ value.each { |k, v| hash[k] = _to_hash(v) }
269
+ end
270
+ elsif value.respond_to? :to_hash
271
+ value.to_hash
272
+ else
273
+ value
274
+ end
275
+ end
276
+ # :nocov:
277
+ end
278
+
279
+ end