# 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 .v_1_vehicle_maintenance_j_1939_check_engine_light import V1VehicleMaintenanceJ1939CheckEngineLight
from .v_1_vehicle_maintenance_j_1939_diagnostic_trouble_codes import V1VehicleMaintenanceJ1939DiagnosticTroubleCodes


class V1VehicleMaintenanceJ1939(UniversalBaseModel):
    """
    J1939 based data. Null if no data is available.
    """

    check_engine_light: typing_extensions.Annotated[
        typing.Optional[V1VehicleMaintenanceJ1939CheckEngineLight],
        FieldMetadata(alias="checkEngineLight"),
        pydantic.Field(alias="checkEngineLight"),
    ] = None
    diagnostic_trouble_codes: typing_extensions.Annotated[
        typing.Optional[typing.List[V1VehicleMaintenanceJ1939DiagnosticTroubleCodes]],
        FieldMetadata(alias="diagnosticTroubleCodes"),
        pydantic.Field(alias="diagnosticTroubleCodes", description="J1939 DTCs."),
    ] = 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
