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,256 @@
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 CreateHostedProviderSessionResponse
18
+ # The ID of the newly-created Acceptance Session
19
+ attr_accessor :session_id
20
+
21
+ # The URL that should be used to launch the Hosted Provider Session on your user's device. There are two recommended ways to do so: - Redirect their browser to the `LaunchUrl` as a top-level navigation - Open a popup window and navigate it to the `LaunchUrl` This URL is sensitive and as such can only be obtained once. If you need to obtain it again, you will need to create a new Acceptance Session.
22
+ attr_accessor :launch_url
23
+
24
+ # The `resultsAccessKey` for the Acceptance Session. This is an encrypted payload which contains the decryption key necessary to access the Session's Data Vault. Save this securely in your systems; it must be passed back with any API call which requires access to the Session's Data Vault. Trinsic cannot access a Session's Data Vault without this key.
25
+ attr_accessor :results_access_key
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'session_id' => :'sessionId',
31
+ :'launch_url' => :'launchUrl',
32
+ :'results_access_key' => :'resultsAccessKey'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'session_id' => :'String',
45
+ :'launch_url' => :'String',
46
+ :'results_access_key' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::CreateHostedProviderSessionResponse` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::CreateHostedProviderSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'session_id')
72
+ self.session_id = attributes[:'session_id']
73
+ else
74
+ self.session_id = nil
75
+ end
76
+
77
+ if attributes.key?(:'launch_url')
78
+ self.launch_url = attributes[:'launch_url']
79
+ else
80
+ self.launch_url = nil
81
+ end
82
+
83
+ if attributes.key?(:'results_access_key')
84
+ self.results_access_key = attributes[:'results_access_key']
85
+ else
86
+ self.results_access_key = nil
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ if @session_id.nil?
96
+ invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
97
+ end
98
+
99
+ if @launch_url.nil?
100
+ invalid_properties.push('invalid value for "launch_url", launch_url cannot be nil.')
101
+ end
102
+
103
+ if @results_access_key.nil?
104
+ invalid_properties.push('invalid value for "results_access_key", results_access_key cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ return false if @session_id.nil?
115
+ return false if @launch_url.nil?
116
+ return false if @results_access_key.nil?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ session_id == o.session_id &&
126
+ launch_url == o.launch_url &&
127
+ results_access_key == o.results_access_key
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [session_id, launch_url, results_access_key].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ transformed_hash = {}
149
+ openapi_types.each_pair do |key, type|
150
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = nil
152
+ elsif type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[attribute_map[key]].is_a?(Array)
156
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
157
+ end
158
+ elsif !attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
160
+ end
161
+ end
162
+ new(transformed_hash)
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def self._deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ # models (e.g. Pet) or oneOf
203
+ klass = TrinsicApi.const_get(type)
204
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -0,0 +1,240 @@
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 CreateWidgetSessionRequest
18
+ # The URL to redirect the user to after the widget session is complete. *Note*: this should NOT be set if you intend to use Trinsic's Web UI SDK to launch the Widget as an embedded iFrame or popup; in that case, session resolution is handled by our SDK, not via redirect.
19
+ attr_accessor :redirect_url
20
+
21
+ # The list of allowed identity providers. If not specified, all available providers will be allowed.
22
+ attr_accessor :providers
23
+
24
+ # Data that you already know about the user being verified. This data is used to improve the user experience during provider selection, by surfacing the most relevant providers first.
25
+ attr_accessor :recommendation_info
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'redirect_url' => :'redirectUrl',
31
+ :'providers' => :'providers',
32
+ :'recommendation_info' => :'recommendationInfo'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'redirect_url' => :'String',
45
+ :'providers' => :'Array<String>',
46
+ :'recommendation_info' => :'RecommendationInfo'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'redirect_url',
54
+ :'providers',
55
+ :'recommendation_info'
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::CreateWidgetSessionRequest` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::CreateWidgetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'redirect_url')
75
+ self.redirect_url = attributes[:'redirect_url']
76
+ end
77
+
78
+ if attributes.key?(:'providers')
79
+ if (value = attributes[:'providers']).is_a?(Array)
80
+ self.providers = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'recommendation_info')
85
+ self.recommendation_info = attributes[:'recommendation_info']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ redirect_url == o.redirect_url &&
110
+ providers == o.providers &&
111
+ recommendation_info == o.recommendation_info
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [redirect_url, providers, recommendation_info].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def self._deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = TrinsicApi.const_get(type)
188
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end