# 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 .route_settings_response_body import RouteSettingsResponseBody
from .routes_stop_response_object_response_body import RoutesStopResponseObjectResponseBody


class WebhookRouteResponseObjectResponseBody(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
    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
    """

    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
    """

    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
