# 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 .device_information import DeviceInformation
from .user_brief_response import UserBriefResponse


class LoginResponse(UniversalBaseModel):
    """
    Response schema for login endpoint.
    """

    success: bool = pydantic.Field()
    """
    Whether login credentials were valid
    """

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

    email_key: str = pydantic.Field()
    """
    UUID key for the email verification flow
    """

    email: str = pydantic.Field()
    """
    User's email address
    """

    requires_verification: bool = pydantic.Field()
    """
    Whether email verification is required
    """

    next_step: str = pydantic.Field()
    """
    Next step in the auth flow (e.g., 'email_verification')
    """

    type: str = pydantic.Field()
    """
    Verification type: 'login', 'registration', or 'password_reset'
    """

    user: UserBriefResponse = pydantic.Field()
    """
    Authenticated user details
    """

    device_info: typing.Optional[DeviceInformation] = pydantic.Field(default=None)
    """
    Device information echoed back from request
    """

    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
