# 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 .alert_object_driver_response_body import AlertObjectDriverResponseBody
from .alert_object_trailer_response_body import AlertObjectTrailerResponseBody
from .alert_object_vehicle_response_body import AlertObjectVehicleResponseBody
from .speed_data_response_body_operation import SpeedDataResponseBodyOperation


class SpeedDataResponseBody(UniversalBaseModel):
    """
    Details specific to Speed.
    """

    current_speed_kilometers_per_hour: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="currentSpeedKilometersPerHour"),
        pydantic.Field(
            alias="currentSpeedKilometersPerHour", description="Current speed of the vehicle in kilometers per hour."
        ),
    ]
    driver: typing.Optional[AlertObjectDriverResponseBody] = None
    min_duration_milliseconds: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="minDurationMilliseconds"),
        pydantic.Field(
            alias="minDurationMilliseconds", description="Minimum duration of the current speed in milliseconds."
        ),
    ]
    operation: SpeedDataResponseBodyOperation = pydantic.Field()
    """
    Operation of the current and threshold comparison.  Valid values: `GREATER`, `INSIDE_RANGE`, `LESS`, `OUTSIDE_RANGE`
    """

    threshold_speed_kilometers_per_hour: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="thresholdSpeedKilometersPerHour"),
        pydantic.Field(
            alias="thresholdSpeedKilometersPerHour",
            description="Threshold speed of the vehicle in kilometers per hour.",
        ),
    ]
    trailer: typing.Optional[AlertObjectTrailerResponseBody] = None
    vehicle: typing.Optional[AlertObjectVehicleResponseBody] = None

    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
