# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .health_reason_response_response_body_health_reason_code import HealthReasonResponseResponseBodyHealthReasonCode


class HealthReasonResponseResponseBody(UniversalBaseModel):
    """
    Information about an active health reason affecting the device.
    """

    health_reason_code: typing_extensions.Annotated[
        typing.Optional[HealthReasonResponseResponseBodyHealthReasonCode],
        FieldMetadata(alias="healthReasonCode"),
        pydantic.Field(
            alias="healthReasonCode",
            description="The type of health reason detected.  Valid values: `assetUnplugged`, `cameraMisaligned`, `dataPending`, `healthy`, `inwardCameraObstruction`, `irregularRecording`, `lowDeviceBattery`, `missingEldDiagnostics`, `missingVin`, `needsReplacement`, `newlyInstalledDevice`, `noGpsSignal`, `notDetected`, `outwardCameraObstruction`, `recordingTimeRequired`, `unknown`, `vgUnplugged`",
        ),
    ] = None
    start_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="startTime"),
        pydantic.Field(
            alias="startTime", description="The timestamp when this health reason began, in RFC3339 format."
        ),
    ] = 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
