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
9- from ...types import Response
10+ from ...types import UNSET , Response
1011
1112
1213def _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