Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-04-06 22:41:11 -07:00
parent 16d7e95ce6
commit 0f66979c90
16 changed files with 3437 additions and 2716 deletions

View File

@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.file_conversion_results_page import FileConversionResultsPage
from ...models.error import Error
from ...models.created_at_sort_mode import CreatedAtSortMode
from ...types import Response
@ -28,12 +28,9 @@ def _get_kwargs(
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [FileConversion], Error]]:
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
if response.status_code == 200:
response_200 = [
FileConversion.from_dict(item)
for item in response.json()
]
response_200 = FileConversionResultsPage.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
@ -44,7 +41,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [FileCon
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [FileConversion], Error]]:
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionResultsPage, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -59,7 +56,7 @@ def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
) -> Response[Union[Any, [FileConversion], Error]]:
) -> Response[Union[Any, FileConversionResultsPage, Error]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
@ -81,7 +78,7 @@ def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
) -> Optional[Union[Any, [FileConversion], Error]]:
) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
This endpoint requires authentication by a KittyCAD employee. """
@ -99,7 +96,7 @@ async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
) -> Response[Union[Any, [FileConversion], Error]]:
) -> Response[Union[Any, FileConversionResultsPage, Error]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
@ -119,7 +116,7 @@ async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
) -> Optional[Union[Any, [FileConversion], Error]]:
) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
This endpoint requires authentication by a KittyCAD employee. """