# 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 .bash_command_info import BashCommandInfo


class BashOutputResult(UniversalBaseModel):
    """
    Result of get_output — returned by POST /v1/bash/output.
    """

    session_id: str = pydantic.Field()
    """
    Session identifier
    """

    stdout: typing.Optional[str] = pydantic.Field(default=None)
    """
    New stdout data since last offset
    """

    stderr: typing.Optional[str] = pydantic.Field(default=None)
    """
    New stderr data since last offset
    """

    offset: typing.Optional[int] = pydantic.Field(default=None)
    """
    Current stdout offset (use for next request)
    """

    stderr_offset: typing.Optional[int] = pydantic.Field(default=None)
    """
    Current stderr offset (use for next request)
    """

    command: typing.Optional[BashCommandInfo] = pydantic.Field(default=None)
    """
    Current or most recent command 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
