# 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(alias="dateDeRegistered", description="The date the device was unregistered."),
    ] = None
    date_registered: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="dateRegistered"),
        pydantic.Field(alias="dateRegistered", description="The date the device was registered."),
    ] = None
    device_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="deviceId"),
        pydantic.Field(alias="deviceId", description="The device identifier."),
    ] = None
    device_license: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="deviceLicense"),
        pydantic.Field(alias="deviceLicense", description="Device license. This is typically the same as `deviceId`."),
    ] = None
    device_nick_name: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="deviceNickName"),
        pydantic.Field(alias="deviceNickName", description="Device description provided during registration."),
    ] = None
    last_connected_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="lastConnectedDate"),
        pydantic.Field(alias="lastConnectedDate", description="Last connected date."),
    ] = None
    last_disconnected_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="lastDisconnectedDate"),
        pydantic.Field(alias="lastDisconnectedDate", description="Last disconnected date."),
    ] = None
    last_transaction_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="lastTransactionDate"),
        pydantic.Field(alias="lastTransactionDate", description="Last transaction date."),
    ] = None
    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(alias="serialNumber", description="The device serial number."),
    ] = 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
