# 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 .vehicle_stats_fault_codes_value_obdii_confirmed_dtcs import VehicleStatsFaultCodesValueObdiiConfirmedDtcs
from .vehicle_stats_fault_codes_value_obdii_diagnostic_trouble_codes_ignition_type import (
    VehicleStatsFaultCodesValueObdiiDiagnosticTroubleCodesIgnitionType,
)
from .vehicle_stats_fault_codes_value_obdii_monitor_status import VehicleStatsFaultCodesValueObdiiMonitorStatus


class VehicleStatsFaultCodesValueObdiiDiagnosticTroubleCodes(UniversalBaseModel):
    """
    Diagnostic trouble code for passenger vehicles.
    """

    confirmed_dtcs: typing_extensions.Annotated[
        typing.Optional[typing.List[VehicleStatsFaultCodesValueObdiiConfirmedDtcs]],
        FieldMetadata(alias="confirmedDtcs"),
        pydantic.Field(alias="confirmedDtcs", description="Confirmed DTC codes."),
    ] = None
    ignition_type: typing_extensions.Annotated[
        typing.Optional[VehicleStatsFaultCodesValueObdiiDiagnosticTroubleCodesIgnitionType],
        FieldMetadata(alias="ignitionType"),
        pydantic.Field(
            alias="ignitionType",
            description="The ignition type of this passenger vehicle. Valid values: `spark`, `compression`.",
        ),
    ] = None
    mil_status: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="milStatus"),
        pydantic.Field(alias="milStatus", description="The MIL status, indicating a check engine light."),
    ] = None
    monitor_status: typing_extensions.Annotated[
        typing.Optional[VehicleStatsFaultCodesValueObdiiMonitorStatus],
        FieldMetadata(alias="monitorStatus"),
        pydantic.Field(alias="monitorStatus"),
    ] = None
    pending_dtcs: typing_extensions.Annotated[
        typing.Optional[typing.List[VehicleStatsFaultCodesValueObdiiConfirmedDtcs]],
        FieldMetadata(alias="pendingDtcs"),
        pydantic.Field(alias="pendingDtcs", description="Pending DTC codes."),
    ] = None
    permanent_dtcs: typing_extensions.Annotated[
        typing.Optional[typing.List[VehicleStatsFaultCodesValueObdiiConfirmedDtcs]],
        FieldMetadata(alias="permanentDtcs"),
        pydantic.Field(alias="permanentDtcs", description="Permanent DTC codes."),
    ] = None
    tx_id: typing_extensions.Annotated[
        int, FieldMetadata(alias="txId"), pydantic.Field(alias="txId", description="The TX identifier.")
    ]

    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
