11from http import HTTPStatus
2- from typing import Any , Dict , List , Optional
2+ from typing import Any , Dict , List , Optional , Union
33
44import httpx
55
@@ -13,27 +13,22 @@ def _get_kwargs(
1313 organization_slug : str ,
1414 project_slug : str ,
1515 task_id : str ,
16- * ,
17- client : AuthenticatedClient ,
1816) -> Dict [str , Any ]:
19- url = "{}/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/" .format (
20- client .base_url , organization_slug = organization_slug , project_slug = project_slug , task_id = task_id
21- )
22-
23- headers : Dict [str , str ] = client .get_headers ()
24- cookies : Dict [str , Any ] = client .get_cookies ()
17+ pass
2518
2619 return {
2720 "method" : "get" ,
28- "url" : url ,
29- "headers" : headers ,
30- "cookies" : cookies ,
31- "timeout" : client . get_timeout () ,
32- "follow_redirects" : client . follow_redirects ,
21+ "url" : "/api/{organization_slug}/{project_slug}/tasks/{task_id}/actions/" . format (
22+ organization_slug = organization_slug ,
23+ project_slug = project_slug ,
24+ task_id = task_id ,
25+ ) ,
3326 }
3427
3528
36- def _parse_response (* , client : Client , response : httpx .Response ) -> Optional [List ["Action" ]]:
29+ def _parse_response (
30+ * , client : Union [AuthenticatedClient , Client ], response : httpx .Response
31+ ) -> Optional [List ["Action" ]]:
3732 if response .status_code == HTTPStatus .OK :
3833 response_200 = []
3934 _response_200 = response .json ()
@@ -49,7 +44,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Lis
4944 return None
5045
5146
52- def _build_response (* , client : Client , response : httpx .Response ) -> Response [List ["Action" ]]:
47+ def _build_response (
48+ * , client : Union [AuthenticatedClient , Client ], response : httpx .Response
49+ ) -> Response [List ["Action" ]]:
5350 return Response (
5451 status_code = HTTPStatus (response .status_code ),
5552 content = response .content ,
@@ -86,11 +83,9 @@ def sync_detailed(
8683 organization_slug = organization_slug ,
8784 project_slug = project_slug ,
8885 task_id = task_id ,
89- client = client ,
9086 )
9187
92- response = httpx .request (
93- verify = client .verify_ssl ,
88+ response = client .get_httpx_client ().request (
9489 ** kwargs ,
9590 )
9691
@@ -157,11 +152,9 @@ async def asyncio_detailed(
157152 organization_slug = organization_slug ,
158153 project_slug = project_slug ,
159154 task_id = task_id ,
160- client = client ,
161155 )
162156
163- async with httpx .AsyncClient (verify = client .verify_ssl ) as _client :
164- response = await _client .request (** kwargs )
157+ response = await client .get_async_httpx_client ().request (** kwargs )
165158
166159 return _build_response (client = client , response = response )
167160
0 commit comments