11from http import HTTPStatus
2- from typing import Any , Optional , Union
2+ from typing import Any , cast
3+ from urllib .parse import quote
34
45import httpx
56
67from ... import errors
78from ...client import AuthenticatedClient , Client
89from ...models .action import Action
910from ...models .action_request import ActionRequest
10- from ...types import Response
11+ from ...types import UNSET , Response
1112
1213
1314def _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
0 commit comments