# 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 .v_1_asset_reefer_response_reefer_stats_alarms_1 import V1AssetReeferResponseReeferStatsAlarms1
from .v_1_asset_reefer_response_reefer_stats_engine_hours import V1AssetReeferResponseReeferStatsEngineHours
from .v_1_asset_reefer_response_reefer_stats_fuel_percentage import V1AssetReeferResponseReeferStatsFuelPercentage
from .v_1_asset_reefer_response_reefer_stats_return_air_temp import V1AssetReeferResponseReeferStatsReturnAirTemp
from .v_1_asset_reefer_response_reefer_stats_set_point import V1AssetReeferResponseReeferStatsSetPoint
from .v_1_assets_reefer_reefer_stats_ambient_air_temperature import V1AssetsReeferReeferStatsAmbientAirTemperature
from .v_1_assets_reefer_reefer_stats_discharge_air_temperature import V1AssetsReeferReeferStatsDischargeAirTemperature
from .v_1_assets_reefer_reefer_stats_power_status import V1AssetsReeferReeferStatsPowerStatus


class V1AssetsReeferReeferStats(UniversalBaseModel):
    """
    Contains all the state changes of the reefer for the included stat types. Each state change is recorded independently, so the number of records in each array may differ depending on when that stat changed state. Stat types with a continuous value (such as temperature) will be recorded at different rates depending on the reefer, but generally readings have a frequency on the order of seconds.
    """

    ambient_air_temperature: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetsReeferReeferStatsAmbientAirTemperature]],
        FieldMetadata(alias="ambientAirTemperature"),
        pydantic.Field(
            alias="ambientAirTemperature",
            description="Ambient temperature of the reefer. This is the temperature of the air around the Samsara Asset Gateway.",
        ),
    ] = None
    discharge_air_temperature: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetsReeferReeferStatsDischargeAirTemperature]],
        FieldMetadata(alias="dischargeAirTemperature"),
        pydantic.Field(
            alias="dischargeAirTemperature",
            description="Discharge air temperature of the reefer. This is the temperature of the air as it leaves the cooling unit.",
        ),
    ] = None
    engine_hours: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetReeferResponseReeferStatsEngineHours]],
        FieldMetadata(alias="engineHours"),
        pydantic.Field(alias="engineHours", description="Engine hours of the reefer"),
    ] = None
    fuel_percentage: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetReeferResponseReeferStatsFuelPercentage]],
        FieldMetadata(alias="fuelPercentage"),
        pydantic.Field(alias="fuelPercentage", description="Fuel percentage of the reefer"),
    ] = None
    power_status: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetsReeferReeferStatsPowerStatus]],
        FieldMetadata(alias="powerStatus"),
        pydantic.Field(alias="powerStatus", description="Power status of the reefer"),
    ] = None
    reefer_alarms: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetReeferResponseReeferStatsAlarms1]],
        FieldMetadata(alias="reeferAlarms"),
        pydantic.Field(alias="reeferAlarms", description="Reefer alarms"),
    ] = None
    return_air_temperature: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetReeferResponseReeferStatsReturnAirTemp]],
        FieldMetadata(alias="returnAirTemperature"),
        pydantic.Field(
            alias="returnAirTemperature",
            description="Return air temperature of the reefer. This is the temperature read by the reefer module (Carrier, Thermo King) that shows the temperature of the air as it enters the system.",
        ),
    ] = None
    set_point: typing_extensions.Annotated[
        typing.Optional[typing.List[V1AssetReeferResponseReeferStatsSetPoint]],
        FieldMetadata(alias="setPoint"),
        pydantic.Field(alias="setPoint", description="Set point temperature of the reefer"),
    ] = None

    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
