trinsic_api 2.2.0 → 2.3.0.pre.alpha2

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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AddRedirectUriResponse.md +18 -0
  3. data/docs/AttachmentAccessKeys.md +2 -0
  4. data/docs/ContractField.md +2 -0
  5. data/docs/ContractIdentifierField.md +22 -0
  6. data/docs/CreateHostedProviderSessionResponse.md +1 -1
  7. data/docs/CreateVerificationProfileResponse.md +18 -0
  8. data/docs/CreateWidgetSessionResponse.md +1 -1
  9. data/docs/EnvironmentRedirectUrisAddRequest.md +18 -0
  10. data/docs/EnvironmentRedirectUrisApi.md +222 -0
  11. data/docs/FaydaProviderOutput.md +18 -0
  12. data/docs/Identifier.md +22 -0
  13. data/docs/IdentityData.md +5 -1
  14. data/docs/IntegrationStep.md +1 -1
  15. data/docs/KenyaNidBiometric2Input.md +22 -0
  16. data/docs/KenyaNidInput.md +1 -1
  17. data/docs/KenyaNidLookup2Input.md +18 -0
  18. data/docs/KenyaNidMatch2Input.md +28 -0
  19. data/docs/ListEnvironmentRedirectUrisResponse.md +20 -0
  20. data/docs/ListVerificationProfilesResponse.md +20 -0
  21. data/docs/MexicoCurpProviderOutput.md +18 -0
  22. data/docs/NigeriaNinInput.md +1 -1
  23. data/docs/PhilippinesDigitalNidProviderOutput.md +18 -0
  24. data/docs/PhilippinesPhysicalNidProviderOutput.md +18 -0
  25. data/docs/ProviderContract.md +2 -0
  26. data/docs/ProviderInput.md +8 -0
  27. data/docs/ProviderOutput.md +26 -0
  28. data/docs/RedirectUriResponse.md +20 -0
  29. data/docs/SexV1.md +15 -0
  30. data/docs/SouthAfricaNidInput.md +1 -1
  31. data/docs/SouthAfricaNidLookup2Input.md +18 -0
  32. data/docs/SpidBillingInformation.md +22 -0
  33. data/docs/SpidInput.md +3 -1
  34. data/docs/SpidProviderOutput.md +44 -0
  35. data/docs/VerificationProfileResponse.md +28 -0
  36. data/docs/VerificationProfilesApi.md +231 -0
  37. data/lib/trinsic_api/api/environment_redirect_uris_api.rb +228 -0
  38. data/lib/trinsic_api/api/verification_profiles_api.rb +273 -0
  39. data/lib/trinsic_api/models/add_redirect_uri_response.rb +237 -0
  40. data/lib/trinsic_api/models/attachment_access_keys.rb +11 -1
  41. data/lib/trinsic_api/models/contract_field.rb +28 -1
  42. data/lib/trinsic_api/models/contract_identifier_field.rb +315 -0
  43. data/lib/trinsic_api/models/create_verification_profile_response.rb +238 -0
  44. data/lib/trinsic_api/models/environment_redirect_uris_add_request.rb +237 -0
  45. data/lib/trinsic_api/models/fayda_provider_output.rb +222 -0
  46. data/lib/trinsic_api/models/identifier.rb +289 -0
  47. data/lib/trinsic_api/models/identity_data.rb +43 -5
  48. data/lib/trinsic_api/models/kenya_nid_biometric2_input.rb +246 -0
  49. data/lib/trinsic_api/models/kenya_nid_input.rb +1 -1
  50. data/lib/trinsic_api/models/kenya_nid_lookup2_input.rb +222 -0
  51. data/lib/trinsic_api/models/kenya_nid_match2_input.rb +299 -0
  52. data/lib/trinsic_api/models/list_environment_redirect_uris_response.rb +268 -0
  53. data/lib/trinsic_api/models/list_verification_profiles_response.rb +266 -0
  54. data/lib/trinsic_api/models/mexico_curp_provider_output.rb +222 -0
  55. data/lib/trinsic_api/models/nigeria_nin_input.rb +1 -1
  56. data/lib/trinsic_api/models/philippines_digital_nid_provider_output.rb +238 -0
  57. data/lib/trinsic_api/models/philippines_physical_nid_provider_output.rb +238 -0
  58. data/lib/trinsic_api/models/provider_contract.rb +14 -1
  59. data/lib/trinsic_api/models/provider_input.rb +45 -1
  60. data/lib/trinsic_api/models/provider_output.rb +261 -0
  61. data/lib/trinsic_api/models/redirect_uri_response.rb +263 -0
  62. data/lib/trinsic_api/models/sex_v1.rb +42 -0
  63. data/lib/trinsic_api/models/south_africa_nid_input.rb +1 -1
  64. data/lib/trinsic_api/models/south_africa_nid_lookup2_input.rb +222 -0
  65. data/lib/trinsic_api/models/spid_billing_information.rb +293 -0
  66. data/lib/trinsic_api/models/spid_input.rb +16 -5
  67. data/lib/trinsic_api/models/spid_provider_output.rb +397 -0
  68. data/lib/trinsic_api/models/verification_profile_response.rb +375 -0
  69. data/lib/trinsic_api/version.rb +1 -1
  70. data/lib/trinsic_api.rb +23 -0
  71. data/spec/api/environment_redirect_uris_api_spec.rb +72 -0
  72. data/spec/api/verification_profiles_api_spec.rb +76 -0
  73. data/spec/models/add_redirect_uri_response_spec.rb +36 -0
  74. data/spec/models/attachment_access_keys_spec.rb +6 -0
  75. data/spec/models/contract_field_spec.rb +6 -0
  76. data/spec/models/contract_identifier_field_spec.rb +48 -0
  77. data/spec/models/create_verification_profile_response_spec.rb +36 -0
  78. data/spec/models/environment_redirect_uris_add_request_spec.rb +36 -0
  79. data/spec/models/fayda_provider_output_spec.rb +36 -0
  80. data/spec/models/identifier_spec.rb +48 -0
  81. data/spec/models/identity_data_spec.rb +12 -0
  82. data/spec/models/kenya_nid_biometric2_input_spec.rb +48 -0
  83. data/spec/models/kenya_nid_lookup2_input_spec.rb +36 -0
  84. data/spec/models/kenya_nid_match2_input_spec.rb +66 -0
  85. data/spec/models/list_environment_redirect_uris_response_spec.rb +42 -0
  86. data/spec/models/list_verification_profiles_response_spec.rb +42 -0
  87. data/spec/models/mexico_curp_provider_output_spec.rb +36 -0
  88. data/spec/models/philippines_digital_nid_provider_output_spec.rb +36 -0
  89. data/spec/models/philippines_physical_nid_provider_output_spec.rb +36 -0
  90. data/spec/models/provider_contract_spec.rb +6 -0
  91. data/spec/models/provider_input_spec.rb +24 -0
  92. data/spec/models/provider_output_spec.rb +60 -0
  93. data/spec/models/redirect_uri_response_spec.rb +42 -0
  94. data/spec/models/sex_v1_spec.rb +30 -0
  95. data/spec/models/south_africa_nid_lookup2_input_spec.rb +36 -0
  96. data/spec/models/spid_billing_information_spec.rb +48 -0
  97. data/spec/models/spid_input_spec.rb +6 -0
  98. data/spec/models/spid_provider_output_spec.rb +114 -0
  99. data/spec/models/verification_profile_response_spec.rb +66 -0
  100. metadata +94 -2
@@ -0,0 +1,289 @@
1
+ =begin
2
+ #Trinsic API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class Identifier
18
+ attr_accessor :identifier
19
+
20
+ attr_accessor :scope
21
+
22
+ attr_accessor :description
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'identifier' => :'identifier',
28
+ :'scope' => :'scope',
29
+ :'description' => :'description'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'identifier' => :'String',
47
+ :'scope' => :'String',
48
+ :'description' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::Identifier` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::Identifier`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'identifier')
75
+ self.identifier = attributes[:'identifier']
76
+ else
77
+ self.identifier = nil
78
+ end
79
+
80
+ if attributes.key?(:'scope')
81
+ self.scope = attributes[:'scope']
82
+ else
83
+ self.scope = nil
84
+ end
85
+
86
+ if attributes.key?(:'description')
87
+ self.description = attributes[:'description']
88
+ else
89
+ self.description = nil
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @identifier.nil?
99
+ invalid_properties.push('invalid value for "identifier", identifier cannot be nil.')
100
+ end
101
+
102
+ if @scope.nil?
103
+ invalid_properties.push('invalid value for "scope", scope cannot be nil.')
104
+ end
105
+
106
+ if @description.nil?
107
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ return false if @identifier.nil?
118
+ return false if @scope.nil?
119
+ return false if @description.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] identifier Value to be assigned
125
+ def identifier=(identifier)
126
+ if identifier.nil?
127
+ fail ArgumentError, 'identifier cannot be nil'
128
+ end
129
+
130
+ @identifier = identifier
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] scope Value to be assigned
135
+ def scope=(scope)
136
+ if scope.nil?
137
+ fail ArgumentError, 'scope cannot be nil'
138
+ end
139
+
140
+ @scope = scope
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] description Value to be assigned
145
+ def description=(description)
146
+ if description.nil?
147
+ fail ArgumentError, 'description cannot be nil'
148
+ end
149
+
150
+ @description = description
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ identifier == o.identifier &&
159
+ scope == o.scope &&
160
+ description == o.description
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [identifier, scope, description].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def self._deserialize(type, value)
203
+ case type.to_sym
204
+ when :Time
205
+ Time.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ # models (e.g. Pet) or oneOf
236
+ klass = TrinsicApi.const_get(type)
237
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end
@@ -27,6 +27,10 @@ module TrinsicApi
27
27
 
28
28
  attr_accessor :attachment_access_keys
29
29
 
30
+ attr_accessor :provider_output
31
+
32
+ attr_accessor :identifiers
33
+
30
34
  # Attribute mapping from ruby-style variable name to JSON key.
31
35
  def self.attribute_map
32
36
  {
@@ -35,7 +39,9 @@ module TrinsicApi
35
39
  :'person' => :'person',
36
40
  :'document' => :'document',
37
41
  :'match' => :'match',
38
- :'attachment_access_keys' => :'attachmentAccessKeys'
42
+ :'attachment_access_keys' => :'attachmentAccessKeys',
43
+ :'provider_output' => :'providerOutput',
44
+ :'identifiers' => :'identifiers'
39
45
  }
40
46
  end
41
47
 
@@ -57,7 +63,9 @@ module TrinsicApi
57
63
  :'person' => :'PersonData',
58
64
  :'document' => :'DocumentData',
59
65
  :'match' => :'MatchData',
60
- :'attachment_access_keys' => :'AttachmentAccessKeys'
66
+ :'attachment_access_keys' => :'AttachmentAccessKeys',
67
+ :'provider_output' => :'ProviderOutput',
68
+ :'identifiers' => :'Array<Identifier>'
61
69
  }
62
70
  end
63
71
 
@@ -69,7 +77,8 @@ module TrinsicApi
69
77
  :'person',
70
78
  :'document',
71
79
  :'match',
72
- :'attachment_access_keys'
80
+ :'attachment_access_keys',
81
+ :'provider_output',
73
82
  ])
74
83
  end
75
84
 
@@ -112,6 +121,18 @@ module TrinsicApi
112
121
  if attributes.key?(:'attachment_access_keys')
113
122
  self.attachment_access_keys = attributes[:'attachment_access_keys']
114
123
  end
124
+
125
+ if attributes.key?(:'provider_output')
126
+ self.provider_output = attributes[:'provider_output']
127
+ end
128
+
129
+ if attributes.key?(:'identifiers')
130
+ if (value = attributes[:'identifiers']).is_a?(Array)
131
+ self.identifiers = value
132
+ end
133
+ else
134
+ self.identifiers = nil
135
+ end
115
136
  end
116
137
 
117
138
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -119,6 +140,10 @@ module TrinsicApi
119
140
  def list_invalid_properties
120
141
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
142
  invalid_properties = Array.new
143
+ if @identifiers.nil?
144
+ invalid_properties.push('invalid value for "identifiers", identifiers cannot be nil.')
145
+ end
146
+
122
147
  invalid_properties
123
148
  end
124
149
 
@@ -126,9 +151,20 @@ module TrinsicApi
126
151
  # @return true if the model is valid
127
152
  def valid?
128
153
  warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if @identifiers.nil?
129
155
  true
130
156
  end
131
157
 
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] identifiers Value to be assigned
160
+ def identifiers=(identifiers)
161
+ if identifiers.nil?
162
+ fail ArgumentError, 'identifiers cannot be nil'
163
+ end
164
+
165
+ @identifiers = identifiers
166
+ end
167
+
132
168
  # Checks equality by comparing each attribute.
133
169
  # @param [Object] Object to be compared
134
170
  def ==(o)
@@ -139,7 +175,9 @@ module TrinsicApi
139
175
  person == o.person &&
140
176
  document == o.document &&
141
177
  match == o.match &&
142
- attachment_access_keys == o.attachment_access_keys
178
+ attachment_access_keys == o.attachment_access_keys &&
179
+ provider_output == o.provider_output &&
180
+ identifiers == o.identifiers
143
181
  end
144
182
 
145
183
  # @see the `==` method
@@ -151,7 +189,7 @@ module TrinsicApi
151
189
  # Calculates hash code according to all attributes.
152
190
  # @return [Integer] Hash code
153
191
  def hash
154
- [originating_provider_id, originating_sub_provider_id, person, document, match, attachment_access_keys].hash
192
+ [originating_provider_id, originating_sub_provider_id, person, document, match, attachment_access_keys, provider_output, identifiers].hash
155
193
  end
156
194
 
157
195
  # Builds the object from hash
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Trinsic API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class KenyaNidBiometric2Input
18
+ # The user's Kenyan National ID number
19
+ attr_accessor :id_number
20
+
21
+ # An array of exactly 8 images required for biometric liveness verification. The first 7 images should be liveness frames captured during the liveness detection process, and the last image (8th) should be a selfie of the user. All images must be in JPEG format and each image must be less than 15MB in size.
22
+ attr_accessor :liveness_images
23
+
24
+ # Test selfie for test environment (optional, maximum 15MB). Must be JPEG format.
25
+ attr_accessor :test_selfie
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id_number' => :'idNumber',
31
+ :'liveness_images' => :'livenessImages',
32
+ :'test_selfie' => :'testSelfie'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id_number' => :'String',
50
+ :'liveness_images' => :'Array<String>',
51
+ :'test_selfie' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'id_number',
59
+ :'liveness_images',
60
+ :'test_selfie'
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::KenyaNidBiometric2Input` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::KenyaNidBiometric2Input`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'id_number')
81
+ self.id_number = attributes[:'id_number']
82
+ end
83
+
84
+ if attributes.key?(:'liveness_images')
85
+ if (value = attributes[:'liveness_images']).is_a?(Array)
86
+ self.liveness_images = value
87
+ end
88
+ end
89
+
90
+ if attributes.key?(:'test_selfie')
91
+ self.test_selfie = attributes[:'test_selfie']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ id_number == o.id_number &&
116
+ liveness_images == o.liveness_images &&
117
+ test_selfie == o.test_selfie
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [id_number, liveness_images, test_selfie].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def self._deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ # models (e.g. Pet) or oneOf
193
+ klass = TrinsicApi.const_get(type)
194
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end
@@ -30,7 +30,7 @@ module TrinsicApi
30
30
  # The user's gender as it appears in their National ID (e.g., male, female)
31
31
  attr_accessor :gender
32
32
 
33
- # The user's South Kenya National ID number
33
+ # The user's Kenya National ID number
34
34
  attr_accessor :national_id_number
35
35
 
36
36
  # Attribute mapping from ruby-style variable name to JSON key.