Update api spec (#162)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -10,44 +10,22 @@ from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
|
||||
|
||||
lang: CodeLanguage,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body: bytes,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
|
||||
|
||||
output: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/file/execute/{lang}".format(client.base_url, lang=lang,) # noqa: E501
|
||||
|
||||
|
||||
|
||||
|
||||
url = "{}/file/execute/{lang}".format(
|
||||
client.base_url,
|
||||
lang=lang,
|
||||
) # noqa: E501
|
||||
|
||||
if output is not None:
|
||||
if "?" in url:
|
||||
url = url + "&output=" + str(output)
|
||||
else:
|
||||
url = url + "?output=" + str(output)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
@ -61,23 +39,22 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]] :
|
||||
if response.status_code == 200:
|
||||
response_200 = CodeOutput.from_dict(response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return Error.from_dict(response.json())
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CodeOutput.from_dict(response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return Error.from_dict(response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[CodeOutput, Error]]]:
|
||||
) -> Response[Optional[Union[CodeOutput, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -87,37 +64,16 @@ def _build_response(
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
|
||||
|
||||
lang: CodeLanguage,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body: bytes,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
|
||||
|
||||
output: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Response[Optional[Union[CodeOutput, Error]]]:
|
||||
) -> Response[Optional[Union[CodeOutput, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
lang=lang,
|
||||
|
||||
output=output,
|
||||
|
||||
body=body,
|
||||
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -130,75 +86,31 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
|
||||
|
||||
lang: CodeLanguage,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body: bytes,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
|
||||
|
||||
output: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Optional[Union[CodeOutput, Error]] :
|
||||
|
||||
|
||||
) -> Optional[Union[CodeOutput, Error]]:
|
||||
return sync_detailed(
|
||||
|
||||
lang=lang,
|
||||
|
||||
output=output,
|
||||
|
||||
body=body,
|
||||
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
|
||||
|
||||
lang: CodeLanguage,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body: bytes,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
|
||||
|
||||
output: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Response[Optional[Union[CodeOutput, Error]]]:
|
||||
) -> Response[Optional[Union[CodeOutput, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
lang=lang,
|
||||
|
||||
output=output,
|
||||
|
||||
body=body,
|
||||
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -209,40 +121,17 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
|
||||
|
||||
lang: CodeLanguage,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body: bytes,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
|
||||
|
||||
output: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Optional[Union[CodeOutput, Error]] :
|
||||
|
||||
|
||||
) -> Optional[Union[CodeOutput, Error]]:
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
|
||||
lang=lang,
|
||||
|
||||
output=output,
|
||||
|
||||
body=body,
|
||||
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
|
Reference in New Issue
Block a user