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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.unchecked_base_model import UncheckedBaseModel


class StartAgentsRequestPropertiesParametersFarewellConfig(UncheckedBaseModel):
    """
    Graceful hang-up settings for the agent.
    """

    graceful_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Enable graceful leave:
    - `true`: When enabled, calling the POST method to stop the agent ensures that the agent is in an `IDLE` state before leaving the channel.
    - `false`: Disabled.
    """

    graceful_timeout_seconds: typing.Optional[int] = pydantic.Field(default=None)
    """
    Graceful exit timeout (in seconds). Represents the maximum time to wait for the agent to enter an `IDLE` state before exiting the channel. This field is only effective when `graceful_enabled` is `true`.
    """

    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
