Files
kittycad.py/kittycad/api/file/file_conversion_status_with_base64_helper.py
Jess Frazelle ab01c82bb7 make tests pass
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2022-02-27 22:24:39 -08:00

46 lines
1.0 KiB
Python

from typing import Any, Dict, Optional, Union
import base64
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...types import Response
from ...api.file.file_conversion_status import sync as fc_sync, asyncio as fc_asyncio
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion]]:
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
fc = fc_sync(
id=id,
client=client,
)
if fc.output != "":
fc.output = base64.b64decode(fc.output)
return fc
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion]]:
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
fc = await fc_asyncio(
id=id,
client=client,
)
if fc.output != "":
fc.output = base64.b64decode(fc.output)
return fc