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,448 @@
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
+ # Personal Information
14
+ class PersonInfo
15
+ # First name of the individual to be verified
16
+ attr_accessor :first_given_name
17
+
18
+ # Second given name of the individual to be verified
19
+ attr_accessor :middle_name
20
+
21
+ # First (paternal) family name of the individual to be verified
22
+ attr_accessor :first_sur_name
23
+
24
+ # second family name of the individual to be verified
25
+ attr_accessor :second_surname
26
+
27
+ # Enter full name in ISO Latin-1 character set
28
+ attr_accessor :iso_latin1_name
29
+
30
+ # Day of birth date (e.g. 23 for a date of birth of 23/11/1975)
31
+ attr_accessor :day_of_birth
32
+
33
+ # Month of birth date (e.g. 11 for a date of birth of 23/11/1975)
34
+ attr_accessor :month_of_birth
35
+
36
+ # Year of birth date (e.g. 1975 for a date of birth of 23/11/1975)
37
+ attr_accessor :year_of_birth
38
+
39
+ # Minimum permitted age of the individual
40
+ attr_accessor :minimum_age
41
+
42
+ # Single character M / F (M = Male, F = Female)
43
+ attr_accessor :gender
44
+
45
+ attr_accessor :additional_fields
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'first_given_name' => :'FirstGivenName',
51
+ :'middle_name' => :'MiddleName',
52
+ :'first_sur_name' => :'FirstSurName',
53
+ :'second_surname' => :'SecondSurname',
54
+ :'iso_latin1_name' => :'ISOLatin1Name',
55
+ :'day_of_birth' => :'DayOfBirth',
56
+ :'month_of_birth' => :'MonthOfBirth',
57
+ :'year_of_birth' => :'YearOfBirth',
58
+ :'minimum_age' => :'MinimumAge',
59
+ :'gender' => :'Gender',
60
+ :'additional_fields' => :'AdditionalFields'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'first_given_name' => :'String',
73
+ :'middle_name' => :'String',
74
+ :'first_sur_name' => :'String',
75
+ :'second_surname' => :'String',
76
+ :'iso_latin1_name' => :'String',
77
+ :'day_of_birth' => :'Integer',
78
+ :'month_of_birth' => :'Integer',
79
+ :'year_of_birth' => :'Integer',
80
+ :'minimum_age' => :'Integer',
81
+ :'gender' => :'String',
82
+ :'additional_fields' => :'PersonInfoAdditionalFields'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::PersonInfo` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::PersonInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'first_given_name')
108
+ self.first_given_name = attributes[:'first_given_name']
109
+ end
110
+
111
+ if attributes.key?(:'middle_name')
112
+ self.middle_name = attributes[:'middle_name']
113
+ end
114
+
115
+ if attributes.key?(:'first_sur_name')
116
+ self.first_sur_name = attributes[:'first_sur_name']
117
+ end
118
+
119
+ if attributes.key?(:'second_surname')
120
+ self.second_surname = attributes[:'second_surname']
121
+ end
122
+
123
+ if attributes.key?(:'iso_latin1_name')
124
+ self.iso_latin1_name = attributes[:'iso_latin1_name']
125
+ end
126
+
127
+ if attributes.key?(:'day_of_birth')
128
+ self.day_of_birth = attributes[:'day_of_birth']
129
+ end
130
+
131
+ if attributes.key?(:'month_of_birth')
132
+ self.month_of_birth = attributes[:'month_of_birth']
133
+ end
134
+
135
+ if attributes.key?(:'year_of_birth')
136
+ self.year_of_birth = attributes[:'year_of_birth']
137
+ end
138
+
139
+ if attributes.key?(:'minimum_age')
140
+ self.minimum_age = attributes[:'minimum_age']
141
+ end
142
+
143
+ if attributes.key?(:'gender')
144
+ self.gender = attributes[:'gender']
145
+ end
146
+
147
+ if attributes.key?(:'additional_fields')
148
+ self.additional_fields = attributes[:'additional_fields']
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 !@first_given_name.nil? && @first_given_name.to_s.length > 200
157
+ invalid_properties.push('invalid value for "first_given_name", the character length must be smaller than or equal to 200.')
158
+ end
159
+
160
+ if !@first_given_name.nil? && @first_given_name.to_s.length < 0
161
+ invalid_properties.push('invalid value for "first_given_name", the character length must be great than or equal to 0.')
162
+ end
163
+
164
+ if !@middle_name.nil? && @middle_name.to_s.length > 200
165
+ invalid_properties.push('invalid value for "middle_name", the character length must be smaller than or equal to 200.')
166
+ end
167
+
168
+ if !@middle_name.nil? && @middle_name.to_s.length < 0
169
+ invalid_properties.push('invalid value for "middle_name", the character length must be great than or equal to 0.')
170
+ end
171
+
172
+ if !@first_sur_name.nil? && @first_sur_name.to_s.length > 200
173
+ invalid_properties.push('invalid value for "first_sur_name", the character length must be smaller than or equal to 200.')
174
+ end
175
+
176
+ if !@first_sur_name.nil? && @first_sur_name.to_s.length < 0
177
+ invalid_properties.push('invalid value for "first_sur_name", the character length must be great than or equal to 0.')
178
+ end
179
+
180
+ if !@second_surname.nil? && @second_surname.to_s.length > 200
181
+ invalid_properties.push('invalid value for "second_surname", the character length must be smaller than or equal to 200.')
182
+ end
183
+
184
+ if !@second_surname.nil? && @second_surname.to_s.length < 0
185
+ invalid_properties.push('invalid value for "second_surname", the character length must be great than or equal to 0.')
186
+ end
187
+
188
+ if !@iso_latin1_name.nil? && @iso_latin1_name.to_s.length > 200
189
+ invalid_properties.push('invalid value for "iso_latin1_name", the character length must be smaller than or equal to 200.')
190
+ end
191
+
192
+ if !@iso_latin1_name.nil? && @iso_latin1_name.to_s.length < 0
193
+ invalid_properties.push('invalid value for "iso_latin1_name", the character length must be great than or equal to 0.')
194
+ end
195
+
196
+ invalid_properties
197
+ end
198
+
199
+ # Check to see if the all the properties in the model are valid
200
+ # @return true if the model is valid
201
+ def valid?
202
+ return false if !@first_given_name.nil? && @first_given_name.to_s.length > 200
203
+ return false if !@first_given_name.nil? && @first_given_name.to_s.length < 0
204
+ return false if !@middle_name.nil? && @middle_name.to_s.length > 200
205
+ return false if !@middle_name.nil? && @middle_name.to_s.length < 0
206
+ return false if !@first_sur_name.nil? && @first_sur_name.to_s.length > 200
207
+ return false if !@first_sur_name.nil? && @first_sur_name.to_s.length < 0
208
+ return false if !@second_surname.nil? && @second_surname.to_s.length > 200
209
+ return false if !@second_surname.nil? && @second_surname.to_s.length < 0
210
+ return false if !@iso_latin1_name.nil? && @iso_latin1_name.to_s.length > 200
211
+ return false if !@iso_latin1_name.nil? && @iso_latin1_name.to_s.length < 0
212
+ true
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] first_given_name Value to be assigned
217
+ def first_given_name=(first_given_name)
218
+ if !first_given_name.nil? && first_given_name.to_s.length > 200
219
+ fail ArgumentError, 'invalid value for "first_given_name", the character length must be smaller than or equal to 200.'
220
+ end
221
+
222
+ if !first_given_name.nil? && first_given_name.to_s.length < 0
223
+ fail ArgumentError, 'invalid value for "first_given_name", the character length must be great than or equal to 0.'
224
+ end
225
+
226
+ @first_given_name = first_given_name
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] middle_name Value to be assigned
231
+ def middle_name=(middle_name)
232
+ if !middle_name.nil? && middle_name.to_s.length > 200
233
+ fail ArgumentError, 'invalid value for "middle_name", the character length must be smaller than or equal to 200.'
234
+ end
235
+
236
+ if !middle_name.nil? && middle_name.to_s.length < 0
237
+ fail ArgumentError, 'invalid value for "middle_name", the character length must be great than or equal to 0.'
238
+ end
239
+
240
+ @middle_name = middle_name
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] first_sur_name Value to be assigned
245
+ def first_sur_name=(first_sur_name)
246
+ if !first_sur_name.nil? && first_sur_name.to_s.length > 200
247
+ fail ArgumentError, 'invalid value for "first_sur_name", the character length must be smaller than or equal to 200.'
248
+ end
249
+
250
+ if !first_sur_name.nil? && first_sur_name.to_s.length < 0
251
+ fail ArgumentError, 'invalid value for "first_sur_name", the character length must be great than or equal to 0.'
252
+ end
253
+
254
+ @first_sur_name = first_sur_name
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] second_surname Value to be assigned
259
+ def second_surname=(second_surname)
260
+ if !second_surname.nil? && second_surname.to_s.length > 200
261
+ fail ArgumentError, 'invalid value for "second_surname", the character length must be smaller than or equal to 200.'
262
+ end
263
+
264
+ if !second_surname.nil? && second_surname.to_s.length < 0
265
+ fail ArgumentError, 'invalid value for "second_surname", the character length must be great than or equal to 0.'
266
+ end
267
+
268
+ @second_surname = second_surname
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] iso_latin1_name Value to be assigned
273
+ def iso_latin1_name=(iso_latin1_name)
274
+ if !iso_latin1_name.nil? && iso_latin1_name.to_s.length > 200
275
+ fail ArgumentError, 'invalid value for "iso_latin1_name", the character length must be smaller than or equal to 200.'
276
+ end
277
+
278
+ if !iso_latin1_name.nil? && iso_latin1_name.to_s.length < 0
279
+ fail ArgumentError, 'invalid value for "iso_latin1_name", the character length must be great than or equal to 0.'
280
+ end
281
+
282
+ @iso_latin1_name = iso_latin1_name
283
+ end
284
+
285
+ # Checks equality by comparing each attribute.
286
+ # @param [Object] Object to be compared
287
+ def ==(o)
288
+ return true if self.equal?(o)
289
+ self.class == o.class &&
290
+ first_given_name == o.first_given_name &&
291
+ middle_name == o.middle_name &&
292
+ first_sur_name == o.first_sur_name &&
293
+ second_surname == o.second_surname &&
294
+ iso_latin1_name == o.iso_latin1_name &&
295
+ day_of_birth == o.day_of_birth &&
296
+ month_of_birth == o.month_of_birth &&
297
+ year_of_birth == o.year_of_birth &&
298
+ minimum_age == o.minimum_age &&
299
+ gender == o.gender &&
300
+ additional_fields == o.additional_fields
301
+ end
302
+
303
+ # @see the `==` method
304
+ # @param [Object] Object to be compared
305
+ def eql?(o)
306
+ self == o
307
+ end
308
+
309
+ # Calculates hash code according to all attributes.
310
+ # @return [Integer] Hash code
311
+ def hash
312
+ [first_given_name, middle_name, first_sur_name, second_surname, iso_latin1_name, day_of_birth, month_of_birth, year_of_birth, minimum_age, gender, additional_fields].hash
313
+ end
314
+
315
+ # :nocov:
316
+ # Builds the object from hash
317
+ # @param [Hash] attributes Model attributes in the form of hash
318
+ # @return [Object] Returns the model itself
319
+ def self.build_from_hash(attributes)
320
+ new.build_from_hash(attributes)
321
+ end
322
+ # :nocov:
323
+
324
+ # :nocov:
325
+ # Builds the object from hash
326
+ # @param [Hash] attributes Model attributes in the form of hash
327
+ # @return [Object] Returns the model itself
328
+ def build_from_hash(attributes)
329
+ return nil unless attributes.is_a?(Hash)
330
+ self.class.openapi_types.each_pair do |key, type|
331
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
332
+ self.send("#{key}=", nil)
333
+ elsif type =~ /\AArray<(.*)>/i
334
+ # check to ensure the input is an array given that the attribute
335
+ # is documented as an array but the input is not
336
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
337
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
338
+ end
339
+ elsif !attributes[self.class.attribute_map[key]].nil?
340
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
341
+ end
342
+ end
343
+
344
+ self
345
+ end
346
+ # :nocov:
347
+
348
+ # :nocov:
349
+ # Deserializes the data based on type
350
+ # @param string type Data type
351
+ # @param string value Value to be deserialized
352
+ # @return [Object] Deserialized data
353
+ def _deserialize(type, value)
354
+ case type.to_sym
355
+ when :Time
356
+ Time.parse(value)
357
+ when :Date
358
+ Date.parse(value)
359
+ when :String
360
+ value.to_s
361
+ when :Integer
362
+ value.to_i
363
+ when :Float
364
+ value.to_f
365
+ when :Boolean
366
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
367
+ true
368
+ else
369
+ false
370
+ end
371
+ when :Object
372
+ # generic object (usually a Hash), return directly
373
+ value
374
+ when /\AArray<(?<inner_type>.+)>\z/
375
+ inner_type = Regexp.last_match[:inner_type]
376
+ value.map { |v| _deserialize(inner_type, v) }
377
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
378
+ k_type = Regexp.last_match[:k_type]
379
+ v_type = Regexp.last_match[:v_type]
380
+ {}.tap do |hash|
381
+ value.each do |k, v|
382
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
383
+ end
384
+ end
385
+ else # model
386
+ # models (e.g. Pet) or oneOf
387
+ klass = Trulioo.const_get(type)
388
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
389
+ end
390
+ end
391
+ # :nocov:
392
+
393
+ # :nocov:
394
+ # Returns the string representation of the object
395
+ # @return [String] String presentation of the object
396
+ def to_s
397
+ to_hash.to_s
398
+ end
399
+ # :nocov:
400
+
401
+ # :nocov:
402
+ # to_body is an alias to to_hash (backward compatibility)
403
+ # @return [Hash] Returns the object in the form of hash
404
+ def to_body
405
+ to_hash
406
+ end
407
+ # :nocov:
408
+
409
+ # :nocov:
410
+ # Returns the object in the form of hash
411
+ # @return [Hash] Returns the object in the form of hash
412
+ def to_hash
413
+ hash = {}
414
+ self.class.attribute_map.each_pair do |attr, param|
415
+ value = self.send(attr)
416
+ if value.nil?
417
+ is_nullable = self.class.openapi_nullable.include?(attr)
418
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
419
+ end
420
+
421
+ hash[param] = _to_hash(value)
422
+ end
423
+ hash
424
+ end
425
+ # :nocov:
426
+
427
+ # :nocov:
428
+ # Outputs non-array value in the form of hash
429
+ # For object, use to_hash. Otherwise, just return the value
430
+ # @param [Object] value Any valid value
431
+ # @return [Hash] Returns the value in the form of hash
432
+ def _to_hash(value)
433
+ if value.is_a?(Array)
434
+ value.compact.map { |v| _to_hash(v) }
435
+ elsif value.is_a?(Hash)
436
+ {}.tap do |hash|
437
+ value.each { |k, v| hash[k] = _to_hash(v) }
438
+ end
439
+ elsif value.respond_to? :to_hash
440
+ value.to_hash
441
+ else
442
+ value
443
+ end
444
+ end
445
+ # :nocov:
446
+ end
447
+
448
+ end
@@ -0,0 +1,228 @@
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 PersonInfoAdditionalFields
14
+ # Full name of of the individual to be verified
15
+ attr_accessor :full_name
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'full_name' => :'FullName'
21
+ }
22
+ end
23
+
24
+ # Returns all the JSON keys this model knows about
25
+ def self.acceptable_attributes
26
+ attribute_map.values
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'full_name' => :'String'
33
+ }
34
+ end
35
+
36
+ # List of attributes with nullable: true
37
+ def self.openapi_nullable
38
+ Set.new([
39
+ ])
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ if (!attributes.is_a?(Hash))
46
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::PersonInfoAdditionalFields` initialize method"
47
+ end
48
+
49
+ # check to see if the attribute exists and convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h|
51
+ if (!self.class.attribute_map.key?(k.to_sym))
52
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::PersonInfoAdditionalFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ end
54
+ h[k.to_sym] = v
55
+ }
56
+
57
+ if attributes.key?(:'full_name')
58
+ self.full_name = attributes[:'full_name']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ full_name == o.full_name
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [full_name].hash
93
+ end
94
+
95
+ # :nocov:
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
101
+ end
102
+ # :nocov:
103
+
104
+ # :nocov:
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+ # :nocov:
127
+
128
+ # :nocov:
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = Trulioo.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+ # :nocov:
172
+
173
+ # :nocov:
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+ # :nocov:
180
+
181
+ # :nocov:
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+ # :nocov:
188
+
189
+ # :nocov:
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
+ # :nocov:
206
+
207
+ # :nocov:
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+ # :nocov:
226
+ end
227
+
228
+ end