# 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 .inattentive_driving_detection_alert_settings_object_response_body_severity import (
    InattentiveDrivingDetectionAlertSettingsObjectResponseBodySeverity,
)


class InattentiveDrivingDetectionAlertSettingsObjectResponseBody(UniversalBaseModel):
    """
    Enables AI detection of inattentive driving events.
    """

    has_in_cab_audio_alerts_enabled: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="hasInCabAudioAlertsEnabled"),
        pydantic.Field(
            alias="hasInCabAudioAlertsEnabled",
            description="Indicates whether in-cab audio alerts for inattentive driving are turned on.",
        ),
    ] = None
    is_enabled: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isEnabled"),
        pydantic.Field(
            alias="isEnabled", description="Indicates whether AI event detection for inattentive driving is turned on."
        ),
    ] = None
    severity: typing.Optional[InattentiveDrivingDetectionAlertSettingsObjectResponseBodySeverity] = pydantic.Field(
        default=None
    )
    """
    Severity of inattentive driving events. Options include low (alerts for all events), medium (alerts for medium and high severity events), and high (alerts for high severity events only).  Valid values: `low`, `medium`, `high`
    """

    speeding_threshold_mph: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="speedingThresholdMph"),
        pydantic.Field(alias="speedingThresholdMph", description="Alert when speed is over this many miles per hour."),
    ] = 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
