onfido-python 4.6.0__py3-none-any.whl → 5.0.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.
- onfido/__init__.py +2 -1
- onfido/api/default_api.py +279 -0
- onfido/api_client.py +2 -2
- onfido/configuration.py +151 -39
- onfido/exceptions.py +17 -0
- onfido/models/__init__.py +1 -0
- onfido/models/applicant_consent_name.py +1 -0
- onfido/models/check.py +2 -2
- onfido/models/check_response.py +2 -2
- onfido/models/check_status.py +1 -0
- onfido/models/country_codes.py +1 -0
- onfido/models/device_intelligence_breakdown_properties_device.py +10 -10
- onfido/models/device_intelligence_report.py +1 -11
- onfido/models/document.py +2 -12
- onfido/models/document_properties.py +6 -6
- onfido/models/document_report.py +3 -3
- onfido/models/document_report_shared.py +108 -0
- onfido/models/document_shared.py +2 -12
- onfido/models/document_types.py +1 -0
- onfido/models/document_video_report.py +3 -3
- onfido/models/document_video_with_address_information_report.py +3 -3
- onfido/models/document_with_address_information_report.py +3 -3
- onfido/models/document_with_driver_verification_report.py +3 -3
- onfido/models/document_with_driver_verification_report_all_of_properties.py +6 -6
- onfido/models/document_with_driving_licence_information_report.py +3 -3
- onfido/models/extraction_document_classification.py +2 -2
- onfido/models/extraction_extracted_data.py +2 -2
- onfido/models/facial_similarity_motion_report.py +3 -3
- onfido/models/facial_similarity_photo_fully_auto_report.py +3 -3
- onfido/models/facial_similarity_photo_report.py +3 -3
- onfido/models/facial_similarity_report_shared.py +11 -1
- onfido/models/facial_similarity_video_report.py +3 -3
- onfido/models/id_number.py +2 -2
- onfido/models/identity_enhanced_report.py +1 -11
- onfido/models/india_pan_report.py +1 -11
- onfido/models/known_faces_report.py +1 -11
- onfido/models/proof_of_address_properties.py +2 -2
- onfido/models/proof_of_address_report.py +1 -11
- onfido/models/repeat_attempts_list_repeat_attempts_inner.py +6 -6
- onfido/models/report_name.py +1 -0
- onfido/models/report_result.py +1 -0
- onfido/models/report_shared.py +1 -11
- onfido/models/report_status.py +1 -0
- onfido/models/report_sub_result.py +1 -0
- onfido/models/results_feedback.py +2 -2
- onfido/models/us_driving_licence_builder.py +6 -6
- onfido/models/us_driving_licence_report.py +1 -11
- onfido/models/us_driving_licence_shared.py +6 -6
- onfido/models/watchlist_aml_properties.py +2 -2
- onfido/models/watchlist_aml_report.py +1 -11
- onfido/models/watchlist_enhanced_report.py +1 -11
- onfido/models/watchlist_monitor.py +2 -2
- onfido/models/watchlist_monitor_builder.py +2 -2
- onfido/models/watchlist_monitor_shared.py +2 -2
- onfido/models/watchlist_peps_only_report.py +1 -11
- onfido/models/watchlist_sanctions_only_report.py +1 -11
- onfido/models/watchlist_standard_properties.py +2 -2
- onfido/models/watchlist_standard_report.py +1 -11
- onfido/models/webhook_event_object_status.py +1 -0
- onfido/models/webhook_event_payload_object.py +1 -1
- onfido/models/webhook_event_resource_type.py +1 -0
- onfido/models/webhook_event_type.py +1 -1
- onfido/models/workflow_run_link.py +2 -2
- onfido/models/workflow_run_status.py +1 -0
- onfido/webhook_event_verifier.py +3 -2
- {onfido_python-4.6.0.dist-info → onfido_python-5.0.0.dist-info}/METADATA +1 -1
- {onfido_python-4.6.0.dist-info → onfido_python-5.0.0.dist-info}/RECORD +70 -69
- {onfido_python-4.6.0.dist-info → onfido_python-5.0.0.dist-info}/LICENSE +0 -0
- {onfido_python-4.6.0.dist-info → onfido_python-5.0.0.dist-info}/WHEEL +0 -0
- {onfido_python-4.6.0.dist-info → onfido_python-5.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
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, Field
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from onfido.models.report_document import ReportDocument
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class DocumentReportShared(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
DocumentReportShared
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["documents"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of DocumentReportShared from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in documents (list)
|
|
76
|
+
_items = []
|
|
77
|
+
if self.documents:
|
|
78
|
+
for _item_documents in self.documents:
|
|
79
|
+
if _item_documents:
|
|
80
|
+
_items.append(_item_documents.to_dict())
|
|
81
|
+
_dict['documents'] = _items
|
|
82
|
+
# puts key-value pairs in additional_properties in the top level
|
|
83
|
+
if self.additional_properties is not None:
|
|
84
|
+
for _key, _value in self.additional_properties.items():
|
|
85
|
+
_dict[_key] = _value
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of DocumentReportShared from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None
|
|
100
|
+
})
|
|
101
|
+
# store additional fields in additional_properties
|
|
102
|
+
for _key in obj.keys():
|
|
103
|
+
if _key not in cls.__properties:
|
|
104
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
105
|
+
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
onfido/models/document_shared.py
CHANGED
|
@@ -36,24 +36,14 @@ class DocumentShared(BaseModel):
|
|
|
36
36
|
additional_properties: Dict[str, Any] = {}
|
|
37
37
|
__properties: ClassVar[List[str]] = ["file_type", "type", "side", "issuing_country", "applicant_id"]
|
|
38
38
|
|
|
39
|
-
@field_validator('file_type')
|
|
40
|
-
def file_type_validate_enum(cls, value):
|
|
41
|
-
"""Validates the enum"""
|
|
42
|
-
if value is None:
|
|
43
|
-
return value
|
|
44
|
-
|
|
45
|
-
if value not in set(['jpg', 'jpeg', 'png', 'pdf']):
|
|
46
|
-
raise ValueError("must be one of enum values ('jpg', 'jpeg', 'png', 'pdf')")
|
|
47
|
-
return value
|
|
48
|
-
|
|
49
39
|
@field_validator('side')
|
|
50
40
|
def side_validate_enum(cls, value):
|
|
51
41
|
"""Validates the enum"""
|
|
52
42
|
if value is None:
|
|
53
43
|
return value
|
|
54
44
|
|
|
55
|
-
if value not in set(['front', 'back']):
|
|
56
|
-
raise ValueError("must be one of enum values ('front', 'back')")
|
|
45
|
+
if value not in set(['front', 'back', 'unknown_default_open_api']):
|
|
46
|
+
raise ValueError("must be one of enum values ('front', 'back', 'unknown_default_open_api')")
|
|
57
47
|
return value
|
|
58
48
|
|
|
59
49
|
model_config = ConfigDict(
|
onfido/models/document_types.py
CHANGED
|
@@ -102,6 +102,7 @@ class DocumentTypes(str, Enum):
|
|
|
102
102
|
IDENTITY_DOCUMENT_WITH_ADDRESS = 'identity_document_with_address'
|
|
103
103
|
EXCHANGE_HOUSE_STATEMENT = 'exchange_house_statement'
|
|
104
104
|
ACCOMMODATION_TENANCY_CERTIFICATE = 'accommodation_tenancy_certificate'
|
|
105
|
+
UNKNOWN_DEFAULT_OPEN_API = 'unknown_default_open_api'
|
|
105
106
|
|
|
106
107
|
@classmethod
|
|
107
108
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -41,12 +41,12 @@ class DocumentVideoReport(BaseModel):
|
|
|
41
41
|
result: Optional[ReportResult] = None
|
|
42
42
|
sub_result: Optional[ReportSubResult] = None
|
|
43
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
44
|
name: ReportName
|
|
45
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
46
46
|
breakdown: Optional[DocumentBreakdown] = None
|
|
47
47
|
properties: Optional[DocumentProperties] = None
|
|
48
48
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
49
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "breakdown", "properties"]
|
|
50
50
|
|
|
51
51
|
model_config = ConfigDict(
|
|
52
52
|
populate_by_name=True,
|
|
@@ -126,8 +126,8 @@ class DocumentVideoReport(BaseModel):
|
|
|
126
126
|
"result": obj.get("result"),
|
|
127
127
|
"sub_result": obj.get("sub_result"),
|
|
128
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
129
|
"name": obj.get("name"),
|
|
130
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
131
131
|
"breakdown": DocumentBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
132
|
"properties": DocumentProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
133
133
|
})
|
|
@@ -41,12 +41,12 @@ class DocumentVideoWithAddressInformationReport(BaseModel):
|
|
|
41
41
|
result: Optional[ReportResult] = None
|
|
42
42
|
sub_result: Optional[ReportSubResult] = None
|
|
43
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
44
|
name: ReportName
|
|
45
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
46
46
|
breakdown: Optional[DocumentBreakdown] = None
|
|
47
47
|
properties: Optional[DocumentProperties] = None
|
|
48
48
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
49
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "breakdown", "properties"]
|
|
50
50
|
|
|
51
51
|
model_config = ConfigDict(
|
|
52
52
|
populate_by_name=True,
|
|
@@ -126,8 +126,8 @@ class DocumentVideoWithAddressInformationReport(BaseModel):
|
|
|
126
126
|
"result": obj.get("result"),
|
|
127
127
|
"sub_result": obj.get("sub_result"),
|
|
128
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
129
|
"name": obj.get("name"),
|
|
130
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
131
131
|
"breakdown": DocumentBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
132
|
"properties": DocumentProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
133
133
|
})
|
|
@@ -41,12 +41,12 @@ class DocumentWithAddressInformationReport(BaseModel):
|
|
|
41
41
|
result: Optional[ReportResult] = None
|
|
42
42
|
sub_result: Optional[ReportSubResult] = None
|
|
43
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
44
|
name: ReportName
|
|
45
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
46
46
|
breakdown: Optional[DocumentBreakdown] = None
|
|
47
47
|
properties: Optional[DocumentProperties] = None
|
|
48
48
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
49
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "breakdown", "properties"]
|
|
50
50
|
|
|
51
51
|
model_config = ConfigDict(
|
|
52
52
|
populate_by_name=True,
|
|
@@ -126,8 +126,8 @@ class DocumentWithAddressInformationReport(BaseModel):
|
|
|
126
126
|
"result": obj.get("result"),
|
|
127
127
|
"sub_result": obj.get("sub_result"),
|
|
128
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
129
|
"name": obj.get("name"),
|
|
130
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
131
131
|
"breakdown": DocumentBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
132
|
"properties": DocumentProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
133
133
|
})
|
|
@@ -41,12 +41,12 @@ class DocumentWithDriverVerificationReport(BaseModel):
|
|
|
41
41
|
result: Optional[ReportResult] = None
|
|
42
42
|
sub_result: Optional[ReportSubResult] = None
|
|
43
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
44
|
name: ReportName
|
|
45
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
46
46
|
breakdown: Optional[DocumentBreakdown] = None
|
|
47
47
|
properties: Optional[DocumentWithDriverVerificationReportAllOfProperties] = None
|
|
48
48
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
49
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "breakdown", "properties"]
|
|
50
50
|
|
|
51
51
|
model_config = ConfigDict(
|
|
52
52
|
populate_by_name=True,
|
|
@@ -126,8 +126,8 @@ class DocumentWithDriverVerificationReport(BaseModel):
|
|
|
126
126
|
"result": obj.get("result"),
|
|
127
127
|
"sub_result": obj.get("sub_result"),
|
|
128
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
129
|
"name": obj.get("name"),
|
|
130
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
131
131
|
"breakdown": DocumentBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
132
|
"properties": DocumentWithDriverVerificationReportAllOfProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
133
133
|
})
|
|
@@ -96,8 +96,8 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
|
|
|
96
96
|
if value is None:
|
|
97
97
|
return value
|
|
98
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')")
|
|
99
|
+
if value not in set(['superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength', 'unknown_default_open_api']):
|
|
100
|
+
raise ValueError("must be one of enum values ('superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength', 'unknown_default_open_api')")
|
|
101
101
|
return value
|
|
102
102
|
|
|
103
103
|
@field_validator('has_issuance_confirmation')
|
|
@@ -106,8 +106,8 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
|
|
|
106
106
|
if value is None:
|
|
107
107
|
return value
|
|
108
108
|
|
|
109
|
-
if value not in set(['true', 'false', 'unspecified']):
|
|
110
|
-
raise ValueError("must be one of enum values ('true', 'false', 'unspecified')")
|
|
109
|
+
if value not in set(['true', 'false', 'unspecified', 'unknown_default_open_api']):
|
|
110
|
+
raise ValueError("must be one of enum values ('true', 'false', 'unspecified', 'unknown_default_open_api')")
|
|
111
111
|
return value
|
|
112
112
|
|
|
113
113
|
@field_validator('security_tier')
|
|
@@ -116,8 +116,8 @@ class DocumentWithDriverVerificationReportAllOfProperties(BaseModel):
|
|
|
116
116
|
if value is None:
|
|
117
117
|
return value
|
|
118
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')")
|
|
119
|
+
if value not in set(['tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier', 'unknown_default_open_api']):
|
|
120
|
+
raise ValueError("must be one of enum values ('tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier', 'unknown_default_open_api')")
|
|
121
121
|
return value
|
|
122
122
|
|
|
123
123
|
model_config = ConfigDict(
|
|
@@ -41,12 +41,12 @@ class DocumentWithDrivingLicenceInformationReport(BaseModel):
|
|
|
41
41
|
result: Optional[ReportResult] = None
|
|
42
42
|
sub_result: Optional[ReportSubResult] = None
|
|
43
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
44
|
name: ReportName
|
|
45
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
46
46
|
breakdown: Optional[DocumentBreakdown] = None
|
|
47
47
|
properties: Optional[DocumentProperties] = None
|
|
48
48
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
49
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "breakdown", "properties"]
|
|
50
50
|
|
|
51
51
|
model_config = ConfigDict(
|
|
52
52
|
populate_by_name=True,
|
|
@@ -126,8 +126,8 @@ class DocumentWithDrivingLicenceInformationReport(BaseModel):
|
|
|
126
126
|
"result": obj.get("result"),
|
|
127
127
|
"sub_result": obj.get("sub_result"),
|
|
128
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
129
|
"name": obj.get("name"),
|
|
130
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
131
131
|
"breakdown": DocumentBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
132
|
"properties": DocumentProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
133
133
|
})
|
|
@@ -42,8 +42,8 @@ class ExtractionDocumentClassification(BaseModel):
|
|
|
42
42
|
if value is None:
|
|
43
43
|
return value
|
|
44
44
|
|
|
45
|
-
if value not in set(['full', 'not_full', 'provisional']):
|
|
46
|
-
raise ValueError("must be one of enum values ('full', 'not_full', 'provisional')")
|
|
45
|
+
if value not in set(['full', 'not_full', 'provisional', 'unknown_default_open_api']):
|
|
46
|
+
raise ValueError("must be one of enum values ('full', 'not_full', 'provisional', 'unknown_default_open_api')")
|
|
47
47
|
return value
|
|
48
48
|
|
|
49
49
|
model_config = ConfigDict(
|
|
@@ -66,8 +66,8 @@ class ExtractionExtractedData(BaseModel):
|
|
|
66
66
|
if value is None:
|
|
67
67
|
return value
|
|
68
68
|
|
|
69
|
-
if value not in set(['Male', 'Female']):
|
|
70
|
-
raise ValueError("must be one of enum values ('Male', 'Female')")
|
|
69
|
+
if value not in set(['Male', 'Female', 'unknown_default_open_api']):
|
|
70
|
+
raise ValueError("must be one of enum values ('Male', 'Female', 'unknown_default_open_api')")
|
|
71
71
|
return value
|
|
72
72
|
|
|
73
73
|
@field_validator('nationality')
|
|
@@ -42,8 +42,8 @@ class FacialSimilarityMotionReport(BaseModel):
|
|
|
42
42
|
result: Optional[ReportResult] = None
|
|
43
43
|
sub_result: Optional[ReportSubResult] = None
|
|
44
44
|
check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
|
|
45
|
-
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]")
|
|
46
45
|
name: ReportName
|
|
46
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
47
47
|
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
|
|
48
48
|
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
|
|
49
49
|
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
|
|
@@ -51,7 +51,7 @@ class FacialSimilarityMotionReport(BaseModel):
|
|
|
51
51
|
breakdown: Optional[FacialSimilarityMotionBreakdown] = None
|
|
52
52
|
properties: Optional[FacialSimilarityMotionProperties] = None
|
|
53
53
|
additional_properties: Dict[str, Any] = {}
|
|
54
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
54
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "live_photos", "live_videos", "motion_captures", "id_photos", "breakdown", "properties"]
|
|
55
55
|
|
|
56
56
|
model_config = ConfigDict(
|
|
57
57
|
populate_by_name=True,
|
|
@@ -159,8 +159,8 @@ class FacialSimilarityMotionReport(BaseModel):
|
|
|
159
159
|
"result": obj.get("result"),
|
|
160
160
|
"sub_result": obj.get("sub_result"),
|
|
161
161
|
"check_id": obj.get("check_id"),
|
|
162
|
-
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
163
162
|
"name": obj.get("name"),
|
|
163
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
164
164
|
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
|
|
165
165
|
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
|
|
166
166
|
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
|
|
@@ -42,8 +42,8 @@ class FacialSimilarityPhotoFullyAutoReport(BaseModel):
|
|
|
42
42
|
result: Optional[ReportResult] = None
|
|
43
43
|
sub_result: Optional[ReportSubResult] = None
|
|
44
44
|
check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
|
|
45
|
-
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]")
|
|
46
45
|
name: ReportName
|
|
46
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
47
47
|
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
|
|
48
48
|
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
|
|
49
49
|
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
|
|
@@ -51,7 +51,7 @@ class FacialSimilarityPhotoFullyAutoReport(BaseModel):
|
|
|
51
51
|
breakdown: Optional[FacialSimilarityPhotoFullyAutoBreakdown] = None
|
|
52
52
|
properties: Optional[FacialSimilarityPhotoFullyAutoProperties] = None
|
|
53
53
|
additional_properties: Dict[str, Any] = {}
|
|
54
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
54
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "live_photos", "live_videos", "motion_captures", "id_photos", "breakdown", "properties"]
|
|
55
55
|
|
|
56
56
|
model_config = ConfigDict(
|
|
57
57
|
populate_by_name=True,
|
|
@@ -159,8 +159,8 @@ class FacialSimilarityPhotoFullyAutoReport(BaseModel):
|
|
|
159
159
|
"result": obj.get("result"),
|
|
160
160
|
"sub_result": obj.get("sub_result"),
|
|
161
161
|
"check_id": obj.get("check_id"),
|
|
162
|
-
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
163
162
|
"name": obj.get("name"),
|
|
163
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
164
164
|
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
|
|
165
165
|
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
|
|
166
166
|
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
|
|
@@ -42,8 +42,8 @@ class FacialSimilarityPhotoReport(BaseModel):
|
|
|
42
42
|
result: Optional[ReportResult] = None
|
|
43
43
|
sub_result: Optional[ReportSubResult] = None
|
|
44
44
|
check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
|
|
45
|
-
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]")
|
|
46
45
|
name: ReportName
|
|
46
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
47
47
|
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
|
|
48
48
|
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
|
|
49
49
|
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
|
|
@@ -51,7 +51,7 @@ class FacialSimilarityPhotoReport(BaseModel):
|
|
|
51
51
|
breakdown: Optional[FacialSimilarityPhotoBreakdown] = None
|
|
52
52
|
properties: Optional[FacialSimilarityPhotoProperties] = None
|
|
53
53
|
additional_properties: Dict[str, Any] = {}
|
|
54
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
54
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "live_photos", "live_videos", "motion_captures", "id_photos", "breakdown", "properties"]
|
|
55
55
|
|
|
56
56
|
model_config = ConfigDict(
|
|
57
57
|
populate_by_name=True,
|
|
@@ -159,8 +159,8 @@ class FacialSimilarityPhotoReport(BaseModel):
|
|
|
159
159
|
"result": obj.get("result"),
|
|
160
160
|
"sub_result": obj.get("sub_result"),
|
|
161
161
|
"check_id": obj.get("check_id"),
|
|
162
|
-
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
163
162
|
"name": obj.get("name"),
|
|
163
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
164
164
|
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
|
|
165
165
|
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
|
|
166
166
|
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from onfido.models.facial_similarity_report_media import FacialSimilarityReportMedia
|
|
23
|
+
from onfido.models.report_document import ReportDocument
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -27,12 +28,13 @@ class FacialSimilarityReportShared(BaseModel):
|
|
|
27
28
|
"""
|
|
28
29
|
FacialSimilarityReportShared
|
|
29
30
|
""" # noqa: E501
|
|
31
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
30
32
|
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
|
|
31
33
|
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
|
|
32
34
|
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
|
|
33
35
|
id_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with id photo ids that were used in the Onfido engine.")
|
|
34
36
|
additional_properties: Dict[str, Any] = {}
|
|
35
|
-
__properties: ClassVar[List[str]] = ["live_photos", "live_videos", "motion_captures", "id_photos"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["documents", "live_photos", "live_videos", "motion_captures", "id_photos"]
|
|
36
38
|
|
|
37
39
|
model_config = ConfigDict(
|
|
38
40
|
populate_by_name=True,
|
|
@@ -75,6 +77,13 @@ class FacialSimilarityReportShared(BaseModel):
|
|
|
75
77
|
exclude=excluded_fields,
|
|
76
78
|
exclude_none=True,
|
|
77
79
|
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each item in documents (list)
|
|
81
|
+
_items = []
|
|
82
|
+
if self.documents:
|
|
83
|
+
for _item_documents in self.documents:
|
|
84
|
+
if _item_documents:
|
|
85
|
+
_items.append(_item_documents.to_dict())
|
|
86
|
+
_dict['documents'] = _items
|
|
78
87
|
# override the default output from pydantic by calling `to_dict()` of each item in live_photos (list)
|
|
79
88
|
_items = []
|
|
80
89
|
if self.live_photos:
|
|
@@ -120,6 +129,7 @@ class FacialSimilarityReportShared(BaseModel):
|
|
|
120
129
|
return cls.model_validate(obj)
|
|
121
130
|
|
|
122
131
|
_obj = cls.model_validate({
|
|
132
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
123
133
|
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
|
|
124
134
|
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
|
|
125
135
|
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
|
|
@@ -42,8 +42,8 @@ class FacialSimilarityVideoReport(BaseModel):
|
|
|
42
42
|
result: Optional[ReportResult] = None
|
|
43
43
|
sub_result: Optional[ReportSubResult] = None
|
|
44
44
|
check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
|
|
45
|
-
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]")
|
|
46
45
|
name: ReportName
|
|
46
|
+
documents: Optional[List[ReportDocument]] = Field(default=None, description="Array of objects with document ids that were used in the Onfido engine.")
|
|
47
47
|
live_photos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live photo ids that were used in the Onfido engine.")
|
|
48
48
|
live_videos: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with live video ids that were used in the Onfido engine.")
|
|
49
49
|
motion_captures: Optional[List[FacialSimilarityReportMedia]] = Field(default=None, description="Array of objects with motion capture ids that were used in the Onfido engine.")
|
|
@@ -51,7 +51,7 @@ class FacialSimilarityVideoReport(BaseModel):
|
|
|
51
51
|
breakdown: Optional[FacialSimilarityVideoBreakdown] = None
|
|
52
52
|
properties: Optional[FacialSimilarityVideoProperties] = None
|
|
53
53
|
additional_properties: Dict[str, Any] = {}
|
|
54
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
54
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "documents", "live_photos", "live_videos", "motion_captures", "id_photos", "breakdown", "properties"]
|
|
55
55
|
|
|
56
56
|
model_config = ConfigDict(
|
|
57
57
|
populate_by_name=True,
|
|
@@ -159,8 +159,8 @@ class FacialSimilarityVideoReport(BaseModel):
|
|
|
159
159
|
"result": obj.get("result"),
|
|
160
160
|
"sub_result": obj.get("sub_result"),
|
|
161
161
|
"check_id": obj.get("check_id"),
|
|
162
|
-
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
163
162
|
"name": obj.get("name"),
|
|
163
|
+
"documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
|
|
164
164
|
"live_photos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_photos"]] if obj.get("live_photos") is not None else None,
|
|
165
165
|
"live_videos": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["live_videos"]] if obj.get("live_videos") is not None else None,
|
|
166
166
|
"motion_captures": [FacialSimilarityReportMedia.from_dict(_item) for _item in obj["motion_captures"]] if obj.get("motion_captures") is not None else None,
|
onfido/models/id_number.py
CHANGED
|
@@ -38,8 +38,8 @@ class IdNumber(BaseModel):
|
|
|
38
38
|
if value is None:
|
|
39
39
|
return value
|
|
40
40
|
|
|
41
|
-
if value not in set(['ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_license', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other']):
|
|
42
|
-
raise ValueError("must be one of enum values ('ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_license', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other')")
|
|
41
|
+
if value not in set(['ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_license', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other', 'unknown_default_open_api']):
|
|
42
|
+
raise ValueError("must be one of enum values ('ssn', 'social_insurance', 'tax_id', 'identity_card', 'driving_license', 'driving_licence', 'share_code', 'voter_id', 'passport', 'other', 'unknown_default_open_api')")
|
|
43
43
|
return value
|
|
44
44
|
|
|
45
45
|
model_config = ConfigDict(
|
|
@@ -22,7 +22,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from onfido.models.identity_enhanced_breakdown import IdentityEnhancedBreakdown
|
|
24
24
|
from onfido.models.identity_enhanced_properties import IdentityEnhancedProperties
|
|
25
|
-
from onfido.models.report_document import ReportDocument
|
|
26
25
|
from onfido.models.report_name import ReportName
|
|
27
26
|
from onfido.models.report_result import ReportResult
|
|
28
27
|
from onfido.models.report_status import ReportStatus
|
|
@@ -41,12 +40,11 @@ class IdentityEnhancedReport(BaseModel):
|
|
|
41
40
|
result: Optional[ReportResult] = None
|
|
42
41
|
sub_result: Optional[ReportSubResult] = None
|
|
43
42
|
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
43
|
name: ReportName
|
|
46
44
|
breakdown: Optional[IdentityEnhancedBreakdown] = None
|
|
47
45
|
properties: Optional[IdentityEnhancedProperties] = None
|
|
48
46
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
47
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "breakdown", "properties"]
|
|
50
48
|
|
|
51
49
|
model_config = ConfigDict(
|
|
52
50
|
populate_by_name=True,
|
|
@@ -89,13 +87,6 @@ class IdentityEnhancedReport(BaseModel):
|
|
|
89
87
|
exclude=excluded_fields,
|
|
90
88
|
exclude_none=True,
|
|
91
89
|
)
|
|
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_documents in self.documents:
|
|
96
|
-
if _item_documents:
|
|
97
|
-
_items.append(_item_documents.to_dict())
|
|
98
|
-
_dict['documents'] = _items
|
|
99
90
|
# override the default output from pydantic by calling `to_dict()` of breakdown
|
|
100
91
|
if self.breakdown:
|
|
101
92
|
_dict['breakdown'] = self.breakdown.to_dict()
|
|
@@ -126,7 +117,6 @@ class IdentityEnhancedReport(BaseModel):
|
|
|
126
117
|
"result": obj.get("result"),
|
|
127
118
|
"sub_result": obj.get("sub_result"),
|
|
128
119
|
"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
120
|
"name": obj.get("name"),
|
|
131
121
|
"breakdown": IdentityEnhancedBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
122
|
"properties": IdentityEnhancedProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|
|
@@ -22,7 +22,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from onfido.models.india_pan_report_all_of_breakdown import IndiaPanReportAllOfBreakdown
|
|
24
24
|
from onfido.models.india_pan_report_all_of_properties import IndiaPanReportAllOfProperties
|
|
25
|
-
from onfido.models.report_document import ReportDocument
|
|
26
25
|
from onfido.models.report_name import ReportName
|
|
27
26
|
from onfido.models.report_result import ReportResult
|
|
28
27
|
from onfido.models.report_status import ReportStatus
|
|
@@ -41,12 +40,11 @@ class IndiaPanReport(BaseModel):
|
|
|
41
40
|
result: Optional[ReportResult] = None
|
|
42
41
|
sub_result: Optional[ReportSubResult] = None
|
|
43
42
|
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
43
|
name: ReportName
|
|
46
44
|
breakdown: Optional[IndiaPanReportAllOfBreakdown] = None
|
|
47
45
|
properties: Optional[IndiaPanReportAllOfProperties] = None
|
|
48
46
|
additional_properties: Dict[str, Any] = {}
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "
|
|
47
|
+
__properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "breakdown", "properties"]
|
|
50
48
|
|
|
51
49
|
model_config = ConfigDict(
|
|
52
50
|
populate_by_name=True,
|
|
@@ -89,13 +87,6 @@ class IndiaPanReport(BaseModel):
|
|
|
89
87
|
exclude=excluded_fields,
|
|
90
88
|
exclude_none=True,
|
|
91
89
|
)
|
|
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_documents in self.documents:
|
|
96
|
-
if _item_documents:
|
|
97
|
-
_items.append(_item_documents.to_dict())
|
|
98
|
-
_dict['documents'] = _items
|
|
99
90
|
# override the default output from pydantic by calling `to_dict()` of breakdown
|
|
100
91
|
if self.breakdown:
|
|
101
92
|
_dict['breakdown'] = self.breakdown.to_dict()
|
|
@@ -126,7 +117,6 @@ class IndiaPanReport(BaseModel):
|
|
|
126
117
|
"result": obj.get("result"),
|
|
127
118
|
"sub_result": obj.get("sub_result"),
|
|
128
119
|
"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
120
|
"name": obj.get("name"),
|
|
131
121
|
"breakdown": IndiaPanReportAllOfBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
|
|
132
122
|
"properties": IndiaPanReportAllOfProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
|