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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .base_route_response_object_response_body import BaseRouteResponseObjectResponseBody
from .route_changes_response_body import RouteChangesResponseBody
from .route_feed_object_response_body_operation import RouteFeedObjectResponseBodyOperation
from .route_feed_object_response_body_source import RouteFeedObjectResponseBodySource
from .route_feed_object_response_body_type import RouteFeedObjectResponseBodyType


class RouteFeedObjectResponseBody(UniversalBaseModel):
    """
    Route feed object.
    """

    changes: RouteChangesResponseBody
    operation: typing.Optional[RouteFeedObjectResponseBodyOperation] = pydantic.Field(default=None)
    """
    The operation that was performed as part of this route update.  Valid values: `stop scheduled`, `stop en route`, `stop skipped`, `stop arrived`, `stop departed`, `stop ETA updated`, `stop arrival time updated`, `stop completion time updated`, `stop order changed`, `stop arrival prevented`
    """

    route: BaseRouteResponseObjectResponseBody
    source: RouteFeedObjectResponseBodySource = pydantic.Field()
    """
    The source of this route update. Updates that are triggered by time or by the route being completed are 'automatic'.  Valid values: `automatic`, `driver`, `admin`
    """

    time: dt.datetime = pydantic.Field()
    """
    The timestamp of the route in RFC 3339 format.
    """

    type: RouteFeedObjectResponseBodyType = pydantic.Field()
    """
    The type of route update. The route tracking updates occur as a route is completed and stops transition from one state to another. Currently only Route Tracking updates are supported, but this will change in the future when additional types are added.  Valid values: `route tracking`
    """

    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
