Skip to content

Commit 26bb53e

Browse files
authored
Merge pull request #50 from taskbadger/sk/upgrades
Library and client upgrades
2 parents f8134e2 + 3f7c328 commit 26bb53e

26 files changed

Lines changed: 1116 additions & 905 deletions

taskbadger.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ paths:
3737
tags:
3838
- Task Endpoints
3939
security:
40+
- projectKeyAuth: []
4041
- bearerAuth: []
4142
responses:
4243
'200':
@@ -109,6 +110,7 @@ paths:
109110
summary: Create Payload
110111
required: true
111112
security:
113+
- projectKeyAuth: []
112114
- bearerAuth: []
113115
responses:
114116
'201':
@@ -159,6 +161,7 @@ paths:
159161
tags:
160162
- Task Endpoints
161163
security:
164+
- projectKeyAuth: []
162165
- bearerAuth: []
163166
responses:
164167
'200':
@@ -229,6 +232,7 @@ paths:
229232
summary: Update Payload
230233
required: true
231234
security:
235+
- projectKeyAuth: []
232236
- bearerAuth: []
233237
responses:
234238
'200':
@@ -289,6 +293,7 @@ paths:
289293
value: 100
290294
summary: Update Payload
291295
security:
296+
- projectKeyAuth: []
292297
- bearerAuth: []
293298
responses:
294299
'200':
@@ -338,6 +343,7 @@ paths:
338343
tags:
339344
- Task Endpoints
340345
security:
346+
- projectKeyAuth: []
341347
- bearerAuth: []
342348
responses:
343349
'204':
@@ -369,6 +375,7 @@ paths:
369375
tags:
370376
- Action Endpoints
371377
security:
378+
- projectKeyAuth: []
372379
- bearerAuth: []
373380
responses:
374381
'200':
@@ -411,6 +418,7 @@ paths:
411418
$ref: '#/components/schemas/ActionRequest'
412419
required: true
413420
security:
421+
- projectKeyAuth: []
414422
- bearerAuth: []
415423
responses:
416424
'201':
@@ -452,6 +460,7 @@ paths:
452460
tags:
453461
- Action Endpoints
454462
security:
463+
- projectKeyAuth: []
455464
- bearerAuth: []
456465
responses:
457466
'200':
@@ -498,6 +507,7 @@ paths:
498507
$ref: '#/components/schemas/ActionRequest'
499508
required: true
500509
security:
510+
- projectKeyAuth: []
501511
- bearerAuth: []
502512
responses:
503513
'200':
@@ -543,6 +553,7 @@ paths:
543553
schema:
544554
$ref: '#/components/schemas/PatchedActionRequest'
545555
security:
556+
- projectKeyAuth: []
546557
- bearerAuth: []
547558
responses:
548559
'200':
@@ -583,6 +594,7 @@ paths:
583594
tags:
584595
- Action Endpoints
585596
security:
597+
- projectKeyAuth: []
586598
- bearerAuth: []
587599
responses:
588600
'204':
@@ -934,6 +946,9 @@ components:
934946
bearerAuth:
935947
type: http
936948
scheme: bearer
949+
projectKeyAuth:
950+
type: http
951+
scheme: bearer
937952
externalDocs:
938953
url: https://docs.taskbadger.net
939954
description: Task Badger Documentation

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

0 commit comments

Comments
 (0)