# 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_status import BashCommandStatus


class ShellKillResult(UniversalBaseModel):
    """
    Process termination result model
    """

    status: BashCommandStatus = pydantic.Field()
    """
    Process status
    """

    exit_code: typing.Optional[int] = pydantic.Field(default=None)
    """
    Process exit code before termination, None if process was still running
    """

    returncode: typing.Optional[int] = pydantic.Field(default=None)
    """
    Deprecated: use exit_code instead. Kept for backward compatibility.
    """

    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
