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

@ -34,9 +34,7 @@ def _get_kwargs(
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[Any, FileVolume, Error]]:
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileVolume, Error]]:
if response.status_code == 201:
response_201 = FileVolume.from_dict(response.json())
return response_201
@ -46,12 +44,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, FileVolume, Error]]:
) -> Response[Optional[Union[FileVolume, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -65,7 +63,7 @@ def sync_detailed(
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileVolume, Error]]:
) -> Response[Optional[Union[FileVolume, Error]]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
@ -85,7 +83,7 @@ def sync(
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileVolume, Error]]:
) -> Optional[Union[FileVolume, Error]]:
"""Get the volume 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
@ -101,7 +99,7 @@ async def asyncio_detailed(
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileVolume, Error]]:
) -> Response[Optional[Union[FileVolume, Error]]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
@ -119,7 +117,7 @@ async def asyncio(
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileVolume, Error]]:
) -> Optional[Union[FileVolume, Error]]:
"""Get the volume 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