# 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 .speeding_severity_level_response_body_severity_level import SpeedingSeverityLevelResponseBodySeverityLevel


class SpeedingSeverityLevelResponseBody(UniversalBaseModel):
    """
    The settings for a specific speeding severity level.
    """

    duration_ms: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="durationMs"),
        pydantic.Field(
            alias="durationMs",
            description="The amount of time the vehicle is speeding in this category before being attributed to this level",
        ),
    ]
    is_enabled: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isEnabled"),
        pydantic.Field(alias="isEnabled", description="Indicates the severity level is enabled"),
    ]
    severity_level: typing_extensions.Annotated[
        SpeedingSeverityLevelResponseBodySeverityLevel,
        FieldMetadata(alias="severityLevel"),
        pydantic.Field(
            alias="severityLevel",
            description="The severity level name.  Valid values: `light`, `moderate`, `heavy`, `severe`",
        ),
    ]
    speed_over_limit_threshold: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="speedOverLimitThreshold"),
        pydantic.Field(
            alias="speedOverLimitThreshold",
            description="The minimum speed above the speed limit that will get attributed to this severity level.",
        ),
    ]

    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
