diff --git a/.release.json b/.release.json index b6a193c..174b6be 100644 --- a/.release.json +++ b/.release.json @@ -1,9 +1,9 @@ { "source": { "repo_url": "https://github.com/onfido/onfido-openapi-spec", - "short_sha": "f941ec8", - "long_sha": "f941ec84c3aeb0d3fcceea537991ba7e1ac96414", - "version": "v3.3.0" + "short_sha": "08508b9", + "long_sha": "08508b9517238b3becb4265130633a418a8ee319", + "version": "v3.5.0" }, - "release": "v3.4.0" + "release": "v3.5.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index fb80a17..c8ff8e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,8 @@ ## v3.4.0 24th July 2024 - Release based on Onfido OpenAPI spec version [v3.3.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.3.0): - - Expose `customer_user_id` in `workflow_runs` - - Add `sdk_token` to workflow run schema + - Expose `customer_user_id` in `workflow_runs` + - Add `sdk_token` to workflow run schema ## v3.3.0 17th July 2024 diff --git a/onfido/__init__.py b/onfido/__init__.py index 3039ce3..771d4ab 100644 --- a/onfido/__init__.py +++ b/onfido/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "3.4.0" +__version__ = "3.5.0" # import apis into sdk package from onfido.api.default_api import DefaultApi @@ -271,6 +271,14 @@ from onfido.models.watchlist_aml_report import WatchlistAmlReport from onfido.models.watchlist_enhanced_breakdown import WatchlistEnhancedBreakdown from onfido.models.watchlist_enhanced_properties import WatchlistEnhancedProperties +from onfido.models.watchlist_enhanced_properties_records_inner import WatchlistEnhancedPropertiesRecordsInner +from onfido.models.watchlist_enhanced_properties_records_inner_address_inner import WatchlistEnhancedPropertiesRecordsInnerAddressInner +from onfido.models.watchlist_enhanced_properties_records_inner_alias_inner import WatchlistEnhancedPropertiesRecordsInnerAliasInner +from onfido.models.watchlist_enhanced_properties_records_inner_associate_inner import WatchlistEnhancedPropertiesRecordsInnerAssociateInner +from onfido.models.watchlist_enhanced_properties_records_inner_attribute_inner import WatchlistEnhancedPropertiesRecordsInnerAttributeInner +from onfido.models.watchlist_enhanced_properties_records_inner_event_inner import WatchlistEnhancedPropertiesRecordsInnerEventInner +from onfido.models.watchlist_enhanced_properties_records_inner_event_inner_source import WatchlistEnhancedPropertiesRecordsInnerEventInnerSource +from onfido.models.watchlist_enhanced_properties_records_inner_source_inner import WatchlistEnhancedPropertiesRecordsInnerSourceInner from onfido.models.watchlist_enhanced_report import WatchlistEnhancedReport from onfido.models.watchlist_monitor import WatchlistMonitor from onfido.models.watchlist_monitor_builder import WatchlistMonitorBuilder diff --git a/onfido/api_client.py b/onfido/api_client.py index 35a0037..d452839 100644 --- a/onfido/api_client.py +++ b/onfido/api_client.py @@ -88,7 +88,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'onfido-python/3.4.0' + self.user_agent = 'onfido-python/3.5.0' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/onfido/configuration.py b/onfido/configuration.py index b84fbb9..b9dc450 100644 --- a/onfido/configuration.py +++ b/onfido/configuration.py @@ -383,7 +383,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v3.6\n"\ - "SDK Package Version: 3.4.0".\ + "SDK Package Version: 3.5.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onfido/models/__init__.py b/onfido/models/__init__.py index d8c009f..bfcf386 100644 --- a/onfido/models/__init__.py +++ b/onfido/models/__init__.py @@ -254,6 +254,14 @@ from onfido.models.watchlist_aml_report import WatchlistAmlReport from onfido.models.watchlist_enhanced_breakdown import WatchlistEnhancedBreakdown from onfido.models.watchlist_enhanced_properties import WatchlistEnhancedProperties +from onfido.models.watchlist_enhanced_properties_records_inner import WatchlistEnhancedPropertiesRecordsInner +from onfido.models.watchlist_enhanced_properties_records_inner_address_inner import WatchlistEnhancedPropertiesRecordsInnerAddressInner +from onfido.models.watchlist_enhanced_properties_records_inner_alias_inner import WatchlistEnhancedPropertiesRecordsInnerAliasInner +from onfido.models.watchlist_enhanced_properties_records_inner_associate_inner import WatchlistEnhancedPropertiesRecordsInnerAssociateInner +from onfido.models.watchlist_enhanced_properties_records_inner_attribute_inner import WatchlistEnhancedPropertiesRecordsInnerAttributeInner +from onfido.models.watchlist_enhanced_properties_records_inner_event_inner import WatchlistEnhancedPropertiesRecordsInnerEventInner +from onfido.models.watchlist_enhanced_properties_records_inner_event_inner_source import WatchlistEnhancedPropertiesRecordsInnerEventInnerSource +from onfido.models.watchlist_enhanced_properties_records_inner_source_inner import WatchlistEnhancedPropertiesRecordsInnerSourceInner from onfido.models.watchlist_enhanced_report import WatchlistEnhancedReport from onfido.models.watchlist_monitor import WatchlistMonitor from onfido.models.watchlist_monitor_builder import WatchlistMonitorBuilder diff --git a/onfido/models/watchlist_enhanced_properties.py b/onfido/models/watchlist_enhanced_properties.py index b27dfb7..b7a8f32 100644 --- a/onfido/models/watchlist_enhanced_properties.py +++ b/onfido/models/watchlist_enhanced_properties.py @@ -17,8 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional +from onfido.models.watchlist_enhanced_properties_records_inner import WatchlistEnhancedPropertiesRecordsInner from typing import Optional, Set from typing_extensions import Self @@ -26,7 +27,7 @@ class WatchlistEnhancedProperties(BaseModel): """ WatchlistEnhancedProperties """ # noqa: E501 - 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.") + 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.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["records"] @@ -71,6 +72,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in records (list) + _items = [] + if self.records: + for _item in self.records: + if _item: + _items.append(_item.to_dict()) + _dict['records'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -88,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "records": obj.get("records") + "records": [WatchlistEnhancedPropertiesRecordsInner.from_dict(_item) for _item in obj["records"]] if obj.get("records") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/onfido/models/watchlist_enhanced_properties_records_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner.py new file mode 100644 index 0000000..76e39d2 --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from onfido.models.watchlist_enhanced_properties_records_inner_address_inner import WatchlistEnhancedPropertiesRecordsInnerAddressInner +from onfido.models.watchlist_enhanced_properties_records_inner_alias_inner import WatchlistEnhancedPropertiesRecordsInnerAliasInner +from onfido.models.watchlist_enhanced_properties_records_inner_associate_inner import WatchlistEnhancedPropertiesRecordsInnerAssociateInner +from onfido.models.watchlist_enhanced_properties_records_inner_attribute_inner import WatchlistEnhancedPropertiesRecordsInnerAttributeInner +from onfido.models.watchlist_enhanced_properties_records_inner_event_inner import WatchlistEnhancedPropertiesRecordsInnerEventInner +from onfido.models.watchlist_enhanced_properties_records_inner_source_inner import WatchlistEnhancedPropertiesRecordsInnerSourceInner +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInner + """ # noqa: E501 + address: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAddressInner]] = Field(default=None, description="All addresses on file.") + alias: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAliasInner]] = Field(default=None, description="Any names that the person is also known as.") + associate: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAssociateInner]] = Field(default=None, description="Any linked persons, for example family relatives or business partners.") + attribute: Optional[List[WatchlistEnhancedPropertiesRecordsInnerAttributeInner]] = Field(default=None, description="Information about the person, for example hair color or nationality.") + date_of_birth: Optional[List[StrictStr]] = Field(default=None, description="All the date of births on file.") + event: Optional[List[WatchlistEnhancedPropertiesRecordsInnerEventInner]] = Field(default=None, description="Information about events that have occurred to the person, for example deportation or arrest.") + full_name: Optional[StrictStr] = Field(default=None, description="The name on file") + position: Optional[List[StrictStr]] = Field(default=None, description="The role, country and date of each position.") + source: Optional[List[WatchlistEnhancedPropertiesRecordsInnerSourceInner]] = Field(default=None, description="Details about where the information was obtained.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["address", "alias", "associate", "attribute", "date_of_birth", "event", "full_name", "position", "source"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in address (list) + _items = [] + if self.address: + for _item in self.address: + if _item: + _items.append(_item.to_dict()) + _dict['address'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alias (list) + _items = [] + if self.alias: + for _item in self.alias: + if _item: + _items.append(_item.to_dict()) + _dict['alias'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in associate (list) + _items = [] + if self.associate: + for _item in self.associate: + if _item: + _items.append(_item.to_dict()) + _dict['associate'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attribute (list) + _items = [] + if self.attribute: + for _item in self.attribute: + if _item: + _items.append(_item.to_dict()) + _dict['attribute'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in event (list) + _items = [] + if self.event: + for _item in self.event: + if _item: + _items.append(_item.to_dict()) + _dict['event'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in source (list) + _items = [] + if self.source: + for _item in self.source: + if _item: + _items.append(_item.to_dict()) + _dict['source'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": [WatchlistEnhancedPropertiesRecordsInnerAddressInner.from_dict(_item) for _item in obj["address"]] if obj.get("address") is not None else None, + "alias": [WatchlistEnhancedPropertiesRecordsInnerAliasInner.from_dict(_item) for _item in obj["alias"]] if obj.get("alias") is not None else None, + "associate": [WatchlistEnhancedPropertiesRecordsInnerAssociateInner.from_dict(_item) for _item in obj["associate"]] if obj.get("associate") is not None else None, + "attribute": [WatchlistEnhancedPropertiesRecordsInnerAttributeInner.from_dict(_item) for _item in obj["attribute"]] if obj.get("attribute") is not None else None, + "date_of_birth": obj.get("date_of_birth"), + "event": [WatchlistEnhancedPropertiesRecordsInnerEventInner.from_dict(_item) for _item in obj["event"]] if obj.get("event") is not None else None, + "full_name": obj.get("full_name"), + "position": obj.get("position"), + "source": [WatchlistEnhancedPropertiesRecordsInnerSourceInner.from_dict(_item) for _item in obj["source"]] if obj.get("source") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_address_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner_address_inner.py new file mode 100644 index 0000000..b9bb5f2 --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_address_inner.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from onfido.models.country_codes import CountryCodes +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerAddressInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerAddressInner + """ # noqa: E501 + address_line1: Optional[StrictStr] = None + country: Optional[CountryCodes] = None + postal_code: Optional[StrictStr] = None + state_province: Optional[StrictStr] = None + town: Optional[StrictStr] = None + locator_type: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["address_line1", "country", "postal_code", "state_province", "town", "locator_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAddressInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAddressInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_line1": obj.get("address_line1"), + "country": obj.get("country"), + "postal_code": obj.get("postal_code"), + "state_province": obj.get("state_province"), + "town": obj.get("town"), + "locator_type": obj.get("locator_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_alias_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner_alias_inner.py new file mode 100644 index 0000000..90e861f --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_alias_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerAliasInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerAliasInner + """ # noqa: E501 + alias_name: Optional[StrictStr] = None + alias_type: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["alias_name", "alias_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAliasInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAliasInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alias_name": obj.get("alias_name"), + "alias_type": obj.get("alias_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.py new file mode 100644 index 0000000..956de2e --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_associate_inner.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerAssociateInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerAssociateInner + """ # noqa: E501 + entity_name: Optional[StrictStr] = None + relationship_direction: Optional[StrictStr] = None + relationship_type: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["entity_name", "relationship_direction", "relationship_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAssociateInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAssociateInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "entity_name": obj.get("entity_name"), + "relationship_direction": obj.get("relationship_direction"), + "relationship_type": obj.get("relationship_type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.py new file mode 100644 index 0000000..330905c --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_attribute_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerAttributeInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerAttributeInner + """ # noqa: E501 + attribute_type: Optional[StrictStr] = None + attribute_value: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attribute_type", "attribute_value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAttributeInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerAttributeInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attribute_type": obj.get("attribute_type"), + "attribute_value": obj.get("attribute_value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_event_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner_event_inner.py new file mode 100644 index 0000000..6b99db0 --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_event_inner.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from onfido.models.watchlist_enhanced_properties_records_inner_event_inner_source import WatchlistEnhancedPropertiesRecordsInnerEventInnerSource +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerEventInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerEventInner + """ # noqa: E501 + category: Optional[StrictStr] = None + event_date: Optional[date] = None + event_description: Optional[StrictStr] = None + source: Optional[WatchlistEnhancedPropertiesRecordsInnerEventInnerSource] = None + sub_category: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["category", "event_date", "event_description", "source", "sub_category"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerEventInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerEventInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "event_date": obj.get("event_date"), + "event_description": obj.get("event_description"), + "source": WatchlistEnhancedPropertiesRecordsInnerEventInnerSource.from_dict(obj["source"]) if obj.get("source") is not None else None, + "sub_category": obj.get("sub_category") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.py b/onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.py new file mode 100644 index 0000000..8536197 --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_event_inner_source.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerEventInnerSource(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerEventInnerSource + """ # noqa: E501 + source_date: Optional[date] = None + source_format: Optional[StrictStr] = None + source_name: Optional[StrictStr] = None + source_url: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["source_date", "source_format", "source_name", "source_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerEventInnerSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerEventInnerSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source_date": obj.get("source_date"), + "source_format": obj.get("source_format"), + "source_name": obj.get("source_name"), + "source_url": obj.get("source_url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/onfido/models/watchlist_enhanced_properties_records_inner_source_inner.py b/onfido/models/watchlist_enhanced_properties_records_inner_source_inner.py new file mode 100644 index 0000000..8cd339e --- /dev/null +++ b/onfido/models/watchlist_enhanced_properties_records_inner_source_inner.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Onfido API v3.6 + + The Onfido API (v3.6) + + The version of the OpenAPI document: v3.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WatchlistEnhancedPropertiesRecordsInnerSourceInner(BaseModel): + """ + WatchlistEnhancedPropertiesRecordsInnerSourceInner + """ # noqa: E501 + source_headline: Optional[StrictStr] = None + source_name: Optional[StrictStr] = None + source_url: Optional[StrictStr] = None + source_format: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["source_headline", "source_name", "source_url", "source_format"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerSourceInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WatchlistEnhancedPropertiesRecordsInnerSourceInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source_headline": obj.get("source_headline"), + "source_name": obj.get("source_name"), + "source_url": obj.get("source_url"), + "source_format": obj.get("source_format") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/pyproject.toml b/pyproject.toml index d219a3b..fe48d12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "onfido-python" -version = "3.4.0" +version = "3.5.0" description = "Python library for the Onfido API" authors = ["OpenAPI Generator Community "] license = "MIT" diff --git a/setup.py b/setup.py index 53ede4f..5cabc4d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "onfido-python" -VERSION = "3.4.0" +VERSION = "3.5.0" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0",