# 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_behavior_object_response_body import SafetyScoreBehaviorObjectResponseBody
from .safety_score_speeding_object_response_body import SafetyScoreSpeedingObjectResponseBody


class VehicleSafetyScoreResponseBody(UniversalBaseModel):
    """
    Safety score details for vehicle.
    """

    behaviors: typing.List[SafetyScoreBehaviorObjectResponseBody] = pydantic.Field()
    """
    Aggregated list of behaviors for the vehicle, one row for each unique type of behavior.
    """

    drive_distance_meters: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="driveDistanceMeters"),
        pydantic.Field(alias="driveDistanceMeters", description="Total sum of distance driven with the vehicle."),
    ]
    drive_time_milliseconds: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="driveTimeMilliseconds"),
        pydantic.Field(alias="driveTimeMilliseconds", description="Total time spent driving with the vehicle."),
    ]
    speeding: typing.List[SafetyScoreSpeedingObjectResponseBody] = pydantic.Field()
    """
    Aggregated list of speeding events for the vehicle, one row for each unique type of speeding.
    """

    vehicle_id: typing_extensions.Annotated[
        str, FieldMetadata(alias="vehicleId"), pydantic.Field(alias="vehicleId", description="ID of the vehicle.")
    ]
    vehicle_score: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="vehicleScore"),
        pydantic.Field(
            alias="vehicleScore",
            description="Safety score for the vehicle. The score is a rounded number between 0-100.",
        ),
    ]

    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
