onfido-python 4.6.0__py3-none-any.whl → 5.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 (81) hide show
  1. onfido/__init__.py +7 -4
  2. onfido/api/default_api.py +541 -0
  3. onfido/api_client.py +2 -2
  4. onfido/configuration.py +151 -39
  5. onfido/exceptions.py +17 -0
  6. onfido/models/__init__.py +6 -3
  7. onfido/models/applicant_consent.py +111 -0
  8. onfido/models/applicant_consent_name.py +1 -0
  9. onfido/models/check.py +2 -2
  10. onfido/models/check_response.py +2 -2
  11. onfido/models/check_status.py +1 -0
  12. onfido/models/country_codes.py +1 -0
  13. onfido/models/device_intelligence_breakdown.py +7 -1
  14. onfido/models/device_intelligence_breakdown_breakdown.py +3 -3
  15. onfido/models/{device_intelligence_breakdown_breakdown_device.py → device_intelligence_breakdown_device.py} +6 -6
  16. onfido/models/{device_intelligence_breakdown_breakdown_device_breakdown.py → device_intelligence_breakdown_device_breakdown.py} +4 -4
  17. onfido/models/device_intelligence_breakdown_properties_device.py +13 -13
  18. onfido/models/device_intelligence_properties.py +116 -0
  19. onfido/models/device_intelligence_report.py +8 -12
  20. onfido/models/document.py +2 -12
  21. onfido/models/document_properties.py +15 -11
  22. onfido/models/{document_properties_driving_licence_information.py → document_properties_driving_licence_information_item.py} +4 -4
  23. onfido/models/document_report.py +3 -3
  24. onfido/models/document_report_shared.py +108 -0
  25. onfido/models/document_shared.py +2 -12
  26. onfido/models/document_types.py +1 -0
  27. onfido/models/document_video_report.py +3 -3
  28. onfido/models/document_video_with_address_information_report.py +3 -3
  29. onfido/models/document_with_address_information_report.py +3 -3
  30. onfido/models/document_with_driver_verification_report.py +3 -3
  31. onfido/models/document_with_driver_verification_report_all_of_properties.py +15 -11
  32. onfido/models/document_with_driving_licence_information_report.py +3 -3
  33. onfido/models/extraction_document_classification.py +2 -2
  34. onfido/models/extraction_extracted_data.py +2 -2
  35. onfido/models/facial_similarity_motion_report.py +3 -3
  36. onfido/models/facial_similarity_photo_fully_auto_report.py +3 -3
  37. onfido/models/facial_similarity_photo_report.py +3 -3
  38. onfido/models/facial_similarity_report_shared.py +11 -1
  39. onfido/models/facial_similarity_video_report.py +3 -3
  40. onfido/models/id_number.py +2 -2
  41. onfido/models/identity_enhanced_report.py +1 -11
  42. onfido/models/india_pan_report.py +1 -11
  43. onfido/models/known_faces_report.py +1 -11
  44. onfido/models/proof_of_address_properties.py +2 -2
  45. onfido/models/proof_of_address_report.py +1 -11
  46. onfido/models/repeat_attempts_list_repeat_attempts_inner.py +6 -6
  47. onfido/models/report_name.py +1 -0
  48. onfido/models/report_result.py +1 -0
  49. onfido/models/report_shared.py +1 -11
  50. onfido/models/report_status.py +1 -0
  51. onfido/models/report_sub_result.py +1 -0
  52. onfido/models/results_feedback.py +2 -2
  53. onfido/models/us_driving_licence_builder.py +6 -6
  54. onfido/models/us_driving_licence_report.py +1 -11
  55. onfido/models/us_driving_licence_shared.py +6 -6
  56. onfido/models/watchlist_aml_properties.py +2 -2
  57. onfido/models/watchlist_aml_report.py +1 -11
  58. onfido/models/watchlist_enhanced_report.py +1 -11
  59. onfido/models/watchlist_monitor.py +2 -2
  60. onfido/models/watchlist_monitor_builder.py +2 -2
  61. onfido/models/watchlist_monitor_shared.py +2 -2
  62. onfido/models/watchlist_peps_only_report.py +1 -11
  63. onfido/models/watchlist_sanctions_only_report.py +1 -11
  64. onfido/models/watchlist_standard_properties.py +2 -2
  65. onfido/models/watchlist_standard_report.py +1 -11
  66. onfido/models/webhook.py +11 -1
  67. onfido/models/webhook_builder.py +11 -1
  68. onfido/models/webhook_event_object_status.py +1 -0
  69. onfido/models/webhook_event_payload_object.py +1 -1
  70. onfido/models/webhook_event_resource_type.py +1 -0
  71. onfido/models/webhook_event_type.py +1 -1
  72. onfido/models/webhook_shared.py +12 -2
  73. onfido/models/webhook_updater.py +11 -1
  74. onfido/models/workflow_run_link.py +2 -2
  75. onfido/models/workflow_run_status.py +1 -0
  76. onfido/webhook_event_verifier.py +3 -2
  77. {onfido_python-4.6.0.dist-info → onfido_python-5.1.0.dist-info}/METADATA +3 -2
  78. {onfido_python-4.6.0.dist-info → onfido_python-5.1.0.dist-info}/RECORD +81 -78
  79. {onfido_python-4.6.0.dist-info → onfido_python-5.1.0.dist-info}/WHEEL +1 -1
  80. {onfido_python-4.6.0.dist-info → onfido_python-5.1.0.dist-info/licenses}/LICENSE +0 -0
  81. {onfido_python-4.6.0.dist-info → onfido_python-5.1.0.dist-info}/top_level.txt +0 -0
@@ -19,15 +19,15 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from onfido.models.device_intelligence_breakdown_breakdown_device_breakdown import DeviceIntelligenceBreakdownBreakdownDeviceBreakdown
22
+ from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class DeviceIntelligenceBreakdownBreakdownDevice(BaseModel):
26
+ class DeviceIntelligenceBreakdownDevice(BaseModel):
27
27
  """
28
28
  Asserts whether the device used to upload the media is trustworthy, i.e. it is a real, physical device.
29
29
  """ # noqa: E501
30
- breakdown: Optional[DeviceIntelligenceBreakdownBreakdownDeviceBreakdown] = None
30
+ breakdown: Optional[DeviceIntelligenceBreakdownDeviceBreakdown] = None
31
31
  additional_properties: Dict[str, Any] = {}
32
32
  __properties: ClassVar[List[str]] = ["breakdown"]
33
33
 
@@ -49,7 +49,7 @@ class DeviceIntelligenceBreakdownBreakdownDevice(BaseModel):
49
49
 
50
50
  @classmethod
51
51
  def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of DeviceIntelligenceBreakdownBreakdownDevice from a JSON string"""
52
+ """Create an instance of DeviceIntelligenceBreakdownDevice from a JSON string"""
53
53
  return cls.from_dict(json.loads(json_str))
54
54
 
55
55
  def to_dict(self) -> Dict[str, Any]:
@@ -84,7 +84,7 @@ class DeviceIntelligenceBreakdownBreakdownDevice(BaseModel):
84
84
 
85
85
  @classmethod
86
86
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of DeviceIntelligenceBreakdownBreakdownDevice from a dict"""
87
+ """Create an instance of DeviceIntelligenceBreakdownDevice from a dict"""
88
88
  if obj is None:
89
89
  return None
90
90
 
@@ -92,7 +92,7 @@ class DeviceIntelligenceBreakdownBreakdownDevice(BaseModel):
92
92
  return cls.model_validate(obj)
93
93
 
94
94
  _obj = cls.model_validate({
95
- "breakdown": DeviceIntelligenceBreakdownBreakdownDeviceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None
95
+ "breakdown": DeviceIntelligenceBreakdownDeviceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None
96
96
  })
97
97
  # store additional fields in additional_properties
98
98
  for _key in obj.keys():
@@ -23,9 +23,9 @@ from onfido.models.document_breakdown_data_comparison_breakdown_issuing_country
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
- class DeviceIntelligenceBreakdownBreakdownDeviceBreakdown(BaseModel):
26
+ class DeviceIntelligenceBreakdownDeviceBreakdown(BaseModel):
27
27
  """
28
- DeviceIntelligenceBreakdownBreakdownDeviceBreakdown
28
+ DeviceIntelligenceBreakdownDeviceBreakdown
29
29
  """ # noqa: E501
30
30
  application_authenticity: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
31
31
  device_integrity: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
@@ -51,7 +51,7 @@ class DeviceIntelligenceBreakdownBreakdownDeviceBreakdown(BaseModel):
51
51
 
52
52
  @classmethod
53
53
  def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of DeviceIntelligenceBreakdownBreakdownDeviceBreakdown from a JSON string"""
54
+ """Create an instance of DeviceIntelligenceBreakdownDeviceBreakdown from a JSON string"""
55
55
  return cls.from_dict(json.loads(json_str))
56
56
 
57
57
  def to_dict(self) -> Dict[str, Any]:
@@ -92,7 +92,7 @@ class DeviceIntelligenceBreakdownBreakdownDeviceBreakdown(BaseModel):
92
92
 
93
93
  @classmethod
94
94
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
- """Create an instance of DeviceIntelligenceBreakdownBreakdownDeviceBreakdown from a dict"""
95
+ """Create an instance of DeviceIntelligenceBreakdownDeviceBreakdown from a dict"""
96
96
  if obj is None:
97
97
  return None
98
98
 
@@ -17,8 +17,8 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Optional
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
@@ -36,7 +36,7 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
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
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.")
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.")
39
+ device_fingerprint_reuse: Optional[Union[StrictFloat, 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.")
40
40
  single_device_used: Optional[StrictBool] = Field(default=None, description="Whether the document or biometric media were uploaded from a single device.")
41
41
  document_capture: Optional[StrictStr] = Field(default=None, description="Whether the document media were live captured from the device camera.")
42
42
  biometric_capture: Optional[StrictStr] = Field(default=None, description="Whether the biometric media were live captured from the device camera.")
@@ -49,8 +49,8 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
49
49
  if value is None:
50
50
  return value
51
51
 
52
- if value not in set(['onfido-android-sdk', 'onfido-ios-sdk', 'onfido-web-sdk']):
53
- raise ValueError("must be one of enum values ('onfido-android-sdk', 'onfido-ios-sdk', 'onfido-web-sdk')")
52
+ if value not in set(['onfido-android-sdk', 'onfido-ios-sdk', 'onfido-web-sdk', 'unknown_default_open_api']):
53
+ raise ValueError("must be one of enum values ('onfido-android-sdk', 'onfido-ios-sdk', 'onfido-web-sdk', 'unknown_default_open_api')")
54
54
  return value
55
55
 
56
56
  @field_validator('authentication_type')
@@ -59,8 +59,8 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
59
59
  if value is None:
60
60
  return value
61
61
 
62
- if value not in set(['sdk_token', 'mobile_token', 'api_token']):
63
- raise ValueError("must be one of enum values ('sdk_token', 'mobile_token', 'api_token')")
62
+ if value not in set(['sdk_token', 'mobile_token', 'api_token', 'unknown_default_open_api']):
63
+ raise ValueError("must be one of enum values ('sdk_token', 'mobile_token', 'api_token', 'unknown_default_open_api')")
64
64
  return value
65
65
 
66
66
  @field_validator('ip_reputation')
@@ -69,8 +69,8 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
69
69
  if value is None:
70
70
  return value
71
71
 
72
- if value not in set(['NOT_ENOUGH_DATA', 'HIGH_RISK', 'LOW_RISK']):
73
- raise ValueError("must be one of enum values ('NOT_ENOUGH_DATA', 'HIGH_RISK', 'LOW_RISK')")
72
+ if value not in set(['NOT_ENOUGH_DATA', 'HIGH_RISK', 'LOW_RISK', 'unknown_default_open_api']):
73
+ raise ValueError("must be one of enum values ('NOT_ENOUGH_DATA', 'HIGH_RISK', 'LOW_RISK', 'unknown_default_open_api')")
74
74
  return value
75
75
 
76
76
  @field_validator('document_capture')
@@ -79,8 +79,8 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
79
79
  if value is None:
80
80
  return value
81
81
 
82
- if value not in set(['live', 'unknown_method']):
83
- raise ValueError("must be one of enum values ('live', 'unknown_method')")
82
+ if value not in set(['live', 'unknown_method', 'unknown_default_open_api']):
83
+ raise ValueError("must be one of enum values ('live', 'unknown_method', 'unknown_default_open_api')")
84
84
  return value
85
85
 
86
86
  @field_validator('biometric_capture')
@@ -89,8 +89,8 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
89
89
  if value is None:
90
90
  return value
91
91
 
92
- if value not in set(['live', 'unknown_method']):
93
- raise ValueError("must be one of enum values ('live', 'unknown_method')")
92
+ if value not in set(['live', 'unknown_method', 'unknown_default_open_api']):
93
+ raise ValueError("must be one of enum values ('live', 'unknown_method', 'unknown_default_open_api')")
94
94
  return value
95
95
 
96
96
  model_config = ConfigDict(
@@ -0,0 +1,116 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Onfido API v3.6
5
+
6
+ The Onfido API (v3.6)
7
+
8
+ The version of the OpenAPI document: v3.6
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice
23
+ from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation
24
+ from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class DeviceIntelligenceProperties(BaseModel):
29
+ """
30
+ DeviceIntelligenceProperties
31
+ """ # noqa: E501
32
+ device: Optional[DeviceIntelligenceBreakdownPropertiesDevice] = None
33
+ ip: Optional[DeviceIntelligenceBreakdownPropertiesIp] = None
34
+ geolocation: Optional[DeviceIntelligenceBreakdownPropertiesGeolocation] = None
35
+ additional_properties: Dict[str, Any] = {}
36
+ __properties: ClassVar[List[str]] = ["device", "ip", "geolocation"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of DeviceIntelligenceProperties from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ * Fields in `self.additional_properties` are added to the output dict.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ "additional_properties",
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ # override the default output from pydantic by calling `to_dict()` of device
80
+ if self.device:
81
+ _dict['device'] = self.device.to_dict()
82
+ # override the default output from pydantic by calling `to_dict()` of ip
83
+ if self.ip:
84
+ _dict['ip'] = self.ip.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of geolocation
86
+ if self.geolocation:
87
+ _dict['geolocation'] = self.geolocation.to_dict()
88
+ # puts key-value pairs in additional_properties in the top level
89
+ if self.additional_properties is not None:
90
+ for _key, _value in self.additional_properties.items():
91
+ _dict[_key] = _value
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of DeviceIntelligenceProperties from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "device": DeviceIntelligenceBreakdownPropertiesDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
106
+ "ip": DeviceIntelligenceBreakdownPropertiesIp.from_dict(obj["ip"]) if obj.get("ip") is not None else None,
107
+ "geolocation": DeviceIntelligenceBreakdownPropertiesGeolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") is not None else None
108
+ })
109
+ # store additional fields in additional_properties
110
+ for _key in obj.keys():
111
+ if _key not in cls.__properties:
112
+ _obj.additional_properties[_key] = obj.get(_key)
113
+
114
+ return _obj
115
+
116
+
@@ -21,7 +21,7 @@ from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
24
- from onfido.models.report_document import ReportDocument
24
+ from onfido.models.device_intelligence_properties import DeviceIntelligenceProperties
25
25
  from onfido.models.report_name import ReportName
26
26
  from onfido.models.report_result import ReportResult
27
27
  from onfido.models.report_status import ReportStatus
@@ -40,11 +40,11 @@ class DeviceIntelligenceReport(BaseModel):
40
40
  result: Optional[ReportResult] = None
41
41
  sub_result: Optional[ReportSubResult] = None
42
42
  check_id: Optional[StrictStr] = Field(default=None, description="The ID of the check to which the report belongs. Read-only.")
43
- 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]")
44
43
  name: ReportName
45
44
  breakdown: Optional[DeviceIntelligenceBreakdown] = None
45
+ properties: Optional[DeviceIntelligenceProperties] = None
46
46
  additional_properties: Dict[str, Any] = {}
47
- __properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "documents", "name", "breakdown"]
47
+ __properties: ClassVar[List[str]] = ["id", "created_at", "href", "status", "result", "sub_result", "check_id", "name", "breakdown", "properties"]
48
48
 
49
49
  model_config = ConfigDict(
50
50
  populate_by_name=True,
@@ -87,16 +87,12 @@ class DeviceIntelligenceReport(BaseModel):
87
87
  exclude=excluded_fields,
88
88
  exclude_none=True,
89
89
  )
90
- # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
91
- _items = []
92
- if self.documents:
93
- for _item_documents in self.documents:
94
- if _item_documents:
95
- _items.append(_item_documents.to_dict())
96
- _dict['documents'] = _items
97
90
  # override the default output from pydantic by calling `to_dict()` of breakdown
98
91
  if self.breakdown:
99
92
  _dict['breakdown'] = self.breakdown.to_dict()
93
+ # override the default output from pydantic by calling `to_dict()` of properties
94
+ if self.properties:
95
+ _dict['properties'] = self.properties.to_dict()
100
96
  # puts key-value pairs in additional_properties in the top level
101
97
  if self.additional_properties is not None:
102
98
  for _key, _value in self.additional_properties.items():
@@ -121,9 +117,9 @@ class DeviceIntelligenceReport(BaseModel):
121
117
  "result": obj.get("result"),
122
118
  "sub_result": obj.get("sub_result"),
123
119
  "check_id": obj.get("check_id"),
124
- "documents": [ReportDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None,
125
120
  "name": obj.get("name"),
126
- "breakdown": DeviceIntelligenceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None
121
+ "breakdown": DeviceIntelligenceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
122
+ "properties": DeviceIntelligenceProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
127
123
  })
128
124
  # store additional fields in additional_properties
129
125
  for _key in obj.keys():
onfido/models/document.py CHANGED
@@ -43,24 +43,14 @@ class Document(BaseModel):
43
43
  additional_properties: Dict[str, Any] = {}
44
44
  __properties: ClassVar[List[str]] = ["file_type", "type", "side", "issuing_country", "applicant_id", "id", "created_at", "href", "download_href", "file_name", "file_size"]
45
45
 
46
- @field_validator('file_type')
47
- def file_type_validate_enum(cls, value):
48
- """Validates the enum"""
49
- if value is None:
50
- return value
51
-
52
- if value not in set(['jpg', 'jpeg', 'png', 'pdf']):
53
- raise ValueError("must be one of enum values ('jpg', 'jpeg', 'png', 'pdf')")
54
- return value
55
-
56
46
  @field_validator('side')
57
47
  def side_validate_enum(cls, value):
58
48
  """Validates the enum"""
59
49
  if value is None:
60
50
  return value
61
51
 
62
- if value not in set(['front', 'back']):
63
- raise ValueError("must be one of enum values ('front', 'back')")
52
+ if value not in set(['front', 'back', 'unknown_default_open_api']):
53
+ raise ValueError("must be one of enum values ('front', 'back', 'unknown_default_open_api')")
64
54
  return value
65
55
 
66
56
  model_config = ConfigDict(
@@ -24,7 +24,7 @@ from onfido.models.document_properties_address_lines import DocumentPropertiesAd
24
24
  from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
25
25
  from onfido.models.document_properties_document_classification import DocumentPropertiesDocumentClassification
26
26
  from onfido.models.document_properties_document_numbers_inner import DocumentPropertiesDocumentNumbersInner
27
- from onfido.models.document_properties_driving_licence_information import DocumentPropertiesDrivingLicenceInformation
27
+ from onfido.models.document_properties_driving_licence_information_item import DocumentPropertiesDrivingLicenceInformationItem
28
28
  from onfido.models.document_properties_extracted_data import DocumentPropertiesExtractedData
29
29
  from onfido.models.document_properties_nfc import DocumentPropertiesNfc
30
30
  from typing import Optional, Set
@@ -76,7 +76,7 @@ class DocumentProperties(BaseModel):
76
76
  address_lines: Optional[DocumentPropertiesAddressLines] = None
77
77
  barcode: Optional[List[DocumentPropertiesBarcodeInner]] = None
78
78
  nfc: Optional[DocumentPropertiesNfc] = None
79
- driving_licence_information: Optional[DocumentPropertiesDrivingLicenceInformation] = None
79
+ driving_licence_information: Optional[List[DocumentPropertiesDrivingLicenceInformationItem]] = None
80
80
  document_classification: Optional[DocumentPropertiesDocumentClassification] = None
81
81
  extracted_data: Optional[DocumentPropertiesExtractedData] = None
82
82
  additional_properties: Dict[str, Any] = {}
@@ -88,8 +88,8 @@ class DocumentProperties(BaseModel):
88
88
  if value is None:
89
89
  return value
90
90
 
91
- if value not in set(['superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength']):
92
- raise ValueError("must be one of enum values ('superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength')")
91
+ if value not in set(['superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength', 'unknown_default_open_api']):
92
+ raise ValueError("must be one of enum values ('superior', 'strong', 'fair', 'weak', 'unacceptable', 'unspecified_identity_evidence_strength', 'unknown_default_open_api')")
93
93
  return value
94
94
 
95
95
  @field_validator('has_issuance_confirmation')
@@ -98,8 +98,8 @@ class DocumentProperties(BaseModel):
98
98
  if value is None:
99
99
  return value
100
100
 
101
- if value not in set(['true', 'false', 'unspecified']):
102
- raise ValueError("must be one of enum values ('true', 'false', 'unspecified')")
101
+ if value not in set(['true', 'false', 'unspecified', 'unknown_default_open_api']):
102
+ raise ValueError("must be one of enum values ('true', 'false', 'unspecified', 'unknown_default_open_api')")
103
103
  return value
104
104
 
105
105
  @field_validator('security_tier')
@@ -108,8 +108,8 @@ class DocumentProperties(BaseModel):
108
108
  if value is None:
109
109
  return value
110
110
 
111
- if value not in set(['tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier']):
112
- raise ValueError("must be one of enum values ('tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier')")
111
+ if value not in set(['tier_1', 'tier_2', 'tier_3', 'tier_4', 'tier_5', 'unspecified_security_tier', 'unknown_default_open_api']):
112
+ 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')")
113
113
  return value
114
114
 
115
115
  model_config = ConfigDict(
@@ -173,9 +173,13 @@ class DocumentProperties(BaseModel):
173
173
  # override the default output from pydantic by calling `to_dict()` of nfc
174
174
  if self.nfc:
175
175
  _dict['nfc'] = self.nfc.to_dict()
176
- # override the default output from pydantic by calling `to_dict()` of driving_licence_information
176
+ # override the default output from pydantic by calling `to_dict()` of each item in driving_licence_information (list)
177
+ _items = []
177
178
  if self.driving_licence_information:
178
- _dict['driving_licence_information'] = self.driving_licence_information.to_dict()
179
+ for _item_driving_licence_information in self.driving_licence_information:
180
+ if _item_driving_licence_information:
181
+ _items.append(_item_driving_licence_information.to_dict())
182
+ _dict['driving_licence_information'] = _items
179
183
  # override the default output from pydantic by calling `to_dict()` of document_classification
180
184
  if self.document_classification:
181
185
  _dict['document_classification'] = self.document_classification.to_dict()
@@ -241,7 +245,7 @@ class DocumentProperties(BaseModel):
241
245
  "address_lines": DocumentPropertiesAddressLines.from_dict(obj["address_lines"]) if obj.get("address_lines") is not None else None,
242
246
  "barcode": [DocumentPropertiesBarcodeInner.from_dict(_item) for _item in obj["barcode"]] if obj.get("barcode") is not None else None,
243
247
  "nfc": DocumentPropertiesNfc.from_dict(obj["nfc"]) if obj.get("nfc") is not None else None,
244
- "driving_licence_information": DocumentPropertiesDrivingLicenceInformation.from_dict(obj["driving_licence_information"]) if obj.get("driving_licence_information") is not None else None,
248
+ "driving_licence_information": [DocumentPropertiesDrivingLicenceInformationItem.from_dict(_item) for _item in obj["driving_licence_information"]] if obj.get("driving_licence_information") is not None else None,
245
249
  "document_classification": DocumentPropertiesDocumentClassification.from_dict(obj["document_classification"]) if obj.get("document_classification") is not None else None,
246
250
  "extracted_data": DocumentPropertiesExtractedData.from_dict(obj["extracted_data"]) if obj.get("extracted_data") is not None else None
247
251
  })
@@ -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 DocumentPropertiesDrivingLicenceInformation(BaseModel):
26
+ class DocumentPropertiesDrivingLicenceInformationItem(BaseModel):
27
27
  """
28
- DocumentPropertiesDrivingLicenceInformation
28
+ DocumentPropertiesDrivingLicenceInformationItem
29
29
  """ # noqa: E501
30
30
  category: Optional[StrictStr] = None
31
31
  obtainment_date: Optional[date] = None
@@ -52,7 +52,7 @@ class DocumentPropertiesDrivingLicenceInformation(BaseModel):
52
52
 
53
53
  @classmethod
54
54
  def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of DocumentPropertiesDrivingLicenceInformation from a JSON string"""
55
+ """Create an instance of DocumentPropertiesDrivingLicenceInformationItem from a JSON string"""
56
56
  return cls.from_dict(json.loads(json_str))
57
57
 
58
58
  def to_dict(self) -> Dict[str, Any]:
@@ -84,7 +84,7 @@ class DocumentPropertiesDrivingLicenceInformation(BaseModel):
84
84
 
85
85
  @classmethod
86
86
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of DocumentPropertiesDrivingLicenceInformation from a dict"""
87
+ """Create an instance of DocumentPropertiesDrivingLicenceInformationItem from a dict"""
88
88
  if obj is None:
89
89
  return None
90
90
 
@@ -41,12 +41,12 @@ class DocumentReport(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", "documents", "name", "breakdown", "properties"]
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 DocumentReport(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
  })
@@ -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
+
@@ -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(
@@ -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: