@ -40,9 +40,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[Any, FileMass, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileMass, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = FileMass.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, FileMass, Error]]:
|
||||
) -> Response[Optional[Union[FileMass, 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, FileMass, Error]]:
|
||||
) -> Response[Optional[Union[FileMass, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
@ -94,7 +92,7 @@ def sync(
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileMass, Error]]:
|
||||
) -> Optional[Union[FileMass, Error]]:
|
||||
"""Get the mass 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, FileMass, Error]]:
|
||||
) -> Response[Optional[Union[FileMass, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
@ -132,7 +130,7 @@ async def asyncio(
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileMass, Error]]:
|
||||
) -> Optional[Union[FileMass, Error]]:
|
||||
"""Get the mass 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
|
||||
|
||||
|
Reference in New Issue
Block a user