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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .additional_data_string import AdditionalDataString
from .created_at import CreatedAt
from .email import Email
from .language import Language
from .mfa import Mfa
from .mfa_mode import MfaMode
from .name_user import NameUser
from .org_x_scope import OrgXScope
from .phone_number import PhoneNumber
from .timezone import Timezone
from .usr_access import UsrAccess
from .usr_status import UsrStatus


class UserQueryRecord(UniversalBaseModel):
    access: typing_extensions.Annotated[typing.Optional[typing.List[UsrAccess]], FieldMetadata(alias="Access")] = None
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalDataString], FieldMetadata(alias="AdditionalData")
    ] = None
    created_at: typing_extensions.Annotated[typing.Optional[CreatedAt], FieldMetadata(alias="createdAt")] = (
        pydantic.Field(default=None)
    )
    """
    The timestamp for the user's creation, in UTC.
    """

    email: typing_extensions.Annotated[typing.Optional[Email], FieldMetadata(alias="Email")] = pydantic.Field(
        default=None
    )
    """
    The user's email address.
    """

    language: typing.Optional[Language] = None
    last_access: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="lastAccess")] = (
        pydantic.Field(default=None)
    )
    """
    The timestamp for the user's last activity, in UTC.
    """

    name: typing_extensions.Annotated[typing.Optional[NameUser], FieldMetadata(alias="Name")] = None
    phone: typing_extensions.Annotated[typing.Optional[PhoneNumber], FieldMetadata(alias="Phone")] = pydantic.Field(
        default=None
    )
    """
    The user's phone number.
    """

    scope: typing_extensions.Annotated[typing.Optional[typing.List[OrgXScope]], FieldMetadata(alias="Scope")] = None
    sn_data: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="snData")] = pydantic.Field(
        default=None
    )
    """
    Additional data provided by the social network related to the customer.
    """

    sn_identifier: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="snIdentifier")] = (
        pydantic.Field(default=None)
    )
    """
    Identifier or token for customer in linked social network.
    """

    sn_provider: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="snProvider")] = pydantic.Field(
        default=None
    )
    """
    Social network linked to customer. Possible values: facebook, google, twitter, microsoft.
    """

    time_zone: typing_extensions.Annotated[typing.Optional[Timezone], FieldMetadata(alias="timeZone")] = None
    user_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="userId")] = pydantic.Field(
        default=None
    )
    """
    The user's ID in Payabli.
    """

    usr_mfa: typing_extensions.Annotated[typing.Optional[Mfa], FieldMetadata(alias="UsrMFA")] = None
    usr_mfa_mode: typing_extensions.Annotated[typing.Optional[MfaMode], FieldMetadata(alias="UsrMFAMode")] = None
    usr_status: typing_extensions.Annotated[typing.Optional[UsrStatus], FieldMetadata(alias="UsrStatus")] = None

    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
