# 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_interval_response_body import SpeedingIntervalResponseBody
from .trip_asset_response_body import TripAssetResponseBody


class TripSpeedingIntervalsResponseBody(UniversalBaseModel):
    """
    TripSpeedingIntervals
    """

    asset: TripAssetResponseBody
    created_at_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(
            alias="createdAtTime", description="UTC time the trip was created in Samsara in RFC 3339 format."
        ),
    ]
    driver_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="driverId"),
        pydantic.Field(
            alias="driverId",
            description="The driver ID assigned to the trip. Only returned if includeDriverId is set to true. 'null' if no driver id.",
        ),
    ] = None
    intervals: typing.List[SpeedingIntervalResponseBody] = pydantic.Field()
    """
    List of speeding intervals that belong to the trip. The full list of intervals associated with the trip is always returned, empty if no intervals exist.
    """

    trip_start_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="tripStartTime"),
        pydantic.Field(alias="tripStartTime", description="UTC time the trip started in RFC 3339 format."),
    ]
    updated_at_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="updatedAtTime"),
        pydantic.Field(
            alias="updatedAtTime",
            description="UTC time the trip was last updated in Samsara in RFC 3339 format. Valid updates are when trip's endTime populates or interval.isDismissed changes value.",
        ),
    ]

    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
