@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user