better and clean;

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2023-05-08 12:58:35 -07:00
parent c209414459
commit 8cf515b39f
92 changed files with 2619 additions and 1373 deletions

View File

@ -40,9 +40,7 @@ def _get_kwargs(
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileDensity, Error]]:
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileDensity, Error]]:
if response.status_code == 201:
response_201 = FileDensity.from_dict(response.json())
return response_201
@ -52,12 +50,12 @@ def _parse_response(
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return None
return Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Union[Any, FileDensity, Error]]:
) -> Response[Optional[Union[FileDensity, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -72,7 +70,7 @@ def sync_detailed(
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileDensity, Error]]:
) -> Response[Optional[Union[FileDensity, Error]]]:
kwargs = _get_kwargs(
material_mass=material_mass,
src_format=src_format,
@ -94,7 +92,7 @@ def sync(
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileDensity, Error]]:
) -> Optional[Union[FileDensity, Error]]:
"""Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
@ -112,7 +110,7 @@ async def asyncio_detailed(
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileDensity, Error]]:
) -> Response[Optional[Union[FileDensity, Error]]]:
kwargs = _get_kwargs(
material_mass=material_mass,
src_format=src_format,
@ -132,7 +130,7 @@ async def asyncio(
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileDensity, Error]]:
) -> Optional[Union[FileDensity, Error]]:
"""Get the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501