onfido 4.6.0 → 5.1.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 (309) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/MIGRATION.md +29 -0
  4. data/README.md +3 -3
  5. data/lib/onfido/api/default_api.rb +130 -5
  6. data/lib/onfido/api_client.rb +3 -2
  7. data/lib/onfido/api_error.rb +1 -1
  8. data/lib/onfido/configuration.rb +1 -1
  9. data/lib/onfido/models/address.rb +1 -1
  10. data/lib/onfido/models/address_builder.rb +1 -1
  11. data/lib/onfido/models/address_shared.rb +1 -1
  12. data/lib/onfido/models/addresses_list.rb +1 -1
  13. data/lib/onfido/models/applicant.rb +1 -1
  14. data/lib/onfido/models/applicant_builder.rb +1 -1
  15. data/lib/onfido/models/applicant_consent.rb +272 -0
  16. data/lib/onfido/models/applicant_consent_builder.rb +1 -1
  17. data/lib/onfido/models/applicant_consent_name.rb +1 -1
  18. data/lib/onfido/models/applicant_create.rb +1 -1
  19. data/lib/onfido/models/applicant_request.rb +1 -1
  20. data/lib/onfido/models/applicant_response.rb +1 -1
  21. data/lib/onfido/models/applicant_shared.rb +1 -1
  22. data/lib/onfido/models/applicant_update.rb +1 -1
  23. data/lib/onfido/models/applicant_updater.rb +1 -1
  24. data/lib/onfido/models/applicants_list.rb +1 -1
  25. data/lib/onfido/models/check.rb +1 -1
  26. data/lib/onfido/models/check_builder.rb +1 -1
  27. data/lib/onfido/models/check_request.rb +1 -1
  28. data/lib/onfido/models/check_response.rb +1 -1
  29. data/lib/onfido/models/check_shared.rb +1 -1
  30. data/lib/onfido/models/check_status.rb +1 -1
  31. data/lib/onfido/models/checks_list.rb +1 -1
  32. data/lib/onfido/models/complete_task_builder.rb +1 -1
  33. data/lib/onfido/models/complete_task_data_builder.rb +1 -1
  34. data/lib/onfido/models/country_codes.rb +1 -1
  35. data/lib/onfido/models/device_intelligence_breakdown.rb +11 -2
  36. data/lib/onfido/models/device_intelligence_breakdown_breakdown.rb +2 -2
  37. data/lib/onfido/models/{device_intelligence_breakdown_breakdown_device.rb → device_intelligence_breakdown_device.rb} +5 -5
  38. data/lib/onfido/models/{device_intelligence_breakdown_breakdown_device_breakdown.rb → device_intelligence_breakdown_device_breakdown.rb} +4 -4
  39. data/lib/onfido/models/device_intelligence_breakdown_properties.rb +1 -1
  40. data/lib/onfido/models/device_intelligence_breakdown_properties_device.rb +2 -2
  41. data/lib/onfido/models/device_intelligence_breakdown_properties_geolocation.rb +1 -1
  42. data/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb +1 -1
  43. data/lib/onfido/models/device_intelligence_properties.rb +232 -0
  44. data/lib/onfido/models/device_intelligence_report.rb +14 -17
  45. data/lib/onfido/models/document.rb +1 -13
  46. data/lib/onfido/models/document_breakdown.rb +1 -1
  47. data/lib/onfido/models/document_breakdown_age_validation.rb +1 -1
  48. data/lib/onfido/models/document_breakdown_age_validation_breakdown.rb +1 -1
  49. data/lib/onfido/models/document_breakdown_compromised_document.rb +1 -1
  50. data/lib/onfido/models/document_breakdown_compromised_document_breakdown.rb +1 -1
  51. data/lib/onfido/models/document_breakdown_data_comparison.rb +1 -1
  52. data/lib/onfido/models/document_breakdown_data_comparison_breakdown.rb +1 -1
  53. data/lib/onfido/models/document_breakdown_data_comparison_breakdown_issuing_country.rb +1 -1
  54. data/lib/onfido/models/document_breakdown_data_consistency.rb +1 -1
  55. data/lib/onfido/models/document_breakdown_data_consistency_breakdown.rb +1 -1
  56. data/lib/onfido/models/document_breakdown_data_validation.rb +1 -1
  57. data/lib/onfido/models/document_breakdown_data_validation_breakdown.rb +1 -1
  58. data/lib/onfido/models/document_breakdown_data_validation_breakdown_document_expiration.rb +1 -1
  59. data/lib/onfido/models/document_breakdown_data_validation_breakdown_expiry_date.rb +1 -1
  60. data/lib/onfido/models/document_breakdown_image_integrity.rb +1 -1
  61. data/lib/onfido/models/document_breakdown_image_integrity_breakdown.rb +1 -1
  62. data/lib/onfido/models/document_breakdown_image_integrity_breakdown_colour_picture.rb +1 -1
  63. data/lib/onfido/models/document_breakdown_image_integrity_breakdown_conclusive_document_quality.rb +1 -1
  64. data/lib/onfido/models/document_breakdown_image_integrity_breakdown_image_quality.rb +1 -1
  65. data/lib/onfido/models/document_breakdown_image_integrity_breakdown_supported_document.rb +1 -1
  66. data/lib/onfido/models/document_breakdown_issuing_authority.rb +1 -1
  67. data/lib/onfido/models/document_breakdown_issuing_authority_breakdown.rb +1 -1
  68. data/lib/onfido/models/document_breakdown_issuing_authority_breakdown_nfc_active_authentication.rb +1 -1
  69. data/lib/onfido/models/document_breakdown_issuing_authority_breakdown_nfc_passive_authentication.rb +1 -1
  70. data/lib/onfido/models/document_breakdown_police_record.rb +1 -1
  71. data/lib/onfido/models/document_breakdown_visual_authenticity.rb +1 -1
  72. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown.rb +1 -1
  73. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_digital_tampering.rb +1 -1
  74. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_face_detection.rb +1 -1
  75. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_fonts.rb +1 -1
  76. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_original_document_present.rb +1 -1
  77. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_other.rb +1 -1
  78. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_picture_face_integrity.rb +1 -1
  79. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_security_features.rb +1 -1
  80. data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_template.rb +1 -1
  81. data/lib/onfido/models/document_cdq_reasons.rb +1 -1
  82. data/lib/onfido/models/document_iq_reasons.rb +1 -1
  83. data/lib/onfido/models/document_odp_reasons.rb +1 -1
  84. data/lib/onfido/models/document_properties.rb +5 -3
  85. data/lib/onfido/models/document_properties_address_lines.rb +1 -1
  86. data/lib/onfido/models/document_properties_barcode_inner.rb +1 -1
  87. data/lib/onfido/models/document_properties_document_classification.rb +1 -1
  88. data/lib/onfido/models/document_properties_document_numbers_inner.rb +1 -1
  89. data/lib/onfido/models/{document_properties_driving_licence_information.rb → document_properties_driving_licence_information_item.rb} +4 -4
  90. data/lib/onfido/models/document_properties_extracted_data.rb +1 -1
  91. data/lib/onfido/models/document_properties_nfc.rb +1 -1
  92. data/lib/onfido/models/document_report.rb +15 -14
  93. data/lib/onfido/models/document_report_shared.rb +217 -0
  94. data/lib/onfido/models/document_response.rb +1 -1
  95. data/lib/onfido/models/document_shared.rb +1 -13
  96. data/lib/onfido/models/document_types.rb +1 -1
  97. data/lib/onfido/models/document_video_report.rb +15 -14
  98. data/lib/onfido/models/document_video_with_address_information_report.rb +15 -14
  99. data/lib/onfido/models/document_with_address_information_report.rb +15 -14
  100. data/lib/onfido/models/document_with_driver_verification_report.rb +15 -14
  101. data/lib/onfido/models/document_with_driver_verification_report_all_of_properties.rb +5 -3
  102. data/lib/onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.rb +1 -1
  103. data/lib/onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.rb +1 -1
  104. data/lib/onfido/models/document_with_driving_licence_information_report.rb +15 -14
  105. data/lib/onfido/models/documents_list.rb +1 -1
  106. data/lib/onfido/models/error.rb +1 -1
  107. data/lib/onfido/models/error1.rb +1 -1
  108. data/lib/onfido/models/error_properties.rb +1 -1
  109. data/lib/onfido/models/error_properties1.rb +1 -1
  110. data/lib/onfido/models/extract_request.rb +1 -1
  111. data/lib/onfido/models/extraction.rb +1 -1
  112. data/lib/onfido/models/extraction_document_classification.rb +1 -1
  113. data/lib/onfido/models/extraction_extracted_data.rb +1 -1
  114. data/lib/onfido/models/facial_similarity_motion_breakdown.rb +1 -1
  115. data/lib/onfido/models/facial_similarity_motion_breakdown_face_comparison.rb +1 -1
  116. data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity.rb +1 -1
  117. data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown.rb +1 -1
  118. data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_face_detected.rb +1 -1
  119. data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_source_integrity.rb +1 -1
  120. data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity.rb +1 -1
  121. data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown.rb +1 -1
  122. data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +1 -1
  123. data/lib/onfido/models/facial_similarity_motion_properties.rb +1 -1
  124. data/lib/onfido/models/facial_similarity_motion_report.rb +14 -14
  125. data/lib/onfido/models/facial_similarity_photo_breakdown.rb +1 -1
  126. data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison.rb +1 -1
  127. data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown.rb +1 -1
  128. data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match.rb +1 -1
  129. data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match_properties.rb +1 -1
  130. data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity.rb +1 -1
  131. data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown.rb +1 -1
  132. data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_face_detected.rb +1 -1
  133. data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_source_integrity.rb +1 -1
  134. data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity.rb +1 -1
  135. data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown.rb +1 -1
  136. data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +1 -1
  137. data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection_properties.rb +1 -1
  138. data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown.rb +1 -1
  139. data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity.rb +1 -1
  140. data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown.rb +1 -1
  141. data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown_source_integrity.rb +1 -1
  142. data/lib/onfido/models/facial_similarity_photo_fully_auto_properties.rb +1 -1
  143. data/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb +14 -14
  144. data/lib/onfido/models/facial_similarity_photo_properties.rb +1 -1
  145. data/lib/onfido/models/facial_similarity_photo_report.rb +14 -14
  146. data/lib/onfido/models/facial_similarity_report_media.rb +1 -1
  147. data/lib/onfido/models/facial_similarity_report_shared.rb +14 -2
  148. data/lib/onfido/models/facial_similarity_video_breakdown.rb +1 -1
  149. data/lib/onfido/models/facial_similarity_video_breakdown_face_comparison.rb +1 -1
  150. data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity.rb +1 -1
  151. data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown.rb +1 -1
  152. data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_face_detected.rb +1 -1
  153. data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_source_integrity.rb +1 -1
  154. data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity.rb +1 -1
  155. data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown.rb +1 -1
  156. data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected.rb +1 -1
  157. data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +1 -1
  158. data/lib/onfido/models/facial_similarity_video_properties.rb +1 -1
  159. data/lib/onfido/models/facial_similarity_video_report.rb +14 -14
  160. data/lib/onfido/models/id_number.rb +1 -1
  161. data/lib/onfido/models/id_photo.rb +1 -1
  162. data/lib/onfido/models/id_photo_response.rb +1 -1
  163. data/lib/onfido/models/id_photos_list.rb +1 -1
  164. data/lib/onfido/models/identity_enhanced_breakdown.rb +1 -1
  165. data/lib/onfido/models/identity_enhanced_breakdown_address.rb +1 -1
  166. data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown.rb +1 -1
  167. data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies.rb +1 -1
  168. data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies_properties.rb +1 -1
  169. data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_telephone_database.rb +1 -1
  170. data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_voting_register.rb +1 -1
  171. data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth.rb +1 -1
  172. data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown.rb +1 -1
  173. data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_credit_agencies.rb +1 -1
  174. data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_voting_register.rb +1 -1
  175. data/lib/onfido/models/identity_enhanced_breakdown_mortality.rb +1 -1
  176. data/lib/onfido/models/identity_enhanced_breakdown_sources.rb +1 -1
  177. data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown.rb +1 -1
  178. data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources.rb +1 -1
  179. data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources_properties.rb +1 -1
  180. data/lib/onfido/models/identity_enhanced_properties.rb +1 -1
  181. data/lib/onfido/models/identity_enhanced_properties_matched_addresses_inner.rb +1 -1
  182. data/lib/onfido/models/identity_enhanced_report.rb +2 -14
  183. data/lib/onfido/models/india_pan_report.rb +2 -14
  184. data/lib/onfido/models/india_pan_report_all_of_breakdown.rb +1 -1
  185. data/lib/onfido/models/india_pan_report_all_of_breakdown_device.rb +1 -1
  186. data/lib/onfido/models/india_pan_report_all_of_breakdown_device_breakdown.rb +1 -1
  187. data/lib/onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid.rb +1 -1
  188. data/lib/onfido/models/india_pan_report_all_of_properties.rb +1 -1
  189. data/lib/onfido/models/india_pan_report_all_of_properties_device.rb +1 -1
  190. data/lib/onfido/models/known_faces_breakdown.rb +1 -1
  191. data/lib/onfido/models/known_faces_breakdown_image_integrity.rb +1 -1
  192. data/lib/onfido/models/known_faces_breakdown_previously_seen_faces.rb +1 -1
  193. data/lib/onfido/models/known_faces_properties.rb +1 -1
  194. data/lib/onfido/models/known_faces_properties_matches_inner.rb +1 -1
  195. data/lib/onfido/models/known_faces_report.rb +2 -14
  196. data/lib/onfido/models/live_photo.rb +1 -1
  197. data/lib/onfido/models/live_photo_response.rb +1 -1
  198. data/lib/onfido/models/live_photos_list.rb +1 -1
  199. data/lib/onfido/models/live_video.rb +1 -1
  200. data/lib/onfido/models/live_videos_list.rb +1 -1
  201. data/lib/onfido/models/location.rb +1 -1
  202. data/lib/onfido/models/location_builder.rb +1 -1
  203. data/lib/onfido/models/location_shared.rb +1 -1
  204. data/lib/onfido/models/motion_capture.rb +1 -1
  205. data/lib/onfido/models/motion_captures_list.rb +1 -1
  206. data/lib/onfido/models/photo_auto_reasons.rb +1 -1
  207. data/lib/onfido/models/photo_reasons.rb +1 -1
  208. data/lib/onfido/models/proof_of_address_breakdown.rb +1 -1
  209. data/lib/onfido/models/proof_of_address_breakdown_data_comparison.rb +1 -1
  210. data/lib/onfido/models/proof_of_address_breakdown_data_comparison_breakdown.rb +1 -1
  211. data/lib/onfido/models/proof_of_address_breakdown_document_classification.rb +1 -1
  212. data/lib/onfido/models/proof_of_address_breakdown_document_classification_breakdown.rb +1 -1
  213. data/lib/onfido/models/proof_of_address_breakdown_image_integrity.rb +1 -1
  214. data/lib/onfido/models/proof_of_address_breakdown_image_integrity_breakdown.rb +1 -1
  215. data/lib/onfido/models/proof_of_address_properties.rb +1 -1
  216. data/lib/onfido/models/proof_of_address_report.rb +2 -14
  217. data/lib/onfido/models/repeat_attempts_list.rb +1 -1
  218. data/lib/onfido/models/repeat_attempts_list_repeat_attempts_inner.rb +1 -1
  219. data/lib/onfido/models/report.rb +1 -1
  220. data/lib/onfido/models/report_document.rb +1 -1
  221. data/lib/onfido/models/report_name.rb +1 -1
  222. data/lib/onfido/models/report_result.rb +1 -1
  223. data/lib/onfido/models/report_shared.rb +2 -14
  224. data/lib/onfido/models/report_status.rb +1 -1
  225. data/lib/onfido/models/report_sub_result.rb +1 -1
  226. data/lib/onfido/models/reports_list.rb +1 -1
  227. data/lib/onfido/models/results_feedback.rb +1 -1
  228. data/lib/onfido/models/sdk_token.rb +1 -1
  229. data/lib/onfido/models/sdk_token_builder.rb +1 -1
  230. data/lib/onfido/models/sdk_token_request.rb +1 -1
  231. data/lib/onfido/models/sdk_token_response.rb +1 -1
  232. data/lib/onfido/models/task.rb +1 -1
  233. data/lib/onfido/models/task_item.rb +1 -1
  234. data/lib/onfido/models/timeline_file_reference.rb +1 -1
  235. data/lib/onfido/models/us_driving_licence_breakdown.rb +1 -1
  236. data/lib/onfido/models/us_driving_licence_breakdown_address.rb +1 -1
  237. data/lib/onfido/models/us_driving_licence_breakdown_address_breakdown.rb +1 -1
  238. data/lib/onfido/models/us_driving_licence_breakdown_document.rb +1 -1
  239. data/lib/onfido/models/us_driving_licence_breakdown_document_breakdown.rb +1 -1
  240. data/lib/onfido/models/us_driving_licence_breakdown_personal.rb +1 -1
  241. data/lib/onfido/models/us_driving_licence_breakdown_personal_breakdown.rb +1 -1
  242. data/lib/onfido/models/us_driving_licence_builder.rb +1 -1
  243. data/lib/onfido/models/us_driving_licence_report.rb +2 -14
  244. data/lib/onfido/models/us_driving_licence_shared.rb +1 -1
  245. data/lib/onfido/models/video_reasons.rb +1 -1
  246. data/lib/onfido/models/watchlist_aml_breakdown.rb +1 -1
  247. data/lib/onfido/models/watchlist_aml_breakdown_adverse_media.rb +1 -1
  248. data/lib/onfido/models/watchlist_aml_breakdown_legal_and_regulatory_warnings.rb +1 -1
  249. data/lib/onfido/models/watchlist_aml_breakdown_politically_exposed_person.rb +1 -1
  250. data/lib/onfido/models/watchlist_aml_breakdown_sanction.rb +1 -1
  251. data/lib/onfido/models/watchlist_aml_properties.rb +2 -2
  252. data/lib/onfido/models/watchlist_aml_report.rb +2 -14
  253. data/lib/onfido/models/watchlist_enhanced_breakdown.rb +1 -1
  254. data/lib/onfido/models/watchlist_enhanced_properties.rb +1 -1
  255. data/lib/onfido/models/watchlist_enhanced_properties_records_inner.rb +1 -1
  256. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_address_inner.rb +1 -1
  257. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_alias_inner.rb +1 -1
  258. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.rb +1 -1
  259. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.rb +1 -1
  260. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_event_inner.rb +1 -1
  261. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.rb +1 -1
  262. data/lib/onfido/models/watchlist_enhanced_properties_records_inner_source_inner.rb +1 -1
  263. data/lib/onfido/models/watchlist_enhanced_report.rb +2 -14
  264. data/lib/onfido/models/watchlist_monitor.rb +1 -1
  265. data/lib/onfido/models/watchlist_monitor_builder.rb +1 -1
  266. data/lib/onfido/models/watchlist_monitor_match.rb +1 -1
  267. data/lib/onfido/models/watchlist_monitor_matches_list.rb +1 -1
  268. data/lib/onfido/models/watchlist_monitor_matches_updater.rb +1 -1
  269. data/lib/onfido/models/watchlist_monitor_response.rb +1 -1
  270. data/lib/onfido/models/watchlist_monitor_shared.rb +1 -1
  271. data/lib/onfido/models/watchlist_monitors_list.rb +1 -1
  272. data/lib/onfido/models/watchlist_peps_only_report.rb +2 -14
  273. data/lib/onfido/models/watchlist_sanctions_only_report.rb +2 -14
  274. data/lib/onfido/models/watchlist_standard_breakdown.rb +1 -1
  275. data/lib/onfido/models/watchlist_standard_properties.rb +2 -2
  276. data/lib/onfido/models/watchlist_standard_report.rb +2 -14
  277. data/lib/onfido/models/webhook.rb +52 -2
  278. data/lib/onfido/models/webhook_builder.rb +52 -2
  279. data/lib/onfido/models/webhook_create.rb +1 -1
  280. data/lib/onfido/models/webhook_event.rb +1 -1
  281. data/lib/onfido/models/webhook_event_object_status.rb +1 -1
  282. data/lib/onfido/models/webhook_event_payload.rb +1 -1
  283. data/lib/onfido/models/webhook_event_payload_object.rb +1 -8
  284. data/lib/onfido/models/webhook_event_payload_resource.rb +1 -1
  285. data/lib/onfido/models/webhook_event_resource_type.rb +1 -1
  286. data/lib/onfido/models/webhook_event_type.rb +2 -3
  287. data/lib/onfido/models/webhook_resend.rb +1 -1
  288. data/lib/onfido/models/webhook_response.rb +1 -1
  289. data/lib/onfido/models/webhook_shared.rb +55 -5
  290. data/lib/onfido/models/webhook_update.rb +1 -1
  291. data/lib/onfido/models/webhook_updater.rb +52 -2
  292. data/lib/onfido/models/webhooks_list.rb +1 -1
  293. data/lib/onfido/models/webhooks_resend_item.rb +1 -1
  294. data/lib/onfido/models/workflow_run.rb +1 -1
  295. data/lib/onfido/models/workflow_run_builder.rb +1 -1
  296. data/lib/onfido/models/workflow_run_error.rb +1 -1
  297. data/lib/onfido/models/workflow_run_link.rb +1 -1
  298. data/lib/onfido/models/workflow_run_request.rb +1 -1
  299. data/lib/onfido/models/workflow_run_response.rb +1 -1
  300. data/lib/onfido/models/workflow_run_shared.rb +1 -1
  301. data/lib/onfido/models/workflow_run_status.rb +1 -1
  302. data/lib/onfido/version.rb +2 -2
  303. data/lib/onfido.rb +7 -4
  304. data/onfido.gemspec +1 -1
  305. data/spec/integrations/applicant_spec.rb +28 -0
  306. data/spec/integrations/document_spec.rb +14 -2
  307. data/spec/integrations/report_schema_spec.rb +33 -0
  308. data/spec/shared_contexts/with_document.rb +4 -0
  309. metadata +26 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d96d6906170b9be6731106168f61d6da039f67f8f65e7202274ef3259e645172
4
- data.tar.gz: daf83bf07548dcba4da864e17c03b768aaf86b4d68bce658c4b2164d30ad6407
3
+ metadata.gz: b50846731ee3d1258557cfbb22b8348d5328af3d2f8b0fba18548e37dc8963ea
4
+ data.tar.gz: efef5ee6be4f2f839764d11e1fb00f23d24e554b1e1c5bbb33ec127fbe603534
5
5
  SHA512:
6
- metadata.gz: 05a2d8051fbffeed8e82da41ab88a118477baf3e6214f62fc1c8a5327979dea2fa29a73e4cf0909acb833fa41cb0e5adf8a11cb46a44d297bf3a4b9d51f14276
7
- data.tar.gz: fa62c445cae9183851eff0acaa5efff06a9a76abce6e216516ad872ed75cdd01ff125098b42b8697212b8e212d06de9fa8c4eecda7b6d90d145a14c02124010c
6
+ metadata.gz: 7460854cfadcc65b683f1087130da5b23f46c3f1e9e4787b9aa5e82a5b8d394e3bea826fd085b70614d5d591e6ab78eff73365bd615ff8bc6e6e7f9f107d9680
7
+ data.tar.gz: 567a9d3e0e751d042022ea2a41691485a1deedddaf91131f3c599e5390638f0e5155c855f4d58a233a69d0e2f3acd072e0f040d0ff022d0fe326a36034c29192
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## v5.0.0 21st February 2025
4
+
5
+ - Release based on Onfido OpenAPI spec version [v5.0.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v5.0.0):
6
+ - Denote webhook event payload.object.href as a not required property
7
+ - [CAT-1593] Drop invalid enum value from webhook event type
8
+ - Add applicant_id in GET /workflow_runs
9
+ - [CAT-1694] Define document file type as free text
10
+ - Add missing import in ApiClient
11
+ - [DOCCAP-2513] Add download-nfc-face endpoint
12
+ - [CAT-1719] Don't impose a type on deprecated records property in watchlist reports
13
+ - Remove documents property for reports where it's not applicable
14
+ - Update openapi generator version to v7.10.0 (was v7.9.0)
15
+ - Update openapi generator version to v7.11.0 (was v7.10.0)
16
+ - Add tests for Download NFC Face endpoint
17
+ - [Migration Guide](MIGRATION.md#upgrading-from-4x-to-5x)
18
+
19
+ ## v4.6.0 24th January 2025
20
+
21
+ - Release based on Onfido OpenAPI spec version [v4.6.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.6.0):
22
+ - [STUDIO-4308] Add driving_license to id_number enum
23
+ - [CAT-1634] Add proxy configuration support to Java client library
24
+ - Update README files (including templated ones)
25
+ - Add customer_user_id in the webhook event resource
26
+ - test: wait for evidence folder to be available
27
+
3
28
  ## v4.5.0 8th January 2025
4
29
 
5
30
  - Release based on Onfido OpenAPI spec version [v4.5.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v4.5.0):
data/MIGRATION.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Migration Guide
2
2
 
3
+ This guide provides detailed instructions on how to upgrade between different
4
+ major versions of the client library.
5
+
6
+ It covers changes in core resources, other endpoints, and the OpenAPI generator,
7
+ ensuring a smooth transition between versions.
8
+
9
+ ## Upgrading from 4.x to 5.x
10
+
11
+ ### Core Resources
12
+
13
+ - Documents
14
+ - Allow any string as `file_type`
15
+
16
+ ### Other Endpoints
17
+
18
+ - Webhooks
19
+ - Drop `WORKFLOW_SIGNED_EVIDENCE_FILE_CREATED` enum value from
20
+ `WebhookEventType` enum
21
+ - Make `href` property in `WebhookEventPayloadObject` optional
22
+ - Reports
23
+ - Allow the deprecated `records` property in `WatchlistAml` and
24
+ `WatchlistStandard` reports to be any object, and not just a string
25
+ - Remove `documents` property from all reports except Document and
26
+ Facial Similarity reports
27
+
28
+ ### OpenAPI generator
29
+
30
+ - Version upgraded from `7.9.0` to `7.11.0`
31
+
3
32
  ## Upgrading from 3.x to 4.x
4
33
 
5
34
  ### Core Resources
data/README.md CHANGED
@@ -14,13 +14,13 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
14
14
  ### Installation
15
15
 
16
16
  ```ruby
17
- gem onfido, '~> 4.6.0'
17
+ gem 'onfido', '~> 5.1.0'
18
18
  ```
19
19
 
20
20
  Configure with your API token, region and optional timeout (default value is 30):
21
21
 
22
22
  ```ruby
23
- require onfido
23
+ require 'onfido'
24
24
 
25
25
  Onfido.configure do |config|
26
26
  config.api_token = ENV["ONFIDO_API_TOKEN"]
@@ -86,7 +86,7 @@ Webhook events payload needs to be verified before it can be accessed. Verifying
86
86
 
87
87
  ## Contributing
88
88
 
89
- This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore, all contributions (except test files) should target the [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. Please follow the contribution guidelines provided in the OpenAPI specification repository.
89
+ This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.11.0); therefore, all contributions (except test files) should target the [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. Please follow the contribution guidelines provided in the OpenAPI specification repository.
90
90
 
91
91
  For contributions to the tests instead, please follow the steps below:
92
92
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -1384,6 +1384,69 @@ module Onfido
1384
1384
  return data, status_code, headers
1385
1385
  end
1386
1386
 
1387
+ # Download NFC face
1388
+ # Downloads digital photos extracted from specific documents belonging to an applicant. If successful, the response will be the binary data representing the image.
1389
+ # @param document_id [String]
1390
+ # @param [Hash] opts the optional parameters
1391
+ # @return [File]
1392
+ def download_nfc_face(document_id, opts = {})
1393
+ data, _status_code, _headers = download_nfc_face_with_http_info(document_id, opts)
1394
+ data
1395
+ end
1396
+
1397
+ # Download NFC face
1398
+ # Downloads digital photos extracted from specific documents belonging to an applicant. If successful, the response will be the binary data representing the image.
1399
+ # @param document_id [String]
1400
+ # @param [Hash] opts the optional parameters
1401
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
1402
+ def download_nfc_face_with_http_info(document_id, opts = {})
1403
+ if @api_client.config.debugging
1404
+ @api_client.config.logger.debug 'Calling API: DefaultApi.download_nfc_face ...'
1405
+ end
1406
+ # verify the required parameter 'document_id' is set
1407
+ if @api_client.config.client_side_validation && document_id.nil?
1408
+ fail ArgumentError, "Missing the required parameter 'document_id' when calling DefaultApi.download_nfc_face"
1409
+ end
1410
+ # resource path
1411
+ local_var_path = '/documents/{document_id}/nfc_face'.sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))
1412
+
1413
+ # query parameters
1414
+ query_params = opts[:query_params] || {}
1415
+
1416
+ # header parameters
1417
+ header_params = opts[:header_params] || {}
1418
+ # HTTP header 'Accept' (if needed)
1419
+ header_params['Accept'] = @api_client.select_header_accept(['*/*', 'application/json']) unless header_params['Accept']
1420
+
1421
+ # form parameters
1422
+ form_params = opts[:form_params] || {}
1423
+
1424
+ # http body (model)
1425
+ post_body = opts[:debug_body]
1426
+
1427
+ # return_type
1428
+ return_type = opts[:debug_return_type] || 'File'
1429
+
1430
+ # auth_names
1431
+ auth_names = opts[:debug_auth_names] || ['Token']
1432
+
1433
+ new_options = opts.merge(
1434
+ :operation => :"DefaultApi.download_nfc_face",
1435
+ :header_params => header_params,
1436
+ :query_params => query_params,
1437
+ :form_params => form_params,
1438
+ :body => post_body,
1439
+ :auth_names => auth_names,
1440
+ :return_type => return_type
1441
+ )
1442
+
1443
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1444
+ if @api_client.config.debugging
1445
+ @api_client.config.logger.debug "API called: DefaultApi#download_nfc_face\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1446
+ end
1447
+ return data, status_code, headers
1448
+ end
1449
+
1387
1450
  # Retrieves the signed document or application form
1388
1451
  # Retrieves the signed document or application form depending on the file_id provided.
1389
1452
  # @param workflow_run_id [String] The unique identifier of the Workflow Run for which you want to retrieve the signed document.
@@ -1713,6 +1776,69 @@ module Onfido
1713
1776
  return data, status_code, headers
1714
1777
  end
1715
1778
 
1779
+ # Retrieve Applicant Consents
1780
+ # Retrieves consents for single applicant.
1781
+ # @param applicant_id [String]
1782
+ # @param [Hash] opts the optional parameters
1783
+ # @return [Array<ApplicantConsent>]
1784
+ def find_applicant_consents(applicant_id, opts = {})
1785
+ data, _status_code, _headers = find_applicant_consents_with_http_info(applicant_id, opts)
1786
+ data
1787
+ end
1788
+
1789
+ # Retrieve Applicant Consents
1790
+ # Retrieves consents for single applicant.
1791
+ # @param applicant_id [String]
1792
+ # @param [Hash] opts the optional parameters
1793
+ # @return [Array<(Array<ApplicantConsent>, Integer, Hash)>] Array<ApplicantConsent> data, response status code and response headers
1794
+ def find_applicant_consents_with_http_info(applicant_id, opts = {})
1795
+ if @api_client.config.debugging
1796
+ @api_client.config.logger.debug 'Calling API: DefaultApi.find_applicant_consents ...'
1797
+ end
1798
+ # verify the required parameter 'applicant_id' is set
1799
+ if @api_client.config.client_side_validation && applicant_id.nil?
1800
+ fail ArgumentError, "Missing the required parameter 'applicant_id' when calling DefaultApi.find_applicant_consents"
1801
+ end
1802
+ # resource path
1803
+ local_var_path = '/applicants/{applicant_id}/consents'.sub('{' + 'applicant_id' + '}', CGI.escape(applicant_id.to_s))
1804
+
1805
+ # query parameters
1806
+ query_params = opts[:query_params] || {}
1807
+
1808
+ # header parameters
1809
+ header_params = opts[:header_params] || {}
1810
+ # HTTP header 'Accept' (if needed)
1811
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1812
+
1813
+ # form parameters
1814
+ form_params = opts[:form_params] || {}
1815
+
1816
+ # http body (model)
1817
+ post_body = opts[:debug_body]
1818
+
1819
+ # return_type
1820
+ return_type = opts[:debug_return_type] || 'Array<ApplicantConsent>'
1821
+
1822
+ # auth_names
1823
+ auth_names = opts[:debug_auth_names] || ['Token']
1824
+
1825
+ new_options = opts.merge(
1826
+ :operation => :"DefaultApi.find_applicant_consents",
1827
+ :header_params => header_params,
1828
+ :query_params => query_params,
1829
+ :form_params => form_params,
1830
+ :body => post_body,
1831
+ :auth_names => auth_names,
1832
+ :return_type => return_type
1833
+ )
1834
+
1835
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1836
+ if @api_client.config.debugging
1837
+ @api_client.config.logger.debug "API called: DefaultApi#find_applicant_consents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1838
+ end
1839
+ return data, status_code, headers
1840
+ end
1841
+
1716
1842
  # Retrieve a Check
1717
1843
  # Retrieves a single check. Returns a check object.
1718
1844
  # @param check_id [String]
@@ -3447,6 +3573,7 @@ module Onfido
3447
3573
  # @option opts [Time] :created_at_gt A ISO-8601 date to filter results with a created date greater than (after) the one provided.
3448
3574
  # @option opts [Time] :created_at_lt A ISO-8601 date to filter results with a created date less than (before) the one provided.
3449
3575
  # @option opts [String] :sort A string with the value &#39;desc&#39; or &#39;asc&#39; that allows to sort the returned list by the completed datetime either descending or ascending, respectively. If not specified, defaults to &#39;desc&#39;. (default to 'desc')
3576
+ # @option opts [String] :applicant_id the applicant&#39;s id.
3450
3577
  # @return [Array<WorkflowRun>]
3451
3578
  def list_workflow_runs(opts = {})
3452
3579
  data, _status_code, _headers = list_workflow_runs_with_http_info(opts)
@@ -3461,6 +3588,7 @@ module Onfido
3461
3588
  # @option opts [Time] :created_at_gt A ISO-8601 date to filter results with a created date greater than (after) the one provided.
3462
3589
  # @option opts [Time] :created_at_lt A ISO-8601 date to filter results with a created date less than (before) the one provided.
3463
3590
  # @option opts [String] :sort A string with the value &#39;desc&#39; or &#39;asc&#39; that allows to sort the returned list by the completed datetime either descending or ascending, respectively. If not specified, defaults to &#39;desc&#39;. (default to 'desc')
3591
+ # @option opts [String] :applicant_id the applicant&#39;s id.
3464
3592
  # @return [Array<(Array<WorkflowRun>, Integer, Hash)>] Array<WorkflowRun> data, response status code and response headers
3465
3593
  def list_workflow_runs_with_http_info(opts = {})
3466
3594
  if @api_client.config.debugging
@@ -3480,6 +3608,7 @@ module Onfido
3480
3608
  query_params[:'created_at_gt'] = opts[:'created_at_gt'] if !opts[:'created_at_gt'].nil?
3481
3609
  query_params[:'created_at_lt'] = opts[:'created_at_lt'] if !opts[:'created_at_lt'].nil?
3482
3610
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
3611
+ query_params[:'applicant_id'] = opts[:'applicant_id'] if !opts[:'applicant_id'].nil?
3483
3612
 
3484
3613
  # header parameters
3485
3614
  header_params = opts[:header_params] || {}
@@ -4164,10 +4293,6 @@ module Onfido
4164
4293
  if @api_client.config.client_side_validation && file.nil?
4165
4294
  fail ArgumentError, "Missing the required parameter 'file' when calling DefaultApi.upload_document"
4166
4295
  end
4167
- allowable_values = ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"]
4168
- if @api_client.config.client_side_validation && opts[:'file_type'] && !allowable_values.include?(opts[:'file_type'])
4169
- fail ArgumentError, "invalid value for \"file_type\", must be one of #{allowable_values}"
4170
- end
4171
4296
  allowable_values = ["front", "back", "unknown_default_open_api"]
4172
4297
  if @api_client.config.client_side_validation && opts[:'side'] && !allowable_values.include?(opts[:'side'])
4173
4298
  fail ArgumentError, "invalid value for \"side\", must be one of #{allowable_values}"
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -19,6 +19,7 @@ require 'faraday'
19
19
  require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
20
20
  require 'marcel'
21
21
 
22
+ require 'pathname'
22
23
 
23
24
  module Onfido
24
25
  class ApiClient
@@ -34,7 +35,7 @@ module Onfido
34
35
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
35
36
  def initialize(config = Configuration.default)
36
37
  @config = config
37
- @user_agent = "onfido-ruby/4.6.0"
38
+ @user_agent = "onfido-ruby/5.1.0"
38
39
  @default_headers = {
39
40
  'Content-Type' => 'application/json',
40
41
  'User-Agent' => @user_agent
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,272 @@
1
+ =begin
2
+ #Onfido API v3.6
3
+
4
+ #The Onfido API (v3.6)
5
+
6
+ The version of the OpenAPI document: v3.6
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Onfido
17
+ class ApplicantConsent
18
+ attr_accessor :name
19
+
20
+ attr_accessor :granted
21
+
22
+ # The date and time when this applicant consent was granted, if not granted the value is nil.
23
+ attr_accessor :granted_at
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'name' => :'name',
51
+ :'granted' => :'granted',
52
+ :'granted_at' => :'granted_at'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'name' => :'ApplicantConsentName',
65
+ :'granted' => :'Boolean',
66
+ :'granted_at' => :'Time'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ :'granted_at'
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::ApplicantConsent` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::ApplicantConsent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'name')
93
+ self.name = attributes[:'name']
94
+ else
95
+ self.name = nil
96
+ end
97
+
98
+ if attributes.key?(:'granted')
99
+ self.granted = attributes[:'granted']
100
+ else
101
+ self.granted = nil
102
+ end
103
+
104
+ if attributes.key?(:'granted_at')
105
+ self.granted_at = attributes[:'granted_at']
106
+ else
107
+ self.granted_at = nil
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 @name.nil?
117
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
118
+ end
119
+
120
+ if @granted.nil?
121
+ invalid_properties.push('invalid value for "granted", granted cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @name.nil?
132
+ return false if @granted.nil?
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ name == o.name &&
142
+ granted == o.granted &&
143
+ granted_at == o.granted_at
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [name, granted, granted_at].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def self._deserialize(type, value)
186
+ case type.to_sym
187
+ when :Time
188
+ Time.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ # models (e.g. Pet) or oneOf
219
+ klass = Onfido.const_get(type)
220
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+
270
+ end
271
+
272
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3.6
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.9.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12