# 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 .safety_score_speeding_object_response_body_speeding_type import SafetyScoreSpeedingObjectResponseBodySpeedingType


class SafetyScoreSpeedingObjectResponseBody(UniversalBaseModel):
    """
    Safety score speeding object.
    """

    duration_milliseconds: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="durationMilliseconds"),
        pydantic.Field(alias="durationMilliseconds", description="Total time spent speeding for the speeding type."),
    ]
    score_impact: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="scoreImpact"),
        pydantic.Field(
            alias="scoreImpact",
            description="Total points increased or deducted from the score due to the total time spent speeding of this type. Weights for this calculation are defined in organisation settings. Negative numbers indicate points deducted.",
        ),
    ]
    speeding_type: typing_extensions.Annotated[
        SafetyScoreSpeedingObjectResponseBodySpeedingType,
        FieldMetadata(alias="speedingType"),
        pydantic.Field(
            alias="speedingType",
            description="Type of speeding.  Valid values: `light`, `moderate`, `heavy`, `severe`, `maxSpeed`, `unknown`",
        ),
    ]

    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
