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:
@ -11,70 +11,40 @@ from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sort_by: CreatedAtSortMode,
|
||||
|
||||
|
||||
|
||||
status: ApiCallStatus,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
limit: Optional[int] = None,
|
||||
|
||||
|
||||
|
||||
page_token: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/async/operations".format(client.base_url, ) # noqa: E501
|
||||
|
||||
|
||||
url = "{}/async/operations".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
|
||||
|
||||
|
||||
if page_token is not None:
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
|
||||
|
||||
|
||||
if sort_by is not None:
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
|
||||
|
||||
|
||||
if status is not None:
|
||||
if "?" in url:
|
||||
url = url + "&status=" + str(status)
|
||||
else:
|
||||
url = url + "?status=" + str(status)
|
||||
|
||||
|
||||
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
@ -84,27 +54,27 @@ def _get_kwargs(
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[AsyncApiCallResultsPage, Error]] :
|
||||
if response.status_code == 200:
|
||||
response_200 = AsyncApiCallResultsPage.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[AsyncApiCallResultsPage, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = AsyncApiCallResultsPage.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[AsyncApiCallResultsPage, Error]]]:
|
||||
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -114,45 +84,18 @@ def _build_response(
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sort_by: CreatedAtSortMode,
|
||||
|
||||
|
||||
|
||||
status: ApiCallStatus,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
limit: Optional[int] = None,
|
||||
|
||||
|
||||
|
||||
page_token: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
|
||||
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
limit=limit,
|
||||
|
||||
page_token=page_token,
|
||||
|
||||
sort_by=sort_by,
|
||||
|
||||
status=status,
|
||||
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -165,92 +108,38 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sort_by: CreatedAtSortMode,
|
||||
|
||||
|
||||
|
||||
status: ApiCallStatus,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
limit: Optional[int] = None,
|
||||
|
||||
|
||||
|
||||
page_token: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Optional[Union[AsyncApiCallResultsPage, Error]] :
|
||||
) -> Optional[Union[AsyncApiCallResultsPage, Error]]:
|
||||
"""For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.
|
||||
This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
|
||||
This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
|
||||
limit=limit,
|
||||
|
||||
page_token=page_token,
|
||||
|
||||
sort_by=sort_by,
|
||||
|
||||
status=status,
|
||||
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sort_by: CreatedAtSortMode,
|
||||
|
||||
|
||||
|
||||
status: ApiCallStatus,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
limit: Optional[int] = None,
|
||||
|
||||
|
||||
|
||||
page_token: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
|
||||
) -> Response[Optional[Union[AsyncApiCallResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
|
||||
limit=limit,
|
||||
|
||||
page_token=page_token,
|
||||
|
||||
sort_by=sort_by,
|
||||
|
||||
status=status,
|
||||
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -261,49 +150,22 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sort_by: CreatedAtSortMode,
|
||||
|
||||
|
||||
|
||||
status: ApiCallStatus,
|
||||
|
||||
|
||||
*,
|
||||
client: Client,
|
||||
|
||||
|
||||
limit: Optional[int] = None,
|
||||
|
||||
|
||||
|
||||
page_token: Optional[str] = None,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) -> Optional[Union[AsyncApiCallResultsPage, Error]] :
|
||||
) -> Optional[Union[AsyncApiCallResultsPage, Error]]:
|
||||
"""For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.
|
||||
This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
|
||||
This endpoint requires authentication by a KittyCAD employee.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
|
||||
limit=limit,
|
||||
|
||||
page_token=page_token,
|
||||
|
||||
sort_by=sort_by,
|
||||
|
||||
status=status,
|
||||
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
|
Reference in New Issue
Block a user