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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .alert_object_product_response_body import AlertObjectProductResponseBody
from .goa_tag_tiny_response_response_body import GoaTagTinyResponseResponseBody


class AlertObjectSensorResponseBody(UniversalBaseModel):
    """
    A sensor associated with the alert.
    """

    id: str = pydantic.Field()
    """
    Thye ID of the sensor associated with the alert
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the sensor.
    """

    pinned_device_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="pinnedDeviceId"),
        pydantic.Field(alias="pinnedDeviceId", description="The Pinned Device ID associated with the alert"),
    ] = None
    product: typing.Optional[AlertObjectProductResponseBody] = None
    tags: typing.Optional[typing.List[GoaTagTinyResponseResponseBody]] = pydantic.Field(default=None)
    """
    The list of [tags](https://kb.samsara.com/hc/en-us/articles/360026674631-Using-Tags-and-Tag-Nesting) associated with the sensor.
    """

    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
