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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .device_attributes import DeviceAttributes
from .component import Component
from .device_status import DeviceStatus
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Device(UncheckedBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A synthetic identifier for the device. The identifier includes a standardized prefix and
    is otherwise an opaque id generated from key device fields.
    """

    attributes: DeviceAttributes = pydantic.Field()
    """
    A collection of DeviceAttributes representing the device.
    """

    components: typing.Optional[typing.List[Component]] = pydantic.Field(default=None)
    """
    A list of components applicable to the device.
    """

    status: typing.Optional[DeviceStatus] = pydantic.Field(default=None)
    """
    The current status of the device.
    """

    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
