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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .build_info import BuildInfo
from .build_status import BuildStatus


class DeploymentBuild(UniversalBaseModel):
    id: typing.Optional[str] = None
    deployment_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="deploymentId")] = None
    component_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="componentName")] = None
    build: typing.Optional[BuildInfo] = None
    build_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="buildId")] = None
    image_uri: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="imageUri")] = None
    name: typing.Optional[str] = None
    status: typing.Optional[BuildStatus] = None
    get_logs_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="getLogsUrl")] = None
    tail_logs_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tailLogsUrl")] = None
    logs_start_ts: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="logsStartTs")] = None
    metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
    created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
    updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None

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

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