diff --git a/README.md b/README.md index 3e27436..0131ac7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: v5.17.2.9580 - Package version: 1.1.1 -- Generator version: 7.10.0 +- Generator version: 7.11.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/pyproject.toml b/pyproject.toml index 39a5ccd..1526426 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ include = ["radarr/py.typed"] [tool.poetry.dependencies] python = "^3.8" -urllib3 = ">= 1.25.3 < 3.0.0" +urllib3 = ">= 1.25.3, < 3.0.0" python-dateutil = ">= 2.8.2" pydantic = ">= 2" typing-extensions = ">= 4.7.1" diff --git a/radarr/api_client.py b/radarr/api_client.py index 025a07d..628c95f 100644 --- a/radarr/api_client.py +++ b/radarr/api_client.py @@ -517,7 +517,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' diff --git a/radarr/exceptions.py b/radarr/exceptions.py index a74b885..fb5ec02 100644 --- a/radarr/exceptions.py +++ b/radarr/exceptions.py @@ -150,6 +150,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,16 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/setup.py b/setup.py index baf9edc..967d71c 100644 --- a/setup.py +++ b/setup.py @@ -47,4 +47,4 @@ Radarr API docs """, # noqa: E501 package_data={"radarr": ["py.typed"]}, -) +) \ No newline at end of file