# 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 .update_engine_immobilizer_relay_state_request_body_request_body_id import (
    UpdateEngineImmobilizerRelayStateRequestBodyRequestBodyId,
)


class UpdateEngineImmobilizerRelayStateRequestBodyRequestBody(UniversalBaseModel):
    """
    A request object to update a relay state.
    """

    id: UpdateEngineImmobilizerRelayStateRequestBodyRequestBodyId = 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="The desired state of the relay. Provide `true` to open the relay, or `false` to close the relay.",
        ),
    ]

    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
