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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class BuildStatusResponse(UniversalBaseModel):
    """
    Build status response (proxied from Cloud Build).
    """

    build_id: str = pydantic.Field()
    """
    Cloud Build build ID.
    """

    cloud_status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Raw Cloud Build status value.
    """

    failure_message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Failure message if build failed (best-effort).
    """

    image_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Image URL for this build (if encoded in build).
    """

    log_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Cloud Build log URL (if available).
    """

    status: str = pydantic.Field()
    """
    Normalized status (queued|building|succeeded|failed|canceled|timed_out|unknown).
    """

    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
