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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .schedule_state import ScheduleState


class ScheduleListItem(UniversalBaseModel):
    """
    Abbreviated schedule info for list responses
    """

    agent_id: str = pydantic.Field()
    """
    ID of the agent this schedule belongs to
    """

    name: str = pydantic.Field()
    """
    Human-readable name for the schedule
    """

    next_action_time: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Next scheduled execution time
    """

    schedule_id: str = pydantic.Field()
    """
    Unique identifier for the schedule
    """

    state: ScheduleState = pydantic.Field()
    """
    Current state of the schedule
    """

    workflow_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the scheduled workflow
    """

    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
