# 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 .deployment_status_value import DeploymentStatusValue
from .deployment_transition import DeploymentTransition


class DeploymentStatus(UniversalBaseModel):
    id: typing.Optional[str] = None
    deployment_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="deploymentId")] = None
    status: typing.Optional[DeploymentStatusValue] = None
    state: typing.Optional[typing.Dict[str, typing.Any]] = None
    transition: typing.Optional[DeploymentTransition] = None
    message: typing.Optional[str] = None
    retry_count: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="retryCount")] = 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
