# 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 TripsBreakdownResponseBody(UniversalBaseModel):
    """
    Trip impacts on safety score.
    """

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

    drive_distance_meters: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="driveDistanceMeters"),
        pydantic.Field(alias="driveDistanceMeters", description="Distance driven during the trip."),
    ]
    driver_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="driverId"),
        pydantic.Field(alias="driverId", description="ID of the driver associated with the trip."),
    ]
    speeding: typing.List[SafetyScoreSpeedingObjectResponseBody] = pydantic.Field()
    """
    Aggregated list of speeding events that occurred during the trip, one row for each unique type of speeding.
    """

    trip_end_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="tripEndTime"),
        pydantic.Field(alias="tripEndTime", description="[RFC 3339] Time the trip ended in UTC."),
    ]
    trip_score_impact: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="tripScoreImpact"),
        pydantic.Field(
            alias="tripScoreImpact",
            description="Impact of the trip to the overall score. This is the effective sum of all risk factors in the trip.",
        ),
    ]
    trip_start_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="tripStartTime"),
        pydantic.Field(alias="tripStartTime", description="[RFC 3339] Time the trip started in UTC."),
    ]
    vehicle_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="vehicleId"),
        pydantic.Field(alias="vehicleId", description="ID of the vehicle associated with the trip."),
    ]

    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
