# 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 .asset_response_body_regulation_mode import AssetResponseBodyRegulationMode
from .asset_response_body_type import AssetResponseBodyType
from .goa_tag_tiny_response_response_body import GoaTagTinyResponseResponseBody


class AssetResponseBody(UniversalBaseModel):
    """
    Representation of a vehicle trailer or other equipment to be tracked.
    """

    created_at_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(alias="createdAtTime", description="The time the asset was created in RFC 3339 format."),
    ]
    external_ids: typing_extensions.Annotated[
        typing.Optional[typing.Dict[str, str]],
        FieldMetadata(alias="externalIds"),
        pydantic.Field(alias="externalIds", description="A map of external ids"),
    ] = None
    id: str = pydantic.Field()
    """
    The unique ID of the asset.
    """

    license_plate: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="licensePlate"),
        pydantic.Field(alias="licensePlate", description="The license plate of the asset."),
    ] = None
    make: typing.Optional[str] = pydantic.Field(default=None)
    """
    The OEM/manufacturer of the asset. Updates to this field are restricted.
    """

    model: typing.Optional[str] = pydantic.Field(default=None)
    """
    The model of the asset. Updates to this field are restricted.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The human-readable name of the asset. This is set by a fleet administrator and will appear in both Samsara’s cloud dashboard as well as the Samsara Driver mobile app. By default, this name is the serial number of the Samsara Asset Gateway. It can be set or updated through the Samsara Dashboard or through the API at any time.
    """

    notes: typing.Optional[str] = pydantic.Field(default=None)
    """
    These are generic notes about the asset. Can be set or updated through the Samsara Dashboard or the API at any time.
    """

    readings_ingestion_enabled: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="readingsIngestionEnabled"),
        pydantic.Field(
            alias="readingsIngestionEnabled",
            description="Indicates whether the asset is expected to have data ingested using the Readings API.",
        ),
    ] = None
    regulation_mode: typing_extensions.Annotated[
        typing.Optional[AssetResponseBodyRegulationMode],
        FieldMetadata(alias="regulationMode"),
        pydantic.Field(
            alias="regulationMode",
            description="Whether or not the asset is regulated, unregulated (non-CMV), or a mixed use unregulated asset. Primarily used with vehicles.  Valid values: `mixed`, `regulated`, `unregulated`",
        ),
    ] = None
    serial_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="serialNumber"),
        pydantic.Field(
            alias="serialNumber",
            description="The serial number of the asset. This can be an internal serial number or used to hold legacy VIN/PIN numbers such as ones of shorter lengths.",
        ),
    ] = 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 Asset.
    """

    type: typing.Optional[AssetResponseBodyType] = pydantic.Field(default=None)
    """
    The operational context in which the asset interacts with the Samsara system. Examples: Vehicle (eg: truck, bus...), Trailer (eg: dry van, reefer, flatbed...), Powered Equipment (eg: dozer, crane...), Unpowered Equipment (eg: container, dumpster...), or Uncategorized.  Valid values: `uncategorized`, `trailer`, `equipment`, `unpowered`, `vehicle`
    """

    updated_at_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="updatedAtTime"),
        pydantic.Field(alias="updatedAtTime", description="The time the asset was last updated in RFC 3339 format."),
    ]
    vin: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique 17-digit VIN (Vehicle Identification Number) or PIN (Product Identification Number) of the asset.
    """

    year: typing.Optional[int] = pydantic.Field(default=None)
    """
    The model year of the asset. Updates to this field are restricted.
    """

    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
