# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .start_render_job_response_format_opts import StartRenderJobResponseFormatOpts
from .start_render_job_response_output import StartRenderJobResponseOutput
from .start_render_job_response_target import StartRenderJobResponseTarget


class StartRenderJobResponse(UniversalBaseModel):
    job_id: typing_extensions.Annotated[str, FieldMetadata(alias="jobId")] = pydantic.Field()
    """
    ID of the render job
    """

    template_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="templateId")] = pydantic.Field(
        default=None
    )
    """
    ID of the template being used
    """

    target: typing.Optional[StartRenderJobResponseTarget] = pydantic.Field(default=None)
    """
    Type of output to be rendered
    """

    upload_presigned_s_3_url: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="uploadPresignedS3Url")
    ] = pydantic.Field(default=None)
    """
    Presigned URL to upload the rendered output to S3
    """

    format_opts: typing_extensions.Annotated[
        typing.Optional[StartRenderJobResponseFormatOpts], FieldMetadata(alias="formatOpts")
    ] = pydantic.Field(default=None)
    """
    Format options for the rendered document
    """

    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Status of the render job
    """

    success: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the render job was successful
    """

    output: typing.Optional[StartRenderJobResponseOutput] = None
    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error that occurred during render
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
