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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .event_stream_cloud_event_user_created_object_app_metadata import EventStreamCloudEventUserCreatedObjectAppMetadata
from .event_stream_cloud_event_user_created_object_identities_item import (
    EventStreamCloudEventUserCreatedObjectIdentitiesItem,
)
from .event_stream_cloud_event_user_created_object_user_metadata import (
    EventStreamCloudEventUserCreatedObjectUserMetadata,
)


class EventStreamCloudEventUserCreatedObject(UniversalBaseModel):
    """
    The event content.
    """

    user_id: str = pydantic.Field()
    """
    ID of the user which can be used when interacting with other APIs.
    """

    email: typing.Optional[str] = pydantic.Field(default=None)
    """
    Email address of this user.
    """

    email_verified: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this email address is verified (true) or unverified (false).
    """

    username: typing.Optional[str] = pydantic.Field(default=None)
    """
    Username of this user.
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    Phone number of this user.
    """

    phone_verified: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this phone number has been verified (true) or not (false).
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Date and time when this entity was created (ISO_8601 format).
    """

    updated_at: dt.datetime = pydantic.Field()
    """
    Date and time when this entity was last updated/modified (ISO_8601 format).
    """

    identities: typing.List[EventStreamCloudEventUserCreatedObjectIdentitiesItem] = pydantic.Field()
    """
    Array of user identity objects when accounts are linked.
    """

    app_metadata: typing.Optional[EventStreamCloudEventUserCreatedObjectAppMetadata] = None
    user_metadata: typing.Optional[EventStreamCloudEventUserCreatedObjectUserMetadata] = None
    picture: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL to picture, photo, or avatar of this user.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of this user.
    """

    nickname: typing.Optional[str] = pydantic.Field(default=None)
    """
    Preferred nickname or alias of this user.
    """

    multifactor: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of multi-factor authentication providers with which this user has enrolled.
    """

    last_ip: typing.Optional[str] = pydantic.Field(default=None)
    """
    Last IP address from which this user logged in.
    """

    last_login: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last date and time this user logged in (ISO_8601 format).
    """

    logins_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of logins this user has performed.
    """

    blocked: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this user was blocked by an administrator (true) or is not (false).
    """

    given_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Given name/first name/forename of this user.
    """

    family_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Family name/last name/surname of this user.
    """

    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
