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