# 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 .goa_driver_tiny_response_response_body import GoaDriverTinyResponseResponseBody
from .goa_vehicle_tiny_response_response_body import GoaVehicleTinyResponseResponseBody
from .live_sharing_link_response_object_response_body import LiveSharingLinkResponseObjectResponseBody
from .route_settings_response_body import RouteSettingsResponseBody
from .routes_stop_response_object_response_body import RoutesStopResponseObjectResponseBody


class BaseRouteResponseObjectResponseBody(UniversalBaseModel):
    actual_route_end_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="actualRouteEndTime"),
        pydantic.Field(
            alias="actualRouteEndTime", description="Actual end time, if it exists, for the route in RFC 3339 format."
        ),
    ] = None
    actual_route_start_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="actualRouteStartTime"),
        pydantic.Field(
            alias="actualRouteStartTime",
            description="Actual start time, if it exists, for the route in RFC 3339 format.",
        ),
    ] = None
    driver: typing.Optional[GoaDriverTinyResponseResponseBody] = None
    external_ids: typing_extensions.Annotated[
        typing.Optional[typing.Dict[str, str]],
        FieldMetadata(alias="externalIds"),
        pydantic.Field(alias="externalIds", description="A map of external ids"),
    ] = None
    id: str = pydantic.Field()
    """
    ID of the route
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Route name
    """

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

    org_local_timezone: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="orgLocalTimezone"),
        pydantic.Field(
            alias="orgLocalTimezone",
            description="The local timezone, as defined in Settings for your organization. Timezones use [IANA timezone database](https://www.iana.org/time-zones) keys (e.g. `America/Los_Angeles`, `America/New_York`, `Europe/London`, etc.). You can find a mapping of common timezone formats to IANA timezone keys [here](https://unicode.org/cldr/charts/latest/supplemental/zone_tzid.html).",
        ),
    ] = None
    recurring_route_live_sharing_links: typing_extensions.Annotated[
        typing.Optional[typing.List[LiveSharingLinkResponseObjectResponseBody]],
        FieldMetadata(alias="recurringRouteLiveSharingLinks"),
        pydantic.Field(
            alias="recurringRouteLiveSharingLinks",
            description="List of shareable, non-expired 'By recurring Route' Live Sharing Links.",
        ),
    ] = None
    scheduled_route_end_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="scheduledRouteEndTime"),
        pydantic.Field(
            alias="scheduledRouteEndTime",
            description="Scheduled end time, if it exists, for the route in RFC 3339 format.",
        ),
    ] = None
    scheduled_route_start_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="scheduledRouteStartTime"),
        pydantic.Field(
            alias="scheduledRouteStartTime",
            description="Scheduled start time, if it exists, for the route in RFC 3339 format.",
        ),
    ] = None
    settings: typing.Optional[RouteSettingsResponseBody] = None
    stops: typing.Optional[typing.List[RoutesStopResponseObjectResponseBody]] = pydantic.Field(default=None)
    """
    List of stops along the route
    """

    tag_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="tagIds"),
        pydantic.Field(alias="tagIds", description="An array of IDs of tags to associate with this route."),
    ] = None
    vehicle: typing.Optional[GoaVehicleTinyResponseResponseBody] = 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
