# 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 import (
    InattentiveDrivingDetectionAlertSettingsObjectResponseBody,
)
from .mobile_usage_detection_alert_settings_object_response_body import (
    MobileUsageDetectionAlertSettingsObjectResponseBody,
)


class DistractedDrivingDetectionAlertSettingsObjectResponseBody(UniversalBaseModel):
    """
    Enables AI detection of distracted driving, surfaces events in Safety Inbox, and enables configurable alerts. By default, Distracted Driving will impact the drivers' safety score.
    """

    inattentive_driving_detection_alerts: typing_extensions.Annotated[
        typing.Optional[InattentiveDrivingDetectionAlertSettingsObjectResponseBody],
        FieldMetadata(alias="inattentiveDrivingDetectionAlerts"),
        pydantic.Field(alias="inattentiveDrivingDetectionAlerts"),
    ] = None
    is_enabled: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isEnabled"),
        pydantic.Field(
            alias="isEnabled",
            description="Indicates whether AI event detection for distracted driving behaviors is turned on.",
        ),
    ] = None
    mobile_usage_detection_alerts: typing_extensions.Annotated[
        typing.Optional[MobileUsageDetectionAlertSettingsObjectResponseBody],
        FieldMetadata(alias="mobileUsageDetectionAlerts"),
        pydantic.Field(alias="mobileUsageDetectionAlerts"),
    ] = 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
