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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .rcs_button_open_url_webview_mode import RcsButtonOpenUrlWebviewMode
from .rcs_button_send_location_lat_long import RcsButtonSendLocationLatLong


class RichButton_OpenUrl(UniversalBaseModel):
    type: typing.Literal["openUrl"] = "openUrl"
    webview_mode: typing_extensions.Annotated[
        typing.Optional[RcsButtonOpenUrlWebviewMode], FieldMetadata(alias="webviewMode")
    ] = None
    payload: str
    title: str
    metadata: typing.Optional[str] = None

    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


class RichButton_Call(UniversalBaseModel):
    type: typing.Literal["call"] = "call"
    metadata: typing.Optional[str] = None
    payload: str
    title: str

    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


class RichButton_Trigger(UniversalBaseModel):
    type: typing.Literal["trigger"] = "trigger"
    metadata: typing.Optional[str] = None
    payload: str
    title: str

    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


class RichButton_RequestUserLocation(UniversalBaseModel):
    type: typing.Literal["requestUserLocation"] = "requestUserLocation"
    metadata: typing.Optional[str] = None
    title: str

    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


class RichButton_ScheduleEvent(UniversalBaseModel):
    type: typing.Literal["scheduleEvent"] = "scheduleEvent"
    event_description: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="eventDescription")] = None
    event_end_time: typing_extensions.Annotated[str, FieldMetadata(alias="eventEndTime")]
    event_start_time: typing_extensions.Annotated[str, FieldMetadata(alias="eventStartTime")]
    event_title: typing_extensions.Annotated[str, FieldMetadata(alias="eventTitle")]
    metadata: typing.Optional[str] = None
    title: str

    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


class RichButton_SendLocation(UniversalBaseModel):
    type: typing.Literal["sendLocation"] = "sendLocation"
    name: typing.Optional[str] = None
    lat_long: typing_extensions.Annotated[RcsButtonSendLocationLatLong, FieldMetadata(alias="latLong")]
    title: str
    metadata: typing.Optional[str] = None

    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


RichButton = typing.Union[
    RichButton_OpenUrl,
    RichButton_Call,
    RichButton_Trigger,
    RichButton_RequestUserLocation,
    RichButton_ScheduleEvent,
    RichButton_SendLocation,
]
