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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
import typing_extensions
from ..core.serialization import FieldMetadata
from .action import Action
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Card(UniversalBaseModel):
    title: str = pydantic.Field()
    """
    The title of the card.
    """

    subtitle: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional subtitle for the card.
    """

    media_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="mediaUrl")] = pydantic.Field(
        default=None
    )
    """
    Optional media URL displayed with the card.
    """

    buttons: typing.Optional[typing.List[Action]] = pydantic.Field(default=None)
    """
    Optional list of buttons on the card (max 4).
    """

    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
