onfido-python 3.5.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.
Files changed (84) hide show
  1. onfido/__init__.py +10 -5
  2. onfido/api/default_api.py +611 -416
  3. onfido/api_client.py +38 -11
  4. onfido/configuration.py +14 -3
  5. onfido/models/__init__.py +9 -4
  6. onfido/models/addresses_list.py +3 -3
  7. onfido/models/applicant.py +3 -3
  8. onfido/models/applicant_builder.py +12 -8
  9. onfido/models/{consents_builder.py → applicant_consent_builder.py} +11 -6
  10. onfido/models/applicant_consent_name.py +38 -0
  11. onfido/models/applicant_request.py +10 -6
  12. onfido/models/applicant_shared.py +3 -3
  13. onfido/models/applicant_updater.py +12 -8
  14. onfido/models/applicants_list.py +3 -3
  15. onfido/models/check.py +10 -13
  16. onfido/models/check_builder.py +3 -1
  17. onfido/models/check_response.py +7 -13
  18. onfido/models/check_shared.py +4 -2
  19. onfido/models/check_status.py +41 -0
  20. onfido/models/checks_list.py +3 -3
  21. onfido/models/device_intelligence_breakdown_properties_device.py +1 -9
  22. onfido/models/device_intelligence_breakdown_properties_ip.py +2 -8
  23. onfido/models/device_intelligence_report.py +3 -3
  24. onfido/models/document.py +2 -1
  25. onfido/models/document_properties.py +6 -6
  26. onfido/models/document_report.py +3 -3
  27. onfido/models/document_shared.py +2 -1
  28. onfido/models/document_types.py +5 -0
  29. onfido/models/document_video_report.py +3 -3
  30. onfido/models/document_video_with_address_information_report.py +3 -3
  31. onfido/models/document_with_address_information_report.py +3 -3
  32. onfido/models/document_with_driver_verification_report.py +3 -3
  33. onfido/models/document_with_driver_verification_report_all_of_properties.py +9 -9
  34. onfido/models/document_with_driving_licence_information_report.py +3 -3
  35. onfido/models/documents_list.py +3 -3
  36. onfido/models/facial_similarity_motion_report.py +3 -3
  37. onfido/models/facial_similarity_photo_fully_auto_report.py +3 -3
  38. onfido/models/facial_similarity_photo_report.py +3 -3
  39. onfido/models/facial_similarity_video_report.py +3 -3
  40. onfido/models/id_photos_list.py +3 -3
  41. onfido/models/identity_enhanced_properties.py +3 -3
  42. onfido/models/identity_enhanced_report.py +3 -3
  43. onfido/models/india_pan_report.py +3 -3
  44. onfido/models/known_faces_properties.py +3 -3
  45. onfido/models/known_faces_report.py +3 -3
  46. onfido/models/live_photos_list.py +3 -3
  47. onfido/models/live_videos_list.py +3 -3
  48. onfido/models/motion_captures_list.py +3 -3
  49. onfido/models/proof_of_address_report.py +3 -3
  50. onfido/models/repeat_attempts_list.py +3 -3
  51. onfido/models/report_shared.py +3 -3
  52. onfido/models/reports_list.py +3 -3
  53. onfido/models/task_item.py +11 -2
  54. onfido/models/us_driving_licence_report.py +3 -3
  55. onfido/models/watchlist_aml_report.py +3 -3
  56. onfido/models/watchlist_enhanced_properties.py +3 -3
  57. onfido/models/watchlist_enhanced_properties_records_inner.py +18 -18
  58. onfido/models/watchlist_enhanced_report.py +3 -3
  59. onfido/models/watchlist_monitor_matches_list.py +3 -3
  60. onfido/models/watchlist_monitors_list.py +3 -3
  61. onfido/models/watchlist_peps_only_report.py +3 -3
  62. onfido/models/watchlist_sanctions_only_report.py +3 -3
  63. onfido/models/watchlist_standard_report.py +3 -3
  64. onfido/models/webhook_event_object_status.py +54 -0
  65. onfido/models/webhook_event_payload.py +9 -4
  66. onfido/models/webhook_event_payload_object.py +2 -1
  67. onfido/models/webhook_event_payload_resource.py +158 -0
  68. onfido/models/webhook_event_resource_type.py +41 -0
  69. onfido/models/webhook_resend.py +3 -3
  70. onfido/models/webhooks_list.py +3 -3
  71. onfido/models/workflow_run.py +9 -18
  72. onfido/models/workflow_run_builder.py +3 -3
  73. onfido/models/{workflow_run_response_error.py → workflow_run_error.py} +4 -4
  74. onfido/models/{workflow_run_shared_link.py → workflow_run_link.py} +24 -4
  75. onfido/models/workflow_run_response.py +6 -15
  76. onfido/models/workflow_run_shared.py +3 -3
  77. onfido/models/workflow_run_status.py +43 -0
  78. onfido/rest.py +1 -1
  79. {onfido_python-3.5.0.dist-info → onfido_python-4.0.0.dist-info}/METADATA +3 -3
  80. {onfido_python-3.5.0.dist-info → onfido_python-4.0.0.dist-info}/RECORD +83 -78
  81. {onfido_python-3.5.0.dist-info → onfido_python-4.0.0.dist-info}/WHEEL +1 -1
  82. onfido/models/consent_item.py +0 -109
  83. {onfido_python-3.5.0.dist-info → onfido_python-4.0.0.dist-info}/LICENSE +0 -0
  84. {onfido_python-3.5.0.dist-info → onfido_python-4.0.0.dist-info}/top_level.txt +0 -0
@@ -88,9 +88,9 @@ class ReportShared(BaseModel):
88
88
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
89
89
  _items = []
90
90
  if self.documents:
91
- for _item in self.documents:
92
- if _item:
93
- _items.append(_item.to_dict())
91
+ for _item_documents in self.documents:
92
+ if _item_documents:
93
+ _items.append(_item_documents.to_dict())
94
94
  _dict['documents'] = _items
95
95
  # puts key-value pairs in additional_properties in the top level
96
96
  if self.additional_properties is not None:
@@ -75,9 +75,9 @@ class ReportsList(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in reports (list)
76
76
  _items = []
77
77
  if self.reports:
78
- for _item in self.reports:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_reports in self.reports:
79
+ if _item_reports:
80
+ _items.append(_item_reports.to_dict())
81
81
  _dict['reports'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, Field, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
24
  from typing import Optional, Set
@@ -29,11 +29,13 @@ class TaskItem(BaseModel):
29
29
  TaskItem
30
30
  """ # noqa: E501
31
31
  id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The identifier for the Task.")
32
+ workflow_run_id: Optional[StrictStr] = Field(default=None, description="The workflow run id the task belongs to.")
32
33
  task_def_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The identifier for the Task Definition.")
34
+ task_def_version: Optional[StrictStr] = Field(default=None, description="The task definition version.")
33
35
  created_at: Optional[datetime] = Field(default=None, description="The date and time when the Task was created.")
34
36
  updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Task was last updated.")
35
37
  additional_properties: Dict[str, Any] = {}
36
- __properties: ClassVar[List[str]] = ["id", "task_def_id", "created_at", "updated_at"]
38
+ __properties: ClassVar[List[str]] = ["id", "workflow_run_id", "task_def_id", "task_def_version", "created_at", "updated_at"]
37
39
 
38
40
  @field_validator('id')
39
41
  def id_validate_regular_expression(cls, value):
@@ -101,6 +103,11 @@ class TaskItem(BaseModel):
101
103
  for _key, _value in self.additional_properties.items():
102
104
  _dict[_key] = _value
103
105
 
106
+ # set to None if task_def_version (nullable) is None
107
+ # and model_fields_set contains the field
108
+ if self.task_def_version is None and "task_def_version" in self.model_fields_set:
109
+ _dict['task_def_version'] = None
110
+
104
111
  return _dict
105
112
 
106
113
  @classmethod
@@ -114,7 +121,9 @@ class TaskItem(BaseModel):
114
121
 
115
122
  _obj = cls.model_validate({
116
123
  "id": obj.get("id"),
124
+ "workflow_run_id": obj.get("workflow_run_id"),
117
125
  "task_def_id": obj.get("task_def_id"),
126
+ "task_def_version": obj.get("task_def_version"),
118
127
  "created_at": obj.get("created_at"),
119
128
  "updated_at": obj.get("updated_at")
120
129
  })
@@ -92,9 +92,9 @@ class UsDrivingLicenceReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class WatchlistAmlReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -75,9 +75,9 @@ class WatchlistEnhancedProperties(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in records (list)
76
76
  _items = []
77
77
  if self.records:
78
- for _item in self.records:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_records in self.records:
79
+ if _item_records:
80
+ _items.append(_item_records.to_dict())
81
81
  _dict['records'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -88,44 +88,44 @@ class WatchlistEnhancedPropertiesRecordsInner(BaseModel):
88
88
  # override the default output from pydantic by calling `to_dict()` of each item in address (list)
89
89
  _items = []
90
90
  if self.address:
91
- for _item in self.address:
92
- if _item:
93
- _items.append(_item.to_dict())
91
+ for _item_address in self.address:
92
+ if _item_address:
93
+ _items.append(_item_address.to_dict())
94
94
  _dict['address'] = _items
95
95
  # override the default output from pydantic by calling `to_dict()` of each item in alias (list)
96
96
  _items = []
97
97
  if self.alias:
98
- for _item in self.alias:
99
- if _item:
100
- _items.append(_item.to_dict())
98
+ for _item_alias in self.alias:
99
+ if _item_alias:
100
+ _items.append(_item_alias.to_dict())
101
101
  _dict['alias'] = _items
102
102
  # override the default output from pydantic by calling `to_dict()` of each item in associate (list)
103
103
  _items = []
104
104
  if self.associate:
105
- for _item in self.associate:
106
- if _item:
107
- _items.append(_item.to_dict())
105
+ for _item_associate in self.associate:
106
+ if _item_associate:
107
+ _items.append(_item_associate.to_dict())
108
108
  _dict['associate'] = _items
109
109
  # override the default output from pydantic by calling `to_dict()` of each item in attribute (list)
110
110
  _items = []
111
111
  if self.attribute:
112
- for _item in self.attribute:
113
- if _item:
114
- _items.append(_item.to_dict())
112
+ for _item_attribute in self.attribute:
113
+ if _item_attribute:
114
+ _items.append(_item_attribute.to_dict())
115
115
  _dict['attribute'] = _items
116
116
  # override the default output from pydantic by calling `to_dict()` of each item in event (list)
117
117
  _items = []
118
118
  if self.event:
119
- for _item in self.event:
120
- if _item:
121
- _items.append(_item.to_dict())
119
+ for _item_event in self.event:
120
+ if _item_event:
121
+ _items.append(_item_event.to_dict())
122
122
  _dict['event'] = _items
123
123
  # override the default output from pydantic by calling `to_dict()` of each item in source (list)
124
124
  _items = []
125
125
  if self.source:
126
- for _item in self.source:
127
- if _item:
128
- _items.append(_item.to_dict())
126
+ for _item_source in self.source:
127
+ if _item_source:
128
+ _items.append(_item_source.to_dict())
129
129
  _dict['source'] = _items
130
130
  # puts key-value pairs in additional_properties in the top level
131
131
  if self.additional_properties is not None:
@@ -92,9 +92,9 @@ class WatchlistEnhancedReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -75,9 +75,9 @@ class WatchlistMonitorMatchesList(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in matches (list)
76
76
  _items = []
77
77
  if self.matches:
78
- for _item in self.matches:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_matches in self.matches:
79
+ if _item_matches:
80
+ _items.append(_item_matches.to_dict())
81
81
  _dict['matches'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -75,9 +75,9 @@ class WatchlistMonitorsList(BaseModel):
75
75
  # override the default output from pydantic by calling `to_dict()` of each item in monitors (list)
76
76
  _items = []
77
77
  if self.monitors:
78
- for _item in self.monitors:
79
- if _item:
80
- _items.append(_item.to_dict())
78
+ for _item_monitors in self.monitors:
79
+ if _item_monitors:
80
+ _items.append(_item_monitors.to_dict())
81
81
  _dict['monitors'] = _items
82
82
  # puts key-value pairs in additional_properties in the top level
83
83
  if self.additional_properties is not None:
@@ -92,9 +92,9 @@ class WatchlistPepsOnlyReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class WatchlistSanctionsOnlyReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -92,9 +92,9 @@ class WatchlistStandardReport(BaseModel):
92
92
  # override the default output from pydantic by calling `to_dict()` of each item in documents (list)
93
93
  _items = []
94
94
  if self.documents:
95
- for _item in self.documents:
96
- if _item:
97
- _items.append(_item.to_dict())
95
+ for _item_documents in self.documents:
96
+ if _item_documents:
97
+ _items.append(_item_documents.to_dict())
98
98
  _dict['documents'] = _items
99
99
  # override the default output from pydantic by calling `to_dict()` of breakdown
100
100
  if self.breakdown:
@@ -0,0 +1,54 @@
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 WebhookEventObjectStatus(str, Enum):
22
+ """
23
+ The current state of the object, if available.
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
+ STARTED = 'started'
38
+ CANCELLED = 'cancelled'
39
+ COMPLETED = 'completed'
40
+ AWAITING_DATA = 'awaiting_data'
41
+ AWAITING_APPROVAL = 'awaiting_approval'
42
+ COMPLETE = 'complete'
43
+ WITHDRAWN = 'withdrawn'
44
+ IN_PROGRESS = 'in_progress'
45
+ AWAITING_APPLICANT = 'awaiting_applicant'
46
+ PAUSED = 'paused'
47
+ REOPENED = 'reopened'
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Self:
51
+ """Create an instance of WebhookEventObjectStatus from a JSON string"""
52
+ return cls(json.loads(json_str))
53
+
54
+
@@ -17,9 +17,11 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
20
+ from pydantic import BaseModel, ConfigDict, Field
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject
23
+ from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource
24
+ from onfido.models.webhook_event_resource_type import WebhookEventResourceType
23
25
  from onfido.models.webhook_event_type import WebhookEventType
24
26
  from typing import Optional, Set
25
27
  from typing_extensions import Self
@@ -28,10 +30,10 @@ class WebhookEventPayload(BaseModel):
28
30
  """
29
31
  WebhookEventPayload
30
32
  """ # noqa: E501
31
- resource_type: StrictStr = Field(description="Indicates the resource affected by this event.")
33
+ resource_type: WebhookEventResourceType = Field(description="Indicates the resource affected by this event.")
32
34
  action: Optional[WebhookEventType] = Field(default=None, description="The event that triggered this webhook.")
33
35
  object: Optional[WebhookEventPayloadObject] = None
34
- resource: Optional[Dict[str, Any]] = Field(default=None, description="The resource affected by this event.")
36
+ resource: Optional[WebhookEventPayloadResource] = None
35
37
  additional_properties: Dict[str, Any] = {}
36
38
  __properties: ClassVar[List[str]] = ["resource_type", "action", "object", "resource"]
37
39
 
@@ -79,6 +81,9 @@ class WebhookEventPayload(BaseModel):
79
81
  # override the default output from pydantic by calling `to_dict()` of object
80
82
  if self.object:
81
83
  _dict['object'] = self.object.to_dict()
84
+ # override the default output from pydantic by calling `to_dict()` of resource
85
+ if self.resource:
86
+ _dict['resource'] = self.resource.to_dict()
82
87
  # puts key-value pairs in additional_properties in the top level
83
88
  if self.additional_properties is not None:
84
89
  for _key, _value in self.additional_properties.items():
@@ -99,7 +104,7 @@ class WebhookEventPayload(BaseModel):
99
104
  "resource_type": obj.get("resource_type"),
100
105
  "action": obj.get("action"),
101
106
  "object": WebhookEventPayloadObject.from_dict(obj["object"]) if obj.get("object") is not None else None,
102
- "resource": obj.get("resource")
107
+ "resource": WebhookEventPayloadResource.from_dict(obj["resource"]) if obj.get("resource") is not None else None
103
108
  })
104
109
  # store additional fields in additional_properties
105
110
  for _key in obj.keys():
@@ -20,6 +20,7 @@ import json
20
20
  from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from onfido.models.webhook_event_object_status import WebhookEventObjectStatus
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
26
 
@@ -28,7 +29,7 @@ class WebhookEventPayloadObject(BaseModel):
28
29
  The object affected by this event.
29
30
  """ # noqa: E501
30
31
  id: StrictStr = Field(description="The unique identifier of the resource.")
31
- status: Optional[StrictStr] = Field(default=None, description="The current state of the object, if available.")
32
+ status: Optional[WebhookEventObjectStatus] = None
32
33
  started_at_iso8601: Optional[datetime] = Field(default=None, description="The date and time when the operation was started, if available.")
33
34
  completed_at_iso8601: Optional[datetime] = Field(default=None, description="The date and time when the operation was completed, if available.")
34
35
  href: StrictStr = Field(description="The uri of the resource.")
@@ -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
+
@@ -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 _item in self.data:
79
- if _item:
80
- _items.append(_item.to_dict())
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:
@@ -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 _item in self.webhooks:
79
- if _item:
80
- _items.append(_item.to_dict())
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: