# 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 .tachograph_activity_state import TachographActivityState


class TachographActivity(UniversalBaseModel):
    """
    Tachograph activity
    """

    end_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="endTime"),
        pydantic.Field(alias="endTime", description="End time of state in RFC 3339 format."),
    ] = None
    is_manual_entry: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isManualEntry"),
        pydantic.Field(
            alias="isManualEntry",
            description='A flag indicating whether the activity was manually entered by the driver. If this is `true`, the state cannot be "UNKNOWN"',
        ),
    ] = None
    start_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="startTime"),
        pydantic.Field(alias="startTime", description="Start time of state in RFC 3339 format."),
    ] = None
    state: typing.Optional[TachographActivityState] = pydantic.Field(default=None)
    """
    Tachograph activity state. Valid values: `BREAK/REST`, `WORK`, `AVAILABILITY`, `DRIVING`, `UNKNOWN`.
    """

    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
