better generatioon

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-06-15 18:18:19 -07:00
parent ba8eeca234
commit 774b8f079c
30 changed files with 9145 additions and 6819 deletions

View File

@ -5,6 +5,7 @@ import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.file_mass import FileMass
from ...models.file_density import FileDensity
from ...models.file_volume import FileVolume
from ...models.error import Error
from ...types import Response
@ -27,7 +28,7 @@ def _get_kwargs(
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileDensity, FileVolume, Error]]:
if response.status_code == 200:
data = response.json()
try:
@ -44,6 +45,13 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
@ -60,7 +68,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileDensity, FileVolume, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -73,7 +81,7 @@ def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
) -> Response[Union[Any, FileConversion, FileMass, FileDensity, FileVolume, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
@ -91,7 +99,7 @@ def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
) -> Optional[Union[Any, FileConversion, FileMass, FileDensity, FileVolume, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
@ -105,7 +113,7 @@ async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
) -> Response[Union[Any, FileConversion, FileMass, FileDensity, FileVolume, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
@ -121,7 +129,7 @@ async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
) -> Optional[Union[Any, FileConversion, FileMass, FileDensity, FileVolume, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """