Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-02-27 22:30:43 -08:00
parent 0ceebbee9c
commit 669b7aded0
4 changed files with 13 additions and 10 deletions

View File

@ -13,18 +13,18 @@ from ...api.file.post_file_conversion import sync as fc_sync, asyncio as fc_asyn
def sync(
source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat,
content: bytes,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileConversion]]:
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
encoded = base64.b64encode(content)
encoded = base64.b64encode(body)
fc = fc_sync(
source_format=source_format,
output_format=output_format,
content=encoded,
body=encoded,
client=client,
)
@ -37,18 +37,18 @@ def sync(
async def asyncio(
source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat,
content: bytes,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileConversion]]:
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
encoded = base64.b64encode(content)
encoded = base64.b64encode(body)
fc = await fc_asyncio(
source_format=source_format,
output_format=output_format,
content=encoded,
body=encoded,
client=client,
)