# 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


class PoiDevice(UniversalBaseModel):
    """
    Information about the point of interaction device (also known as a terminal or cloud device) used to process the transaction.
    """

    connected: typing.Optional[bool] = pydantic.Field(default=None)
    """
    The device connection status.
    """

    date_de_registered: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="dateDeRegistered")
    ] = pydantic.Field(default=None)
    """
    The date the device was unregistered.
    """

    date_registered: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="dateRegistered")
    ] = pydantic.Field(default=None)
    """
    The date the device was registered.
    """

    device_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="deviceId")] = pydantic.Field(
        default=None
    )
    """
    The device identifier.
    """

    device_license: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="deviceLicense")] = (
        pydantic.Field(default=None)
    )
    """
    Device license. This is typically the same as `deviceId`.
    """

    device_nick_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="deviceNickName")] = (
        pydantic.Field(default=None)
    )
    """
    Device description provided during registration.
    """

    last_connected_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="lastConnectedDate")
    ] = pydantic.Field(default=None)
    """
    Last connected date.
    """

    last_disconnected_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="lastDisconnectedDate")
    ] = pydantic.Field(default=None)
    """
    Last disconnected date.
    """

    last_transaction_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="lastTransactionDate")
    ] = pydantic.Field(default=None)
    """
    Last transaction date.
    """

    make: typing.Optional[str] = pydantic.Field(default=None)
    """
    The device manufacturer.
    """

    model: typing.Optional[str] = pydantic.Field(default=None)
    """
    The device model.
    """

    registered: typing.Optional[bool] = pydantic.Field(default=None)
    """
    The device registration status.
    """

    serial_number: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serialNumber")] = (
        pydantic.Field(default=None)
    )
    """
    The device serial number.
    """

    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
