Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"MD024": false
}
6 changes: 3 additions & 3 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "1f90650",
"long_sha": "1f906509f36a1f5056df0c74b774795f8754e4ca",
"version": ""
"short_sha": "4b15a26",
"long_sha": "4b15a26d432dcb9c3788cece0a46b5157b2e8b99",
"version": "v5.1.0"
},
"release": "v5.1.0"
}
7 changes: 4 additions & 3 deletions onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@
from onfido.models.country_codes import CountryCodes
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
from onfido.models.device_intelligence_breakdown_breakdown import DeviceIntelligenceBreakdownBreakdown
from onfido.models.device_intelligence_breakdown_breakdown_device import DeviceIntelligenceBreakdownBreakdownDevice
from onfido.models.device_intelligence_breakdown_breakdown_device_breakdown import DeviceIntelligenceBreakdownBreakdownDeviceBreakdown
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice
from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp
from onfido.models.device_intelligence_properties import DeviceIntelligenceProperties
from onfido.models.device_intelligence_report import DeviceIntelligenceReport
from onfido.models.document import Document
from onfido.models.document_breakdown import DocumentBreakdown
Expand Down Expand Up @@ -110,7 +111,7 @@
from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
from onfido.models.document_properties_document_classification import DocumentPropertiesDocumentClassification
from onfido.models.document_properties_document_numbers_inner import DocumentPropertiesDocumentNumbersInner
from onfido.models.document_properties_driving_licence_information import DocumentPropertiesDrivingLicenceInformation
from onfido.models.document_properties_driving_licence_information_item import DocumentPropertiesDrivingLicenceInformationItem
from onfido.models.document_properties_extracted_data import DocumentPropertiesExtractedData
from onfido.models.document_properties_nfc import DocumentPropertiesNfc
from onfido.models.document_report import DocumentReport
Expand Down
7 changes: 4 additions & 3 deletions onfido/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@
from onfido.models.country_codes import CountryCodes
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
from onfido.models.device_intelligence_breakdown_breakdown import DeviceIntelligenceBreakdownBreakdown
from onfido.models.device_intelligence_breakdown_breakdown_device import DeviceIntelligenceBreakdownBreakdownDevice
from onfido.models.device_intelligence_breakdown_breakdown_device_breakdown import DeviceIntelligenceBreakdownBreakdownDeviceBreakdown
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice
from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp
from onfido.models.device_intelligence_properties import DeviceIntelligenceProperties
from onfido.models.device_intelligence_report import DeviceIntelligenceReport
from onfido.models.document import Document
from onfido.models.document_breakdown import DocumentBreakdown
Expand Down Expand Up @@ -93,7 +94,7 @@
from onfido.models.document_properties_barcode_inner import DocumentPropertiesBarcodeInner
from onfido.models.document_properties_document_classification import DocumentPropertiesDocumentClassification
from onfido.models.document_properties_document_numbers_inner import DocumentPropertiesDocumentNumbersInner
from onfido.models.document_properties_driving_licence_information import DocumentPropertiesDrivingLicenceInformation
from onfido.models.document_properties_driving_licence_information_item import DocumentPropertiesDrivingLicenceInformationItem
from onfido.models.document_properties_extracted_data import DocumentPropertiesExtractedData
from onfido.models.document_properties_nfc import DocumentPropertiesNfc
from onfido.models.document_report import DocumentReport
Expand Down
8 changes: 7 additions & 1 deletion onfido/models/device_intelligence_breakdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.device_intelligence_breakdown_breakdown import DeviceIntelligenceBreakdownBreakdown
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -28,10 +29,11 @@ class DeviceIntelligenceBreakdown(BaseModel):
"""
DeviceIntelligenceBreakdown
""" # noqa: E501
device: Optional[DeviceIntelligenceBreakdownDevice] = None
breakdown: Optional[DeviceIntelligenceBreakdownBreakdown] = None
properties: Optional[DeviceIntelligenceBreakdownProperties] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["breakdown", "properties"]
__properties: ClassVar[List[str]] = ["device", "breakdown", "properties"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -74,6 +76,9 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of device
if self.device:
_dict['device'] = self.device.to_dict()
# override the default output from pydantic by calling `to_dict()` of breakdown
if self.breakdown:
_dict['breakdown'] = self.breakdown.to_dict()
Expand All @@ -97,6 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"device": DeviceIntelligenceBreakdownDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
"breakdown": DeviceIntelligenceBreakdownBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None,
"properties": DeviceIntelligenceBreakdownProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
})
Expand Down
6 changes: 3 additions & 3 deletions onfido/models/device_intelligence_breakdown_breakdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.device_intelligence_breakdown_breakdown_device import DeviceIntelligenceBreakdownBreakdownDevice
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice
from typing import Optional, Set
from typing_extensions import Self

class DeviceIntelligenceBreakdownBreakdown(BaseModel):
"""
DeviceIntelligenceBreakdownBreakdown
""" # noqa: E501
device: Optional[DeviceIntelligenceBreakdownBreakdownDevice] = None
device: Optional[DeviceIntelligenceBreakdownDevice] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["device"]

Expand Down Expand Up @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"device": DeviceIntelligenceBreakdownBreakdownDevice.from_dict(obj["device"]) if obj.get("device") is not None else None
"device": DeviceIntelligenceBreakdownDevice.from_dict(obj["device"]) if obj.get("device") is not None else None
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.device_intelligence_breakdown_breakdown_device_breakdown import DeviceIntelligenceBreakdownBreakdownDeviceBreakdown
from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown
from typing import Optional, Set
from typing_extensions import Self

class DeviceIntelligenceBreakdownBreakdownDevice(BaseModel):
class DeviceIntelligenceBreakdownDevice(BaseModel):
"""
Asserts whether the device used to upload the media is trustworthy, i.e. it is a real, physical device.
""" # noqa: E501
breakdown: Optional[DeviceIntelligenceBreakdownBreakdownDeviceBreakdown] = None
breakdown: Optional[DeviceIntelligenceBreakdownDeviceBreakdown] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["breakdown"]

Expand All @@ -49,7 +49,7 @@ def to_json(self) -> str:

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DeviceIntelligenceBreakdownBreakdownDevice from a JSON string"""
"""Create an instance of DeviceIntelligenceBreakdownDevice from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -84,15 +84,15 @@ def to_dict(self) -> Dict[str, Any]:

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DeviceIntelligenceBreakdownBreakdownDevice from a dict"""
"""Create an instance of DeviceIntelligenceBreakdownDevice from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"breakdown": DeviceIntelligenceBreakdownBreakdownDeviceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None
"breakdown": DeviceIntelligenceBreakdownDeviceBreakdown.from_dict(obj["breakdown"]) if obj.get("breakdown") is not None else None
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from typing import Optional, Set
from typing_extensions import Self

class DeviceIntelligenceBreakdownBreakdownDeviceBreakdown(BaseModel):
class DeviceIntelligenceBreakdownDeviceBreakdown(BaseModel):
"""
DeviceIntelligenceBreakdownBreakdownDeviceBreakdown
DeviceIntelligenceBreakdownDeviceBreakdown
""" # noqa: E501
application_authenticity: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
device_integrity: Optional[DocumentBreakdownDataComparisonBreakdownIssuingCountry] = None
Expand All @@ -51,7 +51,7 @@ def to_json(self) -> str:

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DeviceIntelligenceBreakdownBreakdownDeviceBreakdown from a JSON string"""
"""Create an instance of DeviceIntelligenceBreakdownDeviceBreakdown from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -92,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]:

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DeviceIntelligenceBreakdownBreakdownDeviceBreakdown from a dict"""
"""Create an instance of DeviceIntelligenceBreakdownDeviceBreakdown from a dict"""
if obj is None:
return None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -36,7 +36,7 @@ class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
randomized_device: Optional[StrictBool] = Field(default=None, description="Whether the device is providing false randomized device and network information.")
fake_network_request: Optional[StrictBool] = Field(default=None, description="Whether device is using stolen security tokens to send the network information.")
ip_reputation: Optional[StrictStr] = Field(default=None, description="Whether there is highly suspicious traffic related to the IP address. The risk depends on the overall ratio of clear checks on a given IP.")
device_fingerprint_reuse: Optional[StrictInt] = Field(default=None, description="The number of times the device was used to create a report for a new applicant. A value greater than 1 indicates potential device reuse.")
device_fingerprint_reuse: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of times the device was used to create a report for a new applicant. A value greater than 1 indicates potential device reuse.")
single_device_used: Optional[StrictBool] = Field(default=None, description="Whether the document or biometric media were uploaded from a single device.")
document_capture: Optional[StrictStr] = Field(default=None, description="Whether the document media were live captured from the device camera.")
biometric_capture: Optional[StrictStr] = Field(default=None, description="Whether the biometric media were live captured from the device camera.")
Expand Down
116 changes: 116 additions & 0 deletions onfido/models/device_intelligence_properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# 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
from typing import Any, ClassVar, Dict, List, Optional
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp
from typing import Optional, Set
from typing_extensions import Self

class DeviceIntelligenceProperties(BaseModel):
"""
DeviceIntelligenceProperties
""" # noqa: E501
device: Optional[DeviceIntelligenceBreakdownPropertiesDevice] = None
ip: Optional[DeviceIntelligenceBreakdownPropertiesIp] = None
geolocation: Optional[DeviceIntelligenceBreakdownPropertiesGeolocation] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["device", "ip", "geolocation"]

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 DeviceIntelligenceProperties 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 device
if self.device:
_dict['device'] = self.device.to_dict()
# override the default output from pydantic by calling `to_dict()` of ip
if self.ip:
_dict['ip'] = self.ip.to_dict()
# override the default output from pydantic by calling `to_dict()` of geolocation
if self.geolocation:
_dict['geolocation'] = self.geolocation.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 DeviceIntelligenceProperties from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"device": DeviceIntelligenceBreakdownPropertiesDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
"ip": DeviceIntelligenceBreakdownPropertiesIp.from_dict(obj["ip"]) if obj.get("ip") is not None else None,
"geolocation": DeviceIntelligenceBreakdownPropertiesGeolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") 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


Loading