Skip to content

Commit 4b8b82b

Browse files
committed
update generated client
1 parent 9c3f1b5 commit 4b8b82b

32 files changed

Lines changed: 835 additions & 574 deletions

generator_config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
project_name_override: taskbadger-python
22
package_name_override: taskbadger/internal
33
post_hooks:
4-
- "autoflake -i -r --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports ."
5-
- "isort ."
6-
- "black ."
4+
- "ruff format ."
5+
- "ruff check . --fix"

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ quote-style = "double"
9595
indent-style = "space"
9696
skip-magic-trailing-comma = false
9797
line-ending = "auto"
98+
99+
[tool.ruff.lint.per-file-ignores]
100+
"taskbadger/internal/*" = ["E501"]

taskbadger/internal/api/action_endpoints/action_cancel.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from http import HTTPStatus
22
from typing import Any, Optional, Union
3+
from uuid import UUID
34

45
import httpx
56

@@ -12,18 +13,18 @@ def _get_kwargs(
1213
organization_slug: str,
1314
project_slug: str,
1415
task_id: str,
15-
id: str,
16+
id: UUID,
1617
) -> dict[str, Any]:
17-
pass
18-
19-
return {
18+
_kwargs: dict[str, Any] = {
2019
"method": "delete",
2120
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/{id}/",
2221
}
2322

23+
return _kwargs
24+
2425

2526
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
26-
if response.status_code == HTTPStatus.NO_CONTENT:
27+
if response.status_code == 204:
2728
return None
2829
if client.raise_on_unexpected_status:
2930
raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -44,7 +45,7 @@ def sync_detailed(
4445
organization_slug: str,
4546
project_slug: str,
4647
task_id: str,
47-
id: str,
48+
id: UUID,
4849
*,
4950
client: AuthenticatedClient,
5051
) -> Response[Any]:
@@ -56,11 +57,10 @@ def sync_detailed(
5657
organization_slug (str):
5758
project_slug (str):
5859
task_id (str):
59-
id (str):
60+
id (UUID):
6061
6162
Raises:
62-
errors.UnexpectedStatus: If the server returns an undocumented status code
63-
and Client.raise_on_unexpected_status is True.
63+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
6464
httpx.TimeoutException: If the request takes longer than Client.timeout.
6565
6666
Returns:
@@ -85,7 +85,7 @@ async def asyncio_detailed(
8585
organization_slug: str,
8686
project_slug: str,
8787
task_id: str,
88-
id: str,
88+
id: UUID,
8989
*,
9090
client: AuthenticatedClient,
9191
) -> Response[Any]:
@@ -97,11 +97,10 @@ async def asyncio_detailed(
9797
organization_slug (str):
9898
project_slug (str):
9999
task_id (str):
100-
id (str):
100+
id (UUID):
101101
102102
Raises:
103-
errors.UnexpectedStatus: If the server returns an undocumented status code
104-
and Client.raise_on_unexpected_status is True.
103+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
105104
httpx.TimeoutException: If the request takes longer than Client.timeout.
106105
107106
Returns:

taskbadger/internal/api/action_endpoints/action_create.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ def _get_kwargs(
1515
project_slug: str,
1616
task_id: str,
1717
*,
18-
json_body: ActionRequest,
18+
body: ActionRequest,
1919
) -> dict[str, Any]:
20-
pass
20+
headers: dict[str, Any] = {}
2121

22-
json_json_body = json_body.to_dict()
23-
24-
return {
22+
_kwargs: dict[str, Any] = {
2523
"method": "post",
2624
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/",
27-
"json": json_json_body,
2825
}
2926

27+
_body = body.to_dict()
28+
29+
_kwargs["json"] = _body
30+
headers["Content-Type"] = "application/json"
31+
32+
_kwargs["headers"] = headers
33+
return _kwargs
34+
3035

3136
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Action]:
32-
if response.status_code == HTTPStatus.CREATED:
37+
if response.status_code == 201:
3338
response_201 = Action.from_dict(response.json())
3439

3540
return response_201
@@ -54,7 +59,7 @@ def sync_detailed(
5459
task_id: str,
5560
*,
5661
client: AuthenticatedClient,
57-
json_body: ActionRequest,
62+
body: ActionRequest,
5863
) -> Response[Action]:
5964
"""Create Action
6065
@@ -64,11 +69,10 @@ def sync_detailed(
6469
organization_slug (str):
6570
project_slug (str):
6671
task_id (str):
67-
json_body (ActionRequest):
72+
body (ActionRequest):
6873
6974
Raises:
70-
errors.UnexpectedStatus: If the server returns an undocumented status code
71-
and Client.raise_on_unexpected_status is True.
75+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
7276
httpx.TimeoutException: If the request takes longer than Client.timeout.
7377
7478
Returns:
@@ -79,7 +83,7 @@ def sync_detailed(
7983
organization_slug=organization_slug,
8084
project_slug=project_slug,
8185
task_id=task_id,
82-
json_body=json_body,
86+
body=body,
8387
)
8488

8589
response = client.get_httpx_client().request(
@@ -95,7 +99,7 @@ def sync(
9599
task_id: str,
96100
*,
97101
client: AuthenticatedClient,
98-
json_body: ActionRequest,
102+
body: ActionRequest,
99103
) -> Optional[Action]:
100104
"""Create Action
101105
@@ -105,11 +109,10 @@ def sync(
105109
organization_slug (str):
106110
project_slug (str):
107111
task_id (str):
108-
json_body (ActionRequest):
112+
body (ActionRequest):
109113
110114
Raises:
111-
errors.UnexpectedStatus: If the server returns an undocumented status code
112-
and Client.raise_on_unexpected_status is True.
115+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
113116
httpx.TimeoutException: If the request takes longer than Client.timeout.
114117
115118
Returns:
@@ -121,7 +124,7 @@ def sync(
121124
project_slug=project_slug,
122125
task_id=task_id,
123126
client=client,
124-
json_body=json_body,
127+
body=body,
125128
).parsed
126129

127130

@@ -131,7 +134,7 @@ async def asyncio_detailed(
131134
task_id: str,
132135
*,
133136
client: AuthenticatedClient,
134-
json_body: ActionRequest,
137+
body: ActionRequest,
135138
) -> Response[Action]:
136139
"""Create Action
137140
@@ -141,11 +144,10 @@ async def asyncio_detailed(
141144
organization_slug (str):
142145
project_slug (str):
143146
task_id (str):
144-
json_body (ActionRequest):
147+
body (ActionRequest):
145148
146149
Raises:
147-
errors.UnexpectedStatus: If the server returns an undocumented status code
148-
and Client.raise_on_unexpected_status is True.
150+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
149151
httpx.TimeoutException: If the request takes longer than Client.timeout.
150152
151153
Returns:
@@ -156,7 +158,7 @@ async def asyncio_detailed(
156158
organization_slug=organization_slug,
157159
project_slug=project_slug,
158160
task_id=task_id,
159-
json_body=json_body,
161+
body=body,
160162
)
161163

162164
response = await client.get_async_httpx_client().request(**kwargs)
@@ -170,7 +172,7 @@ async def asyncio(
170172
task_id: str,
171173
*,
172174
client: AuthenticatedClient,
173-
json_body: ActionRequest,
175+
body: ActionRequest,
174176
) -> Optional[Action]:
175177
"""Create Action
176178
@@ -180,11 +182,10 @@ async def asyncio(
180182
organization_slug (str):
181183
project_slug (str):
182184
task_id (str):
183-
json_body (ActionRequest):
185+
body (ActionRequest):
184186
185187
Raises:
186-
errors.UnexpectedStatus: If the server returns an undocumented status code
187-
and Client.raise_on_unexpected_status is True.
188+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
188189
httpx.TimeoutException: If the request takes longer than Client.timeout.
189190
190191
Returns:
@@ -197,6 +198,6 @@ async def asyncio(
197198
project_slug=project_slug,
198199
task_id=task_id,
199200
client=client,
200-
json_body=json_body,
201+
body=body,
201202
)
202203
).parsed

taskbadger/internal/api/action_endpoints/action_get.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from http import HTTPStatus
22
from typing import Any, Optional, Union
3+
from uuid import UUID
34

45
import httpx
56

@@ -13,18 +14,18 @@ def _get_kwargs(
1314
organization_slug: str,
1415
project_slug: str,
1516
task_id: str,
16-
id: str,
17+
id: UUID,
1718
) -> dict[str, Any]:
18-
pass
19-
20-
return {
19+
_kwargs: dict[str, Any] = {
2120
"method": "get",
2221
"url": f"/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/{id}/",
2322
}
2423

24+
return _kwargs
25+
2526

2627
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Action]:
27-
if response.status_code == HTTPStatus.OK:
28+
if response.status_code == 200:
2829
response_200 = Action.from_dict(response.json())
2930

3031
return response_200
@@ -47,7 +48,7 @@ def sync_detailed(
4748
organization_slug: str,
4849
project_slug: str,
4950
task_id: str,
50-
id: str,
51+
id: UUID,
5152
*,
5253
client: AuthenticatedClient,
5354
) -> Response[Action]:
@@ -59,11 +60,10 @@ def sync_detailed(
5960
organization_slug (str):
6061
project_slug (str):
6162
task_id (str):
62-
id (str):
63+
id (UUID):
6364
6465
Raises:
65-
errors.UnexpectedStatus: If the server returns an undocumented status code
66-
and Client.raise_on_unexpected_status is True.
66+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
6767
httpx.TimeoutException: If the request takes longer than Client.timeout.
6868
6969
Returns:
@@ -88,7 +88,7 @@ def sync(
8888
organization_slug: str,
8989
project_slug: str,
9090
task_id: str,
91-
id: str,
91+
id: UUID,
9292
*,
9393
client: AuthenticatedClient,
9494
) -> Optional[Action]:
@@ -100,11 +100,10 @@ def sync(
100100
organization_slug (str):
101101
project_slug (str):
102102
task_id (str):
103-
id (str):
103+
id (UUID):
104104
105105
Raises:
106-
errors.UnexpectedStatus: If the server returns an undocumented status code
107-
and Client.raise_on_unexpected_status is True.
106+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
108107
httpx.TimeoutException: If the request takes longer than Client.timeout.
109108
110109
Returns:
@@ -124,7 +123,7 @@ async def asyncio_detailed(
124123
organization_slug: str,
125124
project_slug: str,
126125
task_id: str,
127-
id: str,
126+
id: UUID,
128127
*,
129128
client: AuthenticatedClient,
130129
) -> Response[Action]:
@@ -136,11 +135,10 @@ async def asyncio_detailed(
136135
organization_slug (str):
137136
project_slug (str):
138137
task_id (str):
139-
id (str):
138+
id (UUID):
140139
141140
Raises:
142-
errors.UnexpectedStatus: If the server returns an undocumented status code
143-
and Client.raise_on_unexpected_status is True.
141+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
144142
httpx.TimeoutException: If the request takes longer than Client.timeout.
145143
146144
Returns:
@@ -163,7 +161,7 @@ async def asyncio(
163161
organization_slug: str,
164162
project_slug: str,
165163
task_id: str,
166-
id: str,
164+
id: UUID,
167165
*,
168166
client: AuthenticatedClient,
169167
) -> Optional[Action]:
@@ -175,11 +173,10 @@ async def asyncio(
175173
organization_slug (str):
176174
project_slug (str):
177175
task_id (str):
178-
id (str):
176+
id (UUID):
179177
180178
Raises:
181-
errors.UnexpectedStatus: If the server returns an undocumented status code
182-
and Client.raise_on_unexpected_status is True.
179+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
183180
httpx.TimeoutException: If the request takes longer than Client.timeout.
184181
185182
Returns:

0 commit comments

Comments
 (0)