# 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
from ..core.serialization import FieldMetadata
from .sent_mms_details import SentMmsDetails


class SentRichMessageFallbackMms(SentMmsDetails):
    """
    Returned when a fallback is configured and the recipient does not support RCS. The API checks RCS capabilities at send time. If the recipient's device doesn't support RCS, the fallback MMS is sent instead. You will also receive a `FALLBACK_SENT` webhook event for the original RCS message.
    """

    fallback_sent: typing_extensions.Annotated[bool, FieldMetadata(alias="fallbackSent")] = pydantic.Field()
    """
    Indicates that the fallback MMS was sent because the recipient does not support RCS.
    """

    original_message_id: typing_extensions.Annotated[str, FieldMetadata(alias="originalMessageId")] = pydantic.Field()
    """
    Unique identifier of the original RCS message that triggered this fallback. Always begins with the prefix `msg_`. This is the RCS message that could not be delivered — the `messageIds` field on this response refers to the actual MMS message(s) that were sent as the fallback.
    """

    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
