Skip to content

Commit

Permalink
Merge pull request #70 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-python after onfido-openapi-spec update (f941ec8)
  • Loading branch information
dvacca-onfido committed Jul 24, 2024
2 parents e30cd11 + 29d2240 commit 019cef2
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 21 deletions.
8 changes: 4 additions & 4 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": "40b86a1",
"long_sha": "40b86a1c8ec8687c15514470f60428b3e7633968",
"version": "v3.2.0"
"short_sha": "f941ec8",
"long_sha": "f941ec84c3aeb0d3fcceea537991ba7e1ac96414",
"version": "v3.3.0"
},
"release": "v3.3.0"
"release": "v3.4.0"
}
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
## v3.3.0 17th July 2024

- Release based on Onfido OpenAPI spec version [v3.2.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.2.0):
- [CAT-1289] Document report's properties: Add middle name
- chore(qes): add documents endpoint
- [CAT-1297] Webhook Event: remove uuid format from object.id
- fix(qes): fix download document http method
- Add started_at_iso8601 field in webhook event
- add jpeg file type for documents
- [CAT-1289] Document report's properties: Add middle name
- chore(qes): add documents endpoint
- [CAT-1297] Webhook Event: remove uuid format from object.id
- fix(qes): fix download document http method
- Add started_at_iso8601 field in webhook event
- add jpeg file type for documents

## v3.2.0 2nd July 2024

Expand Down
2 changes: 1 addition & 1 deletion onfido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
""" # noqa: E501


__version__ = "3.3.0"
__version__ = "3.4.0"

# import apis into sdk package
from onfido.api.default_api import DefaultApi
Expand Down
2 changes: 1 addition & 1 deletion onfido/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.0'
self.user_agent = 'onfido-python/3.4.0'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion onfido/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.0".\
"SDK Package Version: 3.4.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
13 changes: 11 additions & 2 deletions onfido/models/workflow_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class WorkflowRun(BaseModel):
applicant_id: StrictStr = Field(description="The unique identifier for the Applicant.")
workflow_id: StrictStr = Field(description="The unique identifier for the Workflow.")
tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(max_length=30)]] = Field(default=None, description="Tags or labels assigned to the workflow run.")
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
link: Optional[WorkflowRunSharedLink] = None
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was created.")
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was last updated.")
Expand All @@ -43,8 +44,9 @@ class WorkflowRun(BaseModel):
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object contains all of the properties configured on the Workflow version.")
reasons: Optional[List[StrictStr]] = Field(default=None, description="The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow version.")
error: Optional[WorkflowRunResponseError] = None
sdk_token: Optional[StrictStr] = Field(default=None, description="Client token to use when loading this workflow run in the Onfido SDK.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "link", "created_at", "updated_at", "id", "workflow_version_id", "dashboard_url", "status", "output", "reasons", "error"]
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "customer_user_id", "link", "created_at", "updated_at", "id", "workflow_version_id", "dashboard_url", "status", "output", "reasons", "error", "sdk_token"]

@field_validator('status')
def status_validate_enum(cls, value):
Expand Down Expand Up @@ -113,6 +115,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.tags is None and "tags" in self.model_fields_set:
_dict['tags'] = None

# set to None if sdk_token (nullable) is None
# and model_fields_set contains the field
if self.sdk_token is None and "sdk_token" in self.model_fields_set:
_dict['sdk_token'] = None

return _dict

@classmethod
Expand All @@ -128,6 +135,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"applicant_id": obj.get("applicant_id"),
"workflow_id": obj.get("workflow_id"),
"tags": obj.get("tags"),
"customer_user_id": obj.get("customer_user_id"),
"link": WorkflowRunSharedLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
"created_at": obj.get("created_at"),
"updated_at": obj.get("updated_at"),
Expand All @@ -137,7 +145,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"status": obj.get("status"),
"output": obj.get("output"),
"reasons": obj.get("reasons"),
"error": WorkflowRunResponseError.from_dict(obj["error"]) if obj.get("error") is not None else None
"error": WorkflowRunResponseError.from_dict(obj["error"]) if obj.get("error") is not None else None,
"sdk_token": obj.get("sdk_token")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
4 changes: 3 additions & 1 deletion onfido/models/workflow_run_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ class WorkflowRunBuilder(BaseModel):
applicant_id: StrictStr = Field(description="The unique identifier for the Applicant.")
workflow_id: StrictStr = Field(description="The unique identifier for the Workflow.")
tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(max_length=30)]] = Field(default=None, description="Tags or labels assigned to the workflow run.")
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
link: Optional[WorkflowRunSharedLink] = None
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was created.")
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was last updated.")
custom_data: Optional[Dict[str, Any]] = Field(default=None, description="Object with Custom Input Data to be used in the Workflow Run.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "link", "created_at", "updated_at", "custom_data"]
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "customer_user_id", "link", "created_at", "updated_at", "custom_data"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -108,6 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"applicant_id": obj.get("applicant_id"),
"workflow_id": obj.get("workflow_id"),
"tags": obj.get("tags"),
"customer_user_id": obj.get("customer_user_id"),
"link": WorkflowRunSharedLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
"created_at": obj.get("created_at"),
"updated_at": obj.get("updated_at"),
Expand Down
11 changes: 9 additions & 2 deletions onfido/models/workflow_run_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ class WorkflowRunResponse(BaseModel):
output: Optional[Dict[str, Any]] = Field(default=None, description="Output object contains all of the properties configured on the Workflow version.")
reasons: Optional[List[StrictStr]] = Field(default=None, description="The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow version.")
error: Optional[WorkflowRunResponseError] = None
sdk_token: Optional[StrictStr] = Field(default=None, description="Client token to use when loading this workflow run in the Onfido SDK.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["id", "workflow_version_id", "dashboard_url", "status", "output", "reasons", "error"]
__properties: ClassVar[List[str]] = ["id", "workflow_version_id", "dashboard_url", "status", "output", "reasons", "error", "sdk_token"]

@field_validator('status')
def status_validate_enum(cls, value):
Expand Down Expand Up @@ -96,6 +97,11 @@ def to_dict(self) -> Dict[str, Any]:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value

# set to None if sdk_token (nullable) is None
# and model_fields_set contains the field
if self.sdk_token is None and "sdk_token" in self.model_fields_set:
_dict['sdk_token'] = None

return _dict

@classmethod
Expand All @@ -114,7 +120,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"status": obj.get("status"),
"output": obj.get("output"),
"reasons": obj.get("reasons"),
"error": WorkflowRunResponseError.from_dict(obj["error"]) if obj.get("error") is not None else None
"error": WorkflowRunResponseError.from_dict(obj["error"]) if obj.get("error") is not None else None,
"sdk_token": obj.get("sdk_token")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
4 changes: 3 additions & 1 deletion onfido/models/workflow_run_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ class WorkflowRunShared(BaseModel):
applicant_id: StrictStr = Field(description="The unique identifier for the Applicant.")
workflow_id: StrictStr = Field(description="The unique identifier for the Workflow.")
tags: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=128)]], Field(max_length=30)]] = Field(default=None, description="Tags or labels assigned to the workflow run.")
customer_user_id: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="Customer-provided user identifier.")
link: Optional[WorkflowRunSharedLink] = None
created_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was created.")
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the Workflow Run was last updated.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "link", "created_at", "updated_at"]
__properties: ClassVar[List[str]] = ["applicant_id", "workflow_id", "tags", "customer_user_id", "link", "created_at", "updated_at"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -107,6 +108,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"applicant_id": obj.get("applicant_id"),
"workflow_id": obj.get("workflow_id"),
"tags": obj.get("tags"),
"customer_user_id": obj.get("customer_user_id"),
"link": WorkflowRunSharedLink.from_dict(obj["link"]) if obj.get("link") is not None else None,
"created_at": obj.get("created_at"),
"updated_at": obj.get("updated_at")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "onfido-python"
version = "3.3.0"
version = "3.4.0"
description = "Python library for the Onfido API"
authors = ["OpenAPI Generator Community <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "onfido-python"
VERSION = "3.3.0"
VERSION = "3.4.0"
PYTHON_REQUIRES = ">=3.7"
REQUIRES = [
"urllib3 >= 1.25.3, < 2.1.0",
Expand Down

0 comments on commit 019cef2

Please sign in to comment.