@ -4,6 +4,7 @@ import base64
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error_message import ErrorMessage
|
||||
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
|
||||
@ -13,7 +14,7 @@ def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion]]:
|
||||
) -> Optional[Union[Any, FileConversion, ErrorMessage]]:
|
||||
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
|
||||
|
||||
fc = fc_sync(
|
||||
@ -21,7 +22,7 @@ def sync(
|
||||
client=client,
|
||||
)
|
||||
|
||||
if fc.output != "":
|
||||
if isinstance(fc, FileConversion) and fc.output != "":
|
||||
fc.output = base64.b64decode(fc.output)
|
||||
|
||||
return fc
|
||||
@ -31,7 +32,7 @@ async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, FileConversion]]:
|
||||
) -> Optional[Union[Any, FileConversion, ErrorMessage]]:
|
||||
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
|
||||
|
||||
fc = await fc_asyncio(
|
||||
@ -39,7 +40,7 @@ async def asyncio(
|
||||
client=client,
|
||||
)
|
||||
|
||||
if fc.output != "":
|
||||
if isinstance(fc, FileConversion) and fc.output != "":
|
||||
fc.output = base64.b64decode(fc.output)
|
||||
|
||||
return fc
|
||||
|
Reference in New Issue
Block a user