# 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_data_output import AssetDataOutput
from .asset_location import AssetLocation
from .asset_name import AssetName
from .asset_response_location_data_input import AssetResponseLocationDataInput
from .asset_response_parent_asset import AssetResponseParentAsset
from .asset_response_running_status_data_input import AssetResponseRunningStatusDataInput
from .custom_metadata import CustomMetadata
from .location_type import LocationType
from .tag_tiny_response import TagTinyResponse


class AssetResponse(UniversalBaseModel):
    """
    Asset
    """

    custom_metadata: typing_extensions.Annotated[
        typing.Optional[CustomMetadata], FieldMetadata(alias="customMetadata"), pydantic.Field(alias="customMetadata")
    ] = None
    data_outputs: typing_extensions.Annotated[
        typing.Optional[typing.List[AssetDataOutput]],
        FieldMetadata(alias="dataOutputs"),
        pydantic.Field(alias="dataOutputs", description="The list of data outputs configured on the asset."),
    ] = None
    id: str = pydantic.Field()
    """
    The id of the asset
    """

    is_running: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isRunning"),
        pydantic.Field(
            alias="isRunning", description="The running status of the asset. Returns True for On, and False for Off."
        ),
    ]
    location: typing.Optional[AssetLocation] = None
    location_data_input: typing_extensions.Annotated[
        typing.Optional[AssetResponseLocationDataInput],
        FieldMetadata(alias="locationDataInput"),
        pydantic.Field(alias="locationDataInput"),
    ] = None
    location_type: typing_extensions.Annotated[
        typing.Optional[LocationType], FieldMetadata(alias="locationType"), pydantic.Field(alias="locationType")
    ] = None
    name: AssetName
    parent_asset: typing_extensions.Annotated[
        typing.Optional[AssetResponseParentAsset],
        FieldMetadata(alias="parentAsset"),
        pydantic.Field(alias="parentAsset"),
    ] = None
    running_status_data_input: typing_extensions.Annotated[
        typing.Optional[AssetResponseRunningStatusDataInput],
        FieldMetadata(alias="runningStatusDataInput"),
        pydantic.Field(alias="runningStatusDataInput"),
    ] = None
    tags: typing.Optional[typing.List[TagTinyResponse]] = 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 Industrial Asset. **By default**: empty. Can be set or updated through the Samsara Dashboard or the API at any time.
    """

    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
