onfido-python 3.5.0__py3-none-any.whl → 4.1.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 (85) hide show
  1. onfido/__init__.py +11 -6
  2. onfido/api/default_api.py +611 -416
  3. onfido/api_client.py +38 -11
  4. onfido/configuration.py +14 -3
  5. onfido/models/__init__.py +10 -5
  6. onfido/models/addresses_list.py +3 -3
  7. onfido/models/applicant.py +3 -3
  8. onfido/models/applicant_builder.py +12 -8
  9. onfido/models/{consents_builder.py → applicant_consent_builder.py} +11 -6
  10. onfido/models/applicant_consent_name.py +38 -0
  11. onfido/models/applicant_request.py +10 -6
  12. onfido/models/applicant_shared.py +3 -3
  13. onfido/models/applicant_updater.py +12 -8
  14. onfido/models/applicants_list.py +3 -3
  15. onfido/models/check.py +10 -13
  16. onfido/models/check_builder.py +3 -1
  17. onfido/models/check_response.py +7 -13
  18. onfido/models/check_shared.py +4 -2
  19. onfido/models/check_status.py +41 -0
  20. onfido/models/checks_list.py +3 -3
  21. onfido/models/device_intelligence_breakdown_properties_device.py +1 -9
  22. onfido/models/device_intelligence_breakdown_properties_ip.py +2 -8
  23. onfido/models/device_intelligence_report.py +3 -3
  24. onfido/models/document.py +2 -1
  25. onfido/models/document_properties.py +8 -12
  26. onfido/models/{document_properties_barcode_inner.py → document_properties_barcode.py} +4 -4
  27. onfido/models/document_report.py +3 -3
  28. onfido/models/document_shared.py +2 -1
  29. onfido/models/document_types.py +5 -0
  30. onfido/models/document_video_report.py +3 -3
  31. onfido/models/document_video_with_address_information_report.py +3 -3
  32. onfido/models/document_with_address_information_report.py +3 -3
  33. onfido/models/document_with_driver_verification_report.py +3 -3
  34. onfido/models/document_with_driver_verification_report_all_of_properties.py +11 -15
  35. onfido/models/document_with_driving_licence_information_report.py +3 -3
  36. onfido/models/documents_list.py +3 -3
  37. onfido/models/facial_similarity_motion_report.py +3 -3
  38. onfido/models/facial_similarity_photo_fully_auto_report.py +3 -3
  39. onfido/models/facial_similarity_photo_report.py +3 -3
  40. onfido/models/facial_similarity_video_report.py +3 -3
  41. onfido/models/id_photos_list.py +3 -3
  42. onfido/models/identity_enhanced_properties.py +3 -3
  43. onfido/models/identity_enhanced_report.py +3 -3
  44. onfido/models/india_pan_report.py +3 -3
  45. onfido/models/known_faces_properties.py +3 -3
  46. onfido/models/known_faces_report.py +3 -3
  47. onfido/models/live_photos_list.py +3 -3
  48. onfido/models/live_videos_list.py +3 -3
  49. onfido/models/motion_captures_list.py +3 -3
  50. onfido/models/proof_of_address_report.py +3 -3
  51. onfido/models/repeat_attempts_list.py +3 -3
  52. onfido/models/report_shared.py +3 -3
  53. onfido/models/reports_list.py +3 -3
  54. onfido/models/task_item.py +11 -2
  55. onfido/models/us_driving_licence_report.py +3 -3
  56. onfido/models/watchlist_aml_report.py +3 -3
  57. onfido/models/watchlist_enhanced_properties.py +3 -3
  58. onfido/models/watchlist_enhanced_properties_records_inner.py +18 -18
  59. onfido/models/watchlist_enhanced_report.py +3 -3
  60. onfido/models/watchlist_monitor_matches_list.py +3 -3
  61. onfido/models/watchlist_monitors_list.py +3 -3
  62. onfido/models/watchlist_peps_only_report.py +3 -3
  63. onfido/models/watchlist_sanctions_only_report.py +3 -3
  64. onfido/models/watchlist_standard_report.py +3 -3
  65. onfido/models/webhook_event_object_status.py +54 -0
  66. onfido/models/webhook_event_payload.py +9 -4
  67. onfido/models/webhook_event_payload_object.py +2 -1
  68. onfido/models/webhook_event_payload_resource.py +158 -0
  69. onfido/models/webhook_event_resource_type.py +41 -0
  70. onfido/models/webhook_resend.py +3 -3
  71. onfido/models/webhooks_list.py +3 -3
  72. onfido/models/workflow_run.py +9 -18
  73. onfido/models/workflow_run_builder.py +3 -3
  74. onfido/models/{workflow_run_response_error.py → workflow_run_error.py} +4 -4
  75. onfido/models/{workflow_run_shared_link.py → workflow_run_link.py} +24 -4
  76. onfido/models/workflow_run_response.py +6 -15
  77. onfido/models/workflow_run_shared.py +3 -3
  78. onfido/models/workflow_run_status.py +43 -0
  79. onfido/rest.py +1 -1
  80. {onfido_python-3.5.0.dist-info → onfido_python-4.1.0.dist-info}/METADATA +3 -3
  81. {onfido_python-3.5.0.dist-info → onfido_python-4.1.0.dist-info}/RECORD +84 -79
  82. {onfido_python-3.5.0.dist-info → onfido_python-4.1.0.dist-info}/WHEEL +1 -1
  83. onfido/models/consent_item.py +0 -109
  84. {onfido_python-3.5.0.dist-info → onfido_python-4.1.0.dist-info}/LICENSE +0 -0
  85. {onfido_python-3.5.0.dist-info → onfido_python-4.1.0.dist-info}/top_level.txt +0 -0
@@ -30,24 +30,16 @@ class CheckResponse(BaseModel):
30
30
  id: StrictStr = Field(description="The unique identifier for the check.")
31
31
  created_at: Optional[datetime] = Field(default=None, description="The date and time when this check was created.")
32
32
  href: Optional[StrictStr] = Field(default=None, description="The uri of this resource.")
33
- status: Optional[StrictStr] = Field(default=None, description="The current state of the check in the checking process.")
33
+ status: Optional[StrictStr] = None
34
34
  result: Optional[StrictStr] = Field(default=None, description="The overall result of the check, based on the results of the constituent reports.")
35
35
  form_uri: Optional[StrictStr] = Field(default=None, description="A link to the applicant form, if `applicant_provides_data` is `true`.")
36
36
  results_uri: Optional[StrictStr] = Field(default=None, description="A link to the corresponding results page on the Onfido dashboard.")
37
37
  report_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of report ids.")
38
38
  sandbox: Optional[StrictBool] = Field(default=None, description="Indicates whether the object was created in the sandbox or not.")
39
+ paused: Optional[StrictBool] = None
40
+ version: Optional[StrictStr] = None
39
41
  additional_properties: Dict[str, Any] = {}
40
- __properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "form_uri", "results_uri", "report_ids", "sandbox"]
41
-
42
- @field_validator('status')
43
- def status_validate_enum(cls, value):
44
- """Validates the enum"""
45
- if value is None:
46
- return value
47
-
48
- if value not in set(['in_progress', 'awaiting_applicant', 'complete', 'withdrawn', 'paused', 'reopened']):
49
- raise ValueError("must be one of enum values ('in_progress', 'awaiting_applicant', 'complete', 'withdrawn', 'paused', 'reopened')")
50
- return value
42
+ __properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "form_uri", "results_uri", "report_ids", "sandbox", "paused", "version"]
51
43
 
52
44
  @field_validator('result')
53
45
  def result_validate_enum(cls, value):
@@ -125,7 +117,9 @@ class CheckResponse(BaseModel):
125
117
  "form_uri": obj.get("form_uri"),
126
118
  "results_uri": obj.get("results_uri"),
127
119
  "report_ids": obj.get("report_ids"),
128
- "sandbox": obj.get("sandbox")
120
+ "sandbox": obj.get("sandbox"),
121
+ "paused": obj.get("paused"),
122
+ "version": obj.get("version")
129
123
  })
130
124
  # store additional fields in additional_properties
131
125
  for _key in obj.keys():
@@ -31,8 +31,9 @@ class CheckShared(BaseModel):
31
31
  applicant_provides_data: Optional[StrictBool] = Field(default=None, description="Send an applicant form to applicant to complete to proceed with check. Defaults to false. ")
32
32
  tags: Optional[List[StrictStr]] = Field(default=None, description="Array of tags being assigned to this check.")
33
33
  redirect_uri: Optional[StrictStr] = Field(default=None, description="For checks where `applicant_provides_data` is `true`, redirect to this URI when the applicant has submitted their data.")
34
+ privacy_notices_read_consent_given: Optional[StrictBool] = None
34
35
  additional_properties: Dict[str, Any] = {}
35
- __properties: ClassVar[List[str]] = ["webhook_ids", "applicant_id", "applicant_provides_data", "tags", "redirect_uri"]
36
+ __properties: ClassVar[List[str]] = ["webhook_ids", "applicant_id", "applicant_provides_data", "tags", "redirect_uri", "privacy_notices_read_consent_given"]
36
37
 
37
38
  model_config = ConfigDict(
38
39
  populate_by_name=True,
@@ -96,7 +97,8 @@ class CheckShared(BaseModel):
96
97
  "applicant_id": obj.get("applicant_id"),
97
98
  "applicant_provides_data": obj.get("applicant_provides_data"),
98
99
  "tags": obj.get("tags"),
99
- "redirect_uri": obj.get("redirect_uri")
100
+ "redirect_uri": obj.get("redirect_uri"),
101
+ "privacy_notices_read_consent_given": obj.get("privacy_notices_read_consent_given")
100
102
  })
101
103
  # store additional fields in additional_properties
102
104
  for _key in obj.keys():
@@ -0,0 +1,41 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class CheckStatus(str, Enum):
22
+ """
23
+ The current state of the check in the checking process.
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ IN_PROGRESS = 'in_progress'
30
+ AWAITING_APPLICANT = 'awaiting_applicant'
31
+ COMPLETE = 'complete'
32
+ WITHDRAWN = 'withdrawn'
33
+ PAUSED = 'paused'
34
+ REOPENED = 'reopened'
35
+
36
+ @classmethod
37
+ def from_json(cls, json_str: str) -> Self:
38
+ """Create an instance of CheckStatus from a JSON string"""
39
+ return cls(json.loads(json_str))
40
+
41
+
@@ -75,9 +75,9 @@ class ChecksList(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in checks (list)
76
76
  _items = []
77
77
  if self.checks:
78
- for _item in self.checks:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_checks in self.checks:
79
+ if _item_checks:
80
+ _items.append(_item_checks.to_dict())
81
81
  _dict['checks'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -35,17 +35,13 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
35
35
  emulator: Optional[StrictBool] = Field(default=None, description="Whether the device is an emulator.")
36
36
  randomized_device: Optional[StrictBool] = Field(default=None, description="Whether the device is providing false randomized device and network information.")
37
37
  fake_network_request: Optional[StrictBool] = Field(default=None, description="Whether device is using stolen security tokens to send the network information.")
38
- true_os: Optional[StrictStr] = Field(default=None, description="The true operating system of the device.")
39
- os_anomaly: Optional[StrictStr] = Field(default=None, description="The likelihood of an operating system anomaly between the true OS and the OS sent by the device.")
40
- rooted: Optional[StrictBool] = Field(default=None, description="Whether the device is rooted.")
41
- remote_software: Optional[StrictBool] = Field(default=None, description="Whether the device is controlled via remote software.")
42
38
  ip_reputation: Optional[StrictStr] = Field(default=None, description="Whether there is highly suspicious traffic related to the IP address. The risk depends on the overall ratio of clear checks on a given IP.")
43
39
  device_fingerprint_reuse: Optional[StrictInt] = Field(default=None, description="The number of times the device was used to create a report for a new applicant. A value greater than 1 indicates potential device reuse.")
44
40
  single_device_used: Optional[StrictBool] = Field(default=None, description="Whether the document or biometric media were uploaded from a single device.")
45
41
  document_capture: Optional[StrictStr] = Field(default=None, description="Whether the document media were live captured from the device camera.")
46
42
  biometric_capture: Optional[StrictStr] = Field(default=None, description="Whether the biometric media were live captured from the device camera.")
47
43
  additional_properties: Dict[str, Any] = {}
48
- __properties: ClassVar[List[str]] = ["sdk_version", "sdk_source", "authentication_type", "raw_model", "os", "browser", "emulator", "randomized_device", "fake_network_request", "true_os", "os_anomaly", "rooted", "remote_software", "ip_reputation", "device_fingerprint_reuse", "single_device_used", "document_capture", "biometric_capture"]
44
+ __properties: ClassVar[List[str]] = ["sdk_version", "sdk_source", "authentication_type", "raw_model", "os", "browser", "emulator", "randomized_device", "fake_network_request", "ip_reputation", "device_fingerprint_reuse", "single_device_used", "document_capture", "biometric_capture"]
49
45
 
50
46
  @field_validator('sdk_source')
51
47
  def sdk_source_validate_enum(cls, value):
@@ -169,10 +165,6 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
169
165
  "emulator": obj.get("emulator"),
170
166
  "randomized_device": obj.get("randomized_device"),
171
167
  "fake_network_request": obj.get("fake_network_request"),
172
- "true_os": obj.get("true_os"),
173
- "os_anomaly": obj.get("os_anomaly"),
174
- "rooted": obj.get("rooted"),
175
- "remote_software": obj.get("remote_software"),
176
168
  "ip_reputation": obj.get("ip_reputation"),
177
169
  "device_fingerprint_reuse": obj.get("device_fingerprint_reuse"),
178
170
  "single_device_used": obj.get("single_device_used"),
@@ -27,11 +27,8 @@ class DeviceIntelligenceBreakdownPropertiesIp(BaseModel):
27
27
  DeviceIntelligenceBreakdownPropertiesIp
28
28
  """ # noqa: E501
29
29
  address: Optional[StrictStr] = Field(default=None, description="The IP address that uploaded the media.")
30
- vpn_detection: Optional[StrictStr] = Field(default=None, description="The likelihood of the network connection being a VPN.")
31
- proxy_detection: Optional[StrictStr] = Field(default=None, description="The likelihood of the network connection being a Proxy.")
32
- type: Optional[StrictStr] = Field(default=None, description="The type of organization that owns this IP address.")
33
30
  additional_properties: Dict[str, Any] = {}
34
- __properties: ClassVar[List[str]] = ["address", "vpn_detection", "proxy_detection", "type"]
31
+ __properties: ClassVar[List[str]] = ["address"]
35
32
 
36
33
  model_config = ConfigDict(
37
34
  populate_by_name=True,
@@ -91,10 +88,7 @@ class DeviceIntelligenceBreakdownPropertiesIp(BaseModel):
91
88
  return cls.model_validate(obj)
92
89
 
93
90
  _obj = cls.model_validate({
94
- "address": obj.get("address"),
95
- "vpn_detection": obj.get("vpn_detection"),
96
- "proxy_detection": obj.get("proxy_detection"),
97
- "type": obj.get("type")
91
+ "address": obj.get("address")
98
92
  })
99
93
  # store additional fields in additional_properties
100
94
  for _key in obj.keys():
@@ -90,9 +90,9 @@ class DeviceIntelligenceReport(BaseModel):
90
90
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
91
91
  _items = []
92
92
  if self.documents:
93
- for _item in self.documents:
94
- if _item:
95
- _items.append(_item.to_dict())
93
+ for _item_documents in self.documents:
94
+ if _item_documents:
95
+ _items.append(_item_documents.to_dict())
96
96
  _dict['documents'] = _items
97
97
  # override the default output from pydantic by calling `to_dict()` of breakdown
98
98
  if self.breakdown:
onfido/models/document.py CHANGED
@@ -21,6 +21,7 @@ from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from onfido.models.country_codes import CountryCodes
24
+ from onfido.models.document_types import DocumentTypes
24
25
  from typing import Optional, Set
25
26
  from typing_extensions import Self
26
27
 
@@ -29,7 +30,7 @@ class Document(BaseModel):
29
30
  Document
30
31
  """ # noqa: E501
31
32
  file_type: Optional[StrictStr] = Field(default=None, description="The file type of the uploaded file")
32
- type: Optional[StrictStr] = Field(default=None, description="The type of document")
33
+ type: Optional[DocumentTypes] = Field(default=None, description="The type of document")
33
34
  side: Optional[StrictStr] = Field(default=None, description="The side of the document, if applicable. The possible values are front and back")
34
35
  issuing_country: Optional[CountryCodes] = Field(default=None, description="The issuing country of the document, a 3-letter ISO code.")
35
36
  applicant_id: Optional[StrictStr] = Field(default=None, description="The ID of the applicant whose document is being uploaded.")
@@ -21,7 +21,7 @@ from datetime import date
21
21
  from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from onfido.models.document_properties_address_lines import DocumentPropertiesAddressLines
24
- from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
24
+ from onfido.models.document_properties_barcode import DocumentPropertiesBarcode
25
25
  from onfido.models.document_properties_document_classification import DocumentPropertiesDocumentClassification
26
26
  from onfido.models.document_properties_document_numbers_inner import DocumentPropertiesDocumentNumbersInner
27
27
  from onfido.models.document_properties_driving_licence_information import DocumentPropertiesDrivingLicenceInformation
@@ -74,7 +74,7 @@ class DocumentProperties(BaseModel):
74
74
  real_id_compliance: Optional[StrictBool] = None
75
75
  security_tier: Optional[StrictStr] = None
76
76
  address_lines: Optional[DocumentPropertiesAddressLines] = None
77
- barcode: Optional[List[DocumentPropertiesBarcodeInner]] = None
77
+ barcode: Optional[DocumentPropertiesBarcode] = None
78
78
  nfc: Optional[DocumentPropertiesNfc] = None
79
79
  driving_licence_information: Optional[DocumentPropertiesDrivingLicenceInformation] = None
80
80
  document_classification: Optional[DocumentPropertiesDocumentClassification] = None
@@ -156,20 +156,16 @@ class DocumentProperties(BaseModel):
156
156
  # override the default output from pydantic by calling `to_dict()` of each item in document_numbers (list)
157
157
  _items = []
158
158
  if self.document_numbers:
159
- for _item in self.document_numbers:
160
- if _item:
161
- _items.append(_item.to_dict())
159
+ for _item_document_numbers in self.document_numbers:
160
+ if _item_document_numbers:
161
+ _items.append(_item_document_numbers.to_dict())
162
162
  _dict['document_numbers'] = _items
163
163
  # override the default output from pydantic by calling `to_dict()` of address_lines
164
164
  if self.address_lines:
165
165
  _dict['address_lines'] = self.address_lines.to_dict()
166
- # override the default output from pydantic by calling `to_dict()` of each item in barcode (list)
167
- _items = []
166
+ # override the default output from pydantic by calling `to_dict()` of barcode
168
167
  if self.barcode:
169
- for _item in self.barcode:
170
- if _item:
171
- _items.append(_item.to_dict())
172
- _dict['barcode'] = _items
168
+ _dict['barcode'] = self.barcode.to_dict()
173
169
  # override the default output from pydantic by calling `to_dict()` of nfc
174
170
  if self.nfc:
175
171
  _dict['nfc'] = self.nfc.to_dict()
@@ -239,7 +235,7 @@ class DocumentProperties(BaseModel):
239
235
  "real_id_compliance": obj.get("real_id_compliance"),
240
236
  "security_tier": obj.get("security_tier"),
241
237
  "address_lines": DocumentPropertiesAddressLines.from_dict(obj["address_lines"]) if obj.get("address_lines") is not None else None,
242
- "barcode": [DocumentPropertiesBarcodeInner.from_dict(_item) for _item in obj["barcode"]] if obj.get("barcode") is not None else None,
238
+ "barcode": DocumentPropertiesBarcode.from_dict(obj["barcode"]) if obj.get("barcode") is not None else None,
243
239
  "nfc": DocumentPropertiesNfc.from_dict(obj["nfc"]) if obj.get("nfc") is not None else None,
244
240
  "driving_licence_information": DocumentPropertiesDrivingLicenceInformation.from_dict(obj["driving_licence_information"]) if obj.get("driving_licence_information") is not None else None,
245
241
  "document_classification": DocumentPropertiesDocumentClassification.from_dict(obj["document_classification"]) if obj.get("document_classification") is not None else None,
@@ -23,9 +23,9 @@ from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class DocumentPropertiesBarcodeInner(BaseModel):
26
+ class DocumentPropertiesBarcode(BaseModel):
27
27
  """
28
- DocumentPropertiesBarcodeInner
28
+ DocumentPropertiesBarcode
29
29
  """ # noqa: E501
30
30
  first_name: Optional[StrictStr] = None
31
31
  middle_name: Optional[StrictStr] = None
@@ -66,7 +66,7 @@ class DocumentPropertiesBarcodeInner(BaseModel):
66
66
 
67
67
  @classmethod
68
68
  def from_json(cls, json_str: str) -> Optional[Self]:
69
- """Create an instance of DocumentPropertiesBarcodeInner from a JSON string"""
69
+ """Create an instance of DocumentPropertiesBarcode from a JSON string"""
70
70
  return cls.from_dict(json.loads(json_str))
71
71
 
72
72
  def to_dict(self) -> Dict[str, Any]:
@@ -98,7 +98,7 @@ class DocumentPropertiesBarcodeInner(BaseModel):
98
98
 
99
99
  @classmethod
100
100
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
101
- """Create an instance of DocumentPropertiesBarcodeInner from a dict"""
101
+ """Create an instance of DocumentPropertiesBarcode from a dict"""
102
102
  if obj is None:
103
103
  return None
104
104
 
@@ -92,9 +92,9 @@ class DocumentReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -20,6 +20,7 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from onfido.models.country_codes import CountryCodes
23
+ from onfido.models.document_types import DocumentTypes
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
26
 
@@ -28,7 +29,7 @@ class DocumentShared(BaseModel):
28
29
  DocumentShared
29
30
  """ # noqa: E501
30
31
  file_type: Optional[StrictStr] = Field(default=None, description="The file type of the uploaded file")
31
- type: Optional[StrictStr] = Field(default=None, description="The type of document")
32
+ type: Optional[DocumentTypes] = Field(default=None, description="The type of document")
32
33
  side: Optional[StrictStr] = Field(default=None, description="The side of the document, if applicable. The possible values are front and back")
33
34
  issuing_country: Optional[CountryCodes] = Field(default=None, description="The issuing country of the document, a 3-letter ISO code.")
34
35
  applicant_id: Optional[StrictStr] = Field(default=None, description="The ID of the applicant whose document is being uploaded.")
@@ -51,6 +51,11 @@ class DocumentTypes(str, Enum):
51
51
  PROFESSIONAL_QUALIFICATION_CARD = 'professional_qualification_card'
52
52
  CONSULAR_ID = 'consular_id'
53
53
  INTERNATIONAL_DRIVING_LICENCE = 'international_driving_licence'
54
+ HOME_OFFICE_LETTER = 'home_office_letter'
55
+ BIRTH_CERTIFICATE = 'birth_certificate'
56
+ VEHICLE_REGISTRATION_CERTIFICATE = 'vehicle_registration_certificate'
57
+ FORM_FOR_AFFIXING_THE_VISA = 'form_for_affixing_the_visa'
58
+ IDENTIFICATION_NUMBER_DOCUMENT = 'identification_number_document'
54
59
 
55
60
  @classmethod
56
61
  def from_json(cls, json_str: str) -> Self:
@@ -92,9 +92,9 @@ class DocumentVideoReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class DocumentVideoWithAddressInformationReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class DocumentWithAddressInformationReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class DocumentWithDriverVerificationReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -21,7 +21,7 @@ from datetime import date
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from onfido.models.document_properties_address_lines import DocumentPropertiesAddressLines
24
- from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
24
+ from onfido.models.document_properties_barcode import DocumentPropertiesBarcode
25
25
  from onfido.models.document_properties_document_classification import DocumentPropertiesDocumentClassification
26
26
  from onfido.models.document_properties_document_numbers_inner import DocumentPropertiesDocumentNumbersInner
27
27
  from onfido.models.document_properties_driving_licence_information import DocumentPropertiesDrivingLicenceInformation
@@ -76,7 +76,7 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
76
76
  real_id_compliance: Optional[StrictBool] = None
77
77
  security_tier: Optional[StrictStr] = None
78
78
  address_lines: Optional[DocumentPropertiesAddressLines] = None
79
- barcode: Optional[List[DocumentPropertiesBarcodeInner]] = None
79
+ barcode: Optional[DocumentPropertiesBarcode] = None
80
80
  nfc: Optional[DocumentPropertiesNfc] = None
81
81
  driving_licence_information: Optional[DocumentPropertiesDrivingLicenceInformation] = None
82
82
  document_classification: Optional[DocumentPropertiesDocumentClassification] = None
@@ -164,20 +164,16 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
164
164
  # override the default output from pydantic by calling `to_dict()` of each item in document_numbers (list)
165
165
  _items = []
166
166
  if self.document_numbers:
167
- for _item in self.document_numbers:
168
- if _item:
169
- _items.append(_item.to_dict())
167
+ for _item_document_numbers in self.document_numbers:
168
+ if _item_document_numbers:
169
+ _items.append(_item_document_numbers.to_dict())
170
170
  _dict['document_numbers'] = _items
171
171
  # override the default output from pydantic by calling `to_dict()` of address_lines
172
172
  if self.address_lines:
173
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 = []
174
+ # override the default output from pydantic by calling `to_dict()` of barcode
176
175
  if self.barcode:
177
- for _item in self.barcode:
178
- if _item:
179
- _items.append(_item.to_dict())
180
- _dict['barcode'] = _items
176
+ _dict['barcode'] = self.barcode.to_dict()
181
177
  # override the default output from pydantic by calling `to_dict()` of nfc
182
178
  if self.nfc:
183
179
  _dict['nfc'] = self.nfc.to_dict()
@@ -193,9 +189,9 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
193
189
  # override the default output from pydantic by calling `to_dict()` of each item in vehicle_class_details (list)
194
190
  _items = []
195
191
  if self.vehicle_class_details:
196
- for _item in self.vehicle_class_details:
197
- if _item:
198
- _items.append(_item.to_dict())
192
+ for _item_vehicle_class_details in self.vehicle_class_details:
193
+ if _item_vehicle_class_details:
194
+ _items.append(_item_vehicle_class_details.to_dict())
199
195
  _dict['vehicle_class_details'] = _items
200
196
  # override the default output from pydantic by calling `to_dict()` of passenger_vehicle
201
197
  if self.passenger_vehicle:
@@ -257,7 +253,7 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
257
253
  "real_id_compliance": obj.get("real_id_compliance"),
258
254
  "security_tier": obj.get("security_tier"),
259
255
  "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,
256
+ "barcode": DocumentPropertiesBarcode.from_dict(obj["barcode"]) if obj.get("barcode") is not None else None,
261
257
  "nfc": DocumentPropertiesNfc.from_dict(obj["nfc"]) if obj.get("nfc") is not None else None,
262
258
  "driving_licence_information": DocumentPropertiesDrivingLicenceInformation.from_dict(obj["driving_licence_information"]) if obj.get("driving_licence_information") is not None else None,
263
259
  "document_classification": DocumentPropertiesDocumentClassification.from_dict(obj["document_classification"]) if obj.get("document_classification") is not None else None,
@@ -92,9 +92,9 @@ class DocumentWithDrivingLicenceInformationReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -75,9 +75,9 @@ class DocumentsList(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
76
76
  _items = []
77
77
  if self.documents:
78
- for _item in self.documents:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_documents in self.documents:
79
+ if _item_documents:
80
+ _items.append(_item_documents.to_dict())
81
81
  _dict['documents'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -92,9 +92,9 @@ class FacialSimilarityMotionReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class FacialSimilarityPhotoFullyAutoReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class FacialSimilarityPhotoReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class FacialSimilarityVideoReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -75,9 +75,9 @@ class IdPhotosList(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in id_photos (list)
76
76
  _items = []
77
77
  if self.id_photos:
78
- for _item in self.id_photos:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_id_photos in self.id_photos:
79
+ if _item_id_photos:
80
+ _items.append(_item_id_photos.to_dict())
81
81
  _dict['id_photos'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -76,9 +76,9 @@ class IdentityEnhancedProperties(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in matched_addresses (list)
77
77
  _items = []
78
78
  if self.matched_addresses:
79
- for _item in self.matched_addresses:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_matched_addresses in self.matched_addresses:
80
+ if _item_matched_addresses:
81
+ _items.append(_item_matched_addresses.to_dict())
82
82
  _dict['matched_addresses'] = _items
83
83
  # puts key-value pairs in additional_properties in the top level
84
84
  if self.additional_properties is not None:
@@ -92,9 +92,9 @@ class IdentityEnhancedReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class IndiaPanReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -75,9 +75,9 @@ class KnownFacesProperties(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in matches (list)
76
76
  _items = []
77
77
  if self.matches:
78
- for _item in self.matches:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_matches in self.matches:
79
+ if _item_matches:
80
+ _items.append(_item_matches.to_dict())
81
81
  _dict['matches'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None: