Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/infuse_iot/api_client/api/admin/generate_api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ def _get_kwargs(
"url": "/admin/apiKey",
}

_body = body.to_dict()
_kwargs["json"] = body.to_dict()

_kwargs["json"] = _body
headers["Content-Type"] = "application/json"

_kwargs["headers"] = headers
Expand All @@ -38,14 +37,17 @@ def _parse_response(
response_200 = GeneratedAPIKey.from_dict(response.json())

return response_200

if response.status_code == 400:
response_400 = Error.from_dict(response.json())

return response_400

if response.status_code == 500:
response_500 = Error.from_dict(response.json())

return response_500

if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
Expand Down Expand Up @@ -78,7 +80,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Error, GeneratedAPIKey]]
Response[Error | GeneratedAPIKey]
"""

kwargs = _get_kwargs(
Expand Down Expand Up @@ -107,7 +109,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Error, GeneratedAPIKey]
Error | GeneratedAPIKey
"""

return sync_detailed(
Expand All @@ -131,7 +133,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Error, GeneratedAPIKey]]
Response[Error | GeneratedAPIKey]
"""

kwargs = _get_kwargs(
Expand All @@ -158,7 +160,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Error, GeneratedAPIKey]
Error | GeneratedAPIKey
"""

return (
Expand Down
14 changes: 8 additions & 6 deletions src/infuse_iot/api_client/api/board/create_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ def _get_kwargs(
"url": "/board",
}

_body = body.to_dict()
_kwargs["json"] = body.to_dict()

_kwargs["json"] = _body
headers["Content-Type"] = "application/json"

_kwargs["headers"] = headers
Expand All @@ -35,12 +34,15 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res
response_201 = Board.from_dict(response.json())

return response_201

if response.status_code == 409:
response_409 = cast(Any, None)
return response_409

if response.status_code == 422:
response_422 = cast(Any, None)
return response_422

if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
Expand Down Expand Up @@ -71,7 +73,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, Board]]
Response[Any | Board]
"""

kwargs = _get_kwargs(
Expand Down Expand Up @@ -100,7 +102,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, Board]
Any | Board
"""

return sync_detailed(
Expand All @@ -124,7 +126,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, Board]]
Response[Any | Board]
"""

kwargs = _get_kwargs(
Expand All @@ -151,7 +153,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, Board]
Any | Board
"""

return (
Expand Down
15 changes: 10 additions & 5 deletions src/infuse_iot/api_client/api/board/get_board_by_id.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from http import HTTPStatus
from typing import Any, cast
from urllib.parse import quote
from uuid import UUID

import httpx
Expand All @@ -15,7 +16,9 @@ def _get_kwargs(
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/board/id/{id}",
"url": "/board/id/{id}".format(
id=quote(str(id), safe=""),
),
}

return _kwargs
Expand All @@ -26,9 +29,11 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res
response_200 = Board.from_dict(response.json())

return response_200

if response.status_code == 404:
response_404 = cast(Any, None)
return response_404

if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
Expand Down Expand Up @@ -59,7 +64,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, Board]]
Response[Any | Board]
"""

kwargs = _get_kwargs(
Expand Down Expand Up @@ -88,7 +93,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, Board]
Any | Board
"""

return sync_detailed(
Expand All @@ -112,7 +117,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, Board]]
Response[Any | Board]
"""

kwargs = _get_kwargs(
Expand All @@ -139,7 +144,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, Board]
Any | Board
"""

return (
Expand Down
21 changes: 11 additions & 10 deletions src/infuse_iot/api_client/api/board/get_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _get_kwargs(
return _kwargs


def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list["Board"] | None:
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[Board] | None:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
Expand All @@ -40,13 +40,14 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res
response_200.append(response_200_item)

return response_200

if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None


def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list["Board"]]:
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[Board]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -59,7 +60,7 @@ def sync_detailed(
*,
client: AuthenticatedClient | Client,
organisation_id: UUID,
) -> Response[list["Board"]]:
) -> Response[list[Board]]:
"""Get all boards in an organisation

Args:
Expand All @@ -70,7 +71,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[list['Board']]
Response[list[Board]]
"""

kwargs = _get_kwargs(
Expand All @@ -88,7 +89,7 @@ def sync(
*,
client: AuthenticatedClient | Client,
organisation_id: UUID,
) -> list["Board"] | None:
) -> list[Board] | None:
"""Get all boards in an organisation

Args:
Expand All @@ -99,7 +100,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
list['Board']
list[Board]
"""

return sync_detailed(
Expand All @@ -112,7 +113,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient | Client,
organisation_id: UUID,
) -> Response[list["Board"]]:
) -> Response[list[Board]]:
"""Get all boards in an organisation

Args:
Expand All @@ -123,7 +124,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[list['Board']]
Response[list[Board]]
"""

kwargs = _get_kwargs(
Expand All @@ -139,7 +140,7 @@ async def asyncio(
*,
client: AuthenticatedClient | Client,
organisation_id: UUID,
) -> list["Board"] | None:
) -> list[Board] | None:
"""Get all boards in an organisation

Args:
Expand All @@ -150,7 +151,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
list['Board']
list[Board]
"""

return (
Expand Down
Loading