# 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 .command_status import CommandStatus


class BashCommandInfo(UniversalBaseModel):
    """
    Serializable command status info (for API responses).
    """

    command_id: str = pydantic.Field()
    """
    Unique command identifier
    """

    command: str = pydantic.Field()
    """
    The command string
    """

    status: CommandStatus = pydantic.Field()
    """
    Command execution status
    """

    exit_code: typing.Optional[int] = pydantic.Field(default=None)
    """
    Exit code (when completed)
    """

    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
