# 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_tiny_response import DriverTinyResponse
from .hos_log_entry_hos_status_type import HosLogEntryHosStatusType
from .hos_log_location import HosLogLocation
from .time import Time
from .vehicle_tiny_response import VehicleTinyResponse


class HosLogEntry(UniversalBaseModel):
    """
    A single HOS log entry.
    """

    codrivers: typing.Optional[typing.List[DriverTinyResponse]] = pydantic.Field(default=None)
    """
    The codriver information.
    """

    hos_status_type: typing_extensions.Annotated[
        typing.Optional[HosLogEntryHosStatusType],
        FieldMetadata(alias="hosStatusType"),
        pydantic.Field(
            alias="hosStatusType",
            description="The Hours of Service status type. Valid values: `offDuty`, `sleeperBed`, `driving`, `onDuty`, `yardMove`, `personalConveyance`.",
        ),
    ] = None
    log_end_time: typing_extensions.Annotated[
        typing.Optional[Time], FieldMetadata(alias="logEndTime"), pydantic.Field(alias="logEndTime")
    ] = None
    log_recorded_location: typing_extensions.Annotated[
        typing.Optional[HosLogLocation],
        FieldMetadata(alias="logRecordedLocation"),
        pydantic.Field(alias="logRecordedLocation"),
    ] = None
    log_start_time: typing_extensions.Annotated[
        Time, FieldMetadata(alias="logStartTime"), pydantic.Field(alias="logStartTime")
    ]
    remark: typing.Optional[str] = pydantic.Field(default=None)
    """
    Remark associated with the log entry.
    """

    vehicle: typing.Optional[VehicleTinyResponse] = 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
