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.
Files changed (90) hide show
  1. onfido/__init__.py +18 -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 +17 -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 +11 -3
  57. onfido/models/watchlist_enhanced_properties_records_inner.py +164 -0
  58. onfido/models/watchlist_enhanced_properties_records_inner_address_inner.py +111 -0
  59. onfido/models/{consent_item.py → watchlist_enhanced_properties_records_inner_alias_inner.py} +11 -18
  60. onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.py +104 -0
  61. onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.py +102 -0
  62. onfido/models/watchlist_enhanced_properties_records_inner_event_inner.py +113 -0
  63. onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.py +107 -0
  64. onfido/models/watchlist_enhanced_properties_records_inner_source_inner.py +106 -0
  65. onfido/models/watchlist_enhanced_report.py +3 -3
  66. onfido/models/watchlist_monitor_matches_list.py +3 -3
  67. onfido/models/watchlist_monitors_list.py +3 -3
  68. onfido/models/watchlist_peps_only_report.py +3 -3
  69. onfido/models/watchlist_sanctions_only_report.py +3 -3
  70. onfido/models/watchlist_standard_report.py +3 -3
  71. onfido/models/webhook_event_object_status.py +54 -0
  72. onfido/models/webhook_event_payload.py +9 -4
  73. onfido/models/webhook_event_payload_object.py +2 -1
  74. onfido/models/webhook_event_payload_resource.py +158 -0
  75. onfido/models/webhook_event_resource_type.py +41 -0
  76. onfido/models/webhook_resend.py +3 -3
  77. onfido/models/webhooks_list.py +3 -3
  78. onfido/models/workflow_run.py +9 -18
  79. onfido/models/workflow_run_builder.py +3 -3
  80. onfido/models/{workflow_run_response_error.py → workflow_run_error.py} +4 -4
  81. onfido/models/{workflow_run_shared_link.py → workflow_run_link.py} +24 -4
  82. onfido/models/workflow_run_response.py +6 -15
  83. onfido/models/workflow_run_shared.py +3 -3
  84. onfido/models/workflow_run_status.py +43 -0
  85. onfido/rest.py +1 -1
  86. {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/METADATA +3 -3
  87. {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/RECORD +90 -77
  88. {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/WHEEL +1 -1
  89. {onfido_python-3.4.0.dist-info → onfido_python-4.0.0.dist-info}/LICENSE +0 -0
  90. {onfido_python-3.4.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:
@@ -17,8 +17,9 @@ 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
+ from onfido.models.watchlist_enhanced_properties_records_inner import WatchlistEnhancedPropertiesRecordsInner
22
23
  from typing import Optional, Set
23
24
  from typing_extensions import Self
24
25
 
@@ -26,7 +27,7 @@ class WatchlistEnhancedProperties(BaseModel):
26
27
  """
27
28
  WatchlistEnhancedProperties
28
29
  """ # noqa: E501
29
- records: Optional[List[StrictStr]] = Field(default=None, description="Returns any matches including, but not limited to, name and date of birth of match, aliases and associates, and relevant events and sources.")
30
+ records: Optional[List[WatchlistEnhancedPropertiesRecordsInner]] = Field(default=None, description="Returns any matches including, but not limited to, name and date of birth of match, aliases and associates, and relevant events and sources.")
30
31
  additional_properties: Dict[str, Any] = {}
31
32
  __properties: ClassVar[List[str]] = ["records"]
32
33
 
@@ -71,6 +72,13 @@ class WatchlistEnhancedProperties(BaseModel):
71
72
  exclude=excluded_fields,
72
73
  exclude_none=True,
73
74
  )
75
+ # override the default output from pydantic by calling `to_dict()` of each item in records (list)
76
+ _items = []
77
+ if self.records:
78
+ for _item_records in self.records:
79
+ if _item_records:
80
+ _items.append(_item_records.to_dict())
81
+ _dict['records'] = _items
74
82
  # puts key-value pairs in additional_properties in the top level
75
83
  if self.additional_properties is not None:
76
84
  for _key, _value in self.additional_properties.items():
@@ -88,7 +96,7 @@ class WatchlistEnhancedProperties(BaseModel):
88
96
  return cls.model_validate(obj)
89
97
 
90
98
  _obj = cls.model_validate({
91
- "records": obj.get("records")
99
+ "records": [WatchlistEnhancedPropertiesRecordsInner.from_dict(_item) for _item in obj["records"]] if obj.get("records") is not None else None
92
100
  })
93
101
  # store additional fields in additional_properties
94
102
  for _key in obj.keys():
@@ -0,0 +1,164 @@
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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from onfido.models.watchlist_enhanced_properties_records_inner_address_inner import WatchlistEnhancedPropertiesRecordsInnerAddressInner
23
+ from onfido.models.watchlist_enhanced_properties_records_inner_alias_inner import WatchlistEnhancedPropertiesRecordsInnerAliasInner
24
+ from onfido.models.watchlist_enhanced_properties_records_inner_associate_inner import WatchlistEnhancedPropertiesRecordsInnerAssociateInner
25
+ from onfido.models.watchlist_enhanced_properties_records_inner_attribute_inner import WatchlistEnhancedPropertiesRecordsInnerAttributeInner
26
+ from onfido.models.watchlist_enhanced_properties_records_inner_event_inner import WatchlistEnhancedPropertiesRecordsInnerEventInner
27
+ from onfido.models.watchlist_enhanced_properties_records_inner_source_inner import WatchlistEnhancedPropertiesRecordsInnerSourceInner
28
+ from typing import Optional, Set
29
+ from typing_extensions import Self
30
+
31
+ class WatchlistEnhancedPropertiesRecordsInner(BaseModel):
32
+ """
33
+ WatchlistEnhancedPropertiesRecordsInner
34
+ """ # noqa: E501
35
+ address: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAddressInner]] = Field(default=None, description="All addresses on file.")
36
+ alias: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAliasInner]] = Field(default=None, description="Any names that the person is also known as.")
37
+ associate: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAssociateInner]] = Field(default=None, description="Any linked persons, for example family relatives or business partners.")
38
+ attribute: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAttributeInner]] = Field(default=None, description="Information about the person, for example hair color or nationality.")
39
+ date_of_birth: Optional[List[StrictStr]] = Field(default=None, description="All the date of births on file.")
40
+ event: Optional[List[WatchlistEnhancedPropertiesRecordsInnerEventInner]] = Field(default=None, description="Information about events that have occurred to the person, for example deportation or arrest.")
41
+ full_name: Optional[StrictStr] = Field(default=None, description="The name on file")
42
+ position: Optional[List[StrictStr]] = Field(default=None, description="The role, country and date of each position.")
43
+ source: Optional[List[WatchlistEnhancedPropertiesRecordsInnerSourceInner]] = Field(default=None, description="Details about where the information was obtained.")
44
+ additional_properties: Dict[str, Any] = {}
45
+ __properties: ClassVar[List[str]] = ["address", "alias", "associate", "attribute", "date_of_birth", "event", "full_name", "position", "source"]
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInner from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ * Fields in `self.additional_properties` are added to the output dict.
78
+ """
79
+ excluded_fields: Set[str] = set([
80
+ "additional_properties",
81
+ ])
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ # override the default output from pydantic by calling `to_dict()` of each item in address (list)
89
+ _items = []
90
+ if self.address:
91
+ for _item_address in self.address:
92
+ if _item_address:
93
+ _items.append(_item_address.to_dict())
94
+ _dict['address'] = _items
95
+ # override the default output from pydantic by calling `to_dict()` of each item in alias (list)
96
+ _items = []
97
+ if self.alias:
98
+ for _item_alias in self.alias:
99
+ if _item_alias:
100
+ _items.append(_item_alias.to_dict())
101
+ _dict['alias'] = _items
102
+ # override the default output from pydantic by calling `to_dict()` of each item in associate (list)
103
+ _items = []
104
+ if self.associate:
105
+ for _item_associate in self.associate:
106
+ if _item_associate:
107
+ _items.append(_item_associate.to_dict())
108
+ _dict['associate'] = _items
109
+ # override the default output from pydantic by calling `to_dict()` of each item in attribute (list)
110
+ _items = []
111
+ if self.attribute:
112
+ for _item_attribute in self.attribute:
113
+ if _item_attribute:
114
+ _items.append(_item_attribute.to_dict())
115
+ _dict['attribute'] = _items
116
+ # override the default output from pydantic by calling `to_dict()` of each item in event (list)
117
+ _items = []
118
+ if self.event:
119
+ for _item_event in self.event:
120
+ if _item_event:
121
+ _items.append(_item_event.to_dict())
122
+ _dict['event'] = _items
123
+ # override the default output from pydantic by calling `to_dict()` of each item in source (list)
124
+ _items = []
125
+ if self.source:
126
+ for _item_source in self.source:
127
+ if _item_source:
128
+ _items.append(_item_source.to_dict())
129
+ _dict['source'] = _items
130
+ # puts key-value pairs in additional_properties in the top level
131
+ if self.additional_properties is not None:
132
+ for _key, _value in self.additional_properties.items():
133
+ _dict[_key] = _value
134
+
135
+ return _dict
136
+
137
+ @classmethod
138
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
139
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInner from a dict"""
140
+ if obj is None:
141
+ return None
142
+
143
+ if not isinstance(obj, dict):
144
+ return cls.model_validate(obj)
145
+
146
+ _obj = cls.model_validate({
147
+ "address": [WatchlistEnhancedPropertiesRecordsInnerAddressInner.from_dict(_item) for _item in obj["address"]] if obj.get("address") is not None else None,
148
+ "alias": [WatchlistEnhancedPropertiesRecordsInnerAliasInner.from_dict(_item) for _item in obj["alias"]] if obj.get("alias") is not None else None,
149
+ "associate": [WatchlistEnhancedPropertiesRecordsInnerAssociateInner.from_dict(_item) for _item in obj["associate"]] if obj.get("associate") is not None else None,
150
+ "attribute": [WatchlistEnhancedPropertiesRecordsInnerAttributeInner.from_dict(_item) for _item in obj["attribute"]] if obj.get("attribute") is not None else None,
151
+ "date_of_birth": obj.get("date_of_birth"),
152
+ "event": [WatchlistEnhancedPropertiesRecordsInnerEventInner.from_dict(_item) for _item in obj["event"]] if obj.get("event") is not None else None,
153
+ "full_name": obj.get("full_name"),
154
+ "position": obj.get("position"),
155
+ "source": [WatchlistEnhancedPropertiesRecordsInnerSourceInner.from_dict(_item) for _item in obj["source"]] if obj.get("source") is not None else None
156
+ })
157
+ # store additional fields in additional_properties
158
+ for _key in obj.keys():
159
+ if _key not in cls.__properties:
160
+ _obj.additional_properties[_key] = obj.get(_key)
161
+
162
+ return _obj
163
+
164
+
@@ -0,0 +1,111 @@
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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from onfido.models.country_codes import CountryCodes
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class WatchlistEnhancedPropertiesRecordsInnerAddressInner(BaseModel):
27
+ """
28
+ WatchlistEnhancedPropertiesRecordsInnerAddressInner
29
+ """ # noqa: E501
30
+ address_line1: Optional[StrictStr] = None
31
+ country: Optional[CountryCodes] = None
32
+ postal_code: Optional[StrictStr] = None
33
+ state_province: Optional[StrictStr] = None
34
+ town: Optional[StrictStr] = None
35
+ locator_type: Optional[StrictStr] = None
36
+ additional_properties: Dict[str, Any] = {}
37
+ __properties: ClassVar[List[str]] = ["address_line1", "country", "postal_code", "state_province", "town", "locator_type"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAddressInner from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ * Fields in `self.additional_properties` are added to the output dict.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ "additional_properties",
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # puts key-value pairs in additional_properties in the top level
81
+ if self.additional_properties is not None:
82
+ for _key, _value in self.additional_properties.items():
83
+ _dict[_key] = _value
84
+
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAddressInner from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "address_line1": obj.get("address_line1"),
98
+ "country": obj.get("country"),
99
+ "postal_code": obj.get("postal_code"),
100
+ "state_province": obj.get("state_province"),
101
+ "town": obj.get("town"),
102
+ "locator_type": obj.get("locator_type")
103
+ })
104
+ # store additional fields in additional_properties
105
+ for _key in obj.keys():
106
+ if _key not in cls.__properties:
107
+ _obj.additional_properties[_key] = obj.get(_key)
108
+
109
+ return _obj
110
+
111
+
@@ -17,26 +17,19 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ 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 ConsentItem(BaseModel):
25
+ class WatchlistEnhancedPropertiesRecordsInnerAliasInner(BaseModel):
26
26
  """
27
- The applicant's consents
27
+ WatchlistEnhancedPropertiesRecordsInnerAliasInner
28
28
  """ # noqa: E501
29
- name: StrictStr
30
- granted: StrictBool
29
+ alias_name: Optional[StrictStr] = None
30
+ alias_type: Optional[StrictStr] = None
31
31
  additional_properties: Dict[str, Any] = {}
32
- __properties: ClassVar[List[str]] = ["name", "granted"]
33
-
34
- @field_validator('name')
35
- def name_validate_enum(cls, value):
36
- """Validates the enum"""
37
- if value not in set(['privacy_notices_read', 'ssn_verification', 'phone_number_verification']):
38
- raise ValueError("must be one of enum values ('privacy_notices_read', 'ssn_verification', 'phone_number_verification')")
39
- return value
32
+ __properties: ClassVar[List[str]] = ["alias_name", "alias_type"]
40
33
 
41
34
  model_config = ConfigDict(
42
35
  populate_by_name=True,
@@ -56,7 +49,7 @@ class ConsentItem(BaseModel):
56
49
 
57
50
  @classmethod
58
51
  def from_json(cls, json_str: str) -> Optional[Self]:
59
- """Create an instance of ConsentItem from a JSON string"""
52
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAliasInner from a JSON string"""
60
53
  return cls.from_dict(json.loads(json_str))
61
54
 
62
55
  def to_dict(self) -> Dict[str, Any]:
@@ -88,7 +81,7 @@ class ConsentItem(BaseModel):
88
81
 
89
82
  @classmethod
90
83
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
- """Create an instance of ConsentItem from a dict"""
84
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAliasInner from a dict"""
92
85
  if obj is None:
93
86
  return None
94
87
 
@@ -96,8 +89,8 @@ class ConsentItem(BaseModel):
96
89
  return cls.model_validate(obj)
97
90
 
98
91
  _obj = cls.model_validate({
99
- "name": obj.get("name"),
100
- "granted": obj.get("granted")
92
+ "alias_name": obj.get("alias_name"),
93
+ "alias_type": obj.get("alias_type")
101
94
  })
102
95
  # store additional fields in additional_properties
103
96
  for _key in obj.keys():
@@ -0,0 +1,104 @@
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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class WatchlistEnhancedPropertiesRecordsInnerAssociateInner(BaseModel):
26
+ """
27
+ WatchlistEnhancedPropertiesRecordsInnerAssociateInner
28
+ """ # noqa: E501
29
+ entity_name: Optional[StrictStr] = None
30
+ relationship_direction: Optional[StrictStr] = None
31
+ relationship_type: Optional[StrictStr] = None
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["entity_name", "relationship_direction", "relationship_type"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAssociateInner from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAssociateInner from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "entity_name": obj.get("entity_name"),
94
+ "relationship_direction": obj.get("relationship_direction"),
95
+ "relationship_type": obj.get("relationship_type")
96
+ })
97
+ # store additional fields in additional_properties
98
+ for _key in obj.keys():
99
+ if _key not in cls.__properties:
100
+ _obj.additional_properties[_key] = obj.get(_key)
101
+
102
+ return _obj
103
+
104
+