# 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


class J1939D1StatusDataPointValue(UniversalBaseModel):
    """
    A single J1939D1 status
    """

    amber_lamp_status: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="amberLampStatus"), pydantic.Field(alias="amberLampStatus")
    ] = None
    fmi: typing.Optional[int] = None
    mil_status: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="milStatus"), pydantic.Field(alias="milStatus")
    ] = None
    occurance_count: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="occuranceCount"), pydantic.Field(alias="occuranceCount")
    ] = None
    protect_lamp_status: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="protectLampStatus"), pydantic.Field(alias="protectLampStatus")
    ] = None
    red_lamp_status: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="redLampStatus"), pydantic.Field(alias="redLampStatus")
    ] = None
    spn: typing.Optional[int] = None
    tx_id: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="txId"), pydantic.Field(alias="txId")
    ] = 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
