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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #Connect API
2
+ #Trinsic API
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
@@ -14,46 +14,22 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TrinsicApi
17
- class DisclosedFieldsRequest
18
- attr_accessor :id_number
19
-
20
- attr_accessor :given_name
21
-
22
- attr_accessor :family_name
23
-
24
- attr_accessor :address
17
+ class IndonesiaNikInput
18
+ # The user's full name
19
+ attr_accessor :full_name
25
20
 
21
+ # The user's date of birth, in `YYYY-MM-DD` format
26
22
  attr_accessor :date_of_birth
27
23
 
28
- attr_accessor :country
29
-
30
- attr_accessor :issue_date
31
-
32
- attr_accessor :expiration_date
33
-
34
- attr_accessor :document_front
35
-
36
- attr_accessor :document_back
37
-
38
- attr_accessor :document_portrait
39
-
40
- attr_accessor :selfie
24
+ # The user's Indonesia NIK ID number
25
+ attr_accessor :nik_id_number
41
26
 
42
27
  # Attribute mapping from ruby-style variable name to JSON key.
43
28
  def self.attribute_map
44
29
  {
45
- :'id_number' => :'idNumber',
46
- :'given_name' => :'givenName',
47
- :'family_name' => :'familyName',
48
- :'address' => :'address',
30
+ :'full_name' => :'fullName',
49
31
  :'date_of_birth' => :'dateOfBirth',
50
- :'country' => :'country',
51
- :'issue_date' => :'issueDate',
52
- :'expiration_date' => :'expirationDate',
53
- :'document_front' => :'documentFront',
54
- :'document_back' => :'documentBack',
55
- :'document_portrait' => :'documentPortrait',
56
- :'selfie' => :'selfie'
32
+ :'nik_id_number' => :'nikIdNumber'
57
33
  }
58
34
  end
59
35
 
@@ -65,18 +41,9 @@ module TrinsicApi
65
41
  # Attribute type mapping.
66
42
  def self.openapi_types
67
43
  {
68
- :'id_number' => :'Boolean',
69
- :'given_name' => :'Boolean',
70
- :'family_name' => :'Boolean',
71
- :'address' => :'Boolean',
72
- :'date_of_birth' => :'Boolean',
73
- :'country' => :'Boolean',
74
- :'issue_date' => :'Boolean',
75
- :'expiration_date' => :'Boolean',
76
- :'document_front' => :'Boolean',
77
- :'document_back' => :'Boolean',
78
- :'document_portrait' => :'Boolean',
79
- :'selfie' => :'Boolean'
44
+ :'full_name' => :'String',
45
+ :'date_of_birth' => :'Date',
46
+ :'nik_id_number' => :'String'
80
47
  }
81
48
  end
82
49
 
@@ -90,71 +57,70 @@ module TrinsicApi
90
57
  # @param [Hash] attributes Model attributes in the form of hash
91
58
  def initialize(attributes = {})
92
59
  if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::DisclosedFieldsRequest` initialize method"
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::IndonesiaNikInput` initialize method"
94
61
  end
95
62
 
96
63
  # check to see if the attribute exists and convert string to symbol for hash key
97
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
98
65
  if (!self.class.attribute_map.key?(k.to_sym))
99
- fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::DisclosedFieldsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::IndonesiaNikInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
67
  end
101
68
  h[k.to_sym] = v
102
69
  }
103
70
 
104
- if attributes.key?(:'id_number')
105
- self.id_number = attributes[:'id_number']
106
- end
107
-
108
- if attributes.key?(:'given_name')
109
- self.given_name = attributes[:'given_name']
110
- end
111
-
112
- if attributes.key?(:'family_name')
113
- self.family_name = attributes[:'family_name']
114
- end
115
-
116
- if attributes.key?(:'address')
117
- self.address = attributes[:'address']
71
+ if attributes.key?(:'full_name')
72
+ self.full_name = attributes[:'full_name']
73
+ else
74
+ self.full_name = nil
118
75
  end
119
76
 
120
77
  if attributes.key?(:'date_of_birth')
121
78
  self.date_of_birth = attributes[:'date_of_birth']
79
+ else
80
+ self.date_of_birth = nil
81
+ end
82
+
83
+ if attributes.key?(:'nik_id_number')
84
+ self.nik_id_number = attributes[:'nik_id_number']
85
+ else
86
+ self.nik_id_number = nil
122
87
  end
88
+ end
123
89
 
124
- if attributes.key?(:'country')
125
- self.country = attributes[:'country']
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 @full_name.nil?
96
+ invalid_properties.push('invalid value for "full_name", full_name cannot be nil.')
126
97
  end
127
98
 
128
- if attributes.key?(:'issue_date')
129
- self.issue_date = attributes[:'issue_date']
99
+ if @full_name.to_s.length < 1
100
+ invalid_properties.push('invalid value for "full_name", the character length must be great than or equal to 1.')
130
101
  end
131
102
 
132
- if attributes.key?(:'expiration_date')
133
- self.expiration_date = attributes[:'expiration_date']
103
+ if @date_of_birth.nil?
104
+ invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
134
105
  end
135
106
 
136
- if attributes.key?(:'document_front')
137
- self.document_front = attributes[:'document_front']
107
+ if @nik_id_number.nil?
108
+ invalid_properties.push('invalid value for "nik_id_number", nik_id_number cannot be nil.')
138
109
  end
139
110
 
140
- if attributes.key?(:'document_back')
141
- self.document_back = attributes[:'document_back']
111
+ if @nik_id_number.to_s.length > 16
112
+ invalid_properties.push('invalid value for "nik_id_number", the character length must be smaller than or equal to 16.')
142
113
  end
143
114
 
144
- if attributes.key?(:'document_portrait')
145
- self.document_portrait = attributes[:'document_portrait']
115
+ if @nik_id_number.to_s.length < 16
116
+ invalid_properties.push('invalid value for "nik_id_number", the character length must be great than or equal to 16.')
146
117
  end
147
118
 
148
- if attributes.key?(:'selfie')
149
- self.selfie = attributes[:'selfie']
119
+ pattern = Regexp.new(/^\d*$/)
120
+ if @nik_id_number !~ pattern
121
+ invalid_properties.push("invalid value for \"nik_id_number\", must conform to the pattern #{pattern}.")
150
122
  end
151
- end
152
123
 
153
- # Show invalid properties with the reasons. Usually used together with valid?
154
- # @return Array for valid properties with the reasons
155
- def list_invalid_properties
156
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
157
- invalid_properties = Array.new
158
124
  invalid_properties
159
125
  end
160
126
 
@@ -162,26 +128,61 @@ module TrinsicApi
162
128
  # @return true if the model is valid
163
129
  def valid?
164
130
  warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @full_name.nil?
132
+ return false if @full_name.to_s.length < 1
133
+ return false if @date_of_birth.nil?
134
+ return false if @nik_id_number.nil?
135
+ return false if @nik_id_number.to_s.length > 16
136
+ return false if @nik_id_number.to_s.length < 16
137
+ return false if @nik_id_number !~ Regexp.new(/^\d*$/)
165
138
  true
166
139
  end
167
140
 
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] full_name Value to be assigned
143
+ def full_name=(full_name)
144
+ if full_name.nil?
145
+ fail ArgumentError, 'full_name cannot be nil'
146
+ end
147
+
148
+ if full_name.to_s.length < 1
149
+ fail ArgumentError, 'invalid value for "full_name", the character length must be great than or equal to 1.'
150
+ end
151
+
152
+ @full_name = full_name
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] nik_id_number Value to be assigned
157
+ def nik_id_number=(nik_id_number)
158
+ if nik_id_number.nil?
159
+ fail ArgumentError, 'nik_id_number cannot be nil'
160
+ end
161
+
162
+ if nik_id_number.to_s.length > 16
163
+ fail ArgumentError, 'invalid value for "nik_id_number", the character length must be smaller than or equal to 16.'
164
+ end
165
+
166
+ if nik_id_number.to_s.length < 16
167
+ fail ArgumentError, 'invalid value for "nik_id_number", the character length must be great than or equal to 16.'
168
+ end
169
+
170
+ pattern = Regexp.new(/^\d*$/)
171
+ if nik_id_number !~ pattern
172
+ fail ArgumentError, "invalid value for \"nik_id_number\", must conform to the pattern #{pattern}."
173
+ end
174
+
175
+ @nik_id_number = nik_id_number
176
+ end
177
+
168
178
  # Checks equality by comparing each attribute.
169
179
  # @param [Object] Object to be compared
170
180
  def ==(o)
171
181
  return true if self.equal?(o)
172
182
  self.class == o.class &&
173
- id_number == o.id_number &&
174
- given_name == o.given_name &&
175
- family_name == o.family_name &&
176
- address == o.address &&
183
+ full_name == o.full_name &&
177
184
  date_of_birth == o.date_of_birth &&
178
- country == o.country &&
179
- issue_date == o.issue_date &&
180
- expiration_date == o.expiration_date &&
181
- document_front == o.document_front &&
182
- document_back == o.document_back &&
183
- document_portrait == o.document_portrait &&
184
- selfie == o.selfie
185
+ nik_id_number == o.nik_id_number
185
186
  end
186
187
 
187
188
  # @see the `==` method
@@ -193,7 +194,7 @@ module TrinsicApi
193
194
  # Calculates hash code according to all attributes.
194
195
  # @return [Integer] Hash code
195
196
  def hash
196
- [id_number, given_name, family_name, address, date_of_birth, country, issue_date, expiration_date, document_front, document_back, document_portrait, selfie].hash
197
+ [full_name, date_of_birth, nik_id_number].hash
197
198
  end
198
199
 
199
200
  # Builds the object from hash
@@ -0,0 +1,44 @@
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 IntegrationCapability
18
+ LAUNCH_BROWSER = "LaunchBrowser".freeze
19
+ DEEPLINK_TO_MOBILE = "DeeplinkToMobile".freeze
20
+ SHOW_CONTENT = "ShowContent".freeze
21
+ REFRESH_STEP_CONTENT = "RefreshStepContent".freeze
22
+ CAPTURE_REDIRECT = "CaptureRedirect".freeze
23
+ POLL_RESULT = "PollResult".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [LAUNCH_BROWSER, DEEPLINK_TO_MOBILE, SHOW_CONTENT, REFRESH_STEP_CONTENT, CAPTURE_REDIRECT, POLL_RESULT].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if IntegrationCapability.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #IntegrationCapability"
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,42 @@
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 IntegrationLaunchMethod
18
+ LAUNCH_BROWSER = "LaunchBrowser".freeze
19
+ POLL_RESULT = "PollResult".freeze
20
+ DEEPLINK_TO_MOBILE = "DeeplinkToMobile".freeze
21
+ SHOW_CONTENT = "ShowContent".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [LAUNCH_BROWSER, POLL_RESULT, DEEPLINK_TO_MOBILE, SHOW_CONTENT].freeze
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ return value if IntegrationLaunchMethod.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #IntegrationLaunchMethod"
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,275 @@
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
+ # A step to perform in the process of executing an Advanced Provider Session
18
+ class IntegrationStep
19
+ # The launch method to perform
20
+ attr_accessor :method
21
+
22
+ # Step type-specific content related to the step: a URL for `LaunchBrowser`, a deeplink for `DeeplinkToMobile` or a string to show to the user for `ShowContent`.
23
+ attr_accessor :content
24
+
25
+ # If non-null, contains metadata about how to refresh the value of `content`.
26
+ attr_accessor :refresh
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'method' => :'method',
54
+ :'content' => :'content',
55
+ :'refresh' => :'refresh'
56
+ }
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'method' => :'IntegrationLaunchMethod',
68
+ :'content' => :'String',
69
+ :'refresh' => :'StepRefreshInfo'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'refresh'
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::IntegrationStep` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::IntegrationStep`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'method')
96
+ self.method = attributes[:'method']
97
+ else
98
+ self.method = nil
99
+ end
100
+
101
+ if attributes.key?(:'content')
102
+ self.content = attributes[:'content']
103
+ else
104
+ self.content = nil
105
+ end
106
+
107
+ if attributes.key?(:'refresh')
108
+ self.refresh = attributes[:'refresh']
109
+ else
110
+ self.refresh = nil
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ if @method.nil?
120
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
121
+ end
122
+
123
+ if @content.nil?
124
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ return false if @method.nil?
135
+ return false if @content.nil?
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ method == o.method &&
145
+ content == o.content &&
146
+ refresh == o.refresh
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [method, content, refresh].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def self._deserialize(type, value)
189
+ case type.to_sym
190
+ when :Time
191
+ Time.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ # models (e.g. Pet) or oneOf
222
+ klass = TrinsicApi.const_get(type)
223
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+
275
+ end