trinsic_api 2.3.0.pre.alpha1 → 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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AttachmentAccessKeys.md +2 -0
  3. data/docs/CreateHostedProviderSessionResponse.md +1 -1
  4. data/docs/CreateWidgetSessionResponse.md +1 -1
  5. data/docs/IntegrationStep.md +1 -1
  6. data/docs/KenyaNidBiometric2Input.md +22 -0
  7. data/docs/KenyaNidInput.md +1 -1
  8. data/docs/KenyaNidLookup2Input.md +18 -0
  9. data/docs/KenyaNidMatch2Input.md +28 -0
  10. data/docs/NigeriaNinInput.md +1 -1
  11. data/docs/PhilippinesDigitalNidProviderOutput.md +18 -0
  12. data/docs/PhilippinesPhysicalNidProviderOutput.md +18 -0
  13. data/docs/ProviderInput.md +8 -0
  14. data/docs/ProviderOutput.md +5 -1
  15. data/docs/SexV1.md +15 -0
  16. data/docs/SouthAfricaNidInput.md +1 -1
  17. data/docs/SouthAfricaNidLookup2Input.md +18 -0
  18. data/docs/SpidProviderOutput.md +22 -4
  19. data/lib/trinsic_api/models/attachment_access_keys.rb +11 -1
  20. data/lib/trinsic_api/models/kenya_nid_biometric2_input.rb +246 -0
  21. data/lib/trinsic_api/models/kenya_nid_input.rb +1 -1
  22. data/lib/trinsic_api/models/kenya_nid_lookup2_input.rb +222 -0
  23. data/lib/trinsic_api/models/kenya_nid_match2_input.rb +299 -0
  24. data/lib/trinsic_api/models/nigeria_nin_input.rb +1 -1
  25. data/lib/trinsic_api/models/philippines_digital_nid_provider_output.rb +238 -0
  26. data/lib/trinsic_api/models/philippines_physical_nid_provider_output.rb +238 -0
  27. data/lib/trinsic_api/models/provider_input.rb +45 -1
  28. data/lib/trinsic_api/models/provider_output.rb +25 -5
  29. data/lib/trinsic_api/models/sex_v1.rb +42 -0
  30. data/lib/trinsic_api/models/south_africa_nid_input.rb +1 -1
  31. data/lib/trinsic_api/models/south_africa_nid_lookup2_input.rb +222 -0
  32. data/lib/trinsic_api/models/spid_provider_output.rb +149 -18
  33. data/lib/trinsic_api/version.rb +1 -1
  34. data/lib/trinsic_api.rb +7 -0
  35. data/spec/models/attachment_access_keys_spec.rb +6 -0
  36. data/spec/models/kenya_nid_biometric2_input_spec.rb +48 -0
  37. data/spec/models/kenya_nid_lookup2_input_spec.rb +36 -0
  38. data/spec/models/kenya_nid_match2_input_spec.rb +66 -0
  39. data/spec/models/philippines_digital_nid_provider_output_spec.rb +36 -0
  40. data/spec/models/philippines_physical_nid_provider_output_spec.rb +36 -0
  41. data/spec/models/provider_input_spec.rb +24 -0
  42. data/spec/models/provider_output_spec.rb +12 -0
  43. data/spec/models/sex_v1_spec.rb +30 -0
  44. data/spec/models/south_africa_nid_lookup2_input_spec.rb +36 -0
  45. data/spec/models/spid_provider_output_spec.rb +56 -2
  46. metadata +30 -2
@@ -0,0 +1,222 @@
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 KenyaNidLookup2Input
18
+ # The user's National ID number
19
+ attr_accessor :id_number
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id_number' => :'idNumber'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id_number' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'id_number'
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::KenyaNidLookup2Input` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::KenyaNidLookup2Input`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'id_number')
69
+ self.id_number = attributes[:'id_number']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ id_number == o.id_number
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [id_number].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def self._deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = TrinsicApi.const_get(type)
170
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,299 @@
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 KenyaNidMatch2Input
18
+ # The user's Kenyan National ID number
19
+ attr_accessor :id_number
20
+
21
+ # The user's first name as it appears in their National ID
22
+ attr_accessor :given_name
23
+
24
+ # The user's last name as it appears in their National ID
25
+ attr_accessor :family_name
26
+
27
+ # The user's middle name as it appears in their National ID (optional)
28
+ attr_accessor :middle_name
29
+
30
+ # The user's date of birth, in `YYYY-MM-DD` format
31
+ attr_accessor :date_of_birth
32
+
33
+ # The user's sex as it appears in their National ID
34
+ attr_accessor :sex
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'id_number' => :'idNumber',
62
+ :'given_name' => :'givenName',
63
+ :'family_name' => :'familyName',
64
+ :'middle_name' => :'middleName',
65
+ :'date_of_birth' => :'dateOfBirth',
66
+ :'sex' => :'sex'
67
+ }
68
+ end
69
+
70
+ # Returns attribute mapping this model knows about
71
+ def self.acceptable_attribute_map
72
+ attribute_map
73
+ end
74
+
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ acceptable_attribute_map.values
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.openapi_types
82
+ {
83
+ :'id_number' => :'String',
84
+ :'given_name' => :'String',
85
+ :'family_name' => :'String',
86
+ :'middle_name' => :'String',
87
+ :'date_of_birth' => :'Date',
88
+ :'sex' => :'SexV1'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ :'id_number',
96
+ :'given_name',
97
+ :'family_name',
98
+ :'middle_name',
99
+ :'date_of_birth',
100
+ :'sex'
101
+ ])
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ if (!attributes.is_a?(Hash))
108
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::KenyaNidMatch2Input` initialize method"
109
+ end
110
+
111
+ # check to see if the attribute exists and convert string to symbol for hash key
112
+ acceptable_attribute_map = self.class.acceptable_attribute_map
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!acceptable_attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::KenyaNidMatch2Input`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'id_number')
121
+ self.id_number = attributes[:'id_number']
122
+ end
123
+
124
+ if attributes.key?(:'given_name')
125
+ self.given_name = attributes[:'given_name']
126
+ end
127
+
128
+ if attributes.key?(:'family_name')
129
+ self.family_name = attributes[:'family_name']
130
+ end
131
+
132
+ if attributes.key?(:'middle_name')
133
+ self.middle_name = attributes[:'middle_name']
134
+ end
135
+
136
+ if attributes.key?(:'date_of_birth')
137
+ self.date_of_birth = attributes[:'date_of_birth']
138
+ end
139
+
140
+ if attributes.key?(:'sex')
141
+ self.sex = attributes[:'sex']
142
+ end
143
+ end
144
+
145
+ # Show invalid properties with the reasons. Usually used together with valid?
146
+ # @return Array for valid properties with the reasons
147
+ def list_invalid_properties
148
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
149
+ invalid_properties = Array.new
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ true
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ id_number == o.id_number &&
166
+ given_name == o.given_name &&
167
+ family_name == o.family_name &&
168
+ middle_name == o.middle_name &&
169
+ date_of_birth == o.date_of_birth &&
170
+ sex == o.sex
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [id_number, given_name, family_name, middle_name, date_of_birth, sex].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash)
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def self._deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf
246
+ klass = TrinsicApi.const_get(type)
247
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+
299
+ end
@@ -33,7 +33,7 @@ module TrinsicApi
33
33
  # The user's gender as it appears in their National ID (e.g., male, female)
34
34
  attr_accessor :gender
35
35
 
36
- # The user's South African National ID number
36
+ # The user's National ID number
37
37
  attr_accessor :national_id_number
38
38
 
39
39
  # Attribute mapping from ruby-style variable name to JSON key.