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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .organization_info import OrganizationInfo


class EmailValidationResponse(UniversalBaseModel):
    """
    Response schema for email validation endpoint.
    """

    success: bool = pydantic.Field()
    """
    Whether the validation was successful
    """

    is_valid: bool = pydantic.Field()
    """
    Whether the email is valid for signup
    """

    email: str = pydantic.Field()
    """
    The validated email address
    """

    message: str = pydantic.Field()
    """
    Human-readable validation message
    """

    organization: typing.Optional[OrganizationInfo] = pydantic.Field(default=None)
    """
    Organization info if email domain is associated
    """

    reason: typing.Optional[str] = pydantic.Field(default=None)
    """
    Reason for invalid email (no_organization, already_registered, etc.)
    """

    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
