"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .tracker import Tracker, TrackerTypedDict
from enum import Enum
import pydantic
from ship24.types import BaseModel
from ship24.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class GetTrackerByTrackerIDSearchBy(str, Enum):
    r"""Parameter allowing to search either by `trackerId`or `clientTrackerId`. Default behavior is by `trackerId`."""

    TRACKER_ID = "trackerId"
    CLIENT_TRACKER_ID = "clientTrackerId"


class GetTrackerByTrackerIDRequestTypedDict(TypedDict):
    tracker_id: str
    r"""**Required** Id of the tracker, provided by Ship24 at creation. `clientTrackerId` can also be used in this field by employing the `searchBy` parameter."""
    search_by: NotRequired[GetTrackerByTrackerIDSearchBy]
    r"""Parameter allowing to search either by `trackerId`or `clientTrackerId`. Default behavior is by `trackerId`."""


class GetTrackerByTrackerIDRequest(BaseModel):
    tracker_id: Annotated[
        str,
        pydantic.Field(alias="trackerId"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]
    r"""**Required** Id of the tracker, provided by Ship24 at creation. `clientTrackerId` can also be used in this field by employing the `searchBy` parameter."""

    search_by: Annotated[
        Optional[GetTrackerByTrackerIDSearchBy],
        pydantic.Field(alias="searchBy"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Parameter allowing to search either by `trackerId`or `clientTrackerId`. Default behavior is by `trackerId`."""


class GetTrackerByTrackerIDResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: TrackerTypedDict


class GetTrackerByTrackerIDResponse(BaseModel):
    headers: Dict[str, List[str]]

    result: Tracker
