Skip to content

Commit 3f7c328

Browse files
committed
update client generated code
1 parent 957b523 commit 3f7c328

24 files changed

Lines changed: 443 additions & 345 deletions

taskbadger/internal/api/action_endpoints/action_cancel.py

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

56
import httpx
67

78
from ... import errors
89
from ...client import AuthenticatedClient, Client
9-
from ...types import Response
10+
from ...types import UNSET, Response
1011

1112

1213
def _get_kwargs(
@@ -15,15 +16,21 @@ def _get_kwargs(
1516
task_id: str,
1617
id: UUID,
1718
) -> dict[str, Any]:
19+
1820
_kwargs: dict[str, Any] = {
1921
"method": "delete",
20-
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/{id}/",
22+
"url": "/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/{id}/".format(
23+
organization_slug=quote(str(organization_slug), safe=""),
24+
project_slug=quote(str(project_slug), safe=""),
25+
task_id=quote(str(task_id), safe=""),
26+
id=quote(str(id), safe=""),
27+
),
2128
}
2229

2330
return _kwargs
2431

2532

26-
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
33+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None:
2734
if response.status_code == 204:
2835
return None
2936

@@ -33,7 +40,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
3340
return None
3441

3542

36-
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
43+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]:
3744
return Response(
3845
status_code=HTTPStatus(response.status_code),
3946
content=response.content,

taskbadger/internal/api/action_endpoints/action_create.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union
2+
from typing import Any, cast
3+
from urllib.parse import quote
34

45
import httpx
56

67
from ... import errors
78
from ...client import AuthenticatedClient, Client
89
from ...models.action import Action
910
from ...models.action_request import ActionRequest
10-
from ...types import Response
11+
from ...types import UNSET, Response
1112

1213

1314
def _get_kwargs(
@@ -21,7 +22,11 @@ def _get_kwargs(
2122

2223
_kwargs: dict[str, Any] = {
2324
"method": "post",
24-
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/",
25+
"url": "/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/".format(
26+
organization_slug=quote(str(organization_slug), safe=""),
27+
project_slug=quote(str(project_slug), safe=""),
28+
task_id=quote(str(task_id), safe=""),
29+
),
2530
}
2631

2732
_kwargs["json"] = body.to_dict()
@@ -32,7 +37,7 @@ def _get_kwargs(
3237
return _kwargs
3338

3439

35-
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Action]:
40+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Action | None:
3641
if response.status_code == 201:
3742
response_201 = Action.from_dict(response.json())
3843

@@ -44,7 +49,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
4449
return None
4550

4651

47-
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Action]:
52+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Action]:
4853
return Response(
4954
status_code=HTTPStatus(response.status_code),
5055
content=response.content,
@@ -100,7 +105,7 @@ def sync(
100105
*,
101106
client: AuthenticatedClient,
102107
body: ActionRequest,
103-
) -> Optional[Action]:
108+
) -> Action | None:
104109
"""Create Action
105110
106111
Create an action for a task
@@ -173,7 +178,7 @@ async def asyncio(
173178
*,
174179
client: AuthenticatedClient,
175180
body: ActionRequest,
176-
) -> Optional[Action]:
181+
) -> Action | None:
177182
"""Create Action
178183
179184
Create an action for a task

taskbadger/internal/api/action_endpoints/action_get.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union
2+
from typing import Any, cast
3+
from urllib.parse import quote
34
from uuid import UUID
45

56
import httpx
67

78
from ... import errors
89
from ...client import AuthenticatedClient, Client
910
from ...models.action import Action
10-
from ...types import Response
11+
from ...types import UNSET, Response
1112

1213

1314
def _get_kwargs(
@@ -16,15 +17,21 @@ def _get_kwargs(
1617
task_id: str,
1718
id: UUID,
1819
) -> dict[str, Any]:
20+
1921
_kwargs: dict[str, Any] = {
2022
"method": "get",
21-
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/{id}/",
23+
"url": "/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/{id}/".format(
24+
organization_slug=quote(str(organization_slug), safe=""),
25+
project_slug=quote(str(project_slug), safe=""),
26+
task_id=quote(str(task_id), safe=""),
27+
id=quote(str(id), safe=""),
28+
),
2229
}
2330

2431
return _kwargs
2532

2633

27-
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Action]:
34+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Action | None:
2835
if response.status_code == 200:
2936
response_200 = Action.from_dict(response.json())
3037

@@ -36,7 +43,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
3643
return None
3744

3845

39-
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Action]:
46+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Action]:
4047
return Response(
4148
status_code=HTTPStatus(response.status_code),
4249
content=response.content,
@@ -92,7 +99,7 @@ def sync(
9299
id: UUID,
93100
*,
94101
client: AuthenticatedClient,
95-
) -> Optional[Action]:
102+
) -> Action | None:
96103
"""Get Action
97104
98105
Fetch an action
@@ -165,7 +172,7 @@ async def asyncio(
165172
id: UUID,
166173
*,
167174
client: AuthenticatedClient,
168-
) -> Optional[Action]:
175+
) -> Action | None:
169176
"""Get Action
170177
171178
Fetch an action

taskbadger/internal/api/action_endpoints/action_list.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union
2+
from typing import Any, cast
3+
from urllib.parse import quote
34

45
import httpx
56

67
from ... import errors
78
from ...client import AuthenticatedClient, Client
89
from ...models.action import Action
9-
from ...types import Response
10+
from ...types import UNSET, Response
1011

1112

1213
def _get_kwargs(
1314
organization_slug: str,
1415
project_slug: str,
1516
task_id: str,
1617
) -> dict[str, Any]:
18+
1719
_kwargs: dict[str, Any] = {
1820
"method": "get",
19-
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/",
21+
"url": "/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/".format(
22+
organization_slug=quote(str(organization_slug), safe=""),
23+
project_slug=quote(str(project_slug), safe=""),
24+
task_id=quote(str(task_id), safe=""),
25+
),
2026
}
2127

2228
return _kwargs
2329

2430

25-
def _parse_response(
26-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
27-
) -> Optional[list["Action"]]:
31+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[Action] | None:
2832
if response.status_code == 200:
2933
response_200 = []
3034
_response_200 = response.json()
@@ -41,9 +45,7 @@ def _parse_response(
4145
return None
4246

4347

44-
def _build_response(
45-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
46-
) -> Response[list["Action"]]:
48+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[list[Action]]:
4749
return Response(
4850
status_code=HTTPStatus(response.status_code),
4951
content=response.content,
@@ -58,7 +60,7 @@ def sync_detailed(
5860
task_id: str,
5961
*,
6062
client: AuthenticatedClient,
61-
) -> Response[list["Action"]]:
63+
) -> Response[list[Action]]:
6264
"""List Actions
6365
6466
List actions for task
@@ -73,7 +75,7 @@ def sync_detailed(
7375
httpx.TimeoutException: If the request takes longer than Client.timeout.
7476
7577
Returns:
76-
Response[list['Action']]
78+
Response[list[Action]]
7779
"""
7880

7981
kwargs = _get_kwargs(
@@ -95,7 +97,7 @@ def sync(
9597
task_id: str,
9698
*,
9799
client: AuthenticatedClient,
98-
) -> Optional[list["Action"]]:
100+
) -> list[Action] | None:
99101
"""List Actions
100102
101103
List actions for task
@@ -110,7 +112,7 @@ def sync(
110112
httpx.TimeoutException: If the request takes longer than Client.timeout.
111113
112114
Returns:
113-
list['Action']
115+
list[Action]
114116
"""
115117

116118
return sync_detailed(
@@ -127,7 +129,7 @@ async def asyncio_detailed(
127129
task_id: str,
128130
*,
129131
client: AuthenticatedClient,
130-
) -> Response[list["Action"]]:
132+
) -> Response[list[Action]]:
131133
"""List Actions
132134
133135
List actions for task
@@ -142,7 +144,7 @@ async def asyncio_detailed(
142144
httpx.TimeoutException: If the request takes longer than Client.timeout.
143145
144146
Returns:
145-
Response[list['Action']]
147+
Response[list[Action]]
146148
"""
147149

148150
kwargs = _get_kwargs(
@@ -162,7 +164,7 @@ async def asyncio(
162164
task_id: str,
163165
*,
164166
client: AuthenticatedClient,
165-
) -> Optional[list["Action"]]:
167+
) -> list[Action] | None:
166168
"""List Actions
167169
168170
List actions for task
@@ -177,7 +179,7 @@ async def asyncio(
177179
httpx.TimeoutException: If the request takes longer than Client.timeout.
178180
179181
Returns:
180-
list['Action']
182+
list[Action]
181183
"""
182184

183185
return (

0 commit comments

Comments
 (0)