# 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"), pydantic.Field(alias="Access")
    ] = None
    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalDataString],
        FieldMetadata(alias="AdditionalData"),
        pydantic.Field(alias="AdditionalData"),
    ] = None
    created_at: typing_extensions.Annotated[
        typing.Optional[CreatedAt],
        FieldMetadata(alias="createdAt"),
        pydantic.Field(alias="createdAt", description="The timestamp for the user's creation, in UTC."),
    ] = None
    email: typing_extensions.Annotated[
        typing.Optional[Email],
        FieldMetadata(alias="Email"),
        pydantic.Field(alias="Email", description="The user's email address."),
    ] = None
    language: typing.Optional[Language] = None
    last_access: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="lastAccess"),
        pydantic.Field(alias="lastAccess", description="The timestamp for the user's last activity, in UTC."),
    ] = None
    name: typing_extensions.Annotated[
        typing.Optional[NameUser], FieldMetadata(alias="Name"), pydantic.Field(alias="Name")
    ] = None
    phone: typing_extensions.Annotated[
        typing.Optional[PhoneNumber],
        FieldMetadata(alias="Phone"),
        pydantic.Field(alias="Phone", description="The user's phone number."),
    ] = None
    scope: typing_extensions.Annotated[
        typing.Optional[typing.List[OrgXScope]], FieldMetadata(alias="Scope"), pydantic.Field(alias="Scope")
    ] = None
    sn_data: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="snData"),
        pydantic.Field(
            alias="snData", description="Additional data provided by the social network related to the customer."
        ),
    ] = None
    sn_identifier: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="snIdentifier"),
        pydantic.Field(alias="snIdentifier", description="Identifier or token for customer in linked social network."),
    ] = None
    sn_provider: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="snProvider"),
        pydantic.Field(
            alias="snProvider",
            description="Social network linked to customer. Possible values: facebook, google, twitter, microsoft.",
        ),
    ] = None
    time_zone: typing_extensions.Annotated[
        typing.Optional[Timezone], FieldMetadata(alias="timeZone"), pydantic.Field(alias="timeZone")
    ] = None
    user_id: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="userId"),
        pydantic.Field(alias="userId", description="The user's ID in Payabli."),
    ] = None
    usr_mfa: typing_extensions.Annotated[
        typing.Optional[Mfa], FieldMetadata(alias="UsrMFA"), pydantic.Field(alias="UsrMFA")
    ] = None
    usr_mfa_mode: typing_extensions.Annotated[
        typing.Optional[MfaMode], FieldMetadata(alias="UsrMFAMode"), pydantic.Field(alias="UsrMFAMode")
    ] = None
    usr_status: typing_extensions.Annotated[
        typing.Optional[UsrStatus], FieldMetadata(alias="UsrStatus"), pydantic.Field(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
