# 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 .forward_collision_detection_alert_settings_object_response_body_sensitivity import (
    ForwardCollisionDetectionAlertSettingsObjectResponseBodySensitivity,
)


class ForwardCollisionDetectionAlertSettingsObjectResponseBody(UniversalBaseModel):
    """
    Enables AI detection of near forward collisions, surfaces events in Safety Inbox, and enables configurable alerts. While the feature is in beta, it is only enabled during daytime driving hours. In-cab alerts are recommended for testing use only.
    """

    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 forward collision 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 forward collision is turned on."
        ),
    ] = None
    sensitivity: typing.Optional[ForwardCollisionDetectionAlertSettingsObjectResponseBodySensitivity] = pydantic.Field(
        default=None
    )
    """
    Ranges from near forward collision (results in fewer events) to far forward collision (results in more events).  Valid values: `near`, `medium`, `far`
    """

    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
