# 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


class HosViolations(UniversalBaseModel):
    """
    Durations the driver has been in violation of HOS rules. See [this page](https://www.samsara.com/fleet/eld-compliance/hours-of-service) for more information on HOS rules.
    """

    cycle_violation_duration_ms: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="cycleViolationDurationMs"),
        pydantic.Field(
            alias="cycleViolationDurationMs",
            description="Time since the driver has surpassed the driving cycle duration limit in milliseconds. For property-carrying drivers, this is the amount of time the driver has been on duty or driving past the 60/70-hour limit in 7/8 days.",
        ),
    ] = None
    shift_driving_violation_duration_ms: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="shiftDrivingViolationDurationMs"),
        pydantic.Field(
            alias="shiftDrivingViolationDurationMs",
            description="Time since the driver has surpassed the driving shift duration limit in milliseconds. For property-carrying drivers, this is the amount of time the driver has been driving past the 11-hour limit.",
        ),
    ] = 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
