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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .device_created_event_data import DeviceCreatedEventData


class DeviceCreatedEvent(UncheckedBaseModel):
    """
    Published when a Device is created.
    """

    merchant_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The merchant the newly created device belongs to.
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    The type of event this represents. The value is `"device.created"`.
    """

    event_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A UUID that uniquely identifies this device creation event.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The time when the device creation event was first created, in RFC 3339 format.
    """

    data: typing.Optional[DeviceCreatedEventData] = pydantic.Field(default=None)
    """
    The metadata associated with the device creation event.
    """

    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
