# 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 .engine_immobilizer_relay_state_response_body_id import EngineImmobilizerRelayStateResponseBodyId


class EngineImmobilizerRelayStateResponseBody(UniversalBaseModel):
    """
    An engine immobilizer relay state.
    """

    id: EngineImmobilizerRelayStateResponseBodyId = pydantic.Field()
    """
    The ID of the relay  Valid values: `relay1`, `relay2`
    """

    is_open: typing_extensions.Annotated[
        bool, FieldMetadata(alias="isOpen"), pydantic.Field(alias="isOpen", description="Whether the relay is open.")
    ]

    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
