# 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 .specific_vehicle_fault_code_object_request_body import SpecificVehicleFaultCodeObjectRequestBody


class VehicleFaultCodeDetailsObjectRequestBody(UniversalBaseModel):
    """
    Details specific to Vehicle Fault Code. At least one fault code or fault code group must be selected.
    """

    has_any_amber_warning_lamp_codes: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasAnyAmberWarningLampCodes"),
        pydantic.Field(
            alias="hasAnyAmberWarningLampCodes",
            description="If true then alert on codes for less serious errors that do not warrant stopping. Defaults to false.",
        ),
    ] = None
    has_any_fault_codes: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasAnyFaultCodes"),
        pydantic.Field(
            alias="hasAnyFaultCodes", description="If true this means that any code is alertable. Defaults to false."
        ),
    ] = None
    has_any_malfunction_indicator_lamp_codes: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasAnyMalfunctionIndicatorLampCodes"),
        pydantic.Field(
            alias="hasAnyMalfunctionIndicatorLampCodes",
            description="If true then alert on emission-related codes. Defaults to false.",
        ),
    ] = None
    has_any_protection_lamp_codes: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasAnyProtectionLampCodes"),
        pydantic.Field(
            alias="hasAnyProtectionLampCodes",
            description="If true then alert on codes for non-electric vehicle parts. Defaults to false.",
        ),
    ] = None
    has_any_red_stop_lamp_codes: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasAnyRedStopLampCodes"),
        pydantic.Field(
            alias="hasAnyRedStopLampCodes",
            description="If true then alert when the vehicle warrants stopping. Defaults to false.",
        ),
    ] = None
    has_any_trailer_abs_lamp_codes: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasAnyTrailerAbsLampCodes"),
        pydantic.Field(
            alias="hasAnyTrailerAbsLampCodes",
            description="If true then alert when the ABS light is on. Defaults to false.",
        ),
    ] = None
    min_duration_milliseconds: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="minDurationMilliseconds"),
        pydantic.Field(
            alias="minDurationMilliseconds",
            description="The number of milliseconds the trigger needs to stay active before alerting.",
        ),
    ] = None
    specific_fault_codes: typing_extensions.Annotated[
        typing.Optional[typing.List[SpecificVehicleFaultCodeObjectRequestBody]],
        FieldMetadata(alias="specificFaultCodes"),
        pydantic.Field(alias="specificFaultCodes", description="The list of specific fault codes to be alerted on."),
    ] = 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
