# 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 .connection_email_body_email import ConnectionEmailBodyEmail
from .connection_email_email_syntax import ConnectionEmailEmailSyntax
from .connection_email_from_email import ConnectionEmailFromEmail
from .connection_email_subject_email import ConnectionEmailSubjectEmail


class ConnectionEmailEmail(UniversalBaseModel):
    """
    Email template configuration
    """

    body: typing.Optional[ConnectionEmailBodyEmail] = None
    from_: typing_extensions.Annotated[
        typing.Optional[ConnectionEmailFromEmail], FieldMetadata(alias="from"), pydantic.Field(alias="from")
    ] = None
    subject: typing.Optional[ConnectionEmailSubjectEmail] = None
    syntax: typing.Optional[ConnectionEmailEmailSyntax] = pydantic.Field(default=None)
    """
    Email template syntax type
    """

    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
