trinsic_api 1.2.0 → 2.0.0.pre.alpha3
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.
- checksums.yaml +4 -4
- data/docs/AadhaarInput.md +20 -0
- data/docs/Address.md +3 -3
- data/docs/AttachmentAccessKeys.md +7 -5
- data/docs/BangladeshNationalIdInput.md +24 -0
- data/docs/BrazilCpfCheckInput.md +18 -0
- data/docs/BrazilDigitalCnhInput.md +24 -0
- data/docs/CreateAdvancedProviderSessionRequest.md +26 -0
- data/docs/CreateAdvancedProviderSessionResponse.md +22 -0
- data/docs/CreateHostedProviderSessionRequest.md +22 -0
- data/docs/CreateHostedProviderSessionResponse.md +20 -0
- data/docs/CreateWidgetSessionRequest.md +22 -0
- data/docs/{CreateSessionResponse.md → CreateWidgetSessionResponse.md} +5 -5
- data/docs/DocumentData.md +3 -3
- data/docs/DocumentScanAttachments.md +18 -0
- data/docs/{SessionState.md → DocumentType.md} +2 -2
- data/docs/HttpValidationProblemDetails.md +28 -0
- data/docs/IdentityData.md +4 -4
- data/docs/IndonesiaNikInput.md +22 -0
- data/docs/{FailureMessage.md → IntegrationCapability.md} +2 -5
- data/docs/IntegrationLaunchMethod.md +15 -0
- data/docs/IntegrationStep.md +22 -0
- data/docs/KenyaNidInput.md +28 -0
- data/docs/KnownAddress.md +3 -1
- data/docs/KnownPersonData.md +4 -0
- data/docs/MexicoCurpInput.md +18 -0
- data/docs/NetworkApi.md +2 -72
- data/docs/NigeriaNinInput.md +30 -0
- data/docs/PersonData.md +14 -12
- data/docs/PhilippineMatchInput.md +26 -0
- data/docs/PhilippineQRInput.md +20 -0
- data/docs/ProblemDetails.md +26 -0
- data/docs/ProviderAttachments.md +18 -0
- data/docs/ProviderInfo.md +3 -1
- data/docs/ProviderInput.md +38 -0
- data/docs/RecommendRequest.md +7 -3
- data/docs/RefreshStepContentRequest.md +18 -0
- data/docs/RefreshStepContentResponse.md +18 -0
- data/docs/ResultCollection.md +20 -0
- data/docs/ResultCollectionMethod.md +15 -0
- data/docs/Session.md +6 -8
- data/docs/{VerificationFailCode.md → SessionErrorCode.md} +2 -2
- data/docs/SessionsApi.md +236 -18
- data/docs/{SessionFailCode.md → Sex.md} +2 -2
- data/docs/SouthAfricaNidInput.md +24 -0
- data/docs/StepRefreshInfo.md +22 -0
- data/lib/trinsic_api/api/attachments_api.rb +1 -1
- data/lib/trinsic_api/api/network_api.rb +3 -66
- data/lib/trinsic_api/api/sessions_api.rb +217 -19
- data/lib/trinsic_api/api_client.rb +1 -1
- data/lib/trinsic_api/api_error.rb +1 -1
- data/lib/trinsic_api/configuration.rb +1 -1
- data/lib/trinsic_api/models/{validation_result.rb → aadhaar_input.rb} +21 -26
- data/lib/trinsic_api/models/address.rb +16 -10
- data/lib/trinsic_api/models/attachment_access_keys.rb +25 -10
- data/lib/trinsic_api/models/bangladesh_national_id_input.rb +249 -0
- data/lib/trinsic_api/models/brazil_cpf_check_input.rb +261 -0
- data/lib/trinsic_api/models/brazil_digital_cnh_input.rb +294 -0
- data/lib/trinsic_api/models/cancel_session_response.rb +1 -1
- data/lib/trinsic_api/models/create_advanced_provider_session_request.rb +312 -0
- data/lib/trinsic_api/models/create_advanced_provider_session_response.rb +256 -0
- data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +288 -0
- data/lib/trinsic_api/models/create_hosted_provider_session_response.rb +233 -0
- data/lib/trinsic_api/models/create_widget_session_request.rb +240 -0
- data/lib/trinsic_api/models/{create_session_response.rb → create_widget_session_response.rb} +18 -17
- data/lib/trinsic_api/models/document_data.rb +32 -4
- data/lib/trinsic_api/models/{failure_message.rb → document_scan_attachments.rb} +12 -18
- data/lib/trinsic_api/models/{session_state.rb → document_type.rb} +9 -11
- data/lib/trinsic_api/models/get_attachment_request.rb +1 -1
- data/lib/trinsic_api/models/get_attachment_response.rb +1 -1
- data/lib/trinsic_api/models/get_session_response.rb +1 -1
- data/lib/trinsic_api/models/get_session_result_request.rb +1 -1
- data/lib/trinsic_api/models/get_session_result_response.rb +2 -1
- data/lib/trinsic_api/models/http_validation_problem_details.rb +273 -0
- data/lib/trinsic_api/models/identity_data.rb +5 -5
- data/lib/trinsic_api/models/{disclosed_fields_request.rb → indonesia_nik_input.rb} +94 -93
- data/lib/trinsic_api/models/integration_capability.rb +44 -0
- data/lib/trinsic_api/models/integration_launch_method.rb +42 -0
- data/lib/trinsic_api/models/integration_step.rb +275 -0
- data/lib/trinsic_api/models/kenya_nid_input.rb +397 -0
- data/lib/trinsic_api/models/known_address.rb +20 -2
- data/lib/trinsic_api/models/known_identity_data.rb +2 -1
- data/lib/trinsic_api/models/known_person_data.rb +30 -2
- data/lib/trinsic_api/models/list_providers_response.rb +1 -1
- data/lib/trinsic_api/models/list_sessions_response.rb +1 -1
- data/lib/trinsic_api/models/mexico_curp_input.rb +250 -0
- data/lib/trinsic_api/models/nigeria_nin_input.rb +383 -0
- data/lib/trinsic_api/models/order_direction.rb +1 -1
- data/lib/trinsic_api/models/person_data.rb +50 -15
- data/lib/trinsic_api/models/philippine_match_input.rb +260 -0
- data/lib/trinsic_api/models/philippine_qr_input.rb +227 -0
- data/lib/trinsic_api/models/problem_details.rb +255 -0
- data/lib/trinsic_api/models/provider_attachments.rb +215 -0
- data/lib/trinsic_api/models/provider_info.rb +18 -5
- data/lib/trinsic_api/models/provider_information.rb +1 -1
- data/lib/trinsic_api/models/{create_session_request.rb → provider_input.rb} +111 -42
- data/lib/trinsic_api/models/recommend_request.rb +38 -18
- data/lib/trinsic_api/models/recommend_response.rb +1 -1
- data/lib/trinsic_api/models/refresh_step_content_request.rb +216 -0
- data/lib/trinsic_api/models/{identity_lookup_response.rb → refresh_step_content_response.rb} +16 -16
- data/lib/trinsic_api/models/{verification.rb → result_collection.rb} +27 -20
- data/lib/trinsic_api/models/result_collection_method.rb +40 -0
- data/lib/trinsic_api/models/session.rb +32 -48
- data/lib/trinsic_api/models/session_error_code.rb +48 -0
- data/lib/trinsic_api/models/session_ordering.rb +1 -1
- data/lib/trinsic_api/models/sex.rb +42 -0
- data/lib/trinsic_api/models/{disclosed_fields.rb → south_africa_nid_input.rb} +107 -154
- data/lib/trinsic_api/models/step_refresh_info.rb +256 -0
- data/lib/trinsic_api/version.rb +2 -2
- data/lib/trinsic_api.rb +34 -12
- data/spec/api/attachments_api_spec.rb +1 -1
- data/spec/api/network_api_spec.rb +2 -14
- data/spec/api/sessions_api_spec.rb +44 -7
- data/spec/models/{verification_spec.rb → aadhaar_input_spec.rb} +9 -9
- data/spec/models/address_spec.rb +2 -2
- data/spec/models/attachment_access_keys_spec.rb +7 -1
- data/spec/models/bangladesh_national_id_input_spec.rb +54 -0
- data/spec/models/{identity_lookup_response_spec.rb → brazil_cpf_check_input_spec.rb} +8 -8
- data/spec/models/brazil_digital_cnh_input_spec.rb +54 -0
- data/spec/models/cancel_session_response_spec.rb +1 -1
- data/spec/models/create_advanced_provider_session_request_spec.rb +60 -0
- data/spec/models/create_advanced_provider_session_response_spec.rb +48 -0
- data/spec/models/create_hosted_provider_session_request_spec.rb +48 -0
- data/spec/models/create_hosted_provider_session_response_spec.rb +42 -0
- data/spec/models/create_widget_session_request_spec.rb +48 -0
- data/spec/models/{create_session_response_spec.rb → create_widget_session_response_spec.rb} +8 -8
- data/spec/models/document_data_spec.rb +1 -1
- data/spec/models/document_scan_attachments_spec.rb +36 -0
- data/spec/models/{session_state_spec.rb → document_type_spec.rb} +7 -7
- data/spec/models/get_attachment_request_spec.rb +1 -1
- data/spec/models/get_attachment_response_spec.rb +1 -1
- data/spec/models/get_session_response_spec.rb +1 -1
- data/spec/models/get_session_result_request_spec.rb +1 -1
- data/spec/models/get_session_result_response_spec.rb +1 -1
- data/spec/models/http_validation_problem_details_spec.rb +66 -0
- data/spec/models/identity_data_spec.rb +1 -1
- data/spec/models/indonesia_nik_input_spec.rb +48 -0
- data/spec/models/integration_capability_spec.rb +30 -0
- data/spec/models/integration_launch_method_spec.rb +30 -0
- data/spec/models/integration_step_spec.rb +48 -0
- data/spec/models/kenya_nid_input_spec.rb +66 -0
- data/spec/models/known_address_spec.rb +7 -1
- data/spec/models/known_identity_data_spec.rb +1 -1
- data/spec/models/known_person_data_spec.rb +13 -1
- data/spec/models/list_providers_response_spec.rb +1 -1
- data/spec/models/list_sessions_response_spec.rb +1 -1
- data/spec/models/{failure_message_spec.rb → mexico_curp_input_spec.rb} +8 -8
- data/spec/models/nigeria_nin_input_spec.rb +72 -0
- data/spec/models/order_direction_spec.rb +1 -1
- data/spec/models/person_data_spec.rb +8 -2
- data/spec/models/{create_session_request_spec.rb → philippine_match_input_spec.rb} +12 -12
- data/spec/models/philippine_qr_input_spec.rb +42 -0
- data/spec/models/problem_details_spec.rb +60 -0
- data/spec/models/provider_attachments_spec.rb +36 -0
- data/spec/models/provider_info_spec.rb +7 -1
- data/spec/models/provider_information_spec.rb +1 -1
- data/spec/models/{disclosed_fields_spec.rb → provider_input_spec.rb} +18 -24
- data/spec/models/recommend_request_spec.rb +14 -2
- data/spec/models/recommend_response_spec.rb +1 -1
- data/spec/models/refresh_step_content_request_spec.rb +36 -0
- data/spec/models/refresh_step_content_response_spec.rb +36 -0
- data/spec/models/result_collection_method_spec.rb +30 -0
- data/spec/models/{validation_result_spec.rb → result_collection_spec.rb} +9 -9
- data/spec/models/{verification_fail_code_spec.rb → session_error_code_spec.rb} +7 -7
- data/spec/models/session_ordering_spec.rb +1 -1
- data/spec/models/session_spec.rb +4 -10
- data/spec/models/{session_fail_code_spec.rb → sex_spec.rb} +7 -7
- data/spec/models/south_africa_nid_input_spec.rb +54 -0
- data/spec/models/step_refresh_info_spec.rb +48 -0
- data/spec/spec_helper.rb +1 -1
- data/trinsic_api.gemspec +1 -1
- metadata +154 -66
- data/docs/CreateSessionRequest.md +0 -26
- data/docs/DisclosedFields.md +0 -40
- data/docs/DisclosedFieldsRequest.md +0 -40
- data/docs/IdentityLookupResponse.md +0 -18
- data/docs/ValidationResult.md +0 -20
- data/docs/Verification.md +0 -20
- data/lib/trinsic_api/models/session_fail_code.rb +0 -45
- data/lib/trinsic_api/models/verification_fail_code.rb +0 -44
- data/spec/models/disclosed_fields_request_spec.rb +0 -102
@@ -0,0 +1,250 @@
|
|
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 MexicoCurpInput
|
18
|
+
# The user's CURP number
|
19
|
+
attr_accessor :curp
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'curp' => :'curp'
|
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
|
+
:'curp' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::MexicoCurpInput` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::MexicoCurpInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'curp')
|
62
|
+
self.curp = attributes[:'curp']
|
63
|
+
else
|
64
|
+
self.curp = nil
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @curp.nil?
|
74
|
+
invalid_properties.push('invalid value for "curp", curp cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
if @curp.to_s.length > 18
|
78
|
+
invalid_properties.push('invalid value for "curp", the character length must be smaller than or equal to 18.')
|
79
|
+
end
|
80
|
+
|
81
|
+
if @curp.to_s.length < 18
|
82
|
+
invalid_properties.push('invalid value for "curp", the character length must be great than or equal to 18.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
|
+
return false if @curp.nil?
|
93
|
+
return false if @curp.to_s.length > 18
|
94
|
+
return false if @curp.to_s.length < 18
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Custom attribute writer method with validation
|
99
|
+
# @param [Object] curp Value to be assigned
|
100
|
+
def curp=(curp)
|
101
|
+
if curp.nil?
|
102
|
+
fail ArgumentError, 'curp cannot be nil'
|
103
|
+
end
|
104
|
+
|
105
|
+
if curp.to_s.length > 18
|
106
|
+
fail ArgumentError, 'invalid value for "curp", the character length must be smaller than or equal to 18.'
|
107
|
+
end
|
108
|
+
|
109
|
+
if curp.to_s.length < 18
|
110
|
+
fail ArgumentError, 'invalid value for "curp", the character length must be great than or equal to 18.'
|
111
|
+
end
|
112
|
+
|
113
|
+
@curp = curp
|
114
|
+
end
|
115
|
+
|
116
|
+
# Checks equality by comparing each attribute.
|
117
|
+
# @param [Object] Object to be compared
|
118
|
+
def ==(o)
|
119
|
+
return true if self.equal?(o)
|
120
|
+
self.class == o.class &&
|
121
|
+
curp == o.curp
|
122
|
+
end
|
123
|
+
|
124
|
+
# @see the `==` method
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def eql?(o)
|
127
|
+
self == o
|
128
|
+
end
|
129
|
+
|
130
|
+
# Calculates hash code according to all attributes.
|
131
|
+
# @return [Integer] Hash code
|
132
|
+
def hash
|
133
|
+
[curp].hash
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def self.build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
attributes = attributes.transform_keys(&:to_sym)
|
142
|
+
transformed_hash = {}
|
143
|
+
openapi_types.each_pair do |key, type|
|
144
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
145
|
+
transformed_hash["#{key}"] = nil
|
146
|
+
elsif type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
150
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
151
|
+
end
|
152
|
+
elsif !attributes[attribute_map[key]].nil?
|
153
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
154
|
+
end
|
155
|
+
end
|
156
|
+
new(transformed_hash)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Deserializes the data based on type
|
160
|
+
# @param string type Data type
|
161
|
+
# @param string value Value to be deserialized
|
162
|
+
# @return [Object] Deserialized data
|
163
|
+
def self._deserialize(type, value)
|
164
|
+
case type.to_sym
|
165
|
+
when :Time
|
166
|
+
Time.parse(value)
|
167
|
+
when :Date
|
168
|
+
Date.parse(value)
|
169
|
+
when :String
|
170
|
+
value.to_s
|
171
|
+
when :Integer
|
172
|
+
value.to_i
|
173
|
+
when :Float
|
174
|
+
value.to_f
|
175
|
+
when :Boolean
|
176
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
177
|
+
true
|
178
|
+
else
|
179
|
+
false
|
180
|
+
end
|
181
|
+
when :Object
|
182
|
+
# generic object (usually a Hash), return directly
|
183
|
+
value
|
184
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
185
|
+
inner_type = Regexp.last_match[:inner_type]
|
186
|
+
value.map { |v| _deserialize(inner_type, v) }
|
187
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
188
|
+
k_type = Regexp.last_match[:k_type]
|
189
|
+
v_type = Regexp.last_match[:v_type]
|
190
|
+
{}.tap do |hash|
|
191
|
+
value.each do |k, v|
|
192
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
else # model
|
196
|
+
# models (e.g. Pet) or oneOf
|
197
|
+
klass = TrinsicApi.const_get(type)
|
198
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
204
|
+
def to_s
|
205
|
+
to_hash.to_s
|
206
|
+
end
|
207
|
+
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_body
|
211
|
+
to_hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_hash
|
217
|
+
hash = {}
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
219
|
+
value = self.send(attr)
|
220
|
+
if value.nil?
|
221
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
222
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
223
|
+
end
|
224
|
+
|
225
|
+
hash[param] = _to_hash(value)
|
226
|
+
end
|
227
|
+
hash
|
228
|
+
end
|
229
|
+
|
230
|
+
# Outputs non-array value in the form of hash
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
232
|
+
# @param [Object] value Any valid value
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
234
|
+
def _to_hash(value)
|
235
|
+
if value.is_a?(Array)
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
237
|
+
elsif value.is_a?(Hash)
|
238
|
+
{}.tap do |hash|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
240
|
+
end
|
241
|
+
elsif value.respond_to? :to_hash
|
242
|
+
value.to_hash
|
243
|
+
else
|
244
|
+
value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|
@@ -0,0 +1,383 @@
|
|
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 NigeriaNinInput
|
18
|
+
# The user's first name as it appears in their National ID
|
19
|
+
attr_accessor :first_name
|
20
|
+
|
21
|
+
# The user's middle name as it appears in their National ID (optional)
|
22
|
+
attr_accessor :middle_name
|
23
|
+
|
24
|
+
# The user's last name as it appears in their National ID (optional)
|
25
|
+
attr_accessor :last_name
|
26
|
+
|
27
|
+
# The user's phone number (optional)
|
28
|
+
attr_accessor :phone_number
|
29
|
+
|
30
|
+
# The user's date of birth, in `YYYY-MM-DD` format
|
31
|
+
attr_accessor :date_of_birth
|
32
|
+
|
33
|
+
# The user's gender as it appears in their National ID (e.g., male, female)
|
34
|
+
attr_accessor :gender
|
35
|
+
|
36
|
+
# The user's South African National ID number
|
37
|
+
attr_accessor :national_id_number
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'first_name' => :'firstName',
|
43
|
+
:'middle_name' => :'middleName',
|
44
|
+
:'last_name' => :'lastName',
|
45
|
+
:'phone_number' => :'phoneNumber',
|
46
|
+
:'date_of_birth' => :'dateOfBirth',
|
47
|
+
:'gender' => :'gender',
|
48
|
+
:'national_id_number' => :'nationalIdNumber'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.openapi_types
|
59
|
+
{
|
60
|
+
:'first_name' => :'String',
|
61
|
+
:'middle_name' => :'String',
|
62
|
+
:'last_name' => :'String',
|
63
|
+
:'phone_number' => :'String',
|
64
|
+
:'date_of_birth' => :'Date',
|
65
|
+
:'gender' => :'String',
|
66
|
+
:'national_id_number' => :'String'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# List of attributes with nullable: true
|
71
|
+
def self.openapi_nullable
|
72
|
+
Set.new([
|
73
|
+
:'middle_name',
|
74
|
+
:'phone_number',
|
75
|
+
:'gender',
|
76
|
+
])
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
if (!attributes.is_a?(Hash))
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::NigeriaNinInput` initialize method"
|
84
|
+
end
|
85
|
+
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::NigeriaNinInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
93
|
+
|
94
|
+
if attributes.key?(:'first_name')
|
95
|
+
self.first_name = attributes[:'first_name']
|
96
|
+
else
|
97
|
+
self.first_name = nil
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'middle_name')
|
101
|
+
self.middle_name = attributes[:'middle_name']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'last_name')
|
105
|
+
self.last_name = attributes[:'last_name']
|
106
|
+
else
|
107
|
+
self.last_name = nil
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'phone_number')
|
111
|
+
self.phone_number = attributes[:'phone_number']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'date_of_birth')
|
115
|
+
self.date_of_birth = attributes[:'date_of_birth']
|
116
|
+
else
|
117
|
+
self.date_of_birth = nil
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'gender')
|
121
|
+
self.gender = attributes[:'gender']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'national_id_number')
|
125
|
+
self.national_id_number = attributes[:'national_id_number']
|
126
|
+
else
|
127
|
+
self.national_id_number = nil
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
132
|
+
# @return Array for valid properties with the reasons
|
133
|
+
def list_invalid_properties
|
134
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
135
|
+
invalid_properties = Array.new
|
136
|
+
if @first_name.nil?
|
137
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
138
|
+
end
|
139
|
+
|
140
|
+
if @first_name.to_s.length < 1
|
141
|
+
invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 1.')
|
142
|
+
end
|
143
|
+
|
144
|
+
if @last_name.nil?
|
145
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
146
|
+
end
|
147
|
+
|
148
|
+
if @last_name.to_s.length < 1
|
149
|
+
invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 1.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @date_of_birth.nil?
|
153
|
+
invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
|
154
|
+
end
|
155
|
+
|
156
|
+
if @national_id_number.nil?
|
157
|
+
invalid_properties.push('invalid value for "national_id_number", national_id_number cannot be nil.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @national_id_number.to_s.length > 11
|
161
|
+
invalid_properties.push('invalid value for "national_id_number", the character length must be smaller than or equal to 11.')
|
162
|
+
end
|
163
|
+
|
164
|
+
if @national_id_number.to_s.length < 11
|
165
|
+
invalid_properties.push('invalid value for "national_id_number", the character length must be great than or equal to 11.')
|
166
|
+
end
|
167
|
+
|
168
|
+
pattern = Regexp.new(/^\d*$/)
|
169
|
+
if @national_id_number !~ pattern
|
170
|
+
invalid_properties.push("invalid value for \"national_id_number\", must conform to the pattern #{pattern}.")
|
171
|
+
end
|
172
|
+
|
173
|
+
invalid_properties
|
174
|
+
end
|
175
|
+
|
176
|
+
# Check to see if the all the properties in the model are valid
|
177
|
+
# @return true if the model is valid
|
178
|
+
def valid?
|
179
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
180
|
+
return false if @first_name.nil?
|
181
|
+
return false if @first_name.to_s.length < 1
|
182
|
+
return false if @last_name.nil?
|
183
|
+
return false if @last_name.to_s.length < 1
|
184
|
+
return false if @date_of_birth.nil?
|
185
|
+
return false if @national_id_number.nil?
|
186
|
+
return false if @national_id_number.to_s.length > 11
|
187
|
+
return false if @national_id_number.to_s.length < 11
|
188
|
+
return false if @national_id_number !~ Regexp.new(/^\d*$/)
|
189
|
+
true
|
190
|
+
end
|
191
|
+
|
192
|
+
# Custom attribute writer method with validation
|
193
|
+
# @param [Object] first_name Value to be assigned
|
194
|
+
def first_name=(first_name)
|
195
|
+
if first_name.nil?
|
196
|
+
fail ArgumentError, 'first_name cannot be nil'
|
197
|
+
end
|
198
|
+
|
199
|
+
if first_name.to_s.length < 1
|
200
|
+
fail ArgumentError, 'invalid value for "first_name", the character length must be great than or equal to 1.'
|
201
|
+
end
|
202
|
+
|
203
|
+
@first_name = first_name
|
204
|
+
end
|
205
|
+
|
206
|
+
# Custom attribute writer method with validation
|
207
|
+
# @param [Object] last_name Value to be assigned
|
208
|
+
def last_name=(last_name)
|
209
|
+
if last_name.nil?
|
210
|
+
fail ArgumentError, 'last_name cannot be nil'
|
211
|
+
end
|
212
|
+
|
213
|
+
if last_name.to_s.length < 1
|
214
|
+
fail ArgumentError, 'invalid value for "last_name", the character length must be great than or equal to 1.'
|
215
|
+
end
|
216
|
+
|
217
|
+
@last_name = last_name
|
218
|
+
end
|
219
|
+
|
220
|
+
# Custom attribute writer method with validation
|
221
|
+
# @param [Object] national_id_number Value to be assigned
|
222
|
+
def national_id_number=(national_id_number)
|
223
|
+
if national_id_number.nil?
|
224
|
+
fail ArgumentError, 'national_id_number cannot be nil'
|
225
|
+
end
|
226
|
+
|
227
|
+
if national_id_number.to_s.length > 11
|
228
|
+
fail ArgumentError, 'invalid value for "national_id_number", the character length must be smaller than or equal to 11.'
|
229
|
+
end
|
230
|
+
|
231
|
+
if national_id_number.to_s.length < 11
|
232
|
+
fail ArgumentError, 'invalid value for "national_id_number", the character length must be great than or equal to 11.'
|
233
|
+
end
|
234
|
+
|
235
|
+
pattern = Regexp.new(/^\d*$/)
|
236
|
+
if national_id_number !~ pattern
|
237
|
+
fail ArgumentError, "invalid value for \"national_id_number\", must conform to the pattern #{pattern}."
|
238
|
+
end
|
239
|
+
|
240
|
+
@national_id_number = national_id_number
|
241
|
+
end
|
242
|
+
|
243
|
+
# Checks equality by comparing each attribute.
|
244
|
+
# @param [Object] Object to be compared
|
245
|
+
def ==(o)
|
246
|
+
return true if self.equal?(o)
|
247
|
+
self.class == o.class &&
|
248
|
+
first_name == o.first_name &&
|
249
|
+
middle_name == o.middle_name &&
|
250
|
+
last_name == o.last_name &&
|
251
|
+
phone_number == o.phone_number &&
|
252
|
+
date_of_birth == o.date_of_birth &&
|
253
|
+
gender == o.gender &&
|
254
|
+
national_id_number == o.national_id_number
|
255
|
+
end
|
256
|
+
|
257
|
+
# @see the `==` method
|
258
|
+
# @param [Object] Object to be compared
|
259
|
+
def eql?(o)
|
260
|
+
self == o
|
261
|
+
end
|
262
|
+
|
263
|
+
# Calculates hash code according to all attributes.
|
264
|
+
# @return [Integer] Hash code
|
265
|
+
def hash
|
266
|
+
[first_name, middle_name, last_name, phone_number, date_of_birth, gender, national_id_number].hash
|
267
|
+
end
|
268
|
+
|
269
|
+
# Builds the object from hash
|
270
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
271
|
+
# @return [Object] Returns the model itself
|
272
|
+
def self.build_from_hash(attributes)
|
273
|
+
return nil unless attributes.is_a?(Hash)
|
274
|
+
attributes = attributes.transform_keys(&:to_sym)
|
275
|
+
transformed_hash = {}
|
276
|
+
openapi_types.each_pair do |key, type|
|
277
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
278
|
+
transformed_hash["#{key}"] = nil
|
279
|
+
elsif type =~ /\AArray<(.*)>/i
|
280
|
+
# check to ensure the input is an array given that the attribute
|
281
|
+
# is documented as an array but the input is not
|
282
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
283
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
284
|
+
end
|
285
|
+
elsif !attributes[attribute_map[key]].nil?
|
286
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
287
|
+
end
|
288
|
+
end
|
289
|
+
new(transformed_hash)
|
290
|
+
end
|
291
|
+
|
292
|
+
# Deserializes the data based on type
|
293
|
+
# @param string type Data type
|
294
|
+
# @param string value Value to be deserialized
|
295
|
+
# @return [Object] Deserialized data
|
296
|
+
def self._deserialize(type, value)
|
297
|
+
case type.to_sym
|
298
|
+
when :Time
|
299
|
+
Time.parse(value)
|
300
|
+
when :Date
|
301
|
+
Date.parse(value)
|
302
|
+
when :String
|
303
|
+
value.to_s
|
304
|
+
when :Integer
|
305
|
+
value.to_i
|
306
|
+
when :Float
|
307
|
+
value.to_f
|
308
|
+
when :Boolean
|
309
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
310
|
+
true
|
311
|
+
else
|
312
|
+
false
|
313
|
+
end
|
314
|
+
when :Object
|
315
|
+
# generic object (usually a Hash), return directly
|
316
|
+
value
|
317
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
318
|
+
inner_type = Regexp.last_match[:inner_type]
|
319
|
+
value.map { |v| _deserialize(inner_type, v) }
|
320
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
321
|
+
k_type = Regexp.last_match[:k_type]
|
322
|
+
v_type = Regexp.last_match[:v_type]
|
323
|
+
{}.tap do |hash|
|
324
|
+
value.each do |k, v|
|
325
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
326
|
+
end
|
327
|
+
end
|
328
|
+
else # model
|
329
|
+
# models (e.g. Pet) or oneOf
|
330
|
+
klass = TrinsicApi.const_get(type)
|
331
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
# Returns the string representation of the object
|
336
|
+
# @return [String] String presentation of the object
|
337
|
+
def to_s
|
338
|
+
to_hash.to_s
|
339
|
+
end
|
340
|
+
|
341
|
+
# to_body is an alias to to_hash (backward compatibility)
|
342
|
+
# @return [Hash] Returns the object in the form of hash
|
343
|
+
def to_body
|
344
|
+
to_hash
|
345
|
+
end
|
346
|
+
|
347
|
+
# Returns the object in the form of hash
|
348
|
+
# @return [Hash] Returns the object in the form of hash
|
349
|
+
def to_hash
|
350
|
+
hash = {}
|
351
|
+
self.class.attribute_map.each_pair do |attr, param|
|
352
|
+
value = self.send(attr)
|
353
|
+
if value.nil?
|
354
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
355
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
356
|
+
end
|
357
|
+
|
358
|
+
hash[param] = _to_hash(value)
|
359
|
+
end
|
360
|
+
hash
|
361
|
+
end
|
362
|
+
|
363
|
+
# Outputs non-array value in the form of hash
|
364
|
+
# For object, use to_hash. Otherwise, just return the value
|
365
|
+
# @param [Object] value Any valid value
|
366
|
+
# @return [Hash] Returns the value in the form of hash
|
367
|
+
def _to_hash(value)
|
368
|
+
if value.is_a?(Array)
|
369
|
+
value.compact.map { |v| _to_hash(v) }
|
370
|
+
elsif value.is_a?(Hash)
|
371
|
+
{}.tap do |hash|
|
372
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
373
|
+
end
|
374
|
+
elsif value.respond_to? :to_hash
|
375
|
+
value.to_hash
|
376
|
+
else
|
377
|
+
value
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
381
|
+
end
|
382
|
+
|
383
|
+
end
|