Skip to content

Commit 4c3e4a5

Browse files
Merge pull request #107 from onfido/release-upgrade
Refresh onfido-python after onfido-openapi-spec update (4204f00)
2 parents afb54cf + a063fae commit 4c3e4a5

14 files changed

+214
-256
lines changed

.github/workflows/python.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ jobs:
6060
- name: Test with pytest
6161
if: ${{ matrix.python-version == '3.13' &&
6262
github.repository_owner == 'onfido' &&
63-
(github.event_name == 'pull_request' || github.event_name == 'release') }}
63+
(github.event_name == 'pull_request' ||
64+
github.event_name == 'release' ||
65+
github.event_name == 'workflow_dispatch') }}
6466
run: |
6567
poetry run pytest --show-capture=no
6668
env:

.release.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"source": {
33
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
4-
"short_sha": "d66dc55",
5-
"long_sha": "d66dc55aa73210fc789fcb93a3cba9d1d1f89a8a",
6-
"version": "v6.0.0"
4+
"short_sha": "4204f00",
5+
"long_sha": "4204f00a2c7f0f5bd61da3b5442d8eb613418e9e",
6+
"version": ""
77
},
88
"release": "v6.0.0"
99
}

MIGRATION.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@ major versions of the client library.
66
It covers changes in core resources, other endpoints, and the OpenAPI generator,
77
ensuring a smooth transition between versions.
88

9+
## Upgrading from 5.x to 6.x
10+
11+
### Core Resources
12+
13+
- Documents
14+
- Driving licence information properties removed from general `DocumentProperties`
15+
and moved to new `DocumentPropertiesWithDrivingLicenceInformation` class
16+
- Workflow Runs
17+
- `created_at_gt` and `created_at_lt` parameters in `list_workflow_runs` changed from
18+
date-time format to date format (YYYY-MM-DD)
19+
20+
### Other Endpoints
21+
22+
- Reports
23+
- Device Intelligence: Removed deprecated `breakdown` property and related
24+
breakdown classes:
25+
- `DeviceIntelligenceBreakdownBreakdown` removed
26+
- `DeviceIntelligenceBreakdownProperties``DeviceIntelligenceProperties`
27+
- `DeviceIntelligenceBreakdownPropertiesDevice``DeviceIntelligencePropertiesDevice`
28+
- `DeviceIntelligenceBreakdownPropertiesGeolocation``DeviceIntelligencePropertiesGeolocation`
29+
- `DeviceIntelligenceBreakdownPropertiesIp``DeviceIntelligencePropertiesIp`
30+
- Identity Enhanced: Changed `total_number_of_sources` and `number_of_matches` from
31+
number to string type
32+
33+
### OpenAPI generator
34+
35+
- Version upgraded from `7.11.0` to `7.16.0`
36+
937
## Upgrading from 4.x to 5.x
1038

1139
### Core Resources

onfido/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@
5757
"DeviceIntelligenceBreakdown",
5858
"DeviceIntelligenceBreakdownDevice",
5959
"DeviceIntelligenceBreakdownDeviceBreakdown",
60-
"DeviceIntelligenceBreakdownProperties",
61-
"DeviceIntelligenceBreakdownPropertiesDevice",
62-
"DeviceIntelligenceBreakdownPropertiesGeolocation",
63-
"DeviceIntelligenceBreakdownPropertiesIp",
6460
"DeviceIntelligenceProperties",
61+
"DeviceIntelligencePropertiesDevice",
62+
"DeviceIntelligencePropertiesGeolocation",
63+
"DeviceIntelligencePropertiesIp",
6564
"DeviceIntelligenceReport",
6665
"Document",
6766
"DocumentBreakdown",
@@ -317,6 +316,7 @@
317316
"WebhookEventPayload",
318317
"WebhookEventPayloadObject",
319318
"WebhookEventPayloadResource",
319+
"WebhookEventResourceStatus",
320320
"WebhookEventResourceType",
321321
"WebhookEventType",
322322
"WebhookResend",
@@ -382,11 +382,10 @@
382382
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown as DeviceIntelligenceBreakdown
383383
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice as DeviceIntelligenceBreakdownDevice
384384
from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown as DeviceIntelligenceBreakdownDeviceBreakdown
385-
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties as DeviceIntelligenceBreakdownProperties
386-
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice as DeviceIntelligenceBreakdownPropertiesDevice
387-
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation as DeviceIntelligenceBreakdownPropertiesGeolocation
388-
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp as DeviceIntelligenceBreakdownPropertiesIp
389385
from onfido.models.device_intelligence_properties import DeviceIntelligenceProperties as DeviceIntelligenceProperties
386+
from onfido.models.device_intelligence_properties_device import DeviceIntelligencePropertiesDevice as DeviceIntelligencePropertiesDevice
387+
from onfido.models.device_intelligence_properties_geolocation import DeviceIntelligencePropertiesGeolocation as DeviceIntelligencePropertiesGeolocation
388+
from onfido.models.device_intelligence_properties_ip import DeviceIntelligencePropertiesIp as DeviceIntelligencePropertiesIp
390389
from onfido.models.device_intelligence_report import DeviceIntelligenceReport as DeviceIntelligenceReport
391390
from onfido.models.document import Document as Document
392391
from onfido.models.document_breakdown import DocumentBreakdown as DocumentBreakdown
@@ -642,6 +641,7 @@
642641
from onfido.models.webhook_event_payload import WebhookEventPayload as WebhookEventPayload
643642
from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject as WebhookEventPayloadObject
644643
from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource as WebhookEventPayloadResource
644+
from onfido.models.webhook_event_resource_status import WebhookEventResourceStatus as WebhookEventResourceStatus
645645
from onfido.models.webhook_event_resource_type import WebhookEventResourceType as WebhookEventResourceType
646646
from onfido.models.webhook_event_type import WebhookEventType as WebhookEventType
647647
from onfido.models.webhook_resend import WebhookResend as WebhookResend

onfido/models/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@
4242
from onfido.models.device_intelligence_breakdown import DeviceIntelligenceBreakdown
4343
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice
4444
from onfido.models.device_intelligence_breakdown_device_breakdown import DeviceIntelligenceBreakdownDeviceBreakdown
45-
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties
46-
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice
47-
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation
48-
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp
4945
from onfido.models.device_intelligence_properties import DeviceIntelligenceProperties
46+
from onfido.models.device_intelligence_properties_device import DeviceIntelligencePropertiesDevice
47+
from onfido.models.device_intelligence_properties_geolocation import DeviceIntelligencePropertiesGeolocation
48+
from onfido.models.device_intelligence_properties_ip import DeviceIntelligencePropertiesIp
5049
from onfido.models.device_intelligence_report import DeviceIntelligenceReport
5150
from onfido.models.document import Document
5251
from onfido.models.document_breakdown import DocumentBreakdown
@@ -302,6 +301,7 @@
302301
from onfido.models.webhook_event_payload import WebhookEventPayload
303302
from onfido.models.webhook_event_payload_object import WebhookEventPayloadObject
304303
from onfido.models.webhook_event_payload_resource import WebhookEventPayloadResource
304+
from onfido.models.webhook_event_resource_status import WebhookEventResourceStatus
305305
from onfido.models.webhook_event_resource_type import WebhookEventResourceType
306306
from onfido.models.webhook_event_type import WebhookEventType
307307
from onfido.models.webhook_resend import WebhookResend

onfido/models/device_intelligence_breakdown.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from pydantic import BaseModel, ConfigDict
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from onfido.models.device_intelligence_breakdown_device import DeviceIntelligenceBreakdownDevice
23-
from onfido.models.device_intelligence_breakdown_properties import DeviceIntelligenceBreakdownProperties
2423
from typing import Optional, Set
2524
from typing_extensions import Self
2625

@@ -29,9 +28,8 @@ class DeviceIntelligenceBreakdown(BaseModel):
2928
DeviceIntelligenceBreakdown
3029
""" # noqa: E501
3130
device: Optional[DeviceIntelligenceBreakdownDevice] = None
32-
properties: Optional[DeviceIntelligenceBreakdownProperties] = None
3331
additional_properties: Dict[str, Any] = {}
34-
__properties: ClassVar[List[str]] = ["device", "properties"]
32+
__properties: ClassVar[List[str]] = ["device"]
3533

3634
model_config = ConfigDict(
3735
populate_by_name=True,
@@ -77,9 +75,6 @@ def to_dict(self) -> Dict[str, Any]:
7775
# override the default output from pydantic by calling `to_dict()` of device
7876
if self.device:
7977
_dict['device'] = self.device.to_dict()
80-
# override the default output from pydantic by calling `to_dict()` of properties
81-
if self.properties:
82-
_dict['properties'] = self.properties.to_dict()
8378
# puts key-value pairs in additional_properties in the top level
8479
if self.additional_properties is not None:
8580
for _key, _value in self.additional_properties.items():
@@ -97,8 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9792
return cls.model_validate(obj)
9893

9994
_obj = cls.model_validate({
100-
"device": DeviceIntelligenceBreakdownDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
101-
"properties": DeviceIntelligenceBreakdownProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None
95+
"device": DeviceIntelligenceBreakdownDevice.from_dict(obj["device"]) if obj.get("device") is not None else None
10296
})
10397
# store additional fields in additional_properties
10498
for _key in obj.keys():

onfido/models/device_intelligence_breakdown_properties.py

Lines changed: 0 additions & 116 deletions
This file was deleted.

onfido/models/device_intelligence_properties.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919

2020
from pydantic import BaseModel, ConfigDict
2121
from typing import Any, ClassVar, Dict, List, Optional
22-
from onfido.models.device_intelligence_breakdown_properties_device import DeviceIntelligenceBreakdownPropertiesDevice
23-
from onfido.models.device_intelligence_breakdown_properties_geolocation import DeviceIntelligenceBreakdownPropertiesGeolocation
24-
from onfido.models.device_intelligence_breakdown_properties_ip import DeviceIntelligenceBreakdownPropertiesIp
22+
from onfido.models.device_intelligence_properties_device import DeviceIntelligencePropertiesDevice
23+
from onfido.models.device_intelligence_properties_geolocation import DeviceIntelligencePropertiesGeolocation
24+
from onfido.models.device_intelligence_properties_ip import DeviceIntelligencePropertiesIp
2525
from typing import Optional, Set
2626
from typing_extensions import Self
2727

2828
class DeviceIntelligenceProperties(BaseModel):
2929
"""
3030
DeviceIntelligenceProperties
3131
""" # noqa: E501
32-
device: Optional[DeviceIntelligenceBreakdownPropertiesDevice] = None
33-
ip: Optional[DeviceIntelligenceBreakdownPropertiesIp] = None
34-
geolocation: Optional[DeviceIntelligenceBreakdownPropertiesGeolocation] = None
32+
device: Optional[DeviceIntelligencePropertiesDevice] = None
33+
ip: Optional[DeviceIntelligencePropertiesIp] = None
34+
geolocation: Optional[DeviceIntelligencePropertiesGeolocation] = None
3535
additional_properties: Dict[str, Any] = {}
3636
__properties: ClassVar[List[str]] = ["device", "ip", "geolocation"]
3737

@@ -102,9 +102,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102102
return cls.model_validate(obj)
103103

104104
_obj = cls.model_validate({
105-
"device": DeviceIntelligenceBreakdownPropertiesDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
106-
"ip": DeviceIntelligenceBreakdownPropertiesIp.from_dict(obj["ip"]) if obj.get("ip") is not None else None,
107-
"geolocation": DeviceIntelligenceBreakdownPropertiesGeolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") is not None else None
105+
"device": DeviceIntelligencePropertiesDevice.from_dict(obj["device"]) if obj.get("device") is not None else None,
106+
"ip": DeviceIntelligencePropertiesIp.from_dict(obj["ip"]) if obj.get("ip") is not None else None,
107+
"geolocation": DeviceIntelligencePropertiesGeolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") is not None else None
108108
})
109109
# store additional fields in additional_properties
110110
for _key in obj.keys():

onfido/models/device_intelligence_breakdown_properties_device.py renamed to onfido/models/device_intelligence_properties_device.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
from typing import Optional, Set
2323
from typing_extensions import Self
2424

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

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

117117
def to_dict(self) -> Dict[str, Any]:
@@ -148,7 +148,7 @@ def to_dict(self) -> Dict[str, Any]:
148148

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

onfido/models/device_intelligence_breakdown_properties_geolocation.py renamed to onfido/models/device_intelligence_properties_geolocation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
from typing import Optional, Set
2424
from typing_extensions import Self
2525

26-
class DeviceIntelligenceBreakdownPropertiesGeolocation(BaseModel):
26+
class DeviceIntelligencePropertiesGeolocation(BaseModel):
2727
"""
28-
DeviceIntelligenceBreakdownPropertiesGeolocation
28+
DeviceIntelligencePropertiesGeolocation
2929
""" # noqa: E501
3030
city: Optional[StrictStr] = Field(default=None, description="City location of the IP address.")
3131
region: Optional[StrictStr] = Field(default=None, description="Region location of the IP address.")
@@ -51,7 +51,7 @@ def to_json(self) -> str:
5151

5252
@classmethod
5353
def from_json(cls, json_str: str) -> Optional[Self]:
54-
"""Create an instance of DeviceIntelligenceBreakdownPropertiesGeolocation from a JSON string"""
54+
"""Create an instance of DeviceIntelligencePropertiesGeolocation from a JSON string"""
5555
return cls.from_dict(json.loads(json_str))
5656

5757
def to_dict(self) -> Dict[str, Any]:
@@ -83,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]:
8383

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

0 commit comments

Comments
 (0)