# 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 TachographVehicleFile(UniversalBaseModel):
    """
    Tachograph vehicle file
    """

    created_at_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(
            alias="createdAtTime",
            description="Creation time of files in RFC 3339 format. This is either the download time from the tachograph itself (for files downloaded via Samsara VG) or upload time (for files manually uploaded via Samsara UI).",
        ),
    ] = None
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the file.
    """

    url: typing.Optional[str] = pydantic.Field(default=None)
    """
    A temporary URL which can be used to download the file. The link can be used multiple times and expires after an hour.
    """

    vehicle_identification_number: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="vehicleIdentificationNumber"),
        pydantic.Field(alias="vehicleIdentificationNumber", description="VIN associated with the vehicle file."),
    ] = 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
