onfido-python 3.4.0__py3-none-any.whl → 4.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 +18 -5
- onfido/api/default_api.py +611 -416
- onfido/api_client.py +38 -11
- onfido/configuration.py +14 -3
- onfido/models/__init__.py +17 -4
- onfido/models/addresses_list.py +3 -3
- onfido/models/applicant.py +3 -3
- onfido/models/applicant_builder.py +12 -8
- onfido/models/{consents_builder.py → applicant_consent_builder.py} +11 -6
- onfido/models/applicant_consent_name.py +38 -0
- onfido/models/applicant_request.py +10 -6
- onfido/models/applicant_shared.py +3 -3
- onfido/models/applicant_updater.py +12 -8
- onfido/models/applicants_list.py +3 -3
- onfido/models/check.py +10 -13
- onfido/models/check_builder.py +3 -1
- onfido/models/check_response.py +7 -13
- onfido/models/check_shared.py +4 -2
- onfido/models/check_status.py +41 -0
- onfido/models/checks_list.py +3 -3
- onfido/models/device_intelligence_breakdown_properties_device.py +1 -9
- onfido/models/device_intelligence_breakdown_properties_ip.py +2 -8
- onfido/models/device_intelligence_report.py +3 -3
- onfido/models/document.py +2 -1
- onfido/models/document_properties.py +6 -6
- onfido/models/document_report.py +3 -3
- onfido/models/document_shared.py +2 -1
- onfido/models/document_types.py +5 -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 +9 -9
- onfido/models/document_with_driving_licence_information_report.py +3 -3
- onfido/models/documents_list.py +3 -3
- 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_video_report.py +3 -3
- onfido/models/id_photos_list.py +3 -3
- onfido/models/identity_enhanced_properties.py +3 -3
- onfido/models/identity_enhanced_report.py +3 -3
- onfido/models/india_pan_report.py +3 -3
- onfido/models/known_faces_properties.py +3 -3
- onfido/models/known_faces_report.py +3 -3
- onfido/models/live_photos_list.py +3 -3
- onfido/models/live_videos_list.py +3 -3
- onfido/models/motion_captures_list.py +3 -3
- onfido/models/proof_of_address_report.py +3 -3
- onfido/models/repeat_attempts_list.py +3 -3
- onfido/models/report_shared.py +3 -3
- onfido/models/reports_list.py +3 -3
- onfido/models/task_item.py +11 -2
- onfido/models/us_driving_licence_report.py +3 -3
- onfido/models/watchlist_aml_report.py +3 -3
- onfido/models/watchlist_enhanced_properties.py +11 -3
- onfido/models/watchlist_enhanced_properties_records_inner.py +164 -0
- onfido/models/watchlist_enhanced_properties_records_inner_address_inner.py +111 -0
- onfido/models/{consent_item.py → watchlist_enhanced_properties_records_inner_alias_inner.py} +11 -18
- onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.py +104 -0
- onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.py +102 -0
- onfido/models/watchlist_enhanced_properties_records_inner_event_inner.py +113 -0
- onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.py +107 -0
- onfido/models/watchlist_enhanced_properties_records_inner_source_inner.py +106 -0
- onfido/models/watchlist_enhanced_report.py +3 -3
- onfido/models/watchlist_monitor_matches_list.py +3 -3
- onfido/models/watchlist_monitors_list.py +3 -3
- onfido/models/watchlist_peps_only_report.py +3 -3
- onfido/models/watchlist_sanctions_only_report.py +3 -3
- onfido/models/watchlist_standard_report.py +3 -3
- onfido/models/webhook_event_object_status.py +54 -0
- onfido/models/webhook_event_payload.py +9 -4
- onfido/models/webhook_event_payload_object.py +2 -1
- onfido/models/webhook_event_payload_resource.py +158 -0
- onfido/models/webhook_event_resource_type.py +41 -0
- onfido/models/webhook_resend.py +3 -3
- onfido/models/webhooks_list.py +3 -3
- onfido/models/workflow_run.py +9 -18
- onfido/models/workflow_run_builder.py +3 -3
- onfido/models/{workflow_run_response_error.py → workflow_run_error.py} +4 -4
- onfido/models/{workflow_run_shared_link.py → workflow_run_link.py} +24 -4
- onfido/models/workflow_run_response.py +6 -15
- onfido/models/workflow_run_shared.py +3 -3
- onfido/models/workflow_run_status.py +43 -0
- onfido/rest.py +1 -1
- {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/METADATA +3 -3
- {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/RECORD +90 -77
- {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/WHEEL +1 -1
- {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/LICENSE +0 -0
- {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Onfido API v3.6
|
|
5
|
+
|
|
6
|
+
The Onfido API (v3.6)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3.6
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from onfido.models.workflow_run_error import WorkflowRunError
|
|
25
|
+
from onfido.models.workflow_run_link import WorkflowRunLink
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class WebhookEventPayloadResource(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
The resource affected by this event.
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
id: Optional[StrictStr] = Field(default=None, description="The identifier of the resource.")
|
|
34
|
+
applicant_id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the Applicant.")
|
|
35
|
+
created_at: Optional[datetime] = Field(default=None, description="The date and time when the resource was created.")
|
|
36
|
+
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the resource was last updated.")
|
|
37
|
+
dashboard_url: Optional[StrictStr] = Field(default=None, description="The URL for viewing the resource on Onfido Dashboard.")
|
|
38
|
+
workflow_id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the Workflow.")
|
|
39
|
+
workflow_run_id: Optional[StrictStr] = None
|
|
40
|
+
workflow_version_id: Optional[StrictInt] = Field(default=None, description="The identifier for the Workflow version.")
|
|
41
|
+
task_def_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The identifier for the Task Definition.")
|
|
42
|
+
task_def_version: Optional[StrictStr] = Field(default=None, description="The task definition version.")
|
|
43
|
+
input: Optional[Dict[str, Any]] = Field(default=None, description="Input object with the fields used by the Task execution.")
|
|
44
|
+
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object with the fields produced by the Task execution.")
|
|
45
|
+
reasons: Optional[List[StrictStr]] = Field(default=None, description="The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow Version.")
|
|
46
|
+
link: Optional[WorkflowRunLink] = Field(default=None, description="Object for the configuration of the Workflow Run link.")
|
|
47
|
+
error: Optional[WorkflowRunError] = Field(default=None, description="Error object that details why a Workflow Run is in Error status.")
|
|
48
|
+
additional_properties: Dict[str, Any] = {}
|
|
49
|
+
__properties: ClassVar[List[str]] = ["id", "applicant_id", "created_at", "updated_at", "dashboard_url", "workflow_id", "workflow_run_id", "workflow_version_id", "task_def_id", "task_def_version", "input", "output", "reasons", "link", "error"]
|
|
50
|
+
|
|
51
|
+
@field_validator('task_def_id')
|
|
52
|
+
def task_def_id_validate_regular_expression(cls, value):
|
|
53
|
+
"""Validates the regular expression"""
|
|
54
|
+
if value is None:
|
|
55
|
+
return value
|
|
56
|
+
|
|
57
|
+
if not re.match(r"^[0-9a-z_-]+$", value):
|
|
58
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-z_-]+$/")
|
|
59
|
+
return value
|
|
60
|
+
|
|
61
|
+
model_config = ConfigDict(
|
|
62
|
+
populate_by_name=True,
|
|
63
|
+
validate_assignment=True,
|
|
64
|
+
protected_namespaces=(),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def to_str(self) -> str:
|
|
69
|
+
"""Returns the string representation of the model using alias"""
|
|
70
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
71
|
+
|
|
72
|
+
def to_json(self) -> str:
|
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
|
74
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
75
|
+
return json.dumps(self.to_dict())
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of WebhookEventPayloadResource from a JSON string"""
|
|
80
|
+
return cls.from_dict(json.loads(json_str))
|
|
81
|
+
|
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
83
|
+
"""Return the dictionary representation of the model using alias.
|
|
84
|
+
|
|
85
|
+
This has the following differences from calling pydantic's
|
|
86
|
+
`self.model_dump(by_alias=True)`:
|
|
87
|
+
|
|
88
|
+
* `None` is only added to the output dict for nullable fields that
|
|
89
|
+
were set at model initialization. Other fields with value `None`
|
|
90
|
+
are ignored.
|
|
91
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
92
|
+
"""
|
|
93
|
+
excluded_fields: Set[str] = set([
|
|
94
|
+
"additional_properties",
|
|
95
|
+
])
|
|
96
|
+
|
|
97
|
+
_dict = self.model_dump(
|
|
98
|
+
by_alias=True,
|
|
99
|
+
exclude=excluded_fields,
|
|
100
|
+
exclude_none=True,
|
|
101
|
+
)
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of link
|
|
103
|
+
if self.link:
|
|
104
|
+
_dict['link'] = self.link.to_dict()
|
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of error
|
|
106
|
+
if self.error:
|
|
107
|
+
_dict['error'] = self.error.to_dict()
|
|
108
|
+
# puts key-value pairs in additional_properties in the top level
|
|
109
|
+
if self.additional_properties is not None:
|
|
110
|
+
for _key, _value in self.additional_properties.items():
|
|
111
|
+
_dict[_key] = _value
|
|
112
|
+
|
|
113
|
+
# set to None if task_def_version (nullable) is None
|
|
114
|
+
# and model_fields_set contains the field
|
|
115
|
+
if self.task_def_version is None and "task_def_version" in self.model_fields_set:
|
|
116
|
+
_dict['task_def_version'] = None
|
|
117
|
+
|
|
118
|
+
# set to None if output (nullable) is None
|
|
119
|
+
# and model_fields_set contains the field
|
|
120
|
+
if self.output is None and "output" in self.model_fields_set:
|
|
121
|
+
_dict['output'] = None
|
|
122
|
+
|
|
123
|
+
return _dict
|
|
124
|
+
|
|
125
|
+
@classmethod
|
|
126
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
127
|
+
"""Create an instance of WebhookEventPayloadResource from a dict"""
|
|
128
|
+
if obj is None:
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
if not isinstance(obj, dict):
|
|
132
|
+
return cls.model_validate(obj)
|
|
133
|
+
|
|
134
|
+
_obj = cls.model_validate({
|
|
135
|
+
"id": obj.get("id"),
|
|
136
|
+
"applicant_id": obj.get("applicant_id"),
|
|
137
|
+
"created_at": obj.get("created_at"),
|
|
138
|
+
"updated_at": obj.get("updated_at"),
|
|
139
|
+
"dashboard_url": obj.get("dashboard_url"),
|
|
140
|
+
"workflow_id": obj.get("workflow_id"),
|
|
141
|
+
"workflow_run_id": obj.get("workflow_run_id"),
|
|
142
|
+
"workflow_version_id": obj.get("workflow_version_id"),
|
|
143
|
+
"task_def_id": obj.get("task_def_id"),
|
|
144
|
+
"task_def_version": obj.get("task_def_version"),
|
|
145
|
+
"input": obj.get("input"),
|
|
146
|
+
"output": obj.get("output"),
|
|
147
|
+
"reasons": obj.get("reasons"),
|
|
148
|
+
"link": WorkflowRunLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
|
|
149
|
+
"error": WorkflowRunError.from_dict(obj["error"]) if obj.get("error") is not None else None
|
|
150
|
+
})
|
|
151
|
+
# store additional fields in additional_properties
|
|
152
|
+
for _key in obj.keys():
|
|
153
|
+
if _key not in cls.__properties:
|
|
154
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
155
|
+
|
|
156
|
+
return _obj
|
|
157
|
+
|
|
158
|
+
|
|
@@ -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 WebhookEventResourceType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
WebhookEventResourceType
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
CHECK = 'check'
|
|
30
|
+
REPORT = 'report'
|
|
31
|
+
AUDIT_LOG = 'audit_log'
|
|
32
|
+
WORKFLOW_RUN = 'workflow_run'
|
|
33
|
+
WORKFLOW_TASK = 'workflow_task'
|
|
34
|
+
WATCHLIST_MONITOR = 'watchlist_monitor'
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_json(cls, json_str: str) -> Self:
|
|
38
|
+
"""Create an instance of WebhookEventResourceType from a JSON string"""
|
|
39
|
+
return cls(json.loads(json_str))
|
|
40
|
+
|
|
41
|
+
|
onfido/models/webhook_resend.py
CHANGED
|
@@ -75,9 +75,9 @@ class WebhookResend(BaseModel):
|
|
|
75
75
|
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
|
|
76
76
|
_items = []
|
|
77
77
|
if self.data:
|
|
78
|
-
for
|
|
79
|
-
if
|
|
80
|
-
_items.append(
|
|
78
|
+
for _item_data in self.data:
|
|
79
|
+
if _item_data:
|
|
80
|
+
_items.append(_item_data.to_dict())
|
|
81
81
|
_dict['data'] = _items
|
|
82
82
|
# puts key-value pairs in additional_properties in the top level
|
|
83
83
|
if self.additional_properties is not None:
|
onfido/models/webhooks_list.py
CHANGED
|
@@ -75,9 +75,9 @@ class WebhooksList(BaseModel):
|
|
|
75
75
|
# override the default output from pydantic by calling `to_dict()` of each item in webhooks (list)
|
|
76
76
|
_items = []
|
|
77
77
|
if self.webhooks:
|
|
78
|
-
for
|
|
79
|
-
if
|
|
80
|
-
_items.append(
|
|
78
|
+
for _item_webhooks in self.webhooks:
|
|
79
|
+
if _item_webhooks:
|
|
80
|
+
_items.append(_item_webhooks.to_dict())
|
|
81
81
|
_dict['webhooks'] = _items
|
|
82
82
|
# puts key-value pairs in additional_properties in the top level
|
|
83
83
|
if self.additional_properties is not None:
|
onfido/models/workflow_run.py
CHANGED
|
@@ -18,11 +18,12 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
|
-
from onfido.models.
|
|
25
|
-
from onfido.models.
|
|
24
|
+
from onfido.models.workflow_run_error import WorkflowRunError
|
|
25
|
+
from onfido.models.workflow_run_link import WorkflowRunLink
|
|
26
|
+
from onfido.models.workflow_run_status import WorkflowRunStatus
|
|
26
27
|
from typing import Optional, Set
|
|
27
28
|
from typing_extensions import Self
|
|
28
29
|
|
|
@@ -34,30 +35,20 @@ class WorkflowRun(BaseModel):
|
|
|
34
35
|
workflow_id: StrictStr = Field(description="The unique identifier for the Workflow.")
|
|
35
36
|
tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(max_length=30)]] = Field(default=None, description="Tags or labels assigned to the workflow run.")
|
|
36
37
|
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
|
|
37
|
-
link: Optional[
|
|
38
|
+
link: Optional[WorkflowRunLink] = Field(default=None, description="Object for the configuration of the Workflow Run link.")
|
|
38
39
|
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was created.")
|
|
39
40
|
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was last updated.")
|
|
40
41
|
id: StrictStr = Field(description="The unique identifier for the Workflow Run.")
|
|
41
42
|
workflow_version_id: Optional[StrictInt] = Field(default=None, description="The identifier for the Workflow version.")
|
|
42
43
|
dashboard_url: Optional[StrictStr] = Field(default=None, description="The URL for viewing the Workflow Run results on your Onfido Dashboard.")
|
|
43
|
-
status: Optional[
|
|
44
|
+
status: Optional[WorkflowRunStatus] = Field(default=None, description="The status of the Workflow Run.")
|
|
44
45
|
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object contains all of the properties configured on the Workflow version.")
|
|
45
46
|
reasons: Optional[List[StrictStr]] = Field(default=None, description="The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow version.")
|
|
46
|
-
error: Optional[
|
|
47
|
+
error: Optional[WorkflowRunError] = Field(default=None, description="Error object. Only set when the Workflow Run status is 'error'.")
|
|
47
48
|
sdk_token: Optional[StrictStr] = Field(default=None, description="Client token to use when loading this workflow run in the Onfido SDK.")
|
|
48
49
|
additional_properties: Dict[str, Any] = {}
|
|
49
50
|
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "customer_user_id", "link", "created_at", "updated_at", "id", "workflow_version_id", "dashboard_url", "status", "output", "reasons", "error", "sdk_token"]
|
|
50
51
|
|
|
51
|
-
@field_validator('status')
|
|
52
|
-
def status_validate_enum(cls, value):
|
|
53
|
-
"""Validates the enum"""
|
|
54
|
-
if value is None:
|
|
55
|
-
return value
|
|
56
|
-
|
|
57
|
-
if value not in set(['awaiting_input', 'processing', 'abandoned', 'error', 'approved', 'review', 'declined']):
|
|
58
|
-
raise ValueError("must be one of enum values ('awaiting_input', 'processing', 'abandoned', 'error', 'approved', 'review', 'declined')")
|
|
59
|
-
return value
|
|
60
|
-
|
|
61
52
|
model_config = ConfigDict(
|
|
62
53
|
populate_by_name=True,
|
|
63
54
|
validate_assignment=True,
|
|
@@ -136,7 +127,7 @@ class WorkflowRun(BaseModel):
|
|
|
136
127
|
"workflow_id": obj.get("workflow_id"),
|
|
137
128
|
"tags": obj.get("tags"),
|
|
138
129
|
"customer_user_id": obj.get("customer_user_id"),
|
|
139
|
-
"link":
|
|
130
|
+
"link": WorkflowRunLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
|
|
140
131
|
"created_at": obj.get("created_at"),
|
|
141
132
|
"updated_at": obj.get("updated_at"),
|
|
142
133
|
"id": obj.get("id"),
|
|
@@ -145,7 +136,7 @@ class WorkflowRun(BaseModel):
|
|
|
145
136
|
"status": obj.get("status"),
|
|
146
137
|
"output": obj.get("output"),
|
|
147
138
|
"reasons": obj.get("reasons"),
|
|
148
|
-
"error":
|
|
139
|
+
"error": WorkflowRunError.from_dict(obj["error"]) if obj.get("error") is not None else None,
|
|
149
140
|
"sdk_token": obj.get("sdk_token")
|
|
150
141
|
})
|
|
151
142
|
# store additional fields in additional_properties
|
|
@@ -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 typing_extensions import Annotated
|
|
24
|
-
from onfido.models.
|
|
24
|
+
from onfido.models.workflow_run_link import WorkflowRunLink
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ class WorkflowRunBuilder(BaseModel):
|
|
|
33
33
|
workflow_id: StrictStr = Field(description="The unique identifier for the Workflow.")
|
|
34
34
|
tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(max_length=30)]] = Field(default=None, description="Tags or labels assigned to the workflow run.")
|
|
35
35
|
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
|
|
36
|
-
link: Optional[
|
|
36
|
+
link: Optional[WorkflowRunLink] = Field(default=None, description="Object for the configuration of the Workflow Run link.")
|
|
37
37
|
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was created.")
|
|
38
38
|
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was last updated.")
|
|
39
39
|
custom_data: Optional[Dict[str, Any]] = Field(default=None, description="Object with Custom Input Data to be used in the Workflow Run.")
|
|
@@ -110,7 +110,7 @@ class WorkflowRunBuilder(BaseModel):
|
|
|
110
110
|
"workflow_id": obj.get("workflow_id"),
|
|
111
111
|
"tags": obj.get("tags"),
|
|
112
112
|
"customer_user_id": obj.get("customer_user_id"),
|
|
113
|
-
"link":
|
|
113
|
+
"link": WorkflowRunLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
|
|
114
114
|
"created_at": obj.get("created_at"),
|
|
115
115
|
"updated_at": obj.get("updated_at"),
|
|
116
116
|
"custom_data": obj.get("custom_data")
|
|
@@ -22,9 +22,9 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class WorkflowRunError(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
WorkflowRunError
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
type: Optional[StrictStr] = Field(default=None, description="The type of error.")
|
|
30
30
|
message: Optional[StrictStr] = Field(default=None, description="A textual description of the error.")
|
|
@@ -49,7 +49,7 @@ class WorkflowRunResponseError(BaseModel):
|
|
|
49
49
|
|
|
50
50
|
@classmethod
|
|
51
51
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of
|
|
52
|
+
"""Create an instance of WorkflowRunError 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]:
|
|
@@ -81,7 +81,7 @@ class WorkflowRunResponseError(BaseModel):
|
|
|
81
81
|
|
|
82
82
|
@classmethod
|
|
83
83
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
-
"""Create an instance of
|
|
84
|
+
"""Create an instance of WorkflowRunError from a dict"""
|
|
85
85
|
if obj is None:
|
|
86
86
|
return None
|
|
87
87
|
|
|
@@ -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
|
|
26
|
+
class WorkflowRunLink(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
WorkflowRunLink
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
url: Optional[StrictStr] = Field(default=None, description="Link to access the Workflow Run without the need to integrate with Onfido's SDKs.")
|
|
31
31
|
completed_redirect_url: Optional[StrictStr] = Field(default=None, description="When the interactive section of the Workflow Run has completed successfully, the user will be redirected to this URL instead of seeing the default Onfido 'thank you' page.")
|
|
@@ -63,7 +63,7 @@ class WorkflowRunSharedLink(BaseModel):
|
|
|
63
63
|
|
|
64
64
|
@classmethod
|
|
65
65
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
-
"""Create an instance of
|
|
66
|
+
"""Create an instance of WorkflowRunLink from a JSON string"""
|
|
67
67
|
return cls.from_dict(json.loads(json_str))
|
|
68
68
|
|
|
69
69
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -91,11 +91,31 @@ class WorkflowRunSharedLink(BaseModel):
|
|
|
91
91
|
for _key, _value in self.additional_properties.items():
|
|
92
92
|
_dict[_key] = _value
|
|
93
93
|
|
|
94
|
+
# set to None if completed_redirect_url (nullable) is None
|
|
95
|
+
# and model_fields_set contains the field
|
|
96
|
+
if self.completed_redirect_url is None and "completed_redirect_url" in self.model_fields_set:
|
|
97
|
+
_dict['completed_redirect_url'] = None
|
|
98
|
+
|
|
99
|
+
# set to None if expired_redirect_url (nullable) is None
|
|
100
|
+
# and model_fields_set contains the field
|
|
101
|
+
if self.expired_redirect_url is None and "expired_redirect_url" in self.model_fields_set:
|
|
102
|
+
_dict['expired_redirect_url'] = None
|
|
103
|
+
|
|
104
|
+
# set to None if expires_at (nullable) is None
|
|
105
|
+
# and model_fields_set contains the field
|
|
106
|
+
if self.expires_at is None and "expires_at" in self.model_fields_set:
|
|
107
|
+
_dict['expires_at'] = None
|
|
108
|
+
|
|
109
|
+
# set to None if language (nullable) is None
|
|
110
|
+
# and model_fields_set contains the field
|
|
111
|
+
if self.language is None and "language" in self.model_fields_set:
|
|
112
|
+
_dict['language'] = None
|
|
113
|
+
|
|
94
114
|
return _dict
|
|
95
115
|
|
|
96
116
|
@classmethod
|
|
97
117
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
-
"""Create an instance of
|
|
118
|
+
"""Create an instance of WorkflowRunLink from a dict"""
|
|
99
119
|
if obj is None:
|
|
100
120
|
return None
|
|
101
121
|
|
|
@@ -17,9 +17,10 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from onfido.models.
|
|
22
|
+
from onfido.models.workflow_run_error import WorkflowRunError
|
|
23
|
+
from onfido.models.workflow_run_status import WorkflowRunStatus
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -30,24 +31,14 @@ class WorkflowRunResponse(BaseModel):
|
|
|
30
31
|
id: StrictStr = Field(description="The unique identifier for the Workflow Run.")
|
|
31
32
|
workflow_version_id: Optional[StrictInt] = Field(default=None, description="The identifier for the Workflow version.")
|
|
32
33
|
dashboard_url: Optional[StrictStr] = Field(default=None, description="The URL for viewing the Workflow Run results on your Onfido Dashboard.")
|
|
33
|
-
status: Optional[
|
|
34
|
+
status: Optional[WorkflowRunStatus] = Field(default=None, description="The status of the Workflow Run.")
|
|
34
35
|
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object contains all of the properties configured on the Workflow version.")
|
|
35
36
|
reasons: Optional[List[StrictStr]] = Field(default=None, description="The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow version.")
|
|
36
|
-
error: Optional[
|
|
37
|
+
error: Optional[WorkflowRunError] = Field(default=None, description="Error object. Only set when the Workflow Run status is 'error'.")
|
|
37
38
|
sdk_token: Optional[StrictStr] = Field(default=None, description="Client token to use when loading this workflow run in the Onfido SDK.")
|
|
38
39
|
additional_properties: Dict[str, Any] = {}
|
|
39
40
|
__properties: ClassVar[List[str]] = ["id", "workflow_version_id", "dashboard_url", "status", "output", "reasons", "error", "sdk_token"]
|
|
40
41
|
|
|
41
|
-
@field_validator('status')
|
|
42
|
-
def status_validate_enum(cls, value):
|
|
43
|
-
"""Validates the enum"""
|
|
44
|
-
if value is None:
|
|
45
|
-
return value
|
|
46
|
-
|
|
47
|
-
if value not in set(['awaiting_input', 'processing', 'abandoned', 'error', 'approved', 'review', 'declined']):
|
|
48
|
-
raise ValueError("must be one of enum values ('awaiting_input', 'processing', 'abandoned', 'error', 'approved', 'review', 'declined')")
|
|
49
|
-
return value
|
|
50
|
-
|
|
51
42
|
model_config = ConfigDict(
|
|
52
43
|
populate_by_name=True,
|
|
53
44
|
validate_assignment=True,
|
|
@@ -120,7 +111,7 @@ class WorkflowRunResponse(BaseModel):
|
|
|
120
111
|
"status": obj.get("status"),
|
|
121
112
|
"output": obj.get("output"),
|
|
122
113
|
"reasons": obj.get("reasons"),
|
|
123
|
-
"error":
|
|
114
|
+
"error": WorkflowRunError.from_dict(obj["error"]) if obj.get("error") is not None else None,
|
|
124
115
|
"sdk_token": obj.get("sdk_token")
|
|
125
116
|
})
|
|
126
117
|
# store additional fields in additional_properties
|
|
@@ -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 typing_extensions import Annotated
|
|
24
|
-
from onfido.models.
|
|
24
|
+
from onfido.models.workflow_run_link import WorkflowRunLink
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ class WorkflowRunShared(BaseModel):
|
|
|
33
33
|
workflow_id: StrictStr = Field(description="The unique identifier for the Workflow.")
|
|
34
34
|
tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(max_length=30)]] = Field(default=None, description="Tags or labels assigned to the workflow run.")
|
|
35
35
|
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
|
|
36
|
-
link: Optional[
|
|
36
|
+
link: Optional[WorkflowRunLink] = Field(default=None, description="Object for the configuration of the Workflow Run link.")
|
|
37
37
|
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was created.")
|
|
38
38
|
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was last updated.")
|
|
39
39
|
additional_properties: Dict[str, Any] = {}
|
|
@@ -109,7 +109,7 @@ class WorkflowRunShared(BaseModel):
|
|
|
109
109
|
"workflow_id": obj.get("workflow_id"),
|
|
110
110
|
"tags": obj.get("tags"),
|
|
111
111
|
"customer_user_id": obj.get("customer_user_id"),
|
|
112
|
-
"link":
|
|
112
|
+
"link": WorkflowRunLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
|
|
113
113
|
"created_at": obj.get("created_at"),
|
|
114
114
|
"updated_at": obj.get("updated_at")
|
|
115
115
|
})
|
|
@@ -0,0 +1,43 @@
|
|
|
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 WorkflowRunStatus(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
WorkflowRunStatus
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
PROCESSING = 'processing'
|
|
30
|
+
AWAITING_INPUT = 'awaiting_input'
|
|
31
|
+
AWAITING_CLIENT_INPUT = 'awaiting_client_input'
|
|
32
|
+
APPROVED = 'approved'
|
|
33
|
+
DECLINED = 'declined'
|
|
34
|
+
REVIEW = 'review'
|
|
35
|
+
ABANDONED = 'abandoned'
|
|
36
|
+
ERROR = 'error'
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_json(cls, json_str: str) -> Self:
|
|
40
|
+
"""Create an instance of WorkflowRunStatus from a JSON string"""
|
|
41
|
+
return cls(json.loads(json_str))
|
|
42
|
+
|
|
43
|
+
|
onfido/rest.py
CHANGED
|
@@ -226,7 +226,7 @@ class RESTClientObject:
|
|
|
226
226
|
headers=headers,
|
|
227
227
|
preload_content=False
|
|
228
228
|
)
|
|
229
|
-
elif headers['Content-Type']
|
|
229
|
+
elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
|
|
230
230
|
request_body = "true" if body else "false"
|
|
231
231
|
r = self.pool_manager.request(
|
|
232
232
|
method,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: onfido-python
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0
|
|
4
4
|
Summary: Python library for the Onfido API
|
|
5
5
|
Home-page:
|
|
6
6
|
Author: OpenAPI Generator community
|
|
@@ -9,8 +9,8 @@ License: MIT
|
|
|
9
9
|
Keywords: OpenAPI,OpenAPI-Generator,onfido,identity
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist: urllib3 <
|
|
13
|
-
Requires-Dist: python-dateutil
|
|
12
|
+
Requires-Dist: urllib3 <3.0.0,>=1.25.3
|
|
13
|
+
Requires-Dist: python-dateutil >=2.8.2
|
|
14
14
|
Requires-Dist: pydantic >=2
|
|
15
15
|
Requires-Dist: typing-extensions >=4.7.1
|
|
16
16
|
|