trinsic_api 1.2.0 → 2.0.0

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 (212) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/docs/AadhaarInput.md +20 -0
  4. data/docs/Address.md +3 -3
  5. data/docs/AttachmentAccessKeys.md +7 -5
  6. data/docs/AttachmentsApi.md +1 -1
  7. data/docs/BangladeshNationalIdInput.md +24 -0
  8. data/docs/BrazilCpfCheckInput.md +18 -0
  9. data/docs/BrazilDigitalCnhInput.md +24 -0
  10. data/docs/CreateAdvancedProviderSessionRequest.md +26 -0
  11. data/docs/CreateAdvancedProviderSessionResponse.md +22 -0
  12. data/docs/CreateHostedProviderSessionRequest.md +22 -0
  13. data/docs/CreateHostedProviderSessionResponse.md +22 -0
  14. data/docs/CreateWidgetSessionRequest.md +22 -0
  15. data/docs/CreateWidgetSessionResponse.md +22 -0
  16. data/docs/DocumentData.md +3 -3
  17. data/docs/DocumentScanAttachments.md +18 -0
  18. data/docs/{SessionState.md → DocumentType.md} +2 -2
  19. data/docs/HttpValidationProblemDetails.md +28 -0
  20. data/docs/IdentityData.md +6 -4
  21. data/docs/IdinInput.md +18 -0
  22. data/docs/IndonesiaNikInput.md +22 -0
  23. data/docs/{FailureMessage.md → IntegrationCapability.md} +2 -5
  24. data/docs/IntegrationLaunchMethod.md +15 -0
  25. data/docs/IntegrationStep.md +22 -0
  26. data/docs/KenyaNidInput.md +28 -0
  27. data/docs/{SessionFailCode.md → Language.md} +2 -2
  28. data/docs/ListProviderContractsResponse.md +18 -0
  29. data/docs/MexicoCurpInput.md +18 -0
  30. data/docs/MobileIdInput.md +22 -0
  31. data/docs/NetworkApi.md +22 -25
  32. data/docs/NigeriaNinInput.md +30 -0
  33. data/docs/PersonData.md +14 -12
  34. data/docs/PhilippineMatchInput.md +26 -0
  35. data/docs/PhilippineQRInput.md +20 -0
  36. data/docs/ProblemDetails.md +26 -0
  37. data/docs/ProviderAttachments.md +18 -0
  38. data/docs/ProviderContract.md +46 -0
  39. data/docs/ProviderInformation.md +3 -3
  40. data/docs/ProviderInput.md +50 -0
  41. data/docs/RecommendRequest.md +2 -6
  42. data/docs/RecommendationInfo.md +24 -0
  43. data/docs/RefreshStepContentRequest.md +18 -0
  44. data/docs/RefreshStepContentResponse.md +18 -0
  45. data/docs/ResultCollection.md +20 -0
  46. data/docs/ResultCollectionMethod.md +15 -0
  47. data/docs/Session.md +6 -8
  48. data/docs/{VerificationFailCode.md → SessionErrorCode.md} +2 -2
  49. data/docs/SessionsApi.md +237 -19
  50. data/docs/Sex.md +15 -0
  51. data/docs/SmartIdInput.md +18 -0
  52. data/docs/SouthAfricaNidInput.md +24 -0
  53. data/docs/SpidInput.md +18 -0
  54. data/docs/StepRefreshInfo.md +22 -0
  55. data/docs/SubProviderMetadata.md +24 -0
  56. data/docs/TrinsicTestDatabaseLookupInput.md +24 -0
  57. data/docs/TrinsicTestSubProvidersInput.md +18 -0
  58. data/lib/trinsic_api/api/attachments_api.rb +3 -3
  59. data/lib/trinsic_api/api/network_api.rb +19 -25
  60. data/lib/trinsic_api/api/sessions_api.rb +219 -21
  61. data/lib/trinsic_api/api_client.rb +1 -1
  62. data/lib/trinsic_api/api_error.rb +1 -1
  63. data/lib/trinsic_api/configuration.rb +1 -1
  64. data/lib/trinsic_api/models/aadhaar_input.rb +227 -0
  65. data/lib/trinsic_api/models/address.rb +16 -10
  66. data/lib/trinsic_api/models/attachment_access_keys.rb +25 -10
  67. data/lib/trinsic_api/models/bangladesh_national_id_input.rb +249 -0
  68. data/lib/trinsic_api/models/brazil_cpf_check_input.rb +261 -0
  69. data/lib/trinsic_api/models/brazil_digital_cnh_input.rb +294 -0
  70. data/lib/trinsic_api/models/cancel_session_response.rb +1 -1
  71. data/lib/trinsic_api/models/create_advanced_provider_session_request.rb +312 -0
  72. data/lib/trinsic_api/models/create_advanced_provider_session_response.rb +256 -0
  73. data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +288 -0
  74. data/lib/trinsic_api/models/create_hosted_provider_session_response.rb +256 -0
  75. data/lib/trinsic_api/models/create_widget_session_request.rb +240 -0
  76. data/lib/trinsic_api/models/create_widget_session_response.rb +256 -0
  77. data/lib/trinsic_api/models/document_data.rb +32 -4
  78. data/lib/trinsic_api/models/{failure_message.rb → document_scan_attachments.rb} +12 -18
  79. data/lib/trinsic_api/models/{session_state.rb → document_type.rb} +9 -11
  80. data/lib/trinsic_api/models/get_attachment_request.rb +1 -1
  81. data/lib/trinsic_api/models/get_attachment_response.rb +1 -1
  82. data/lib/trinsic_api/models/get_session_response.rb +1 -1
  83. data/lib/trinsic_api/models/get_session_result_request.rb +1 -1
  84. data/lib/trinsic_api/models/get_session_result_response.rb +2 -1
  85. data/lib/trinsic_api/models/{known_address.rb → http_validation_problem_details.rb} +55 -51
  86. data/lib/trinsic_api/models/identity_data.rb +16 -6
  87. data/lib/trinsic_api/models/{known_identity_data.rb → idin_input.rb} +13 -13
  88. data/lib/trinsic_api/models/{disclosed_fields_request.rb → indonesia_nik_input.rb} +94 -93
  89. data/lib/trinsic_api/models/integration_capability.rb +44 -0
  90. data/lib/trinsic_api/models/integration_launch_method.rb +42 -0
  91. data/lib/trinsic_api/models/integration_step.rb +275 -0
  92. data/lib/trinsic_api/models/kenya_nid_input.rb +397 -0
  93. data/lib/trinsic_api/models/language.rb +42 -0
  94. data/lib/trinsic_api/models/{validation_result.rb → list_provider_contracts_response.rb} +17 -25
  95. data/lib/trinsic_api/models/list_providers_response.rb +1 -1
  96. data/lib/trinsic_api/models/list_sessions_response.rb +1 -1
  97. data/lib/trinsic_api/models/{create_session_response.rb → mexico_curp_input.rb} +44 -26
  98. data/lib/trinsic_api/models/mobile_id_input.rb +260 -0
  99. data/lib/trinsic_api/models/nigeria_nin_input.rb +383 -0
  100. data/lib/trinsic_api/models/order_direction.rb +1 -1
  101. data/lib/trinsic_api/models/person_data.rb +50 -15
  102. data/lib/trinsic_api/models/{known_person_data.rb → philippine_match_input.rb} +28 -33
  103. data/lib/trinsic_api/models/philippine_qr_input.rb +227 -0
  104. data/lib/trinsic_api/models/{verification.rb → problem_details.rb} +49 -42
  105. data/lib/trinsic_api/models/provider_attachments.rb +215 -0
  106. data/lib/trinsic_api/models/provider_contract.rb +482 -0
  107. data/lib/trinsic_api/models/provider_info.rb +1 -1
  108. data/lib/trinsic_api/models/provider_information.rb +1 -1
  109. data/lib/trinsic_api/models/provider_input.rb +392 -0
  110. data/lib/trinsic_api/models/recommend_request.rb +10 -40
  111. data/lib/trinsic_api/models/recommend_response.rb +1 -1
  112. data/lib/trinsic_api/models/recommendation_info.rb +256 -0
  113. data/lib/trinsic_api/models/refresh_step_content_request.rb +216 -0
  114. data/lib/trinsic_api/models/{identity_lookup_response.rb → refresh_step_content_response.rb} +16 -16
  115. data/lib/trinsic_api/models/result_collection.rb +261 -0
  116. data/lib/trinsic_api/models/result_collection_method.rb +40 -0
  117. data/lib/trinsic_api/models/session.rb +32 -48
  118. data/lib/trinsic_api/models/session_error_code.rb +48 -0
  119. data/lib/trinsic_api/models/session_ordering.rb +1 -1
  120. data/lib/trinsic_api/models/sex.rb +42 -0
  121. data/lib/trinsic_api/models/smart_id_input.rb +216 -0
  122. data/lib/trinsic_api/models/{disclosed_fields.rb → south_africa_nid_input.rb} +107 -154
  123. data/lib/trinsic_api/models/spid_input.rb +216 -0
  124. data/lib/trinsic_api/models/step_refresh_info.rb +256 -0
  125. data/lib/trinsic_api/models/sub_provider_metadata.rb +274 -0
  126. data/lib/trinsic_api/models/trinsic_test_database_lookup_input.rb +249 -0
  127. data/lib/trinsic_api/models/trinsic_test_sub_providers_input.rb +216 -0
  128. data/lib/trinsic_api/version.rb +2 -2
  129. data/lib/trinsic_api.rb +45 -15
  130. data/spec/api/attachments_api_spec.rb +2 -2
  131. data/spec/api/network_api_spec.rb +8 -9
  132. data/spec/api/sessions_api_spec.rb +45 -8
  133. data/spec/models/{verification_spec.rb → aadhaar_input_spec.rb} +9 -9
  134. data/spec/models/address_spec.rb +2 -2
  135. data/spec/models/attachment_access_keys_spec.rb +7 -1
  136. data/spec/models/bangladesh_national_id_input_spec.rb +54 -0
  137. data/spec/models/{identity_lookup_response_spec.rb → brazil_cpf_check_input_spec.rb} +8 -8
  138. data/spec/models/brazil_digital_cnh_input_spec.rb +54 -0
  139. data/spec/models/cancel_session_response_spec.rb +1 -1
  140. data/spec/models/create_advanced_provider_session_request_spec.rb +60 -0
  141. data/spec/models/create_advanced_provider_session_response_spec.rb +48 -0
  142. data/spec/models/create_hosted_provider_session_request_spec.rb +48 -0
  143. data/spec/models/create_hosted_provider_session_response_spec.rb +48 -0
  144. data/spec/models/create_widget_session_request_spec.rb +48 -0
  145. data/spec/models/create_widget_session_response_spec.rb +48 -0
  146. data/spec/models/document_data_spec.rb +1 -1
  147. data/spec/models/document_scan_attachments_spec.rb +36 -0
  148. data/spec/models/{session_state_spec.rb → document_type_spec.rb} +7 -7
  149. data/spec/models/get_attachment_request_spec.rb +1 -1
  150. data/spec/models/get_attachment_response_spec.rb +1 -1
  151. data/spec/models/get_session_response_spec.rb +1 -1
  152. data/spec/models/get_session_result_request_spec.rb +1 -1
  153. data/spec/models/get_session_result_response_spec.rb +1 -1
  154. data/spec/models/http_validation_problem_details_spec.rb +66 -0
  155. data/spec/models/identity_data_spec.rb +7 -1
  156. data/spec/models/{failure_message_spec.rb → idin_input_spec.rb} +8 -8
  157. data/spec/models/indonesia_nik_input_spec.rb +48 -0
  158. data/spec/models/integration_capability_spec.rb +30 -0
  159. data/spec/models/integration_launch_method_spec.rb +30 -0
  160. data/spec/models/integration_step_spec.rb +48 -0
  161. data/spec/models/{known_person_data_spec.rb → kenya_nid_input_spec.rb} +13 -13
  162. data/spec/models/{session_fail_code_spec.rb → language_spec.rb} +7 -7
  163. data/spec/models/list_provider_contracts_response_spec.rb +36 -0
  164. data/spec/models/list_providers_response_spec.rb +1 -1
  165. data/spec/models/list_sessions_response_spec.rb +1 -1
  166. data/spec/models/{known_identity_data_spec.rb → mexico_curp_input_spec.rb} +8 -8
  167. data/spec/models/mobile_id_input_spec.rb +48 -0
  168. data/spec/models/{known_address_spec.rb → nigeria_nin_input_spec.rb} +14 -14
  169. data/spec/models/order_direction_spec.rb +1 -1
  170. data/spec/models/person_data_spec.rb +8 -2
  171. data/spec/models/{create_session_request_spec.rb → philippine_match_input_spec.rb} +12 -12
  172. data/spec/models/{create_session_response_spec.rb → philippine_qr_input_spec.rb} +9 -9
  173. data/spec/models/problem_details_spec.rb +60 -0
  174. data/spec/models/provider_attachments_spec.rb +36 -0
  175. data/spec/models/{disclosed_fields_request_spec.rb → provider_contract_spec.rb} +37 -19
  176. data/spec/models/provider_info_spec.rb +1 -1
  177. data/spec/models/provider_information_spec.rb +1 -1
  178. data/spec/models/{disclosed_fields_spec.rb → provider_input_spec.rb} +49 -19
  179. data/spec/models/recommend_request_spec.rb +2 -14
  180. data/spec/models/recommend_response_spec.rb +1 -1
  181. data/spec/models/recommendation_info_spec.rb +54 -0
  182. data/spec/models/refresh_step_content_request_spec.rb +36 -0
  183. data/spec/models/refresh_step_content_response_spec.rb +36 -0
  184. data/spec/models/result_collection_method_spec.rb +30 -0
  185. data/spec/models/{validation_result_spec.rb → result_collection_spec.rb} +9 -9
  186. data/spec/models/{verification_fail_code_spec.rb → session_error_code_spec.rb} +7 -7
  187. data/spec/models/session_ordering_spec.rb +1 -1
  188. data/spec/models/session_spec.rb +4 -10
  189. data/spec/models/sex_spec.rb +30 -0
  190. data/spec/models/smart_id_input_spec.rb +36 -0
  191. data/spec/models/south_africa_nid_input_spec.rb +54 -0
  192. data/spec/models/spid_input_spec.rb +36 -0
  193. data/spec/models/step_refresh_info_spec.rb +48 -0
  194. data/spec/models/sub_provider_metadata_spec.rb +54 -0
  195. data/spec/models/trinsic_test_database_lookup_input_spec.rb +54 -0
  196. data/spec/models/trinsic_test_sub_providers_input_spec.rb +36 -0
  197. data/spec/spec_helper.rb +1 -1
  198. data/trinsic_api.gemspec +1 -1
  199. metadata +195 -75
  200. data/docs/CreateSessionRequest.md +0 -26
  201. data/docs/CreateSessionResponse.md +0 -20
  202. data/docs/DisclosedFields.md +0 -40
  203. data/docs/DisclosedFieldsRequest.md +0 -40
  204. data/docs/IdentityLookupResponse.md +0 -18
  205. data/docs/KnownAddress.md +0 -30
  206. data/docs/KnownIdentityData.md +0 -18
  207. data/docs/KnownPersonData.md +0 -28
  208. data/docs/ValidationResult.md +0 -20
  209. data/docs/Verification.md +0 -20
  210. data/lib/trinsic_api/models/create_session_request.rb +0 -257
  211. data/lib/trinsic_api/models/session_fail_code.rb +0 -45
  212. data/lib/trinsic_api/models/verification_fail_code.rb +0 -44
@@ -0,0 +1,216 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class SmartIdInput
18
+ # The user's Smart ID Document Number
19
+ attr_accessor :smart_id_document_number
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'smart_id_document_number' => :'smartIdDocumentNumber'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'smart_id_document_number' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ :'smart_id_document_number'
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::SmartIdInput` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::SmartIdInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'smart_id_document_number')
63
+ self.smart_id_document_number = attributes[:'smart_id_document_number']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ warn '[DEPRECATED] the `valid?` method is obsolete'
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ smart_id_document_number == o.smart_id_document_number
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [smart_id_document_number].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ attributes = attributes.transform_keys(&:to_sym)
108
+ transformed_hash = {}
109
+ openapi_types.each_pair do |key, type|
110
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
111
+ transformed_hash["#{key}"] = nil
112
+ elsif type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[attribute_map[key]].is_a?(Array)
116
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
+ end
118
+ elsif !attributes[attribute_map[key]].nil?
119
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
120
+ end
121
+ end
122
+ new(transformed_hash)
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def self._deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = TrinsicApi.const_get(type)
164
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #Connect API
2
+ #Trinsic API
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
@@ -14,46 +14,26 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TrinsicApi
17
- class DisclosedFields
18
- attr_accessor :id_number
19
-
20
- attr_accessor :given_name
21
-
22
- attr_accessor :family_name
23
-
24
- attr_accessor :address
17
+ class SouthAfricaNidInput
18
+ # The user's full name as it appears in their National ID
19
+ attr_accessor :full_name
25
20
 
21
+ # The user's date of birth, in `YYYY-MM-DD` format
26
22
  attr_accessor :date_of_birth
27
23
 
28
- attr_accessor :country
29
-
30
- attr_accessor :issue_date
31
-
32
- attr_accessor :expiration_date
33
-
34
- attr_accessor :document_front
35
-
36
- attr_accessor :document_back
37
-
38
- attr_accessor :document_portrait
24
+ # The user's gender as it appears in their National ID (e.g., male, female)
25
+ attr_accessor :gender
39
26
 
40
- attr_accessor :selfie
27
+ # The user's South African National ID number
28
+ attr_accessor :national_id_number
41
29
 
42
30
  # Attribute mapping from ruby-style variable name to JSON key.
43
31
  def self.attribute_map
44
32
  {
45
- :'id_number' => :'idNumber',
46
- :'given_name' => :'givenName',
47
- :'family_name' => :'familyName',
48
- :'address' => :'address',
33
+ :'full_name' => :'fullName',
49
34
  :'date_of_birth' => :'dateOfBirth',
50
- :'country' => :'country',
51
- :'issue_date' => :'issueDate',
52
- :'expiration_date' => :'expirationDate',
53
- :'document_front' => :'documentFront',
54
- :'document_back' => :'documentBack',
55
- :'document_portrait' => :'documentPortrait',
56
- :'selfie' => :'selfie'
35
+ :'gender' => :'gender',
36
+ :'national_id_number' => :'nationalIdNumber'
57
37
  }
58
38
  end
59
39
 
@@ -65,18 +45,10 @@ module TrinsicApi
65
45
  # Attribute type mapping.
66
46
  def self.openapi_types
67
47
  {
68
- :'id_number' => :'Boolean',
69
- :'given_name' => :'Boolean',
70
- :'family_name' => :'Boolean',
71
- :'address' => :'Boolean',
72
- :'date_of_birth' => :'Boolean',
73
- :'country' => :'Boolean',
74
- :'issue_date' => :'Boolean',
75
- :'expiration_date' => :'Boolean',
76
- :'document_front' => :'Boolean',
77
- :'document_back' => :'Boolean',
78
- :'document_portrait' => :'Boolean',
79
- :'selfie' => :'Boolean'
48
+ :'full_name' => :'String',
49
+ :'date_of_birth' => :'Date',
50
+ :'gender' => :'String',
51
+ :'national_id_number' => :'String'
80
52
  }
81
53
  end
82
54
 
@@ -90,39 +62,21 @@ module TrinsicApi
90
62
  # @param [Hash] attributes Model attributes in the form of hash
91
63
  def initialize(attributes = {})
92
64
  if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::DisclosedFields` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::SouthAfricaNidInput` initialize method"
94
66
  end
95
67
 
96
68
  # check to see if the attribute exists and convert string to symbol for hash key
97
69
  attributes = attributes.each_with_object({}) { |(k, v), h|
98
70
  if (!self.class.attribute_map.key?(k.to_sym))
99
- fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::DisclosedFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::SouthAfricaNidInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
72
  end
101
73
  h[k.to_sym] = v
102
74
  }
103
75
 
104
- if attributes.key?(:'id_number')
105
- self.id_number = attributes[:'id_number']
106
- else
107
- self.id_number = nil
108
- end
109
-
110
- if attributes.key?(:'given_name')
111
- self.given_name = attributes[:'given_name']
112
- else
113
- self.given_name = nil
114
- end
115
-
116
- if attributes.key?(:'family_name')
117
- self.family_name = attributes[:'family_name']
118
- else
119
- self.family_name = nil
120
- end
121
-
122
- if attributes.key?(:'address')
123
- self.address = attributes[:'address']
76
+ if attributes.key?(:'full_name')
77
+ self.full_name = attributes[:'full_name']
124
78
  else
125
- self.address = nil
79
+ self.full_name = nil
126
80
  end
127
81
 
128
82
  if attributes.key?(:'date_of_birth')
@@ -131,46 +85,16 @@ module TrinsicApi
131
85
  self.date_of_birth = nil
132
86
  end
133
87
 
134
- if attributes.key?(:'country')
135
- self.country = attributes[:'country']
136
- else
137
- self.country = nil
138
- end
139
-
140
- if attributes.key?(:'issue_date')
141
- self.issue_date = attributes[:'issue_date']
142
- else
143
- self.issue_date = nil
144
- end
145
-
146
- if attributes.key?(:'expiration_date')
147
- self.expiration_date = attributes[:'expiration_date']
148
- else
149
- self.expiration_date = nil
150
- end
151
-
152
- if attributes.key?(:'document_front')
153
- self.document_front = attributes[:'document_front']
154
- else
155
- self.document_front = nil
156
- end
157
-
158
- if attributes.key?(:'document_back')
159
- self.document_back = attributes[:'document_back']
160
- else
161
- self.document_back = nil
162
- end
163
-
164
- if attributes.key?(:'document_portrait')
165
- self.document_portrait = attributes[:'document_portrait']
88
+ if attributes.key?(:'gender')
89
+ self.gender = attributes[:'gender']
166
90
  else
167
- self.document_portrait = nil
91
+ self.gender = nil
168
92
  end
169
93
 
170
- if attributes.key?(:'selfie')
171
- self.selfie = attributes[:'selfie']
94
+ if attributes.key?(:'national_id_number')
95
+ self.national_id_number = attributes[:'national_id_number']
172
96
  else
173
- self.selfie = nil
97
+ self.national_id_number = nil
174
98
  end
175
99
  end
176
100
 
@@ -179,52 +103,41 @@ module TrinsicApi
179
103
  def list_invalid_properties
180
104
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
181
105
  invalid_properties = Array.new
182
- if @id_number.nil?
183
- invalid_properties.push('invalid value for "id_number", id_number cannot be nil.')
184
- end
185
-
186
- if @given_name.nil?
187
- invalid_properties.push('invalid value for "given_name", given_name cannot be nil.')
106
+ if @full_name.nil?
107
+ invalid_properties.push('invalid value for "full_name", full_name cannot be nil.')
188
108
  end
189
109
 
190
- if @family_name.nil?
191
- invalid_properties.push('invalid value for "family_name", family_name cannot be nil.')
192
- end
193
-
194
- if @address.nil?
195
- invalid_properties.push('invalid value for "address", address cannot be nil.')
110
+ if @full_name.to_s.length < 1
111
+ invalid_properties.push('invalid value for "full_name", the character length must be great than or equal to 1.')
196
112
  end
197
113
 
198
114
  if @date_of_birth.nil?
199
115
  invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
200
116
  end
201
117
 
202
- if @country.nil?
203
- invalid_properties.push('invalid value for "country", country cannot be nil.')
204
- end
205
-
206
- if @issue_date.nil?
207
- invalid_properties.push('invalid value for "issue_date", issue_date cannot be nil.')
118
+ if @gender.nil?
119
+ invalid_properties.push('invalid value for "gender", gender cannot be nil.')
208
120
  end
209
121
 
210
- if @expiration_date.nil?
211
- invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.')
122
+ if @gender.to_s.length < 1
123
+ invalid_properties.push('invalid value for "gender", the character length must be great than or equal to 1.')
212
124
  end
213
125
 
214
- if @document_front.nil?
215
- invalid_properties.push('invalid value for "document_front", document_front cannot be nil.')
126
+ if @national_id_number.nil?
127
+ invalid_properties.push('invalid value for "national_id_number", national_id_number cannot be nil.')
216
128
  end
217
129
 
218
- if @document_back.nil?
219
- invalid_properties.push('invalid value for "document_back", document_back cannot be nil.')
130
+ if @national_id_number.to_s.length > 13
131
+ invalid_properties.push('invalid value for "national_id_number", the character length must be smaller than or equal to 13.')
220
132
  end
221
133
 
222
- if @document_portrait.nil?
223
- invalid_properties.push('invalid value for "document_portrait", document_portrait cannot be nil.')
134
+ if @national_id_number.to_s.length < 13
135
+ invalid_properties.push('invalid value for "national_id_number", the character length must be great than or equal to 13.')
224
136
  end
225
137
 
226
- if @selfie.nil?
227
- invalid_properties.push('invalid value for "selfie", selfie cannot be nil.')
138
+ pattern = Regexp.new(/^\d*$/)
139
+ if @national_id_number !~ pattern
140
+ invalid_properties.push("invalid value for \"national_id_number\", must conform to the pattern #{pattern}.")
228
141
  end
229
142
 
230
143
  invalid_properties
@@ -234,38 +147,78 @@ module TrinsicApi
234
147
  # @return true if the model is valid
235
148
  def valid?
236
149
  warn '[DEPRECATED] the `valid?` method is obsolete'
237
- return false if @id_number.nil?
238
- return false if @given_name.nil?
239
- return false if @family_name.nil?
240
- return false if @address.nil?
150
+ return false if @full_name.nil?
151
+ return false if @full_name.to_s.length < 1
241
152
  return false if @date_of_birth.nil?
242
- return false if @country.nil?
243
- return false if @issue_date.nil?
244
- return false if @expiration_date.nil?
245
- return false if @document_front.nil?
246
- return false if @document_back.nil?
247
- return false if @document_portrait.nil?
248
- return false if @selfie.nil?
153
+ return false if @gender.nil?
154
+ return false if @gender.to_s.length < 1
155
+ return false if @national_id_number.nil?
156
+ return false if @national_id_number.to_s.length > 13
157
+ return false if @national_id_number.to_s.length < 13
158
+ return false if @national_id_number !~ Regexp.new(/^\d*$/)
249
159
  true
250
160
  end
251
161
 
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] full_name Value to be assigned
164
+ def full_name=(full_name)
165
+ if full_name.nil?
166
+ fail ArgumentError, 'full_name cannot be nil'
167
+ end
168
+
169
+ if full_name.to_s.length < 1
170
+ fail ArgumentError, 'invalid value for "full_name", the character length must be great than or equal to 1.'
171
+ end
172
+
173
+ @full_name = full_name
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] gender Value to be assigned
178
+ def gender=(gender)
179
+ if gender.nil?
180
+ fail ArgumentError, 'gender cannot be nil'
181
+ end
182
+
183
+ if gender.to_s.length < 1
184
+ fail ArgumentError, 'invalid value for "gender", the character length must be great than or equal to 1.'
185
+ end
186
+
187
+ @gender = gender
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] national_id_number Value to be assigned
192
+ def national_id_number=(national_id_number)
193
+ if national_id_number.nil?
194
+ fail ArgumentError, 'national_id_number cannot be nil'
195
+ end
196
+
197
+ if national_id_number.to_s.length > 13
198
+ fail ArgumentError, 'invalid value for "national_id_number", the character length must be smaller than or equal to 13.'
199
+ end
200
+
201
+ if national_id_number.to_s.length < 13
202
+ fail ArgumentError, 'invalid value for "national_id_number", the character length must be great than or equal to 13.'
203
+ end
204
+
205
+ pattern = Regexp.new(/^\d*$/)
206
+ if national_id_number !~ pattern
207
+ fail ArgumentError, "invalid value for \"national_id_number\", must conform to the pattern #{pattern}."
208
+ end
209
+
210
+ @national_id_number = national_id_number
211
+ end
212
+
252
213
  # Checks equality by comparing each attribute.
253
214
  # @param [Object] Object to be compared
254
215
  def ==(o)
255
216
  return true if self.equal?(o)
256
217
  self.class == o.class &&
257
- id_number == o.id_number &&
258
- given_name == o.given_name &&
259
- family_name == o.family_name &&
260
- address == o.address &&
218
+ full_name == o.full_name &&
261
219
  date_of_birth == o.date_of_birth &&
262
- country == o.country &&
263
- issue_date == o.issue_date &&
264
- expiration_date == o.expiration_date &&
265
- document_front == o.document_front &&
266
- document_back == o.document_back &&
267
- document_portrait == o.document_portrait &&
268
- selfie == o.selfie
220
+ gender == o.gender &&
221
+ national_id_number == o.national_id_number
269
222
  end
270
223
 
271
224
  # @see the `==` method
@@ -277,7 +230,7 @@ module TrinsicApi
277
230
  # Calculates hash code according to all attributes.
278
231
  # @return [Integer] Hash code
279
232
  def hash
280
- [id_number, given_name, family_name, address, date_of_birth, country, issue_date, expiration_date, document_front, document_back, document_portrait, selfie].hash
233
+ [full_name, date_of_birth, gender, national_id_number].hash
281
234
  end
282
235
 
283
236
  # Builds the object from hash