Skip to content

Commit

Permalink
Merge pull request #81 from devopsarr/feature/code-generation
Browse files Browse the repository at this point in the history
fix(deps): update openapitools/openapi-generator-cli docker tag to v7.11.0
  • Loading branch information
devopsarr[bot] authored Jan 20, 2025
2 parents d9ee3af + 8a1e7ad commit ba7182a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:

- API version: v4.0.12.2823
- Package version: 1.0.2 <!--- x-release-please-version -->
- Generator version: 7.10.0
- Generator version: 7.11.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include = ["sonarr/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"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
Sonarr API docs - The v3 API docs apply to both v3 and v4 versions of Sonarr. Some functionality may only be available in v4 of the Sonarr application.
""", # noqa: E501
package_data={"sonarr": ["py.typed"]},
)
)
2 changes: 1 addition & 1 deletion sonarr/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ' '
Expand Down
17 changes: 17 additions & 0 deletions sonarr/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = ""
Expand Down

0 comments on commit ba7182a

Please sign in to comment.