diff --git a/README.md b/README.md index 6b13c313..09e14e51 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Please, include the `User-Agent` header with the name of your application or pro This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: Latest -- Package version: 0.3.0 +- Package version: 0.3.1 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/phrasetms_client/__init__.py b/phrasetms_client/__init__.py index e98e657e..29abb778 100644 --- a/phrasetms_client/__init__.py +++ b/phrasetms_client/__init__.py @@ -14,7 +14,7 @@ """ -__version__ = "0.3.0" +__version__ = "0.3.1" # import apis into sdk package from phrasetms_client.api.additional_workflow_step_api import AdditionalWorkflowStepApi diff --git a/phrasetms_client/configuration.py b/phrasetms_client/configuration.py index 7ce21389..42ff2553 100644 --- a/phrasetms_client/configuration.py +++ b/phrasetms_client/configuration.py @@ -423,7 +423,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: Latest\n" - "SDK Package Version: 0.3.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 0.3.1".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/phrasetms_client/models/job_create_request_dto.py b/phrasetms_client/models/job_create_request_dto.py index 922975e4..128b3590 100644 --- a/phrasetms_client/models/job_create_request_dto.py +++ b/phrasetms_client/models/job_create_request_dto.py @@ -25,6 +25,7 @@ from phrasetms_client.models.providers_per_language import ProvidersPerLanguage from phrasetms_client.models.uid_reference import UidReference from phrasetms_client.models.workflow_step_configuration import WorkflowStepConfiguration +from phrasetms_client.utils import DateTimeEncoder class JobCreateRequestDto(BaseModel): """ @@ -54,7 +55,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) + return json.dumps(self.to_dict(), cls=DateTimeEncoder) @classmethod def from_json(cls, json_str: str) -> JobCreateRequestDto: diff --git a/phrasetms_client/utils.py b/phrasetms_client/utils.py new file mode 100644 index 00000000..49cb59a9 --- /dev/null +++ b/phrasetms_client/utils.py @@ -0,0 +1,9 @@ +from datetime import datetime +import json + +class DateTimeEncoder(json.JSONEncoder): + def default(self, o): + if isinstance(o, datetime): + return o.isoformat() + + return super().default(o) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 53acfbd5..28e1b41b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "phrasetms_client" -version = "0.3.0" +version = "0.3.1" description = "Phrase TMS API" authors = ["Martin Chrástek"] license = "NoLicense" diff --git a/setup.py b/setup.py index 0deeda1b..aaa86ebb 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "phrasetms-client" -VERSION = "0.3.0" +VERSION = "0.3.1" PYTHON_REQUIRES = ">=3.7" REQUIRES = ["urllib3 >= 1.25.3", "python-dateutil", "pydantic >= 1.10.5, < 2", "aenum"]