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.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AadhaarInput.md +20 -0
  3. data/docs/Address.md +3 -3
  4. data/docs/AttachmentAccessKeys.md +7 -5
  5. data/docs/BangladeshNationalIdInput.md +24 -0
  6. data/docs/BrazilCpfCheckInput.md +18 -0
  7. data/docs/BrazilDigitalCnhInput.md +24 -0
  8. data/docs/CreateAdvancedProviderSessionRequest.md +26 -0
  9. data/docs/CreateAdvancedProviderSessionResponse.md +22 -0
  10. data/docs/CreateHostedProviderSessionRequest.md +22 -0
  11. data/docs/CreateHostedProviderSessionResponse.md +20 -0
  12. data/docs/CreateWidgetSessionRequest.md +22 -0
  13. data/docs/{CreateSessionResponse.md → CreateWidgetSessionResponse.md} +5 -5
  14. data/docs/DocumentData.md +3 -3
  15. data/docs/DocumentScanAttachments.md +18 -0
  16. data/docs/{SessionState.md → DocumentType.md} +2 -2
  17. data/docs/HttpValidationProblemDetails.md +28 -0
  18. data/docs/IdentityData.md +4 -4
  19. data/docs/IndonesiaNikInput.md +22 -0
  20. data/docs/{FailureMessage.md → IntegrationCapability.md} +2 -5
  21. data/docs/IntegrationLaunchMethod.md +15 -0
  22. data/docs/IntegrationStep.md +22 -0
  23. data/docs/KenyaNidInput.md +28 -0
  24. data/docs/KnownAddress.md +3 -1
  25. data/docs/KnownPersonData.md +4 -0
  26. data/docs/MexicoCurpInput.md +18 -0
  27. data/docs/NetworkApi.md +2 -72
  28. data/docs/NigeriaNinInput.md +30 -0
  29. data/docs/PersonData.md +14 -12
  30. data/docs/PhilippineMatchInput.md +26 -0
  31. data/docs/PhilippineQRInput.md +20 -0
  32. data/docs/ProblemDetails.md +26 -0
  33. data/docs/ProviderAttachments.md +18 -0
  34. data/docs/ProviderInfo.md +3 -1
  35. data/docs/ProviderInput.md +38 -0
  36. data/docs/RecommendRequest.md +7 -3
  37. data/docs/RefreshStepContentRequest.md +18 -0
  38. data/docs/RefreshStepContentResponse.md +18 -0
  39. data/docs/ResultCollection.md +20 -0
  40. data/docs/ResultCollectionMethod.md +15 -0
  41. data/docs/Session.md +6 -8
  42. data/docs/{VerificationFailCode.md → SessionErrorCode.md} +2 -2
  43. data/docs/SessionsApi.md +236 -18
  44. data/docs/{SessionFailCode.md → Sex.md} +2 -2
  45. data/docs/SouthAfricaNidInput.md +24 -0
  46. data/docs/StepRefreshInfo.md +22 -0
  47. data/lib/trinsic_api/api/attachments_api.rb +1 -1
  48. data/lib/trinsic_api/api/network_api.rb +3 -66
  49. data/lib/trinsic_api/api/sessions_api.rb +217 -19
  50. data/lib/trinsic_api/api_client.rb +1 -1
  51. data/lib/trinsic_api/api_error.rb +1 -1
  52. data/lib/trinsic_api/configuration.rb +1 -1
  53. data/lib/trinsic_api/models/{validation_result.rb → aadhaar_input.rb} +21 -26
  54. data/lib/trinsic_api/models/address.rb +16 -10
  55. data/lib/trinsic_api/models/attachment_access_keys.rb +25 -10
  56. data/lib/trinsic_api/models/bangladesh_national_id_input.rb +249 -0
  57. data/lib/trinsic_api/models/brazil_cpf_check_input.rb +261 -0
  58. data/lib/trinsic_api/models/brazil_digital_cnh_input.rb +294 -0
  59. data/lib/trinsic_api/models/cancel_session_response.rb +1 -1
  60. data/lib/trinsic_api/models/create_advanced_provider_session_request.rb +312 -0
  61. data/lib/trinsic_api/models/create_advanced_provider_session_response.rb +256 -0
  62. data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +288 -0
  63. data/lib/trinsic_api/models/create_hosted_provider_session_response.rb +233 -0
  64. data/lib/trinsic_api/models/create_widget_session_request.rb +240 -0
  65. data/lib/trinsic_api/models/{create_session_response.rb → create_widget_session_response.rb} +18 -17
  66. data/lib/trinsic_api/models/document_data.rb +32 -4
  67. data/lib/trinsic_api/models/{failure_message.rb → document_scan_attachments.rb} +12 -18
  68. data/lib/trinsic_api/models/{session_state.rb → document_type.rb} +9 -11
  69. data/lib/trinsic_api/models/get_attachment_request.rb +1 -1
  70. data/lib/trinsic_api/models/get_attachment_response.rb +1 -1
  71. data/lib/trinsic_api/models/get_session_response.rb +1 -1
  72. data/lib/trinsic_api/models/get_session_result_request.rb +1 -1
  73. data/lib/trinsic_api/models/get_session_result_response.rb +2 -1
  74. data/lib/trinsic_api/models/http_validation_problem_details.rb +273 -0
  75. data/lib/trinsic_api/models/identity_data.rb +5 -5
  76. data/lib/trinsic_api/models/{disclosed_fields_request.rb → indonesia_nik_input.rb} +94 -93
  77. data/lib/trinsic_api/models/integration_capability.rb +44 -0
  78. data/lib/trinsic_api/models/integration_launch_method.rb +42 -0
  79. data/lib/trinsic_api/models/integration_step.rb +275 -0
  80. data/lib/trinsic_api/models/kenya_nid_input.rb +397 -0
  81. data/lib/trinsic_api/models/known_address.rb +20 -2
  82. data/lib/trinsic_api/models/known_identity_data.rb +2 -1
  83. data/lib/trinsic_api/models/known_person_data.rb +30 -2
  84. data/lib/trinsic_api/models/list_providers_response.rb +1 -1
  85. data/lib/trinsic_api/models/list_sessions_response.rb +1 -1
  86. data/lib/trinsic_api/models/mexico_curp_input.rb +250 -0
  87. data/lib/trinsic_api/models/nigeria_nin_input.rb +383 -0
  88. data/lib/trinsic_api/models/order_direction.rb +1 -1
  89. data/lib/trinsic_api/models/person_data.rb +50 -15
  90. data/lib/trinsic_api/models/philippine_match_input.rb +260 -0
  91. data/lib/trinsic_api/models/philippine_qr_input.rb +227 -0
  92. data/lib/trinsic_api/models/problem_details.rb +255 -0
  93. data/lib/trinsic_api/models/provider_attachments.rb +215 -0
  94. data/lib/trinsic_api/models/provider_info.rb +18 -5
  95. data/lib/trinsic_api/models/provider_information.rb +1 -1
  96. data/lib/trinsic_api/models/{create_session_request.rb → provider_input.rb} +111 -42
  97. data/lib/trinsic_api/models/recommend_request.rb +38 -18
  98. data/lib/trinsic_api/models/recommend_response.rb +1 -1
  99. data/lib/trinsic_api/models/refresh_step_content_request.rb +216 -0
  100. data/lib/trinsic_api/models/{identity_lookup_response.rb → refresh_step_content_response.rb} +16 -16
  101. data/lib/trinsic_api/models/{verification.rb → result_collection.rb} +27 -20
  102. data/lib/trinsic_api/models/result_collection_method.rb +40 -0
  103. data/lib/trinsic_api/models/session.rb +32 -48
  104. data/lib/trinsic_api/models/session_error_code.rb +48 -0
  105. data/lib/trinsic_api/models/session_ordering.rb +1 -1
  106. data/lib/trinsic_api/models/sex.rb +42 -0
  107. data/lib/trinsic_api/models/{disclosed_fields.rb → south_africa_nid_input.rb} +107 -154
  108. data/lib/trinsic_api/models/step_refresh_info.rb +256 -0
  109. data/lib/trinsic_api/version.rb +2 -2
  110. data/lib/trinsic_api.rb +34 -12
  111. data/spec/api/attachments_api_spec.rb +1 -1
  112. data/spec/api/network_api_spec.rb +2 -14
  113. data/spec/api/sessions_api_spec.rb +44 -7
  114. data/spec/models/{verification_spec.rb → aadhaar_input_spec.rb} +9 -9
  115. data/spec/models/address_spec.rb +2 -2
  116. data/spec/models/attachment_access_keys_spec.rb +7 -1
  117. data/spec/models/bangladesh_national_id_input_spec.rb +54 -0
  118. data/spec/models/{identity_lookup_response_spec.rb → brazil_cpf_check_input_spec.rb} +8 -8
  119. data/spec/models/brazil_digital_cnh_input_spec.rb +54 -0
  120. data/spec/models/cancel_session_response_spec.rb +1 -1
  121. data/spec/models/create_advanced_provider_session_request_spec.rb +60 -0
  122. data/spec/models/create_advanced_provider_session_response_spec.rb +48 -0
  123. data/spec/models/create_hosted_provider_session_request_spec.rb +48 -0
  124. data/spec/models/create_hosted_provider_session_response_spec.rb +42 -0
  125. data/spec/models/create_widget_session_request_spec.rb +48 -0
  126. data/spec/models/{create_session_response_spec.rb → create_widget_session_response_spec.rb} +8 -8
  127. data/spec/models/document_data_spec.rb +1 -1
  128. data/spec/models/document_scan_attachments_spec.rb +36 -0
  129. data/spec/models/{session_state_spec.rb → document_type_spec.rb} +7 -7
  130. data/spec/models/get_attachment_request_spec.rb +1 -1
  131. data/spec/models/get_attachment_response_spec.rb +1 -1
  132. data/spec/models/get_session_response_spec.rb +1 -1
  133. data/spec/models/get_session_result_request_spec.rb +1 -1
  134. data/spec/models/get_session_result_response_spec.rb +1 -1
  135. data/spec/models/http_validation_problem_details_spec.rb +66 -0
  136. data/spec/models/identity_data_spec.rb +1 -1
  137. data/spec/models/indonesia_nik_input_spec.rb +48 -0
  138. data/spec/models/integration_capability_spec.rb +30 -0
  139. data/spec/models/integration_launch_method_spec.rb +30 -0
  140. data/spec/models/integration_step_spec.rb +48 -0
  141. data/spec/models/kenya_nid_input_spec.rb +66 -0
  142. data/spec/models/known_address_spec.rb +7 -1
  143. data/spec/models/known_identity_data_spec.rb +1 -1
  144. data/spec/models/known_person_data_spec.rb +13 -1
  145. data/spec/models/list_providers_response_spec.rb +1 -1
  146. data/spec/models/list_sessions_response_spec.rb +1 -1
  147. data/spec/models/{failure_message_spec.rb → mexico_curp_input_spec.rb} +8 -8
  148. data/spec/models/nigeria_nin_input_spec.rb +72 -0
  149. data/spec/models/order_direction_spec.rb +1 -1
  150. data/spec/models/person_data_spec.rb +8 -2
  151. data/spec/models/{create_session_request_spec.rb → philippine_match_input_spec.rb} +12 -12
  152. data/spec/models/philippine_qr_input_spec.rb +42 -0
  153. data/spec/models/problem_details_spec.rb +60 -0
  154. data/spec/models/provider_attachments_spec.rb +36 -0
  155. data/spec/models/provider_info_spec.rb +7 -1
  156. data/spec/models/provider_information_spec.rb +1 -1
  157. data/spec/models/{disclosed_fields_spec.rb → provider_input_spec.rb} +18 -24
  158. data/spec/models/recommend_request_spec.rb +14 -2
  159. data/spec/models/recommend_response_spec.rb +1 -1
  160. data/spec/models/refresh_step_content_request_spec.rb +36 -0
  161. data/spec/models/refresh_step_content_response_spec.rb +36 -0
  162. data/spec/models/result_collection_method_spec.rb +30 -0
  163. data/spec/models/{validation_result_spec.rb → result_collection_spec.rb} +9 -9
  164. data/spec/models/{verification_fail_code_spec.rb → session_error_code_spec.rb} +7 -7
  165. data/spec/models/session_ordering_spec.rb +1 -1
  166. data/spec/models/session_spec.rb +4 -10
  167. data/spec/models/{session_fail_code_spec.rb → sex_spec.rb} +7 -7
  168. data/spec/models/south_africa_nid_input_spec.rb +54 -0
  169. data/spec/models/step_refresh_info_spec.rb +48 -0
  170. data/spec/spec_helper.rb +1 -1
  171. data/trinsic_api.gemspec +1 -1
  172. metadata +154 -66
  173. data/docs/CreateSessionRequest.md +0 -26
  174. data/docs/DisclosedFields.md +0 -40
  175. data/docs/DisclosedFieldsRequest.md +0 -40
  176. data/docs/IdentityLookupResponse.md +0 -18
  177. data/docs/ValidationResult.md +0 -20
  178. data/docs/Verification.md +0 -20
  179. data/lib/trinsic_api/models/session_fail_code.rb +0 -45
  180. data/lib/trinsic_api/models/verification_fail_code.rb +0 -44
  181. data/spec/models/disclosed_fields_request_spec.rb +0 -102
@@ -0,0 +1,294 @@
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 BrazilDigitalCnhInput
18
+ # The user's 11-digit, numeric CPF Number
19
+ attr_accessor :cpf_number
20
+
21
+ # The raw bytes of the digital CNH file collected from the user. TODO: Lucas or JP help me describe these below vvvvvvvv This can be: - An image containing a physical or digital QR code - A PDF file exported from the CNH app - Some scary third thing?
22
+ attr_accessor :digital_cnh_file
23
+
24
+ # The MIME Type of the file contained in `DigitalCnhFile`. Must be one of `application/pdf`, `image/jpeg`, or `image/png`.
25
+ attr_accessor :digital_cnh_file_content_type
26
+
27
+ # The raw bytes of the image of the user's face, collected for biometric comparison.
28
+ attr_accessor :facial_biometry_photo
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'cpf_number' => :'cpfNumber',
34
+ :'digital_cnh_file' => :'digitalCnhFile',
35
+ :'digital_cnh_file_content_type' => :'digitalCnhFileContentType',
36
+ :'facial_biometry_photo' => :'facialBiometryPhoto'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'cpf_number' => :'String',
49
+ :'digital_cnh_file' => :'String',
50
+ :'digital_cnh_file_content_type' => :'String',
51
+ :'facial_biometry_photo' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'digital_cnh_file',
59
+ :'digital_cnh_file_content_type',
60
+ :'facial_biometry_photo'
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::BrazilDigitalCnhInput` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::BrazilDigitalCnhInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'cpf_number')
80
+ self.cpf_number = attributes[:'cpf_number']
81
+ else
82
+ self.cpf_number = nil
83
+ end
84
+
85
+ if attributes.key?(:'digital_cnh_file')
86
+ self.digital_cnh_file = attributes[:'digital_cnh_file']
87
+ end
88
+
89
+ if attributes.key?(:'digital_cnh_file_content_type')
90
+ self.digital_cnh_file_content_type = attributes[:'digital_cnh_file_content_type']
91
+ end
92
+
93
+ if attributes.key?(:'facial_biometry_photo')
94
+ self.facial_biometry_photo = attributes[:'facial_biometry_photo']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ if @cpf_number.nil?
104
+ invalid_properties.push('invalid value for "cpf_number", cpf_number cannot be nil.')
105
+ end
106
+
107
+ if @cpf_number.to_s.length > 11
108
+ invalid_properties.push('invalid value for "cpf_number", the character length must be smaller than or equal to 11.')
109
+ end
110
+
111
+ if @cpf_number.to_s.length < 11
112
+ invalid_properties.push('invalid value for "cpf_number", the character length must be great than or equal to 11.')
113
+ end
114
+
115
+ pattern = Regexp.new(/^\d*$/)
116
+ if @cpf_number !~ pattern
117
+ invalid_properties.push("invalid value for \"cpf_number\", must conform to the pattern #{pattern}.")
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @cpf_number.nil?
128
+ return false if @cpf_number.to_s.length > 11
129
+ return false if @cpf_number.to_s.length < 11
130
+ return false if @cpf_number !~ Regexp.new(/^\d*$/)
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] cpf_number Value to be assigned
136
+ def cpf_number=(cpf_number)
137
+ if cpf_number.nil?
138
+ fail ArgumentError, 'cpf_number cannot be nil'
139
+ end
140
+
141
+ if cpf_number.to_s.length > 11
142
+ fail ArgumentError, 'invalid value for "cpf_number", the character length must be smaller than or equal to 11.'
143
+ end
144
+
145
+ if cpf_number.to_s.length < 11
146
+ fail ArgumentError, 'invalid value for "cpf_number", the character length must be great than or equal to 11.'
147
+ end
148
+
149
+ pattern = Regexp.new(/^\d*$/)
150
+ if cpf_number !~ pattern
151
+ fail ArgumentError, "invalid value for \"cpf_number\", must conform to the pattern #{pattern}."
152
+ end
153
+
154
+ @cpf_number = cpf_number
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ cpf_number == o.cpf_number &&
163
+ digital_cnh_file == o.digital_cnh_file &&
164
+ digital_cnh_file_content_type == o.digital_cnh_file_content_type &&
165
+ facial_biometry_photo == o.facial_biometry_photo
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [cpf_number, digital_cnh_file, digital_cnh_file_content_type, facial_biometry_photo].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def self._deserialize(type, value)
208
+ case type.to_sym
209
+ when :Time
210
+ Time.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :Boolean
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ # models (e.g. Pet) or oneOf
241
+ klass = TrinsicApi.const_get(type)
242
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+
294
+ 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
 
@@ -0,0 +1,312 @@
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 CreateAdvancedProviderSessionRequest
18
+ # The ID of the provider to launch
19
+ attr_accessor :provider
20
+
21
+ # Provider-specific input for those providers which require it.
22
+ attr_accessor :provider_input
23
+
24
+ # The Redirect URL to which the user should be sent after the session is complete. This field is required for providers which employ a redirect-based flow.
25
+ attr_accessor :redirect_url
26
+
27
+ # The list of capabilities your integration supports. Capabilities are the core of Trinsic's whitelabel-with-optional-fallback offering. Most capabilities align with either an `IntegrationLaunchMethod` or an `IntegrationCollectionMethod`. The exception being refresh content to support updating the content of the launch method. For example, to support a basic redirect-based flow, you must include the `LaunchRedirect` and `CaptureRedirect` capabilities. To support a mobile deeplink / polling flow, you must include the `DeeplinkToMobile` and `PollForResults` capabilities. If `FallbackToHostedUi` is `true`, Trinsic will automatically fall back to a Trinsic-hosted UI to cover any gaps in your integration's capabilities. If `FallbackToHostedUi` is `false`, gaps in your integration's capabilities will result in an error during Session creation. Read more on how to integrate at <a href=\"https://docs.trinsic.id/docs/advanced-provider-sessions\">the guide on Advanced Provider Sessions</a>
28
+ attr_accessor :capabilities
29
+
30
+ # Whether the session should fall back to a Trinsic-hosted UI in certain instances. Specifically, fallback will occur if any of the following are true: - You attempted to launch a provider which requires a capability you did not express support for - In this case, Trinsic's hosted UI will perform the necessary capability - You attempted to launch a provider which requires input, and the input was either not provided or incomplete - In this case, Trinsic's hosted UI will collect the necessary input from the user If fallback occurs, the session's NextStep will always be LaunchBrowser, and the CollectionMethod will always be CaptureRedirect. If this field is set to `true`, you must also: 1. Set the `RedirectUrl` field to a non-empty value 2. Include the `LaunchBrowser` and `CaptureRedirect` capabilities in the `Capabilities` field
31
+ attr_accessor :fallback_to_hosted_ui
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'provider' => :'provider',
37
+ :'provider_input' => :'providerInput',
38
+ :'redirect_url' => :'redirectUrl',
39
+ :'capabilities' => :'capabilities',
40
+ :'fallback_to_hosted_ui' => :'fallbackToHostedUI'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'provider' => :'String',
53
+ :'provider_input' => :'ProviderInput',
54
+ :'redirect_url' => :'String',
55
+ :'capabilities' => :'Array<IntegrationCapability>',
56
+ :'fallback_to_hosted_ui' => :'Boolean'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'provider_input',
64
+ :'redirect_url',
65
+ :'fallback_to_hosted_ui'
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::CreateAdvancedProviderSessionRequest` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!self.class.attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::CreateAdvancedProviderSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'provider')
85
+ self.provider = attributes[:'provider']
86
+ else
87
+ self.provider = nil
88
+ end
89
+
90
+ if attributes.key?(:'provider_input')
91
+ self.provider_input = attributes[:'provider_input']
92
+ end
93
+
94
+ if attributes.key?(:'redirect_url')
95
+ self.redirect_url = attributes[:'redirect_url']
96
+ end
97
+
98
+ if attributes.key?(:'capabilities')
99
+ if (value = attributes[:'capabilities']).is_a?(Array)
100
+ self.capabilities = value
101
+ end
102
+ else
103
+ self.capabilities = nil
104
+ end
105
+
106
+ if attributes.key?(:'fallback_to_hosted_ui')
107
+ self.fallback_to_hosted_ui = attributes[:'fallback_to_hosted_ui']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if @provider.nil?
117
+ invalid_properties.push('invalid value for "provider", provider cannot be nil.')
118
+ end
119
+
120
+ if @provider.to_s.length < 1
121
+ invalid_properties.push('invalid value for "provider", the character length must be great than or equal to 1.')
122
+ end
123
+
124
+ if @capabilities.nil?
125
+ invalid_properties.push('invalid value for "capabilities", capabilities cannot be nil.')
126
+ end
127
+
128
+ if @capabilities.length < 1
129
+ invalid_properties.push('invalid value for "capabilities", number of items must be greater than or equal to 1.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ return false if @provider.nil?
140
+ return false if @provider.to_s.length < 1
141
+ return false if @capabilities.nil?
142
+ return false if @capabilities.length < 1
143
+ true
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] provider Value to be assigned
148
+ def provider=(provider)
149
+ if provider.nil?
150
+ fail ArgumentError, 'provider cannot be nil'
151
+ end
152
+
153
+ if provider.to_s.length < 1
154
+ fail ArgumentError, 'invalid value for "provider", the character length must be great than or equal to 1.'
155
+ end
156
+
157
+ @provider = provider
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] capabilities Value to be assigned
162
+ def capabilities=(capabilities)
163
+ if capabilities.nil?
164
+ fail ArgumentError, 'capabilities cannot be nil'
165
+ end
166
+
167
+ if capabilities.length < 1
168
+ fail ArgumentError, 'invalid value for "capabilities", number of items must be greater than or equal to 1.'
169
+ end
170
+
171
+ @capabilities = capabilities
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ provider == o.provider &&
180
+ provider_input == o.provider_input &&
181
+ redirect_url == o.redirect_url &&
182
+ capabilities == o.capabilities &&
183
+ fallback_to_hosted_ui == o.fallback_to_hosted_ui
184
+ end
185
+
186
+ # @see the `==` method
187
+ # @param [Object] Object to be compared
188
+ def eql?(o)
189
+ self == o
190
+ end
191
+
192
+ # Calculates hash code according to all attributes.
193
+ # @return [Integer] Hash code
194
+ def hash
195
+ [provider, provider_input, redirect_url, capabilities, fallback_to_hosted_ui].hash
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def self.build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ attributes = attributes.transform_keys(&:to_sym)
204
+ transformed_hash = {}
205
+ openapi_types.each_pair do |key, type|
206
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = nil
208
+ elsif type =~ /\AArray<(.*)>/i
209
+ # check to ensure the input is an array given that the attribute
210
+ # is documented as an array but the input is not
211
+ if attributes[attribute_map[key]].is_a?(Array)
212
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
213
+ end
214
+ elsif !attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
216
+ end
217
+ end
218
+ new(transformed_hash)
219
+ end
220
+
221
+ # Deserializes the data based on type
222
+ # @param string type Data type
223
+ # @param string value Value to be deserialized
224
+ # @return [Object] Deserialized data
225
+ def self._deserialize(type, value)
226
+ case type.to_sym
227
+ when :Time
228
+ Time.parse(value)
229
+ when :Date
230
+ Date.parse(value)
231
+ when :String
232
+ value.to_s
233
+ when :Integer
234
+ value.to_i
235
+ when :Float
236
+ value.to_f
237
+ when :Boolean
238
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
239
+ true
240
+ else
241
+ false
242
+ end
243
+ when :Object
244
+ # generic object (usually a Hash), return directly
245
+ value
246
+ when /\AArray<(?<inner_type>.+)>\z/
247
+ inner_type = Regexp.last_match[:inner_type]
248
+ value.map { |v| _deserialize(inner_type, v) }
249
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
250
+ k_type = Regexp.last_match[:k_type]
251
+ v_type = Regexp.last_match[:v_type]
252
+ {}.tap do |hash|
253
+ value.each do |k, v|
254
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
255
+ end
256
+ end
257
+ else # model
258
+ # models (e.g. Pet) or oneOf
259
+ klass = TrinsicApi.const_get(type)
260
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
261
+ end
262
+ end
263
+
264
+ # Returns the string representation of the object
265
+ # @return [String] String presentation of the object
266
+ def to_s
267
+ to_hash.to_s
268
+ end
269
+
270
+ # to_body is an alias to to_hash (backward compatibility)
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_body
273
+ to_hash
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ # Outputs non-array value in the form of hash
293
+ # For object, use to_hash. Otherwise, just return the value
294
+ # @param [Object] value Any valid value
295
+ # @return [Hash] Returns the value in the form of hash
296
+ def _to_hash(value)
297
+ if value.is_a?(Array)
298
+ value.compact.map { |v| _to_hash(v) }
299
+ elsif value.is_a?(Hash)
300
+ {}.tap do |hash|
301
+ value.each { |k, v| hash[k] = _to_hash(v) }
302
+ end
303
+ elsif value.respond_to? :to_hash
304
+ value.to_hash
305
+ else
306
+ value
307
+ end
308
+ end
309
+
310
+ end
311
+
312
+ end