# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .order_task_object_response_body import OrderTaskObjectResponseBody
from .single_use_location_object_response_body import SingleUseLocationObjectResponseBody


class RouteStopObjectResponseBody(UniversalBaseModel):
    """
    Route stop object
    """

    hub_location_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="hubLocationId"),
        pydantic.Field(alias="hubLocationId", description="The hub location identifier from dispatch"),
    ] = None
    id: str = pydantic.Field()
    """
    The Samsara-generated unique identifier (UUID) for the stop
    """

    name: str = pydantic.Field()
    """
    The name of the stop
    """

    notes: typing.Optional[str] = pydantic.Field(default=None)
    """
    Additional notes for the stop
    """

    orders: typing.Optional[typing.List[OrderTaskObjectResponseBody]] = pydantic.Field(default=None)
    """
    List of order tasks associated with this stop
    """

    scheduled_arrival_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="scheduledArrivalTime"),
        pydantic.Field(alias="scheduledArrivalTime", description="The scheduled arrival time at the stop"),
    ]
    scheduled_departure_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="scheduledDepartureTime"),
        pydantic.Field(alias="scheduledDepartureTime", description="The scheduled departure time from the stop"),
    ]
    single_use_location: typing_extensions.Annotated[
        typing.Optional[SingleUseLocationObjectResponseBody],
        FieldMetadata(alias="singleUseLocation"),
        pydantic.Field(alias="singleUseLocation"),
    ] = 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
