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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .missing_state_response_body_update_source import MissingStateResponseBodyUpdateSource
from .notification_recipient_response_response_body import NotificationRecipientResponseResponseBody


class MissingStateResponseBody(UniversalBaseModel):
    """
    An asset currently marked as missing, including notification recipients.
    """

    id: str = pydantic.Field()
    """
    The unique Samsara ID of the asset.
    """

    name: str = pydantic.Field()
    """
    The human-readable name of the asset.
    """

    note: typing.Optional[str] = pydantic.Field(default=None)
    """
    A note associated with the missing asset.
    """

    notification_recipients: typing.Optional[typing.List[NotificationRecipientResponseResponseBody]] = pydantic.Field(
        default=None
    )
    """
    Users subscribed to location update notifications for this asset.
    """

    update_source: typing.Optional[MissingStateResponseBodyUpdateSource] = pydantic.Field(default=None)
    """
    The source of the last update to this recovery state. Defaults to `dashboard` if not explicitly set.  Valid values: `dashboard`, `api`
    """

    updated_at_ms: int = pydantic.Field()
    """
    Timestamp when the asset was marked as missing, in milliseconds since epoch.
    """

    updated_by_user_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    The ID of the user who marked the asset as missing.
    """

    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
