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
4 changes: 3 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ jobs:
- name: Test with pytest
if: ${{ matrix.python-version == '3.13' &&
github.repository_owner == 'onfido' &&
(github.event_name == 'pull_request' || github.event_name == 'release') }}
(github.event_name == 'pull_request' ||
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch') }}
run: |
poetry run pytest --show-capture=no
env:
Expand Down
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": "d66dc55",
"long_sha": "d66dc55aa73210fc789fcb93a3cba9d1d1f89a8a",
"version": "v6.0.0"
"short_sha": "4204f00",
"long_sha": "4204f00a2c7f0f5bd61da3b5442d8eb613418e9e",
"version": ""
},
"release": "v6.0.0"
}
28 changes: 28 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ major versions of the client library.
It covers changes in core resources, other endpoints, and the OpenAPI generator,
ensuring a smooth transition between versions.

## Upgrading from 5.x to 6.x

### Core Resources

- Documents
- Driving licence information properties removed from general `DocumentProperties`
and moved to new `DocumentPropertiesWithDrivingLicenceInformation` class
- Workflow Runs
- `created_at_gt` and `created_at_lt` parameters in `list_workflow_runs` changed from
date-time format to date format (YYYY-MM-DD)

### Other Endpoints

- Reports
- Device Intelligence: Removed deprecated `breakdown` property and related
breakdown classes:
- `DeviceIntelligenceBreakdownBreakdown` removed
- `DeviceIntelligenceBreakdownProperties` → `DeviceIntelligenceProperties`
- `DeviceIntelligenceBreakdownPropertiesDevice` → `DeviceIntelligencePropertiesDevice`
- `DeviceIntelligenceBreakdownPropertiesGeolocation` → `DeviceIntelligencePropertiesGeolocation`
- `DeviceIntelligenceBreakdownPropertiesIp` → `DeviceIntelligencePropertiesIp`
- Identity Enhanced: Changed `total_number_of_sources` and `number_of_matches` from
number to string type

### OpenAPI generator

- Version upgraded from `7.11.0` to `7.16.0`

## Upgrading from 4.x to 5.x

### Core Resources
Expand Down
16 changes: 8 additions & 8 deletions onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@
"DeviceIntelligenceBreakdown",
"DeviceIntelligenceBreakdownDevice",
"DeviceIntelligenceBreakdownDeviceBreakdown",
"DeviceIntelligenceBreakdownProperties",
"DeviceIntelligenceBreakdownPropertiesDevice",
"DeviceIntelligenceBreakdownPropertiesGeolocation",
"DeviceIntelligenceBreakdownPropertiesIp",
"DeviceIntelligenceProperties",
"DeviceIntelligencePropertiesDevice",
"DeviceIntelligencePropertiesGeolocation",
"DeviceIntelligencePropertiesIp",
"DeviceIntelligenceReport",
"Document",
"DocumentBreakdown",
Expand Down Expand Up @@ -317,6 +316,7 @@
"WebhookEventPayload",
"WebhookEventPayloadObject",
"WebhookEventPayloadResource",
"WebhookEventResourceStatus",
"WebhookEventResourceType",
"WebhookEventType",
"WebhookResend",
Expand Down Expand Up @@ -382,11 +382,10 @@
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown as DeviceIntelligenceBreakdown
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice as DeviceIntelligenceBreakdownDevice
from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown as DeviceIntelligenceBreakdownDeviceBreakdown
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties as DeviceIntelligenceBreakdownProperties
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice as DeviceIntelligenceBreakdownPropertiesDevice
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation as DeviceIntelligenceBreakdownPropertiesGeolocation
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp as DeviceIntelligenceBreakdownPropertiesIp
from onfido.models.device_intelligence_properties import DeviceIntelligenceProperties as DeviceIntelligenceProperties
from onfido.models.device_intelligence_properties_device import DeviceIntelligencePropertiesDevice as DeviceIntelligencePropertiesDevice
from onfido.models.device_intelligence_properties_geolocation import DeviceIntelligencePropertiesGeolocation as DeviceIntelligencePropertiesGeolocation
from onfido.models.device_intelligence_properties_ip import DeviceIntelligencePropertiesIp as DeviceIntelligencePropertiesIp
from onfido.models.device_intelligence_report import DeviceIntelligenceReport as DeviceIntelligenceReport
from onfido.models.document import Document as Document
from onfido.models.document_breakdown import DocumentBreakdown as DocumentBreakdown
Expand Down Expand Up @@ -642,6 +641,7 @@
from onfido.models.webhook_event_payload import WebhookEventPayload as WebhookEventPayload
from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject as WebhookEventPayloadObject
from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource as WebhookEventPayloadResource
from onfido.models.webhook_event_resource_status import WebhookEventResourceStatus as WebhookEventResourceStatus
from onfido.models.webhook_event_resource_type import WebhookEventResourceType as WebhookEventResourceType
from onfido.models.webhook_event_type import WebhookEventType as WebhookEventType
from onfido.models.webhook_resend import WebhookResend as WebhookResend
Expand Down
8 changes: 4 additions & 4 deletions onfido/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
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_properties_device import DeviceIntelligencePropertiesDevice
from onfido.models.device_intelligence_properties_geolocation import DeviceIntelligencePropertiesGeolocation
from onfido.models.device_intelligence_properties_ip import DeviceIntelligencePropertiesIp
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 @@ -302,6 +301,7 @@
from onfido.models.webhook_event_payload import WebhookEventPayload
from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject
from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource
from onfido.models.webhook_event_resource_status import WebhookEventResourceStatus
from onfido.models.webhook_event_resource_type import WebhookEventResourceType
from onfido.models.webhook_event_type import WebhookEventType
from onfido.models.webhook_resend import WebhookResend
Expand Down
10 changes: 2 additions & 8 deletions onfido/models/device_intelligence_breakdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List, Optional
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 @@ -29,9 +28,8 @@ class DeviceIntelligenceBreakdown(BaseModel):
DeviceIntelligenceBreakdown
""" # noqa: E501
device: Optional[DeviceIntelligenceBreakdownDevice] = None
properties: Optional[DeviceIntelligenceBreakdownProperties] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["device", "properties"]
__properties: ClassVar[List[str]] = ["device"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -77,9 +75,6 @@ def to_dict(self) -> Dict[str, Any]:
# 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 properties
if self.properties:
_dict['properties'] = self.properties.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():
Expand All @@ -97,8 +92,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,
"properties": DeviceIntelligenceBreakdownProperties.from_dict(obj["properties"]) if obj.get("properties") 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
116 changes: 0 additions & 116 deletions onfido/models/device_intelligence_breakdown_properties.py

This file was deleted.

18 changes: 9 additions & 9 deletions onfido/models/device_intelligence_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@

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 onfido.models.device_intelligence_properties_device import DeviceIntelligencePropertiesDevice
from onfido.models.device_intelligence_properties_geolocation import DeviceIntelligencePropertiesGeolocation
from onfido.models.device_intelligence_properties_ip import DeviceIntelligencePropertiesIp
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
device: Optional[DeviceIntelligencePropertiesDevice] = None
ip: Optional[DeviceIntelligencePropertiesIp] = None
geolocation: Optional[DeviceIntelligencePropertiesGeolocation] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["device", "ip", "geolocation"]

Expand Down Expand Up @@ -102,9 +102,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
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
"device": DeviceIntelligencePropertiesDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
"ip": DeviceIntelligencePropertiesIp.from_dict(obj["ip"]) if obj.get("ip") is not None else None,
"geolocation": DeviceIntelligencePropertiesGeolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") 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 @@ -22,9 +22,9 @@
from typing import Optional, Set
from typing_extensions import Self

class DeviceIntelligenceBreakdownPropertiesDevice(BaseModel):
class DeviceIntelligencePropertiesDevice(BaseModel):
"""
DeviceIntelligenceBreakdownPropertiesDevice
DeviceIntelligencePropertiesDevice
""" # noqa: E501
sdk_version: Optional[StrictStr] = Field(default=None, description="The SDK version that was used.")
sdk_source: Optional[StrictStr] = Field(default=None, description="The SDK used to upload the media.")
Expand Down Expand Up @@ -111,7 +111,7 @@ def to_json(self) -> str:

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

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

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

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 DeviceIntelligenceBreakdownPropertiesGeolocation(BaseModel):
class DeviceIntelligencePropertiesGeolocation(BaseModel):
"""
DeviceIntelligenceBreakdownPropertiesGeolocation
DeviceIntelligencePropertiesGeolocation
""" # noqa: E501
city: Optional[StrictStr] = Field(default=None, description="City location of the IP address.")
region: Optional[StrictStr] = Field(default=None, description="Region location of the IP address.")
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 DeviceIntelligenceBreakdownPropertiesGeolocation from a JSON string"""
"""Create an instance of DeviceIntelligencePropertiesGeolocation from a JSON string"""
return cls.from_dict(json.loads(json_str))

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

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

Expand Down
Loading