@@ -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
3136def _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
0 commit comments