# 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 .hub_location_service_window_input_request_body import HubLocationServiceWindowInputRequestBody


class HubLocationInputObjectRequestBody(UniversalBaseModel):
    """
    Input object for creating hub locations
    """

    address: str = pydantic.Field()
    """
    The physical address of the location
    """

    customer_location_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="customerLocationId"),
        pydantic.Field(alias="customerLocationId", description="The customer-provided identifier for the location"),
    ]
    driver_instructions: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="driverInstructions"),
        pydantic.Field(alias="driverInstructions", description="Instructions for the driver"),
    ] = None
    hub_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="hubId"),
        pydantic.Field(alias="hubId", description="The ID of the hub this location belongs to"),
    ]
    is_depot: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isDepot"),
        pydantic.Field(alias="isDepot", description="Indicates if the location is a depot"),
    ]
    latitude: typing.Optional[float] = pydantic.Field(default=None)
    """
    Latitude coordinate of the location. If not provided and address is provided, the address will be geocoded to obtain coordinates.
    """

    longitude: typing.Optional[float] = pydantic.Field(default=None)
    """
    Longitude coordinate of the location. If not provided and address is provided, the address will be geocoded to obtain coordinates.
    """

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

    planner_notes: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="plannerNotes"),
        pydantic.Field(alias="plannerNotes", description="Notes for the planner"),
    ] = None
    service_time_seconds: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="serviceTimeSeconds"),
        pydantic.Field(alias="serviceTimeSeconds", description="Estimated service time at this location in seconds"),
    ] = None
    service_windows: typing_extensions.Annotated[
        typing.Optional[typing.List[HubLocationServiceWindowInputRequestBody]],
        FieldMetadata(alias="serviceWindows"),
        pydantic.Field(
            alias="serviceWindows",
            description="An array of time windows during which service can be performed at this location",
        ),
    ] = None
    skills_required: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="skillsRequired"),
        pydantic.Field(
            alias="skillsRequired", description="An array of skill IDs required for service at this location"
        ),
    ] = 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
