# 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 .device_recovery_state_response_body_status import DeviceRecoveryStateResponseBodyStatus
from .notification_recipient_response_body import NotificationRecipientResponseBody
from .recovery_photo_response_body import RecoveryPhotoResponseBody


class DeviceRecoveryStateResponseBody(UniversalBaseModel):
    """
    The full recovery state for an asset, including notification recipients and recovery photos.
    """

    additional_details: typing.Optional[str] = pydantic.Field(default=None)
    """
    Additional details provided during recovery.
    """

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

    missing_reason: typing.Optional[str] = pydantic.Field(default=None)
    """
    The reason the asset was originally marked as missing.
    """

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

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

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

    recovery_photos: typing.Optional[typing.List[RecoveryPhotoResponseBody]] = pydantic.Field(default=None)
    """
    Photos associated with the recovery event. URLs are temporary and expire at url_expires_at_ms.
    """

    recovery_status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Whether the asset was physically recovered.
    """

    status: DeviceRecoveryStateResponseBodyStatus = pydantic.Field()
    """
    The current recovery status of the asset.  Valid values: `UNKNOWN`, `MISSING`, `LOCATED`, `RECOVERED`
    """

    updated_at_ms: int = pydantic.Field()
    """
    Timestamp when the recovery state was last updated, in milliseconds since epoch.
    """

    updated_by_user_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    The ID of the user who last updated the recovery state.
    """

    uuid_: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="uuid"),
        pydantic.Field(alias="uuid", description="The unique UUID of this recovery state record."),
    ]

    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
