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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .scheduled_message_summary_status import ScheduledMessageSummaryStatus


class ScheduledMessageSummary(UniversalBaseModel):
    id: str = pydantic.Field()
    """
    Unique identifier for the scheduled message.
    """

    send_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="sendAt")] = pydantic.Field(
        default=None
    )
    """
    ISO 8601 timestamp of when the message is scheduled to be sent.
    """

    status: ScheduledMessageSummaryStatus = pydantic.Field()
    """
    Current status of the scheduled message.
    """

    recurrence: typing.Optional[str] = pydantic.Field(default=None)
    """
    Cron expression for recurring schedules.
    """

    timezone: typing.Optional[str] = pydantic.Field(default=None)
    """
    Timezone for the schedule (e.g. "America/New_York").
    """

    end_date: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="endDate")] = pydantic.Field(
        default=None
    )
    """
    ISO 8601 end date for recurring schedules.
    """

    payload: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    The scheduled message payload.
    """

    created_at: typing_extensions.Annotated[str, FieldMetadata(alias="createdAt")] = pydantic.Field()
    """
    ISO 8601 timestamp of when the schedule was created.
    """

    updated_at: typing_extensions.Annotated[str, FieldMetadata(alias="updatedAt")] = pydantic.Field()
    """
    ISO 8601 timestamp of when the schedule was last updated.
    """

    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
