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,410 @@
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
+ # The verification call for the Normalized API is a POST method call
14
+ class VerifyRequest
15
+ # Indicate that Trulioo terms and conditions are accepted
16
+ attr_accessor :accept_trulioo_terms_and_conditions
17
+
18
+ # This field is not used anymore. If provided it must match the setting on your account or you will get an error.
19
+ attr_accessor :demo
20
+
21
+ attr_accessor :call_back_url
22
+
23
+ attr_accessor :timeout
24
+
25
+ # Set to true if you want to receive address cleanse information, This will only change the response if you have address cleansing enabled for the country you are querying for.
26
+ attr_accessor :cleansed_address
27
+
28
+ # Indicate the configuration used for the verification. Currently only 'Identity Verification' is supported.
29
+ attr_accessor :configuration_name
30
+
31
+ # Some datasources required your customer provide consent to access them. Set that the customer has provided consent for each datasource that requires one. If consent is not provided the datasource will not be queried.
32
+ attr_accessor :consent_for_data_sources
33
+
34
+ # The country code for which the verification needs to be performed.
35
+ attr_accessor :country_code
36
+
37
+ # Customer Reference Id
38
+ attr_accessor :customer_reference_id
39
+
40
+ attr_accessor :data_fields
41
+
42
+ # Verbose Mode Output Flag.
43
+ attr_accessor :verbose_mode
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'accept_trulioo_terms_and_conditions' => :'AcceptTruliooTermsAndConditions',
49
+ :'demo' => :'Demo',
50
+ :'call_back_url' => :'CallBackUrl',
51
+ :'timeout' => :'Timeout',
52
+ :'cleansed_address' => :'CleansedAddress',
53
+ :'configuration_name' => :'ConfigurationName',
54
+ :'consent_for_data_sources' => :'ConsentForDataSources',
55
+ :'country_code' => :'CountryCode',
56
+ :'customer_reference_id' => :'CustomerReferenceID',
57
+ :'data_fields' => :'DataFields',
58
+ :'verbose_mode' => :'VerboseMode'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'accept_trulioo_terms_and_conditions' => :'Boolean',
71
+ :'demo' => :'Boolean',
72
+ :'call_back_url' => :'String',
73
+ :'timeout' => :'Integer',
74
+ :'cleansed_address' => :'Boolean',
75
+ :'configuration_name' => :'String',
76
+ :'consent_for_data_sources' => :'Array<String>',
77
+ :'country_code' => :'String',
78
+ :'customer_reference_id' => :'String',
79
+ :'data_fields' => :'DataFields',
80
+ :'verbose_mode' => :'Boolean'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::VerifyRequest` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::VerifyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'accept_trulioo_terms_and_conditions')
106
+ self.accept_trulioo_terms_and_conditions = attributes[:'accept_trulioo_terms_and_conditions']
107
+ end
108
+
109
+ if attributes.key?(:'demo')
110
+ self.demo = attributes[:'demo']
111
+ end
112
+
113
+ if attributes.key?(:'call_back_url')
114
+ self.call_back_url = attributes[:'call_back_url']
115
+ end
116
+
117
+ if attributes.key?(:'timeout')
118
+ self.timeout = attributes[:'timeout']
119
+ end
120
+
121
+ if attributes.key?(:'cleansed_address')
122
+ self.cleansed_address = attributes[:'cleansed_address']
123
+ end
124
+
125
+ if attributes.key?(:'configuration_name')
126
+ self.configuration_name = attributes[:'configuration_name']
127
+ end
128
+
129
+ if attributes.key?(:'consent_for_data_sources')
130
+ if (value = attributes[:'consent_for_data_sources']).is_a?(Array)
131
+ self.consent_for_data_sources = value
132
+ end
133
+ end
134
+
135
+ if attributes.key?(:'country_code')
136
+ self.country_code = attributes[:'country_code']
137
+ end
138
+
139
+ if attributes.key?(:'customer_reference_id')
140
+ self.customer_reference_id = attributes[:'customer_reference_id']
141
+ end
142
+
143
+ if attributes.key?(:'data_fields')
144
+ self.data_fields = attributes[:'data_fields']
145
+ end
146
+
147
+ if attributes.key?(:'verbose_mode')
148
+ self.verbose_mode = attributes[:'verbose_mode']
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ invalid_properties = Array.new
156
+ if !@call_back_url.nil? && @call_back_url.to_s.length > 2083
157
+ invalid_properties.push('invalid value for "call_back_url", the character length must be smaller than or equal to 2083.')
158
+ end
159
+
160
+ if !@call_back_url.nil? && @call_back_url.to_s.length < 0
161
+ invalid_properties.push('invalid value for "call_back_url", the character length must be great than or equal to 0.')
162
+ end
163
+
164
+ if !@configuration_name.nil? && @configuration_name.to_s.length > 45
165
+ invalid_properties.push('invalid value for "configuration_name", the character length must be smaller than or equal to 45.')
166
+ end
167
+
168
+ if !@configuration_name.nil? && @configuration_name.to_s.length < 0
169
+ invalid_properties.push('invalid value for "configuration_name", the character length must be great than or equal to 0.')
170
+ end
171
+
172
+ if @country_code.nil?
173
+ invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
174
+ end
175
+
176
+ if !@customer_reference_id.nil? && @customer_reference_id.to_s.length > 128
177
+ invalid_properties.push('invalid value for "customer_reference_id", the character length must be smaller than or equal to 128.')
178
+ end
179
+
180
+ if !@customer_reference_id.nil? && @customer_reference_id.to_s.length < 0
181
+ invalid_properties.push('invalid value for "customer_reference_id", the character length must be great than or equal to 0.')
182
+ end
183
+
184
+ if @data_fields.nil?
185
+ invalid_properties.push('invalid value for "data_fields", data_fields cannot be nil.')
186
+ end
187
+
188
+ invalid_properties
189
+ end
190
+
191
+ # Check to see if the all the properties in the model are valid
192
+ # @return true if the model is valid
193
+ def valid?
194
+ return false if !@call_back_url.nil? && @call_back_url.to_s.length > 2083
195
+ return false if !@call_back_url.nil? && @call_back_url.to_s.length < 0
196
+ return false if !@configuration_name.nil? && @configuration_name.to_s.length > 45
197
+ return false if !@configuration_name.nil? && @configuration_name.to_s.length < 0
198
+ return false if @country_code.nil?
199
+ return false if !@customer_reference_id.nil? && @customer_reference_id.to_s.length > 128
200
+ return false if !@customer_reference_id.nil? && @customer_reference_id.to_s.length < 0
201
+ return false if @data_fields.nil?
202
+ true
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] call_back_url Value to be assigned
207
+ def call_back_url=(call_back_url)
208
+ if !call_back_url.nil? && call_back_url.to_s.length > 2083
209
+ fail ArgumentError, 'invalid value for "call_back_url", the character length must be smaller than or equal to 2083.'
210
+ end
211
+
212
+ if !call_back_url.nil? && call_back_url.to_s.length < 0
213
+ fail ArgumentError, 'invalid value for "call_back_url", the character length must be great than or equal to 0.'
214
+ end
215
+
216
+ @call_back_url = call_back_url
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] configuration_name Value to be assigned
221
+ def configuration_name=(configuration_name)
222
+ if !configuration_name.nil? && configuration_name.to_s.length > 45
223
+ fail ArgumentError, 'invalid value for "configuration_name", the character length must be smaller than or equal to 45.'
224
+ end
225
+
226
+ if !configuration_name.nil? && configuration_name.to_s.length < 0
227
+ fail ArgumentError, 'invalid value for "configuration_name", the character length must be great than or equal to 0.'
228
+ end
229
+
230
+ @configuration_name = configuration_name
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] customer_reference_id Value to be assigned
235
+ def customer_reference_id=(customer_reference_id)
236
+ if !customer_reference_id.nil? && customer_reference_id.to_s.length > 128
237
+ fail ArgumentError, 'invalid value for "customer_reference_id", the character length must be smaller than or equal to 128.'
238
+ end
239
+
240
+ if !customer_reference_id.nil? && customer_reference_id.to_s.length < 0
241
+ fail ArgumentError, 'invalid value for "customer_reference_id", the character length must be great than or equal to 0.'
242
+ end
243
+
244
+ @customer_reference_id = customer_reference_id
245
+ end
246
+
247
+ # Checks equality by comparing each attribute.
248
+ # @param [Object] Object to be compared
249
+ def ==(o)
250
+ return true if self.equal?(o)
251
+ self.class == o.class &&
252
+ accept_trulioo_terms_and_conditions == o.accept_trulioo_terms_and_conditions &&
253
+ demo == o.demo &&
254
+ call_back_url == o.call_back_url &&
255
+ timeout == o.timeout &&
256
+ cleansed_address == o.cleansed_address &&
257
+ configuration_name == o.configuration_name &&
258
+ consent_for_data_sources == o.consent_for_data_sources &&
259
+ country_code == o.country_code &&
260
+ customer_reference_id == o.customer_reference_id &&
261
+ data_fields == o.data_fields &&
262
+ verbose_mode == o.verbose_mode
263
+ end
264
+
265
+ # @see the `==` method
266
+ # @param [Object] Object to be compared
267
+ def eql?(o)
268
+ self == o
269
+ end
270
+
271
+ # Calculates hash code according to all attributes.
272
+ # @return [Integer] Hash code
273
+ def hash
274
+ [accept_trulioo_terms_and_conditions, demo, call_back_url, timeout, cleansed_address, configuration_name, consent_for_data_sources, country_code, customer_reference_id, data_fields, verbose_mode].hash
275
+ end
276
+
277
+ # :nocov:
278
+ # Builds the object from hash
279
+ # @param [Hash] attributes Model attributes in the form of hash
280
+ # @return [Object] Returns the model itself
281
+ def self.build_from_hash(attributes)
282
+ new.build_from_hash(attributes)
283
+ end
284
+ # :nocov:
285
+
286
+ # :nocov:
287
+ # Builds the object from hash
288
+ # @param [Hash] attributes Model attributes in the form of hash
289
+ # @return [Object] Returns the model itself
290
+ def build_from_hash(attributes)
291
+ return nil unless attributes.is_a?(Hash)
292
+ self.class.openapi_types.each_pair do |key, type|
293
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
294
+ self.send("#{key}=", nil)
295
+ elsif type =~ /\AArray<(.*)>/i
296
+ # check to ensure the input is an array given that the attribute
297
+ # is documented as an array but the input is not
298
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
299
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
300
+ end
301
+ elsif !attributes[self.class.attribute_map[key]].nil?
302
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
303
+ end
304
+ end
305
+
306
+ self
307
+ end
308
+ # :nocov:
309
+
310
+ # :nocov:
311
+ # Deserializes the data based on type
312
+ # @param string type Data type
313
+ # @param string value Value to be deserialized
314
+ # @return [Object] Deserialized data
315
+ def _deserialize(type, value)
316
+ case type.to_sym
317
+ when :Time
318
+ Time.parse(value)
319
+ when :Date
320
+ Date.parse(value)
321
+ when :String
322
+ value.to_s
323
+ when :Integer
324
+ value.to_i
325
+ when :Float
326
+ value.to_f
327
+ when :Boolean
328
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
329
+ true
330
+ else
331
+ false
332
+ end
333
+ when :Object
334
+ # generic object (usually a Hash), return directly
335
+ value
336
+ when /\AArray<(?<inner_type>.+)>\z/
337
+ inner_type = Regexp.last_match[:inner_type]
338
+ value.map { |v| _deserialize(inner_type, v) }
339
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
340
+ k_type = Regexp.last_match[:k_type]
341
+ v_type = Regexp.last_match[:v_type]
342
+ {}.tap do |hash|
343
+ value.each do |k, v|
344
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
345
+ end
346
+ end
347
+ else # model
348
+ # models (e.g. Pet) or oneOf
349
+ klass = Trulioo.const_get(type)
350
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
351
+ end
352
+ end
353
+ # :nocov:
354
+
355
+ # :nocov:
356
+ # Returns the string representation of the object
357
+ # @return [String] String presentation of the object
358
+ def to_s
359
+ to_hash.to_s
360
+ end
361
+ # :nocov:
362
+
363
+ # :nocov:
364
+ # to_body is an alias to to_hash (backward compatibility)
365
+ # @return [Hash] Returns the object in the form of hash
366
+ def to_body
367
+ to_hash
368
+ end
369
+ # :nocov:
370
+
371
+ # :nocov:
372
+ # Returns the object in the form of hash
373
+ # @return [Hash] Returns the object in the form of hash
374
+ def to_hash
375
+ hash = {}
376
+ self.class.attribute_map.each_pair do |attr, param|
377
+ value = self.send(attr)
378
+ if value.nil?
379
+ is_nullable = self.class.openapi_nullable.include?(attr)
380
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
381
+ end
382
+
383
+ hash[param] = _to_hash(value)
384
+ end
385
+ hash
386
+ end
387
+ # :nocov:
388
+
389
+ # :nocov:
390
+ # Outputs non-array value in the form of hash
391
+ # For object, use to_hash. Otherwise, just return the value
392
+ # @param [Object] value Any valid value
393
+ # @return [Hash] Returns the value in the form of hash
394
+ def _to_hash(value)
395
+ if value.is_a?(Array)
396
+ value.compact.map { |v| _to_hash(v) }
397
+ elsif value.is_a?(Hash)
398
+ {}.tap do |hash|
399
+ value.each { |k, v| hash[k] = _to_hash(v) }
400
+ end
401
+ elsif value.respond_to? :to_hash
402
+ value.to_hash
403
+ else
404
+ value
405
+ end
406
+ end
407
+ # :nocov:
408
+ end
409
+
410
+ end
@@ -0,0 +1,288 @@
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 VerifyResult
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
+ # Country Code
21
+ attr_accessor :country_code
22
+
23
+ # Product Name
24
+ attr_accessor :product_name
25
+
26
+ attr_accessor :record
27
+
28
+ # Customer Reference Id
29
+ attr_accessor :customer_reference_id
30
+
31
+ attr_accessor :errors
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'transaction_id' => :'TransactionID',
37
+ :'uploaded_dt' => :'UploadedDt',
38
+ :'country_code' => :'CountryCode',
39
+ :'product_name' => :'ProductName',
40
+ :'record' => :'Record',
41
+ :'customer_reference_id' => :'CustomerReferenceID',
42
+ :'errors' => :'Errors'
43
+ }
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'transaction_id' => :'String',
55
+ :'uploaded_dt' => :'Time',
56
+ :'country_code' => :'String',
57
+ :'product_name' => :'String',
58
+ :'record' => :'Record',
59
+ :'customer_reference_id' => :'String',
60
+ :'errors' => :'Array<ServiceError>'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::VerifyResult` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::VerifyResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'transaction_id')
86
+ self.transaction_id = attributes[:'transaction_id']
87
+ end
88
+
89
+ if attributes.key?(:'uploaded_dt')
90
+ self.uploaded_dt = attributes[:'uploaded_dt']
91
+ end
92
+
93
+ if attributes.key?(:'country_code')
94
+ self.country_code = attributes[:'country_code']
95
+ end
96
+
97
+ if attributes.key?(:'product_name')
98
+ self.product_name = attributes[:'product_name']
99
+ end
100
+
101
+ if attributes.key?(:'record')
102
+ self.record = attributes[:'record']
103
+ end
104
+
105
+ if attributes.key?(:'customer_reference_id')
106
+ self.customer_reference_id = attributes[:'customer_reference_id']
107
+ end
108
+
109
+ if attributes.key?(:'errors')
110
+ if (value = attributes[:'errors']).is_a?(Array)
111
+ self.errors = value
112
+ end
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
+ invalid_properties = Array.new
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ transaction_id == o.transaction_id &&
135
+ uploaded_dt == o.uploaded_dt &&
136
+ country_code == o.country_code &&
137
+ product_name == o.product_name &&
138
+ record == o.record &&
139
+ customer_reference_id == o.customer_reference_id &&
140
+ errors == o.errors
141
+ end
142
+
143
+ # @see the `==` method
144
+ # @param [Object] Object to be compared
145
+ def eql?(o)
146
+ self == o
147
+ end
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Integer] Hash code
151
+ def hash
152
+ [transaction_id, uploaded_dt, country_code, product_name, record, customer_reference_id, errors].hash
153
+ end
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 self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+ # :nocov:
163
+
164
+ # :nocov:
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.openapi_types.each_pair do |key, type|
171
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
172
+ self.send("#{key}=", nil)
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end
182
+ end
183
+
184
+ self
185
+ end
186
+ # :nocov:
187
+
188
+ # :nocov:
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = Trulioo.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+ # :nocov:
232
+
233
+ # :nocov:
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+ # :nocov:
240
+
241
+ # :nocov:
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+ # :nocov:
248
+
249
+ # :nocov:
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+ # :nocov:
266
+
267
+ # :nocov:
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+ # :nocov:
286
+ end
287
+
288
+ end