# 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 .driver_eld_ruleset_cycle import DriverEldRulesetCycle
from .driver_eld_ruleset_jurisdiction import DriverEldRulesetJurisdiction
from .driver_eld_ruleset_rest_break import DriverEldRulesetRestBreak
from .driver_eld_ruleset_restart import DriverEldRulesetRestart
from .driver_eld_ruleset_shift import DriverEldRulesetShift


class DriverEldRuleset(UniversalBaseModel):
    """
    An ELD ruleset for a driver.
    """

    break_: typing_extensions.Annotated[
        typing.Optional[DriverEldRulesetRestBreak], FieldMetadata(alias="break"), pydantic.Field(alias="break")
    ] = None
    cycle: typing.Optional[DriverEldRulesetCycle] = None
    jurisdiction: typing.Optional[DriverEldRulesetJurisdiction] = None
    restart: typing.Optional[DriverEldRulesetRestart] = None
    shift: typing.Optional[DriverEldRulesetShift] = 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
