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

import typing

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


class DeployResponse(UniversalBaseModel):
    """
    Immediate response from deploy request.

    CLI polls GET /branches/{branch_id} or GET /versions/{version_id} for status updates.
    """

    agent_id: str = pydantic.Field()
    """
    Agent ID (created or existing)
    """

    branch_id: str = pydantic.Field()
    """
    Branch ID for this git branch
    """

    message: str = pydantic.Field()
    """
    Human-readable status message
    """

    tasks_migrated: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of tasks migrated from old version (if any)
    """

    version_id: str = pydantic.Field()
    """
    New version ID
    """

    version_status: VersionStatus = pydantic.Field()
    """
    Initial version status
    """

    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
