onfido-python 3.4.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 (291) hide show
  1. onfido/__init__.py +311 -0
  2. onfido/api/__init__.py +5 -0
  3. onfido/api/default_api.py +17488 -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 +199 -0
  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 +255 -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 +279 -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 +109 -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 +158 -0
  278. onfido/models/workflow_run_builder.py +125 -0
  279. onfido/models/workflow_run_request.py +100 -0
  280. onfido/models/workflow_run_response.py +133 -0
  281. onfido/models/workflow_run_response_error.py +102 -0
  282. onfido/models/workflow_run_shared.py +123 -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 +27 -0
  287. onfido_python-3.4.0.dist-info/LICENSE +21 -0
  288. onfido_python-3.4.0.dist-info/METADATA +18 -0
  289. onfido_python-3.4.0.dist-info/RECORD +291 -0
  290. onfido_python-3.4.0.dist-info/WHEEL +5 -0
  291. onfido_python-3.4.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,279 @@
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, StrictBool, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from onfido.models.document_properties_address_lines import DocumentPropertiesAddressLines
24
+ from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
25
+ from onfido.models.document_properties_document_classification import DocumentPropertiesDocumentClassification
26
+ from onfido.models.document_properties_document_numbers_inner import DocumentPropertiesDocumentNumbersInner
27
+ from onfido.models.document_properties_driving_licence_information import DocumentPropertiesDrivingLicenceInformation
28
+ from onfido.models.document_properties_extracted_data import DocumentPropertiesExtractedData
29
+ from onfido.models.document_properties_nfc import DocumentPropertiesNfc
30
+ from onfido.models.document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle import DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle
31
+ from onfido.models.document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner import DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner
32
+ from typing import Optional, Set
33
+ from typing_extensions import Self
34
+
35
+ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
36
+ """
37
+ DocumentWithDriverVerificationReportAllOfProperties
38
+ """ # noqa: E501
39
+ date_of_birth: Optional[date] = None
40
+ date_of_expiry: Optional[date] = None
41
+ personal_number: Optional[StrictStr] = None
42
+ document_numbers: Optional[List[DocumentPropertiesDocumentNumbersInner]] = None
43
+ document_type: Optional[StrictStr] = None
44
+ first_name: Optional[StrictStr] = None
45
+ middle_name: Optional[StrictStr] = None
46
+ last_name: Optional[StrictStr] = None
47
+ gender: Optional[StrictStr] = None
48
+ issuing_country: Optional[StrictStr] = None
49
+ nationality: Optional[StrictStr] = None
50
+ issuing_state: Optional[StrictStr] = None
51
+ issuing_date: Optional[date] = None
52
+ categorisation: Optional[StrictStr] = None
53
+ mrz_line1: Optional[StrictStr] = None
54
+ mrz_line2: Optional[StrictStr] = None
55
+ mrz_line3: Optional[StrictStr] = None
56
+ address: Optional[StrictStr] = None
57
+ place_of_birth: Optional[StrictStr] = None
58
+ spouse_name: Optional[StrictStr] = None
59
+ widow_name: Optional[StrictStr] = None
60
+ alias_name: Optional[StrictStr] = None
61
+ issuing_authority: Optional[StrictStr] = None
62
+ remarks: Optional[StrictStr] = None
63
+ civil_state: Optional[StrictStr] = None
64
+ expatriation: Optional[StrictStr] = None
65
+ father_name: Optional[StrictStr] = None
66
+ mother_name: Optional[StrictStr] = None
67
+ religion: Optional[StrictStr] = None
68
+ type_of_permit: Optional[StrictStr] = None
69
+ version_number: Optional[StrictStr] = None
70
+ document_subtype: Optional[StrictStr] = None
71
+ profession: Optional[StrictStr] = None
72
+ security_document_number: Optional[StrictStr] = None
73
+ tax_number: Optional[StrictStr] = None
74
+ nist_identity_evidence_strength: Optional[StrictStr] = None
75
+ has_issuance_confirmation: Optional[StrictStr] = None
76
+ real_id_compliance: Optional[StrictBool] = None
77
+ security_tier: Optional[StrictStr] = None
78
+ address_lines: Optional[DocumentPropertiesAddressLines] = None
79
+ barcode: Optional[List[DocumentPropertiesBarcodeInner]] = None
80
+ nfc: Optional[DocumentPropertiesNfc] = None
81
+ driving_licence_information: Optional[DocumentPropertiesDrivingLicenceInformation] = None
82
+ document_classification: Optional[DocumentPropertiesDocumentClassification] = None
83
+ extracted_data: Optional[DocumentPropertiesExtractedData] = None
84
+ drivers_licence: Optional[StrictBool] = Field(default=None, description="True for **non-restricted** driving licences")
85
+ restricted_licence: Optional[StrictBool] = Field(default=None, description="True for **limited/restricted** driving license, including learner's permits")
86
+ raw_licence_category: Optional[StrictStr] = Field(default=None, description="Underlying, non-normalised, licence category (e.g. \"Junior operators license\")")
87
+ raw_vehicle_classes: Optional[StrictStr] = Field(default=None, description="Comma-separated vehicle classes that the user is qualified for")
88
+ vehicle_class_details: Optional[List[DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner]] = Field(default=None, description="Detailed classes/categories information")
89
+ passenger_vehicle: Optional[DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle] = None
90
+ additional_properties: Dict[str, Any] = {}
91
+ __properties: ClassVar[List[str]] = ["date_of_birth", "date_of_expiry", "personal_number", "document_numbers", "document_type", "first_name", "middle_name", "last_name", "gender", "issuing_country", "nationality", "issuing_state", "issuing_date", "categorisation", "mrz_line1", "mrz_line2", "mrz_line3", "address", "place_of_birth", "spouse_name", "widow_name", "alias_name", "issuing_authority", "remarks", "civil_state", "expatriation", "father_name", "mother_name", "religion", "type_of_permit", "version_number", "document_subtype", "profession", "security_document_number", "tax_number", "nist_identity_evidence_strength", "has_issuance_confirmation", "real_id_compliance", "security_tier", "address_lines", "barcode", "nfc", "driving_licence_information", "document_classification", "extracted_data", "drivers_licence", "restricted_licence", "raw_licence_category", "raw_vehicle_classes", "vehicle_class_details", "passenger_vehicle"]
92
+
93
+ @field_validator('nist_identity_evidence_strength')
94
+ def nist_identity_evidence_strength_validate_enum(cls, value):
95
+ """Validates the enum"""
96
+ if value is None:
97
+ return value
98
+
99
+ if value not in set(['superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength']):
100
+ raise ValueError("must be one of enum values ('superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength')")
101
+ return value
102
+
103
+ @field_validator('has_issuance_confirmation')
104
+ def has_issuance_confirmation_validate_enum(cls, value):
105
+ """Validates the enum"""
106
+ if value is None:
107
+ return value
108
+
109
+ if value not in set(['true', 'false', 'unspecified']):
110
+ raise ValueError("must be one of enum values ('true', 'false', 'unspecified')")
111
+ return value
112
+
113
+ @field_validator('security_tier')
114
+ def security_tier_validate_enum(cls, value):
115
+ """Validates the enum"""
116
+ if value is None:
117
+ return value
118
+
119
+ if value not in set(['tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier']):
120
+ raise ValueError("must be one of enum values ('tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier')")
121
+ return value
122
+
123
+ model_config = ConfigDict(
124
+ populate_by_name=True,
125
+ validate_assignment=True,
126
+ protected_namespaces=(),
127
+ )
128
+
129
+
130
+ def to_str(self) -> str:
131
+ """Returns the string representation of the model using alias"""
132
+ return pprint.pformat(self.model_dump(by_alias=True))
133
+
134
+ def to_json(self) -> str:
135
+ """Returns the JSON representation of the model using alias"""
136
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
137
+ return json.dumps(self.to_dict())
138
+
139
+ @classmethod
140
+ def from_json(cls, json_str: str) -> Optional[Self]:
141
+ """Create an instance of DocumentWithDriverVerificationReportAllOfProperties from a JSON string"""
142
+ return cls.from_dict(json.loads(json_str))
143
+
144
+ def to_dict(self) -> Dict[str, Any]:
145
+ """Return the dictionary representation of the model using alias.
146
+
147
+ This has the following differences from calling pydantic's
148
+ `self.model_dump(by_alias=True)`:
149
+
150
+ * `None` is only added to the output dict for nullable fields that
151
+ were set at model initialization. Other fields with value `None`
152
+ are ignored.
153
+ * Fields in `self.additional_properties` are added to the output dict.
154
+ """
155
+ excluded_fields: Set[str] = set([
156
+ "additional_properties",
157
+ ])
158
+
159
+ _dict = self.model_dump(
160
+ by_alias=True,
161
+ exclude=excluded_fields,
162
+ exclude_none=True,
163
+ )
164
+ # override the default output from pydantic by calling `to_dict()` of each item in document_numbers (list)
165
+ _items = []
166
+ if self.document_numbers:
167
+ for _item in self.document_numbers:
168
+ if _item:
169
+ _items.append(_item.to_dict())
170
+ _dict['document_numbers'] = _items
171
+ # override the default output from pydantic by calling `to_dict()` of address_lines
172
+ if self.address_lines:
173
+ _dict['address_lines'] = self.address_lines.to_dict()
174
+ # override the default output from pydantic by calling `to_dict()` of each item in barcode (list)
175
+ _items = []
176
+ if self.barcode:
177
+ for _item in self.barcode:
178
+ if _item:
179
+ _items.append(_item.to_dict())
180
+ _dict['barcode'] = _items
181
+ # override the default output from pydantic by calling `to_dict()` of nfc
182
+ if self.nfc:
183
+ _dict['nfc'] = self.nfc.to_dict()
184
+ # override the default output from pydantic by calling `to_dict()` of driving_licence_information
185
+ if self.driving_licence_information:
186
+ _dict['driving_licence_information'] = self.driving_licence_information.to_dict()
187
+ # override the default output from pydantic by calling `to_dict()` of document_classification
188
+ if self.document_classification:
189
+ _dict['document_classification'] = self.document_classification.to_dict()
190
+ # override the default output from pydantic by calling `to_dict()` of extracted_data
191
+ if self.extracted_data:
192
+ _dict['extracted_data'] = self.extracted_data.to_dict()
193
+ # override the default output from pydantic by calling `to_dict()` of each item in vehicle_class_details (list)
194
+ _items = []
195
+ if self.vehicle_class_details:
196
+ for _item in self.vehicle_class_details:
197
+ if _item:
198
+ _items.append(_item.to_dict())
199
+ _dict['vehicle_class_details'] = _items
200
+ # override the default output from pydantic by calling `to_dict()` of passenger_vehicle
201
+ if self.passenger_vehicle:
202
+ _dict['passenger_vehicle'] = self.passenger_vehicle.to_dict()
203
+ # puts key-value pairs in additional_properties in the top level
204
+ if self.additional_properties is not None:
205
+ for _key, _value in self.additional_properties.items():
206
+ _dict[_key] = _value
207
+
208
+ return _dict
209
+
210
+ @classmethod
211
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
212
+ """Create an instance of DocumentWithDriverVerificationReportAllOfProperties from a dict"""
213
+ if obj is None:
214
+ return None
215
+
216
+ if not isinstance(obj, dict):
217
+ return cls.model_validate(obj)
218
+
219
+ _obj = cls.model_validate({
220
+ "date_of_birth": obj.get("date_of_birth"),
221
+ "date_of_expiry": obj.get("date_of_expiry"),
222
+ "personal_number": obj.get("personal_number"),
223
+ "document_numbers": [DocumentPropertiesDocumentNumbersInner.from_dict(_item) for _item in obj["document_numbers"]] if obj.get("document_numbers") is not None else None,
224
+ "document_type": obj.get("document_type"),
225
+ "first_name": obj.get("first_name"),
226
+ "middle_name": obj.get("middle_name"),
227
+ "last_name": obj.get("last_name"),
228
+ "gender": obj.get("gender"),
229
+ "issuing_country": obj.get("issuing_country"),
230
+ "nationality": obj.get("nationality"),
231
+ "issuing_state": obj.get("issuing_state"),
232
+ "issuing_date": obj.get("issuing_date"),
233
+ "categorisation": obj.get("categorisation"),
234
+ "mrz_line1": obj.get("mrz_line1"),
235
+ "mrz_line2": obj.get("mrz_line2"),
236
+ "mrz_line3": obj.get("mrz_line3"),
237
+ "address": obj.get("address"),
238
+ "place_of_birth": obj.get("place_of_birth"),
239
+ "spouse_name": obj.get("spouse_name"),
240
+ "widow_name": obj.get("widow_name"),
241
+ "alias_name": obj.get("alias_name"),
242
+ "issuing_authority": obj.get("issuing_authority"),
243
+ "remarks": obj.get("remarks"),
244
+ "civil_state": obj.get("civil_state"),
245
+ "expatriation": obj.get("expatriation"),
246
+ "father_name": obj.get("father_name"),
247
+ "mother_name": obj.get("mother_name"),
248
+ "religion": obj.get("religion"),
249
+ "type_of_permit": obj.get("type_of_permit"),
250
+ "version_number": obj.get("version_number"),
251
+ "document_subtype": obj.get("document_subtype"),
252
+ "profession": obj.get("profession"),
253
+ "security_document_number": obj.get("security_document_number"),
254
+ "tax_number": obj.get("tax_number"),
255
+ "nist_identity_evidence_strength": obj.get("nist_identity_evidence_strength"),
256
+ "has_issuance_confirmation": obj.get("has_issuance_confirmation"),
257
+ "real_id_compliance": obj.get("real_id_compliance"),
258
+ "security_tier": obj.get("security_tier"),
259
+ "address_lines": DocumentPropertiesAddressLines.from_dict(obj["address_lines"]) if obj.get("address_lines") is not None else None,
260
+ "barcode": [DocumentPropertiesBarcodeInner.from_dict(_item) for _item in obj["barcode"]] if obj.get("barcode") is not None else None,
261
+ "nfc": DocumentPropertiesNfc.from_dict(obj["nfc"]) if obj.get("nfc") is not None else None,
262
+ "driving_licence_information": DocumentPropertiesDrivingLicenceInformation.from_dict(obj["driving_licence_information"]) if obj.get("driving_licence_information") is not None else None,
263
+ "document_classification": DocumentPropertiesDocumentClassification.from_dict(obj["document_classification"]) if obj.get("document_classification") is not None else None,
264
+ "extracted_data": DocumentPropertiesExtractedData.from_dict(obj["extracted_data"]) if obj.get("extracted_data") is not None else None,
265
+ "drivers_licence": obj.get("drivers_licence"),
266
+ "restricted_licence": obj.get("restricted_licence"),
267
+ "raw_licence_category": obj.get("raw_licence_category"),
268
+ "raw_vehicle_classes": obj.get("raw_vehicle_classes"),
269
+ "vehicle_class_details": [DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner.from_dict(_item) for _item in obj["vehicle_class_details"]] if obj.get("vehicle_class_details") is not None else None,
270
+ "passenger_vehicle": DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle.from_dict(obj["passenger_vehicle"]) if obj.get("passenger_vehicle") is not None else None
271
+ })
272
+ # store additional fields in additional_properties
273
+ for _key in obj.keys():
274
+ if _key not in cls.__properties:
275
+ _obj.additional_properties[_key] = obj.get(_key)
276
+
277
+ return _obj
278
+
279
+
@@ -0,0 +1,105 @@
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, StrictBool
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle(BaseModel):
27
+ """
28
+ Normalised data for passenger cars
29
+ """ # noqa: E501
30
+ is_qualified: Optional[StrictBool] = Field(default=None, description="Whether they are qualified for a passenger car, such as a “B” class in the UK")
31
+ obtainment_date: Optional[date] = Field(default=None, description="Date the class qualification was obtained")
32
+ expiry_date: Optional[date] = Field(default=None, description="Date the class qualification expires, which may be different to doc expiry")
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["is_qualified", "obtainment_date", "expiry_date"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ * Fields in `self.additional_properties` are added to the output dict.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ "additional_properties",
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # puts key-value pairs in additional_properties in the top level
78
+ if self.additional_properties is not None:
79
+ for _key, _value in self.additional_properties.items():
80
+ _dict[_key] = _value
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of DocumentWithDriverVerificationReportAllOfPropertiesAllOfPassengerVehicle from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "is_qualified": obj.get("is_qualified"),
95
+ "obtainment_date": obj.get("obtainment_date"),
96
+ "expiry_date": obj.get("expiry_date")
97
+ })
98
+ # store additional fields in additional_properties
99
+ for _key in obj.keys():
100
+ if _key not in cls.__properties:
101
+ _obj.additional_properties[_key] = obj.get(_key)
102
+
103
+ return _obj
104
+
105
+
@@ -0,0 +1,107 @@
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, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner(BaseModel):
27
+ """
28
+ DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner
29
+ """ # noqa: E501
30
+ category: Optional[StrictStr] = Field(default=None, description="Vehicle class/category")
31
+ codes: Optional[StrictStr] = Field(default=None, description="Special conditions driver must meet")
32
+ obtainment_date: Optional[date] = Field(default=None, description="Category obtainment date")
33
+ expiry_date: Optional[date] = Field(default=None, description="Category expiry date")
34
+ additional_properties: Dict[str, Any] = {}
35
+ __properties: ClassVar[List[str]] = ["category", "codes", "obtainment_date", "expiry_date"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ * Fields in `self.additional_properties` are added to the output dict.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "additional_properties",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # puts key-value pairs in additional_properties in the top level
79
+ if self.additional_properties is not None:
80
+ for _key, _value in self.additional_properties.items():
81
+ _dict[_key] = _value
82
+
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of DocumentWithDriverVerificationReportAllOfPropertiesAllOfVehicleClassDetailsInner from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "category": obj.get("category"),
96
+ "codes": obj.get("codes"),
97
+ "obtainment_date": obj.get("obtainment_date"),
98
+ "expiry_date": obj.get("expiry_date")
99
+ })
100
+ # store additional fields in additional_properties
101
+ for _key in obj.keys():
102
+ if _key not in cls.__properties:
103
+ _obj.additional_properties[_key] = obj.get(_key)
104
+
105
+ return _obj
106
+
107
+
@@ -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_breakdown import DocumentBreakdown
24
+ from onfido.models.document_properties import DocumentProperties
25
+ from onfido.models.report_document import ReportDocument
26
+ from onfido.models.report_name import ReportName
27
+ from onfido.models.report_result import ReportResult
28
+ from onfido.models.report_status import ReportStatus
29
+ from onfido.models.report_sub_result import ReportSubResult
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class DocumentWithDrivingLicenceInformationReport(BaseModel):
34
+ """
35
+ DocumentWithDrivingLicenceInformationReport
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[DocumentBreakdown] = 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 DocumentWithDrivingLicenceInformationReport 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 DocumentWithDrivingLicenceInformationReport 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": DocumentBreakdown.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
+