# 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
from .route_settings_request_body_route_completion_condition import RouteSettingsRequestBodyRouteCompletionCondition
from .route_settings_request_body_route_starting_condition import RouteSettingsRequestBodyRouteStartingCondition
from .route_settings_request_body_sequencing_method import RouteSettingsRequestBodySequencingMethod


class RouteSettingsRequestBody(UniversalBaseModel):
    """
    An optional dictionary, only necessary to override the defaults for route start and end conditions.
    """

    route_completion_condition: typing_extensions.Annotated[
        typing.Optional[RouteSettingsRequestBodyRouteCompletionCondition],
        FieldMetadata(alias="routeCompletionCondition"),
        pydantic.Field(
            alias="routeCompletionCondition",
            description="Defaults to 'arriveLastStop' which ends the route upon arriving at the final stop. The condition 'departLastStop' \nends the route upon departing the last stop. If 'arriveLastStop' is set, then the departure time of the final stop should not be set.  Valid values: `arriveLastStop`, `departLastStop`",
        ),
    ] = None
    route_starting_condition: typing_extensions.Annotated[
        typing.Optional[RouteSettingsRequestBodyRouteStartingCondition],
        FieldMetadata(alias="routeStartingCondition"),
        pydantic.Field(
            alias="routeStartingCondition",
            description="Defaults to 'departFirstStop' which starts the route upon departing the first stop in the route.\n The condition 'arriveFirstStop' starts the route upon arriving at the first stop in the route. If 'departFirstStop' is set,\nthe arrival time of the first stop should not be set.  Valid values: `departFirstStop`, `arriveFirstStop`",
        ),
    ] = None
    sequencing_method: typing_extensions.Annotated[
        typing.Optional[RouteSettingsRequestBodySequencingMethod],
        FieldMetadata(alias="sequencingMethod"),
        pydantic.Field(
            alias="sequencingMethod",
            description="Determines how stops are sequenced on the route. 'scheduledArrivalTime' sequences stops by their scheduled arrival times (default). 'manual' allows custom sequencing via stop.sequenceNumber. 'unknown' indicates the method is not specified.  Valid values: `unknown`, `scheduledArrivalTime`, `manual`",
        ),
    ] = 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
