onfido-python 2.10.1__py3-none-any.whl → 3.2.0__py3-none-any.whl

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 (326) hide show
  1. onfido/__init__.py +311 -2
  2. onfido/api/__init__.py +5 -0
  3. onfido/api/default_api.py +17207 -0
  4. onfido/api_client.py +770 -0
  5. onfido/api_response.py +21 -0
  6. onfido/configuration.py +460 -0
  7. onfido/exceptions.py +184 -77
  8. onfido/models/__init__.py +291 -0
  9. onfido/models/address.py +169 -0
  10. onfido/models/address_builder.py +169 -0
  11. onfido/models/address_shared.py +169 -0
  12. onfido/models/addresses_list.py +108 -0
  13. onfido/models/applicant.py +162 -0
  14. onfido/models/applicant_builder.py +152 -0
  15. onfido/models/applicant_create.py +117 -0
  16. onfido/models/applicant_request.py +116 -0
  17. onfido/models/applicant_response.py +146 -0
  18. onfido/models/applicant_shared.py +115 -0
  19. onfido/models/applicant_update.py +123 -0
  20. onfido/models/applicant_updater.py +158 -0
  21. onfido/models/applicants_list.py +108 -0
  22. onfido/models/check.py +147 -0
  23. onfido/models/check_builder.py +127 -0
  24. onfido/models/check_request.py +119 -0
  25. onfido/models/check_response.py +137 -0
  26. onfido/models/check_shared.py +108 -0
  27. onfido/models/checks_list.py +108 -0
  28. onfido/models/complete_task_builder.py +104 -0
  29. onfido/models/complete_task_data_builder.py +143 -0
  30. onfido/models/consent_item.py +109 -0
  31. onfido/models/consents_builder.py +98 -0
  32. onfido/models/country_codes.py +285 -0
  33. onfido/models/device_intelligence_breakdown.py +110 -0
  34. onfido/models/device_intelligence_breakdown_breakdown.py +104 -0
  35. onfido/models/device_intelligence_breakdown_breakdown_device.py +104 -0
  36. onfido/models/device_intelligence_breakdown_breakdown_device_breakdown.py +114 -0
  37. onfido/models/device_intelligence_breakdown_properties.py +116 -0
  38. onfido/models/device_intelligence_breakdown_properties_device.py +189 -0
  39. onfido/models/device_intelligence_breakdown_properties_geolocation.py +105 -0
  40. onfido/models/device_intelligence_breakdown_properties_ip.py +106 -0
  41. onfido/models/device_intelligence_report.py +135 -0
  42. onfido/models/document.py +142 -0
  43. onfido/models/document_breakdown.py +152 -0
  44. onfido/models/document_breakdown_age_validation.py +106 -0
  45. onfido/models/document_breakdown_age_validation_breakdown.py +104 -0
  46. onfido/models/document_breakdown_compromised_document.py +106 -0
  47. onfido/models/document_breakdown_compromised_document_breakdown.py +109 -0
  48. onfido/models/document_breakdown_data_comparison.py +106 -0
  49. onfido/models/document_breakdown_data_comparison_breakdown.py +139 -0
  50. onfido/models/document_breakdown_data_comparison_breakdown_issuing_country.py +102 -0
  51. onfido/models/document_breakdown_data_consistency.py +106 -0
  52. onfido/models/document_breakdown_data_consistency_breakdown.py +149 -0
  53. onfido/models/document_breakdown_data_validation.py +106 -0
  54. onfido/models/document_breakdown_data_validation_breakdown.py +136 -0
  55. onfido/models/document_breakdown_data_validation_breakdown_document_expiration.py +102 -0
  56. onfido/models/document_breakdown_data_validation_breakdown_expiry_date.py +102 -0
  57. onfido/models/document_breakdown_image_integrity.py +106 -0
  58. onfido/models/document_breakdown_image_integrity_breakdown.py +122 -0
  59. onfido/models/document_breakdown_image_integrity_breakdown_colour_picture.py +102 -0
  60. onfido/models/document_breakdown_image_integrity_breakdown_conclusive_document_quality.py +106 -0
  61. onfido/models/document_breakdown_image_integrity_breakdown_image_quality.py +106 -0
  62. onfido/models/document_breakdown_image_integrity_breakdown_supported_document.py +102 -0
  63. onfido/models/document_breakdown_issuing_authority.py +106 -0
  64. onfido/models/document_breakdown_issuing_authority_breakdown.py +110 -0
  65. onfido/models/document_breakdown_issuing_authority_breakdown_nfc_active_authentication.py +102 -0
  66. onfido/models/document_breakdown_issuing_authority_breakdown_nfc_passive_authentication.py +102 -0
  67. onfido/models/document_breakdown_police_record.py +100 -0
  68. onfido/models/document_breakdown_visual_authenticity.py +106 -0
  69. onfido/models/document_breakdown_visual_authenticity_breakdown.py +146 -0
  70. onfido/models/document_breakdown_visual_authenticity_breakdown_digital_tampering.py +102 -0
  71. onfido/models/document_breakdown_visual_authenticity_breakdown_face_detection.py +102 -0
  72. onfido/models/document_breakdown_visual_authenticity_breakdown_fonts.py +102 -0
  73. onfido/models/document_breakdown_visual_authenticity_breakdown_original_document_present.py +106 -0
  74. onfido/models/document_breakdown_visual_authenticity_breakdown_other.py +102 -0
  75. onfido/models/document_breakdown_visual_authenticity_breakdown_picture_face_integrity.py +102 -0
  76. onfido/models/document_breakdown_visual_authenticity_breakdown_security_features.py +102 -0
  77. onfido/models/document_breakdown_visual_authenticity_breakdown_template.py +102 -0
  78. onfido/models/document_cdq_reasons.py +114 -0
  79. onfido/models/document_iq_reasons.py +118 -0
  80. onfido/models/document_odp_reasons.py +106 -0
  81. onfido/models/document_properties.py +253 -0
  82. onfido/models/document_properties_address_lines.py +110 -0
  83. onfido/models/document_properties_barcode_inner.py +135 -0
  84. onfido/models/document_properties_document_classification.py +104 -0
  85. onfido/models/document_properties_document_numbers_inner.py +102 -0
  86. onfido/models/document_properties_driving_licence_information.py +107 -0
  87. onfido/models/document_properties_extracted_data.py +141 -0
  88. onfido/models/document_properties_nfc.py +125 -0
  89. onfido/models/document_report.py +141 -0
  90. onfido/models/document_response.py +111 -0
  91. onfido/models/document_shared.py +129 -0
  92. onfido/models/document_types.py +60 -0
  93. onfido/models/document_video_report.py +141 -0
  94. onfido/models/document_video_with_address_information_report.py +141 -0
  95. onfido/models/document_with_address_information_report.py +141 -0
  96. onfido/models/document_with_driver_verification_report.py +141 -0
  97. onfido/models/document_with_driver_verification_report_all_of_properties.py +277 -0
  98. onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.py +105 -0
  99. onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.py +107 -0
  100. onfido/models/document_with_driving_licence_information_report.py +141 -0
  101. onfido/models/documents_list.py +108 -0
  102. onfido/models/error.py +104 -0
  103. onfido/models/error1.py +106 -0
  104. onfido/models/error_properties.py +104 -0
  105. onfido/models/error_properties1.py +102 -0
  106. onfido/models/extract_request.py +100 -0
  107. onfido/models/extraction.py +112 -0
  108. onfido/models/extraction_document_classification.py +120 -0
  109. onfido/models/extraction_extracted_data.py +176 -0
  110. onfido/models/facial_similarity_motion_breakdown.py +116 -0
  111. onfido/models/facial_similarity_motion_breakdown_face_comparison.py +106 -0
  112. onfido/models/facial_similarity_motion_breakdown_image_integrity.py +106 -0
  113. onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown.py +110 -0
  114. onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_face_detected.py +102 -0
  115. onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
  116. onfido/models/facial_similarity_motion_breakdown_visual_authenticity.py +106 -0
  117. onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown.py +110 -0
  118. onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
  119. onfido/models/facial_similarity_motion_properties.py +100 -0
  120. onfido/models/facial_similarity_motion_report.py +141 -0
  121. onfido/models/facial_similarity_photo_breakdown.py +116 -0
  122. onfido/models/facial_similarity_photo_breakdown_face_comparison.py +106 -0
  123. onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown.py +104 -0
  124. onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match.py +106 -0
  125. onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match_properties.py +102 -0
  126. onfido/models/facial_similarity_photo_breakdown_image_integrity.py +106 -0
  127. onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown.py +110 -0
  128. onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_face_detected.py +102 -0
  129. onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
  130. onfido/models/facial_similarity_photo_breakdown_visual_authenticity.py +106 -0
  131. onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown.py +104 -0
  132. onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
  133. onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection_properties.py +100 -0
  134. onfido/models/facial_similarity_photo_fully_auto_breakdown.py +116 -0
  135. onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity.py +106 -0
  136. onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown.py +110 -0
  137. onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
  138. onfido/models/facial_similarity_photo_fully_auto_properties.py +100 -0
  139. onfido/models/facial_similarity_photo_fully_auto_report.py +141 -0
  140. onfido/models/facial_similarity_photo_properties.py +100 -0
  141. onfido/models/facial_similarity_photo_report.py +141 -0
  142. onfido/models/facial_similarity_video_breakdown.py +116 -0
  143. onfido/models/facial_similarity_video_breakdown_face_comparison.py +106 -0
  144. onfido/models/facial_similarity_video_breakdown_image_integrity.py +106 -0
  145. onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown.py +110 -0
  146. onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_face_detected.py +102 -0
  147. onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_source_integrity.py +106 -0
  148. onfido/models/facial_similarity_video_breakdown_visual_authenticity.py +106 -0
  149. onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown.py +110 -0
  150. onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected.py +102 -0
  151. onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection.py +106 -0
  152. onfido/models/facial_similarity_video_properties.py +100 -0
  153. onfido/models/facial_similarity_video_report.py +141 -0
  154. onfido/models/id_number.py +114 -0
  155. onfido/models/id_photo.py +113 -0
  156. onfido/models/id_photo_response.py +113 -0
  157. onfido/models/id_photos_list.py +108 -0
  158. onfido/models/identity_enhanced_breakdown.py +122 -0
  159. onfido/models/identity_enhanced_breakdown_address.py +106 -0
  160. onfido/models/identity_enhanced_breakdown_address_breakdown.py +116 -0
  161. onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies.py +106 -0
  162. onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies_properties.py +100 -0
  163. onfido/models/identity_enhanced_breakdown_address_breakdown_telephone_database.py +102 -0
  164. onfido/models/identity_enhanced_breakdown_address_breakdown_voting_register.py +102 -0
  165. onfido/models/identity_enhanced_breakdown_date_of_birth.py +106 -0
  166. onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown.py +110 -0
  167. onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_credit_agencies.py +102 -0
  168. onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_voting_register.py +102 -0
  169. onfido/models/identity_enhanced_breakdown_mortality.py +100 -0
  170. onfido/models/identity_enhanced_breakdown_sources.py +106 -0
  171. onfido/models/identity_enhanced_breakdown_sources_breakdown.py +104 -0
  172. onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources.py +106 -0
  173. onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources_properties.py +100 -0
  174. onfido/models/identity_enhanced_properties.py +110 -0
  175. onfido/models/identity_enhanced_properties_matched_addresses_inner.py +102 -0
  176. onfido/models/identity_enhanced_report.py +141 -0
  177. onfido/models/india_pan_report.py +141 -0
  178. onfido/models/india_pan_report_all_of_breakdown.py +104 -0
  179. onfido/models/india_pan_report_all_of_breakdown_device.py +104 -0
  180. onfido/models/india_pan_report_all_of_breakdown_device_breakdown.py +109 -0
  181. onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid.py +100 -0
  182. onfido/models/india_pan_report_all_of_properties.py +104 -0
  183. onfido/models/india_pan_report_all_of_properties_device.py +102 -0
  184. onfido/models/known_faces_breakdown.py +110 -0
  185. onfido/models/known_faces_breakdown_image_integrity.py +100 -0
  186. onfido/models/known_faces_breakdown_previously_seen_faces.py +100 -0
  187. onfido/models/known_faces_properties.py +108 -0
  188. onfido/models/known_faces_properties_matches_inner.py +108 -0
  189. onfido/models/known_faces_report.py +141 -0
  190. onfido/models/live_photo.py +113 -0
  191. onfido/models/live_photo_response.py +113 -0
  192. onfido/models/live_photos_list.py +108 -0
  193. onfido/models/live_video.py +115 -0
  194. onfido/models/live_videos_list.py +108 -0
  195. onfido/models/location.py +103 -0
  196. onfido/models/location_builder.py +103 -0
  197. onfido/models/location_shared.py +103 -0
  198. onfido/models/motion_capture.py +113 -0
  199. onfido/models/motion_captures_list.py +108 -0
  200. onfido/models/photo_auto_reasons.py +108 -0
  201. onfido/models/photo_reasons.py +108 -0
  202. onfido/models/proof_of_address_breakdown.py +116 -0
  203. onfido/models/proof_of_address_breakdown_data_comparison.py +106 -0
  204. onfido/models/proof_of_address_breakdown_data_comparison_breakdown.py +114 -0
  205. onfido/models/proof_of_address_breakdown_document_classification.py +106 -0
  206. onfido/models/proof_of_address_breakdown_document_classification_breakdown.py +104 -0
  207. onfido/models/proof_of_address_breakdown_image_integrity.py +106 -0
  208. onfido/models/proof_of_address_breakdown_image_integrity_breakdown.py +104 -0
  209. onfido/models/proof_of_address_properties.py +125 -0
  210. onfido/models/proof_of_address_report.py +141 -0
  211. onfido/models/repeat_attempts_list.py +117 -0
  212. onfido/models/repeat_attempts_list_repeat_attempts_inner.py +143 -0
  213. onfido/models/report.py +621 -0
  214. onfido/models/report_document.py +100 -0
  215. onfido/models/report_name.py +56 -0
  216. onfido/models/report_result.py +38 -0
  217. onfido/models/report_shared.py +129 -0
  218. onfido/models/report_status.py +40 -0
  219. onfido/models/report_sub_result.py +39 -0
  220. onfido/models/reports_list.py +108 -0
  221. onfido/models/results_feedback.py +116 -0
  222. onfido/models/sdk_token.py +100 -0
  223. onfido/models/sdk_token_builder.py +106 -0
  224. onfido/models/sdk_token_request.py +106 -0
  225. onfido/models/sdk_token_response.py +100 -0
  226. onfido/models/task.py +146 -0
  227. onfido/models/task_item.py +128 -0
  228. onfido/models/timeline_file_reference.py +102 -0
  229. onfido/models/us_driving_licence_breakdown.py +116 -0
  230. onfido/models/us_driving_licence_breakdown_address.py +106 -0
  231. onfido/models/us_driving_licence_breakdown_address_breakdown.py +129 -0
  232. onfido/models/us_driving_licence_breakdown_document.py +106 -0
  233. onfido/models/us_driving_licence_breakdown_document_breakdown.py +119 -0
  234. onfido/models/us_driving_licence_breakdown_personal.py +106 -0
  235. onfido/models/us_driving_licence_breakdown_personal_breakdown.py +164 -0
  236. onfido/models/us_driving_licence_builder.py +185 -0
  237. onfido/models/us_driving_licence_report.py +141 -0
  238. onfido/models/us_driving_licence_shared.py +185 -0
  239. onfido/models/video_reasons.py +106 -0
  240. onfido/models/watchlist_aml_breakdown.py +122 -0
  241. onfido/models/watchlist_aml_breakdown_adverse_media.py +100 -0
  242. onfido/models/watchlist_aml_breakdown_legal_and_regulatory_warnings.py +100 -0
  243. onfido/models/watchlist_aml_breakdown_politically_exposed_person.py +100 -0
  244. onfido/models/watchlist_aml_breakdown_sanction.py +100 -0
  245. onfido/models/watchlist_aml_properties.py +100 -0
  246. onfido/models/watchlist_aml_report.py +141 -0
  247. onfido/models/watchlist_enhanced_breakdown.py +122 -0
  248. onfido/models/watchlist_enhanced_properties.py +100 -0
  249. onfido/models/watchlist_enhanced_report.py +141 -0
  250. onfido/models/watchlist_monitor.py +120 -0
  251. onfido/models/watchlist_monitor_builder.py +111 -0
  252. onfido/models/watchlist_monitor_match.py +102 -0
  253. onfido/models/watchlist_monitor_matches_list.py +108 -0
  254. onfido/models/watchlist_monitor_matches_updater.py +102 -0
  255. onfido/models/watchlist_monitor_response.py +107 -0
  256. onfido/models/watchlist_monitor_shared.py +111 -0
  257. onfido/models/watchlist_monitors_list.py +108 -0
  258. onfido/models/watchlist_peps_only_report.py +141 -0
  259. onfido/models/watchlist_sanctions_only_report.py +141 -0
  260. onfido/models/watchlist_standard_breakdown.py +116 -0
  261. onfido/models/watchlist_standard_properties.py +100 -0
  262. onfido/models/watchlist_standard_report.py +141 -0
  263. onfido/models/webhook.py +115 -0
  264. onfido/models/webhook_builder.py +109 -0
  265. onfido/models/webhook_create.py +100 -0
  266. onfido/models/webhook_event.py +104 -0
  267. onfido/models/webhook_event_payload.py +111 -0
  268. onfido/models/webhook_event_payload_object.py +107 -0
  269. onfido/models/webhook_event_type.py +52 -0
  270. onfido/models/webhook_resend.py +108 -0
  271. onfido/models/webhook_response.py +106 -0
  272. onfido/models/webhook_shared.py +107 -0
  273. onfido/models/webhook_update.py +100 -0
  274. onfido/models/webhook_updater.py +109 -0
  275. onfido/models/webhooks_list.py +108 -0
  276. onfido/models/webhooks_resend_item.py +103 -0
  277. onfido/models/workflow_run.py +149 -0
  278. onfido/models/workflow_run_builder.py +123 -0
  279. onfido/models/workflow_run_request.py +100 -0
  280. onfido/models/workflow_run_response.py +126 -0
  281. onfido/models/workflow_run_response_error.py +102 -0
  282. onfido/models/workflow_run_shared.py +121 -0
  283. onfido/models/workflow_run_shared_link.py +119 -0
  284. onfido/py.typed +0 -0
  285. onfido/rest.py +258 -0
  286. onfido/webhook_event_verifier.py +14 -7
  287. {onfido_python-2.10.1.dist-info → onfido_python-3.2.0.dist-info}/LICENSE +1 -1
  288. onfido_python-3.2.0.dist-info/METADATA +18 -0
  289. onfido_python-3.2.0.dist-info/RECORD +291 -0
  290. {onfido_python-2.10.1.dist-info → onfido_python-3.2.0.dist-info}/WHEEL +2 -1
  291. onfido_python-3.2.0.dist-info/top_level.txt +1 -0
  292. onfido/aio_resource.py +0 -131
  293. onfido/mimetype.py +0 -5
  294. onfido/onfido.py +0 -71
  295. onfido/onfido_download.py +0 -11
  296. onfido/regions.py +0 -11
  297. onfido/resource.py +0 -88
  298. onfido/resources/address_picker.py +0 -6
  299. onfido/resources/applicants.py +0 -23
  300. onfido/resources/checks.py +0 -19
  301. onfido/resources/documents.py +0 -16
  302. onfido/resources/extraction.py +0 -6
  303. onfido/resources/live_photos.py +0 -17
  304. onfido/resources/live_videos.py +0 -16
  305. onfido/resources/motion_captures.py +0 -16
  306. onfido/resources/reports.py +0 -16
  307. onfido/resources/sdk_tokens.py +0 -5
  308. onfido/resources/watchlist_monitors.py +0 -16
  309. onfido/resources/webhooks.py +0 -18
  310. onfido/resources/workflow_runs.py +0 -17
  311. onfido/resources_aio/address_picker.py +0 -6
  312. onfido/resources_aio/applicants.py +0 -23
  313. onfido/resources_aio/checks.py +0 -19
  314. onfido/resources_aio/documents.py +0 -16
  315. onfido/resources_aio/extraction.py +0 -6
  316. onfido/resources_aio/live_photos.py +0 -17
  317. onfido/resources_aio/live_videos.py +0 -16
  318. onfido/resources_aio/motion_captures.py +0 -16
  319. onfido/resources_aio/reports.py +0 -16
  320. onfido/resources_aio/sdk_tokens.py +0 -6
  321. onfido/resources_aio/watchlist_monitors.py +0 -16
  322. onfido/resources_aio/webhooks.py +0 -18
  323. onfido/resources_aio/workflow_runs.py +0 -17
  324. onfido/utils.py +0 -22
  325. onfido_python-2.10.1.dist-info/METADATA +0 -181
  326. onfido_python-2.10.1.dist-info/RECORD +0 -40
@@ -0,0 +1,106 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Onfido API v3.6
5
+
6
+ The Onfido API (v3.6)
7
+
8
+ The version of the OpenAPI document: v3.6
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from onfido.models.us_driving_licence_breakdown_personal_breakdown import UsDrivingLicenceBreakdownPersonalBreakdown
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class UsDrivingLicenceBreakdownPersonal(BaseModel):
27
+ """
28
+ Asserts whether the personal data provided matches a real driving license in the DMV driver's license database.
29
+ """ # noqa: E501
30
+ result: Optional[StrictStr] = None
31
+ breakdown: Optional[UsDrivingLicenceBreakdownPersonalBreakdown] = None
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["result", "breakdown"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of UsDrivingLicenceBreakdownPersonal from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of breakdown
77
+ if self.breakdown:
78
+ _dict['breakdown'] = self.breakdown.to_dict()
79
+ # puts key-value pairs in additional_properties in the top level
80
+ if self.additional_properties is not None:
81
+ for _key, _value in self.additional_properties.items():
82
+ _dict[_key] = _value
83
+
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of UsDrivingLicenceBreakdownPersonal from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "result": obj.get("result"),
97
+ "breakdown": UsDrivingLicenceBreakdownPersonalBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None
98
+ })
99
+ # store additional fields in additional_properties
100
+ for _key in obj.keys():
101
+ if _key not in cls.__properties:
102
+ _obj.additional_properties[_key] = obj.get(_key)
103
+
104
+ return _obj
105
+
106
+
@@ -0,0 +1,164 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Onfido API v3.6
5
+
6
+ The Onfido API (v3.6)
7
+
8
+ The version of the OpenAPI document: v3.6
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from onfido.models.document_breakdown_data_comparison_breakdown_issuing_country import DocumentBreakdownDataComparisonBreakdownIssuingCountry
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class UsDrivingLicenceBreakdownPersonalBreakdown(BaseModel):
27
+ """
28
+ UsDrivingLicenceBreakdownPersonalBreakdown
29
+ """ # noqa: E501
30
+ first_name: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
31
+ name_suffix: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
32
+ height: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
33
+ weight: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
34
+ sex_code: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
35
+ eye_color: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
36
+ date_of_birth: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
37
+ last_name: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
38
+ middle_name: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
39
+ first_name_fuzzy: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
40
+ middle_name_fuzzy: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
41
+ last_name_fuzzy: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
42
+ middle_initial: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
43
+ additional_properties: Dict[str, Any] = {}
44
+ __properties: ClassVar[List[str]] = ["first_name", "name_suffix", "height", "weight", "sex_code", "eye_color", "date_of_birth", "last_name", "middle_name", "first_name_fuzzy", "middle_name_fuzzy", "last_name_fuzzy", "middle_initial"]
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of UsDrivingLicenceBreakdownPersonalBreakdown from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ * Fields in `self.additional_properties` are added to the output dict.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ "additional_properties",
80
+ ])
81
+
82
+ _dict = self.model_dump(
83
+ by_alias=True,
84
+ exclude=excluded_fields,
85
+ exclude_none=True,
86
+ )
87
+ # override the default output from pydantic by calling `to_dict()` of first_name
88
+ if self.first_name:
89
+ _dict['first_name'] = self.first_name.to_dict()
90
+ # override the default output from pydantic by calling `to_dict()` of name_suffix
91
+ if self.name_suffix:
92
+ _dict['name_suffix'] = self.name_suffix.to_dict()
93
+ # override the default output from pydantic by calling `to_dict()` of height
94
+ if self.height:
95
+ _dict['height'] = self.height.to_dict()
96
+ # override the default output from pydantic by calling `to_dict()` of weight
97
+ if self.weight:
98
+ _dict['weight'] = self.weight.to_dict()
99
+ # override the default output from pydantic by calling `to_dict()` of sex_code
100
+ if self.sex_code:
101
+ _dict['sex_code'] = self.sex_code.to_dict()
102
+ # override the default output from pydantic by calling `to_dict()` of eye_color
103
+ if self.eye_color:
104
+ _dict['eye_color'] = self.eye_color.to_dict()
105
+ # override the default output from pydantic by calling `to_dict()` of date_of_birth
106
+ if self.date_of_birth:
107
+ _dict['date_of_birth'] = self.date_of_birth.to_dict()
108
+ # override the default output from pydantic by calling `to_dict()` of last_name
109
+ if self.last_name:
110
+ _dict['last_name'] = self.last_name.to_dict()
111
+ # override the default output from pydantic by calling `to_dict()` of middle_name
112
+ if self.middle_name:
113
+ _dict['middle_name'] = self.middle_name.to_dict()
114
+ # override the default output from pydantic by calling `to_dict()` of first_name_fuzzy
115
+ if self.first_name_fuzzy:
116
+ _dict['first_name_fuzzy'] = self.first_name_fuzzy.to_dict()
117
+ # override the default output from pydantic by calling `to_dict()` of middle_name_fuzzy
118
+ if self.middle_name_fuzzy:
119
+ _dict['middle_name_fuzzy'] = self.middle_name_fuzzy.to_dict()
120
+ # override the default output from pydantic by calling `to_dict()` of last_name_fuzzy
121
+ if self.last_name_fuzzy:
122
+ _dict['last_name_fuzzy'] = self.last_name_fuzzy.to_dict()
123
+ # override the default output from pydantic by calling `to_dict()` of middle_initial
124
+ if self.middle_initial:
125
+ _dict['middle_initial'] = self.middle_initial.to_dict()
126
+ # puts key-value pairs in additional_properties in the top level
127
+ if self.additional_properties is not None:
128
+ for _key, _value in self.additional_properties.items():
129
+ _dict[_key] = _value
130
+
131
+ return _dict
132
+
133
+ @classmethod
134
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
135
+ """Create an instance of UsDrivingLicenceBreakdownPersonalBreakdown from a dict"""
136
+ if obj is None:
137
+ return None
138
+
139
+ if not isinstance(obj, dict):
140
+ return cls.model_validate(obj)
141
+
142
+ _obj = cls.model_validate({
143
+ "first_name": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["first_name"]) if obj.get("first_name") is not None else None,
144
+ "name_suffix": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["name_suffix"]) if obj.get("name_suffix") is not None else None,
145
+ "height": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["height"]) if obj.get("height") is not None else None,
146
+ "weight": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["weight"]) if obj.get("weight") is not None else None,
147
+ "sex_code": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["sex_code"]) if obj.get("sex_code") is not None else None,
148
+ "eye_color": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["eye_color"]) if obj.get("eye_color") is not None else None,
149
+ "date_of_birth": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["date_of_birth"]) if obj.get("date_of_birth") is not None else None,
150
+ "last_name": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["last_name"]) if obj.get("last_name") is not None else None,
151
+ "middle_name": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["middle_name"]) if obj.get("middle_name") is not None else None,
152
+ "first_name_fuzzy": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["first_name_fuzzy"]) if obj.get("first_name_fuzzy") is not None else None,
153
+ "middle_name_fuzzy": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["middle_name_fuzzy"]) if obj.get("middle_name_fuzzy") is not None else None,
154
+ "last_name_fuzzy": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["last_name_fuzzy"]) if obj.get("last_name_fuzzy") is not None else None,
155
+ "middle_initial": DocumentBreakdownDataComparisonBreakdownIssuingCountry.from_dict(obj["middle_initial"]) if obj.get("middle_initial") is not None else None
156
+ })
157
+ # store additional fields in additional_properties
158
+ for _key in obj.keys():
159
+ if _key not in cls.__properties:
160
+ _obj.additional_properties[_key] = obj.get(_key)
161
+
162
+ return _obj
163
+
164
+
@@ -0,0 +1,185 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Onfido API v3.6
5
+
6
+ The Onfido API (v3.6)
7
+
8
+ The version of the OpenAPI document: v3.6
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import date
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class UsDrivingLicenceBuilder(BaseModel):
28
+ """
29
+ UsDrivingLicenceBuilder
30
+ """ # noqa: E501
31
+ id_number: StrictStr = Field(description="Driving licence ID number")
32
+ issue_state: Annotated[str, Field(strict=True)] = Field(description="Two letter code of issuing state (state-issued driving licenses only)")
33
+ address_line_1: Optional[StrictStr] = Field(default=None, description="Line 1 of the address")
34
+ address_line_2: Optional[StrictStr] = Field(default=None, description="Line 2 of the address")
35
+ city: Optional[StrictStr] = Field(default=None, description="The city of the owner's address")
36
+ date_of_birth: Optional[date] = Field(default=None, description="Date of birth in yyyy-mm-dd format")
37
+ document_category: Optional[StrictStr] = Field(default=None, description="Document category.")
38
+ expiration_date: Optional[date] = Field(default=None, description="Expiration date of the driving licence in yyyy-mm-dd format")
39
+ eye_color_code: Optional[StrictStr] = Field(default=None, description="Eye color code.")
40
+ first_name: Optional[StrictStr] = Field(default=None, description="The owner's first name")
41
+ gender: Optional[StrictStr] = None
42
+ issue_date: Optional[date] = Field(default=None, description="Issue date in yyyy-mm-dd format")
43
+ last_name: Optional[StrictStr] = Field(default=None, description="The owner's surname")
44
+ middle_name: Optional[StrictStr] = Field(default=None, description="The owner's middle name")
45
+ name_suffix: Optional[StrictStr] = Field(default=None, description="The owner's name suffix")
46
+ postal_code: Optional[StrictStr] = Field(default=None, description="The postcode or ZIP of the owner's address")
47
+ state: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="2-characters state code")
48
+ weight_measure: Optional[StrictInt] = Field(default=None, description="Weight in pounds")
49
+ additional_properties: Dict[str, Any] = {}
50
+ __properties: ClassVar[List[str]] = ["id_number", "issue_state", "address_line_1", "address_line_2", "city", "date_of_birth", "document_category", "expiration_date", "eye_color_code", "first_name", "gender", "issue_date", "last_name", "middle_name", "name_suffix", "postal_code", "state", "weight_measure"]
51
+
52
+ @field_validator('issue_state')
53
+ def issue_state_validate_regular_expression(cls, value):
54
+ """Validates the regular expression"""
55
+ if not re.match(r"^[A-Z]{2}$", value):
56
+ raise ValueError(r"must validate the regular expression /^[A-Z]{2}$/")
57
+ return value
58
+
59
+ @field_validator('document_category')
60
+ def document_category_validate_enum(cls, value):
61
+ """Validates the enum"""
62
+ if value is None:
63
+ return value
64
+
65
+ if value not in set(['driver license', 'driver permit', 'id card']):
66
+ raise ValueError("must be one of enum values ('driver license', 'driver permit', 'id card')")
67
+ return value
68
+
69
+ @field_validator('eye_color_code')
70
+ def eye_color_code_validate_enum(cls, value):
71
+ """Validates the enum"""
72
+ if value is None:
73
+ return value
74
+
75
+ if value not in set(['BLK', 'BLU', 'BRO', 'DIC', 'GRY', 'GRN', 'HAZ', 'MAR', 'PNK']):
76
+ raise ValueError("must be one of enum values ('BLK', 'BLU', 'BRO', 'DIC', 'GRY', 'GRN', 'HAZ', 'MAR', 'PNK')")
77
+ return value
78
+
79
+ @field_validator('gender')
80
+ def gender_validate_enum(cls, value):
81
+ """Validates the enum"""
82
+ if value is None:
83
+ return value
84
+
85
+ if value not in set(['Male', 'Female']):
86
+ raise ValueError("must be one of enum values ('Male', 'Female')")
87
+ return value
88
+
89
+ @field_validator('state')
90
+ def state_validate_regular_expression(cls, value):
91
+ """Validates the regular expression"""
92
+ if value is None:
93
+ return value
94
+
95
+ if not re.match(r"^[A-Z]{2}$", value):
96
+ raise ValueError(r"must validate the regular expression /^[A-Z]{2}$/")
97
+ return value
98
+
99
+ model_config = ConfigDict(
100
+ populate_by_name=True,
101
+ validate_assignment=True,
102
+ protected_namespaces=(),
103
+ )
104
+
105
+
106
+ def to_str(self) -> str:
107
+ """Returns the string representation of the model using alias"""
108
+ return pprint.pformat(self.model_dump(by_alias=True))
109
+
110
+ def to_json(self) -> str:
111
+ """Returns the JSON representation of the model using alias"""
112
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
113
+ return json.dumps(self.to_dict())
114
+
115
+ @classmethod
116
+ def from_json(cls, json_str: str) -> Optional[Self]:
117
+ """Create an instance of UsDrivingLicenceBuilder from a JSON string"""
118
+ return cls.from_dict(json.loads(json_str))
119
+
120
+ def to_dict(self) -> Dict[str, Any]:
121
+ """Return the dictionary representation of the model using alias.
122
+
123
+ This has the following differences from calling pydantic's
124
+ `self.model_dump(by_alias=True)`:
125
+
126
+ * `None` is only added to the output dict for nullable fields that
127
+ were set at model initialization. Other fields with value `None`
128
+ are ignored.
129
+ * OpenAPI `readOnly` fields are excluded.
130
+ * Fields in `self.additional_properties` are added to the output dict.
131
+ """
132
+ excluded_fields: Set[str] = set([
133
+ "gender",
134
+ "additional_properties",
135
+ ])
136
+
137
+ _dict = self.model_dump(
138
+ by_alias=True,
139
+ exclude=excluded_fields,
140
+ exclude_none=True,
141
+ )
142
+ # puts key-value pairs in additional_properties in the top level
143
+ if self.additional_properties is not None:
144
+ for _key, _value in self.additional_properties.items():
145
+ _dict[_key] = _value
146
+
147
+ return _dict
148
+
149
+ @classmethod
150
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
151
+ """Create an instance of UsDrivingLicenceBuilder from a dict"""
152
+ if obj is None:
153
+ return None
154
+
155
+ if not isinstance(obj, dict):
156
+ return cls.model_validate(obj)
157
+
158
+ _obj = cls.model_validate({
159
+ "id_number": obj.get("id_number"),
160
+ "issue_state": obj.get("issue_state"),
161
+ "address_line_1": obj.get("address_line_1"),
162
+ "address_line_2": obj.get("address_line_2"),
163
+ "city": obj.get("city"),
164
+ "date_of_birth": obj.get("date_of_birth"),
165
+ "document_category": obj.get("document_category"),
166
+ "expiration_date": obj.get("expiration_date"),
167
+ "eye_color_code": obj.get("eye_color_code"),
168
+ "first_name": obj.get("first_name"),
169
+ "gender": obj.get("gender"),
170
+ "issue_date": obj.get("issue_date"),
171
+ "last_name": obj.get("last_name"),
172
+ "middle_name": obj.get("middle_name"),
173
+ "name_suffix": obj.get("name_suffix"),
174
+ "postal_code": obj.get("postal_code"),
175
+ "state": obj.get("state"),
176
+ "weight_measure": obj.get("weight_measure")
177
+ })
178
+ # store additional fields in additional_properties
179
+ for _key in obj.keys():
180
+ if _key not in cls.__properties:
181
+ _obj.additional_properties[_key] = obj.get(_key)
182
+
183
+ return _obj
184
+
185
+
@@ -0,0 +1,141 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Onfido API v3.6
5
+
6
+ The Onfido API (v3.6)
7
+
8
+ The version of the OpenAPI document: v3.6
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from onfido.models.document_properties import DocumentProperties
24
+ from onfido.models.report_document import ReportDocument
25
+ from onfido.models.report_name import ReportName
26
+ from onfido.models.report_result import ReportResult
27
+ from onfido.models.report_status import ReportStatus
28
+ from onfido.models.report_sub_result import ReportSubResult
29
+ from onfido.models.us_driving_licence_breakdown import UsDrivingLicenceBreakdown
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class UsDrivingLicenceReport(BaseModel):
34
+ """
35
+ UsDrivingLicenceReport
36
+ """ # noqa: E501
37
+ id: StrictStr = Field(description="The unique identifier for the report. Read-only.")
38
+ created_at: Optional[datetime] = Field(default=None, description="The date and time at which the report was first initiated. Read-only.")
39
+ href: Optional[StrictStr] = Field(default=None, description="The API endpoint to retrieve the report. Read-only.")
40
+ status: Optional[ReportStatus] = None
41
+ result: Optional[ReportResult] = None
42
+ sub_result: Optional[ReportSubResult] = None
43
+ check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
44
+ documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine. [ONLY POPULATED FOR DOCUMENT AND FACIAL SIMILARITY REPORTS]")
45
+ name: ReportName
46
+ breakdown: Optional[UsDrivingLicenceBreakdown] = None
47
+ properties: Optional[DocumentProperties] = None
48
+ additional_properties: Dict[str, Any] = {}
49
+ __properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "documents", "name", "breakdown", "properties"]
50
+
51
+ model_config = ConfigDict(
52
+ populate_by_name=True,
53
+ validate_assignment=True,
54
+ protected_namespaces=(),
55
+ )
56
+
57
+
58
+ def to_str(self) -> str:
59
+ """Returns the string representation of the model using alias"""
60
+ return pprint.pformat(self.model_dump(by_alias=True))
61
+
62
+ def to_json(self) -> str:
63
+ """Returns the JSON representation of the model using alias"""
64
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
+ return json.dumps(self.to_dict())
66
+
67
+ @classmethod
68
+ def from_json(cls, json_str: str) -> Optional[Self]:
69
+ """Create an instance of UsDrivingLicenceReport from a JSON string"""
70
+ return cls.from_dict(json.loads(json_str))
71
+
72
+ def to_dict(self) -> Dict[str, Any]:
73
+ """Return the dictionary representation of the model using alias.
74
+
75
+ This has the following differences from calling pydantic's
76
+ `self.model_dump(by_alias=True)`:
77
+
78
+ * `None` is only added to the output dict for nullable fields that
79
+ were set at model initialization. Other fields with value `None`
80
+ are ignored.
81
+ * Fields in `self.additional_properties` are added to the output dict.
82
+ """
83
+ excluded_fields: Set[str] = set([
84
+ "additional_properties",
85
+ ])
86
+
87
+ _dict = self.model_dump(
88
+ by_alias=True,
89
+ exclude=excluded_fields,
90
+ exclude_none=True,
91
+ )
92
+ # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
+ _items = []
94
+ if self.documents:
95
+ for _item in self.documents:
96
+ if _item:
97
+ _items.append(_item.to_dict())
98
+ _dict['documents'] = _items
99
+ # override the default output from pydantic by calling `to_dict()` of breakdown
100
+ if self.breakdown:
101
+ _dict['breakdown'] = self.breakdown.to_dict()
102
+ # override the default output from pydantic by calling `to_dict()` of properties
103
+ if self.properties:
104
+ _dict['properties'] = self.properties.to_dict()
105
+ # puts key-value pairs in additional_properties in the top level
106
+ if self.additional_properties is not None:
107
+ for _key, _value in self.additional_properties.items():
108
+ _dict[_key] = _value
109
+
110
+ return _dict
111
+
112
+ @classmethod
113
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114
+ """Create an instance of UsDrivingLicenceReport from a dict"""
115
+ if obj is None:
116
+ return None
117
+
118
+ if not isinstance(obj, dict):
119
+ return cls.model_validate(obj)
120
+
121
+ _obj = cls.model_validate({
122
+ "id": obj.get("id"),
123
+ "created_at": obj.get("created_at"),
124
+ "href": obj.get("href"),
125
+ "status": obj.get("status"),
126
+ "result": obj.get("result"),
127
+ "sub_result": obj.get("sub_result"),
128
+ "check_id": obj.get("check_id"),
129
+ "documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
130
+ "name": obj.get("name"),
131
+ "breakdown": UsDrivingLicenceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
132
+ "properties": DocumentProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
133
+ })
134
+ # store additional fields in additional_properties
135
+ for _key in obj.keys():
136
+ if _key not in cls.__properties:
137
+ _obj.additional_properties[_key] = obj.get(_key)
138
+
139
+ return _obj
140
+
141
+