Skip to content

Commit 9ccbd0d

Browse files
committed
api_client: regenerate from latest definitions
Regenerate the cloud API client from the latest openapi specification. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent 5b57f5b commit 9ccbd0d

137 files changed

Lines changed: 2307 additions & 867 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/infuse_iot/api_client/api/admin/generate_api_key.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ def _get_kwargs(
2222
"url": "/admin/apiKey",
2323
}
2424

25-
_body = body.to_dict()
25+
_kwargs["json"] = body.to_dict()
2626

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

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

4039
return response_200
40+
4141
if response.status_code == 400:
4242
response_400 = Error.from_dict(response.json())
4343

4444
return response_400
45+
4546
if response.status_code == 500:
4647
response_500 = Error.from_dict(response.json())
4748

4849
return response_500
50+
4951
if client.raise_on_unexpected_status:
5052
raise errors.UnexpectedStatus(response.status_code, response.content)
5153
else:
@@ -78,7 +80,7 @@ def sync_detailed(
7880
httpx.TimeoutException: If the request takes longer than Client.timeout.
7981
8082
Returns:
81-
Response[Union[Error, GeneratedAPIKey]]
83+
Response[Error | GeneratedAPIKey]
8284
"""
8385

8486
kwargs = _get_kwargs(
@@ -107,7 +109,7 @@ def sync(
107109
httpx.TimeoutException: If the request takes longer than Client.timeout.
108110
109111
Returns:
110-
Union[Error, GeneratedAPIKey]
112+
Error | GeneratedAPIKey
111113
"""
112114

113115
return sync_detailed(
@@ -131,7 +133,7 @@ async def asyncio_detailed(
131133
httpx.TimeoutException: If the request takes longer than Client.timeout.
132134
133135
Returns:
134-
Response[Union[Error, GeneratedAPIKey]]
136+
Response[Error | GeneratedAPIKey]
135137
"""
136138

137139
kwargs = _get_kwargs(
@@ -158,7 +160,7 @@ async def asyncio(
158160
httpx.TimeoutException: If the request takes longer than Client.timeout.
159161
160162
Returns:
161-
Union[Error, GeneratedAPIKey]
163+
Error | GeneratedAPIKey
162164
"""
163165

164166
return (

src/infuse_iot/api_client/api/board/create_board.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ def _get_kwargs(
2121
"url": "/board",
2222
}
2323

24-
_body = body.to_dict()
24+
_kwargs["json"] = body.to_dict()
2525

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

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

3736
return response_201
37+
3838
if response.status_code == 409:
3939
response_409 = cast(Any, None)
4040
return response_409
41+
4142
if response.status_code == 422:
4243
response_422 = cast(Any, None)
4344
return response_422
45+
4446
if client.raise_on_unexpected_status:
4547
raise errors.UnexpectedStatus(response.status_code, response.content)
4648
else:
@@ -71,7 +73,7 @@ def sync_detailed(
7173
httpx.TimeoutException: If the request takes longer than Client.timeout.
7274
7375
Returns:
74-
Response[Union[Any, Board]]
76+
Response[Any | Board]
7577
"""
7678

7779
kwargs = _get_kwargs(
@@ -100,7 +102,7 @@ def sync(
100102
httpx.TimeoutException: If the request takes longer than Client.timeout.
101103
102104
Returns:
103-
Union[Any, Board]
105+
Any | Board
104106
"""
105107

106108
return sync_detailed(
@@ -124,7 +126,7 @@ async def asyncio_detailed(
124126
httpx.TimeoutException: If the request takes longer than Client.timeout.
125127
126128
Returns:
127-
Response[Union[Any, Board]]
129+
Response[Any | Board]
128130
"""
129131

130132
kwargs = _get_kwargs(
@@ -151,7 +153,7 @@ async def asyncio(
151153
httpx.TimeoutException: If the request takes longer than Client.timeout.
152154
153155
Returns:
154-
Union[Any, Board]
156+
Any | Board
155157
"""
156158

157159
return (

src/infuse_iot/api_client/api/board/get_board_by_id.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from http import HTTPStatus
22
from typing import Any, cast
3+
from urllib.parse import quote
34
from uuid import UUID
45

56
import httpx
@@ -15,7 +16,9 @@ def _get_kwargs(
1516
) -> dict[str, Any]:
1617
_kwargs: dict[str, Any] = {
1718
"method": "get",
18-
"url": f"/board/id/{id}",
19+
"url": "/board/id/{id}".format(
20+
id=quote(str(id), safe=""),
21+
),
1922
}
2023

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

2831
return response_200
32+
2933
if response.status_code == 404:
3034
response_404 = cast(Any, None)
3135
return response_404
36+
3237
if client.raise_on_unexpected_status:
3338
raise errors.UnexpectedStatus(response.status_code, response.content)
3439
else:
@@ -59,7 +64,7 @@ def sync_detailed(
5964
httpx.TimeoutException: If the request takes longer than Client.timeout.
6065
6166
Returns:
62-
Response[Union[Any, Board]]
67+
Response[Any | Board]
6368
"""
6469

6570
kwargs = _get_kwargs(
@@ -88,7 +93,7 @@ def sync(
8893
httpx.TimeoutException: If the request takes longer than Client.timeout.
8994
9095
Returns:
91-
Union[Any, Board]
96+
Any | Board
9297
"""
9398

9499
return sync_detailed(
@@ -112,7 +117,7 @@ async def asyncio_detailed(
112117
httpx.TimeoutException: If the request takes longer than Client.timeout.
113118
114119
Returns:
115-
Response[Union[Any, Board]]
120+
Response[Any | Board]
116121
"""
117122

118123
kwargs = _get_kwargs(
@@ -139,7 +144,7 @@ async def asyncio(
139144
httpx.TimeoutException: If the request takes longer than Client.timeout.
140145
141146
Returns:
142-
Union[Any, Board]
147+
Any | Board
143148
"""
144149

145150
return (

src/infuse_iot/api_client/api/board/get_boards.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _get_kwargs(
3030
return _kwargs
3131

3232

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

4242
return response_200
43+
4344
if client.raise_on_unexpected_status:
4445
raise errors.UnexpectedStatus(response.status_code, response.content)
4546
else:
4647
return None
4748

4849

49-
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list["Board"]]:
50+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[Board]]:
5051
return Response(
5152
status_code=HTTPStatus(response.status_code),
5253
content=response.content,
@@ -59,7 +60,7 @@ def sync_detailed(
5960
*,
6061
client: AuthenticatedClient | Client,
6162
organisation_id: UUID,
62-
) -> Response[list["Board"]]:
63+
) -> Response[list[Board]]:
6364
"""Get all boards in an organisation
6465
6566
Args:
@@ -70,7 +71,7 @@ def sync_detailed(
7071
httpx.TimeoutException: If the request takes longer than Client.timeout.
7172
7273
Returns:
73-
Response[list['Board']]
74+
Response[list[Board]]
7475
"""
7576

7677
kwargs = _get_kwargs(
@@ -88,7 +89,7 @@ def sync(
8889
*,
8990
client: AuthenticatedClient | Client,
9091
organisation_id: UUID,
91-
) -> list["Board"] | None:
92+
) -> list[Board] | None:
9293
"""Get all boards in an organisation
9394
9495
Args:
@@ -99,7 +100,7 @@ def sync(
99100
httpx.TimeoutException: If the request takes longer than Client.timeout.
100101
101102
Returns:
102-
list['Board']
103+
list[Board]
103104
"""
104105

105106
return sync_detailed(
@@ -112,7 +113,7 @@ async def asyncio_detailed(
112113
*,
113114
client: AuthenticatedClient | Client,
114115
organisation_id: UUID,
115-
) -> Response[list["Board"]]:
116+
) -> Response[list[Board]]:
116117
"""Get all boards in an organisation
117118
118119
Args:
@@ -123,7 +124,7 @@ async def asyncio_detailed(
123124
httpx.TimeoutException: If the request takes longer than Client.timeout.
124125
125126
Returns:
126-
Response[list['Board']]
127+
Response[list[Board]]
127128
"""
128129

129130
kwargs = _get_kwargs(
@@ -139,7 +140,7 @@ async def asyncio(
139140
*,
140141
client: AuthenticatedClient | Client,
141142
organisation_id: UUID,
142-
) -> list["Board"] | None:
143+
) -> list[Board] | None:
143144
"""Get all boards in an organisation
144145
145146
Args:
@@ -150,7 +151,7 @@ async def asyncio(
150151
httpx.TimeoutException: If the request takes longer than Client.timeout.
151152
152153
Returns:
153-
list['Board']
154+
list[Board]
154155
"""
155156

156157
return (

0 commit comments

Comments
 (0)