Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Aug 24, 2024
1 parent 5e3203b commit a87ee9f
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 94 deletions.
8 changes: 4 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,24 @@ Methods:
Types:

```python
from onebusaway.types import SearchForStopRetrieveResponse
from onebusaway.types import SearchForStopListResponse
```

Methods:

- <code title="get /api/where/search/stop.json">client.search_for_stop.<a href="./src/onebusaway/resources/search_for_stop.py">retrieve</a>(\*\*<a href="src/onebusaway/types/search_for_stop_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/search_for_stop_retrieve_response.py">SearchForStopRetrieveResponse</a></code>
- <code title="get /api/where/search/stop.json">client.search_for_stop.<a href="./src/onebusaway/resources/search_for_stop.py">list</a>(\*\*<a href="src/onebusaway/types/search_for_stop_list_params.py">params</a>) -> <a href="./src/onebusaway/types/search_for_stop_list_response.py">SearchForStopListResponse</a></code>

# SearchForRoute

Types:

```python
from onebusaway.types import SearchForRouteRetrieveResponse
from onebusaway.types import SearchForRouteListResponse
```

Methods:

- <code title="get /api/where/search/route.json">client.search_for_route.<a href="./src/onebusaway/resources/search_for_route.py">retrieve</a>(\*\*<a href="src/onebusaway/types/search_for_route_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/search_for_route_retrieve_response.py">SearchForRouteRetrieveResponse</a></code>
- <code title="get /api/where/search/route.json">client.search_for_route.<a href="./src/onebusaway/resources/search_for_route.py">list</a>(\*\*<a href="src/onebusaway/types/search_for_route_list_params.py">params</a>) -> <a href="./src/onebusaway/types/search_for_route_list_response.py">SearchForRouteListResponse</a></code>

# Block

Expand Down
36 changes: 18 additions & 18 deletions src/onebusaway/resources/search_for_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import httpx

from ..types import search_for_route_retrieve_params
from ..types import search_for_route_list_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import (
maybe_transform,
Expand All @@ -19,7 +19,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.search_for_route_retrieve_response import SearchForRouteRetrieveResponse
from ..types.search_for_route_list_response import SearchForRouteListResponse

__all__ = ["SearchForRouteResource", "AsyncSearchForRouteResource"]

Expand All @@ -33,7 +33,7 @@ def with_raw_response(self) -> SearchForRouteResourceWithRawResponse:
def with_streaming_response(self) -> SearchForRouteResourceWithStreamingResponse:
return SearchForRouteResourceWithStreamingResponse(self)

def retrieve(
def list(
self,
*,
input: str,
Expand All @@ -44,7 +44,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SearchForRouteRetrieveResponse:
) -> SearchForRouteListResponse:
"""
Search for a route based on its name.
Expand Down Expand Up @@ -73,10 +73,10 @@ def retrieve(
"input": input,
"max_count": max_count,
},
search_for_route_retrieve_params.SearchForRouteRetrieveParams,
search_for_route_list_params.SearchForRouteListParams,
),
),
cast_to=SearchForRouteRetrieveResponse,
cast_to=SearchForRouteListResponse,
)


Expand All @@ -89,7 +89,7 @@ def with_raw_response(self) -> AsyncSearchForRouteResourceWithRawResponse:
def with_streaming_response(self) -> AsyncSearchForRouteResourceWithStreamingResponse:
return AsyncSearchForRouteResourceWithStreamingResponse(self)

async def retrieve(
async def list(
self,
*,
input: str,
Expand All @@ -100,7 +100,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SearchForRouteRetrieveResponse:
) -> SearchForRouteListResponse:
"""
Search for a route based on its name.
Expand Down Expand Up @@ -129,44 +129,44 @@ async def retrieve(
"input": input,
"max_count": max_count,
},
search_for_route_retrieve_params.SearchForRouteRetrieveParams,
search_for_route_list_params.SearchForRouteListParams,
),
),
cast_to=SearchForRouteRetrieveResponse,
cast_to=SearchForRouteListResponse,
)


class SearchForRouteResourceWithRawResponse:
def __init__(self, search_for_route: SearchForRouteResource) -> None:
self._search_for_route = search_for_route

self.retrieve = to_raw_response_wrapper(
search_for_route.retrieve,
self.list = to_raw_response_wrapper(
search_for_route.list,
)


class AsyncSearchForRouteResourceWithRawResponse:
def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None:
self._search_for_route = search_for_route

self.retrieve = async_to_raw_response_wrapper(
search_for_route.retrieve,
self.list = async_to_raw_response_wrapper(
search_for_route.list,
)


class SearchForRouteResourceWithStreamingResponse:
def __init__(self, search_for_route: SearchForRouteResource) -> None:
self._search_for_route = search_for_route

self.retrieve = to_streamed_response_wrapper(
search_for_route.retrieve,
self.list = to_streamed_response_wrapper(
search_for_route.list,
)


class AsyncSearchForRouteResourceWithStreamingResponse:
def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None:
self._search_for_route = search_for_route

self.retrieve = async_to_streamed_response_wrapper(
search_for_route.retrieve,
self.list = async_to_streamed_response_wrapper(
search_for_route.list,
)
36 changes: 18 additions & 18 deletions src/onebusaway/resources/search_for_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import httpx

from ..types import search_for_stop_retrieve_params
from ..types import search_for_stop_list_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import (
maybe_transform,
Expand All @@ -19,7 +19,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.search_for_stop_retrieve_response import SearchForStopRetrieveResponse
from ..types.search_for_stop_list_response import SearchForStopListResponse

__all__ = ["SearchForStopResource", "AsyncSearchForStopResource"]

Expand All @@ -33,7 +33,7 @@ def with_raw_response(self) -> SearchForStopResourceWithRawResponse:
def with_streaming_response(self) -> SearchForStopResourceWithStreamingResponse:
return SearchForStopResourceWithStreamingResponse(self)

def retrieve(
def list(
self,
*,
input: str,
Expand All @@ -44,7 +44,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SearchForStopRetrieveResponse:
) -> SearchForStopListResponse:
"""
Search for a stop based on its name.
Expand Down Expand Up @@ -73,10 +73,10 @@ def retrieve(
"input": input,
"max_count": max_count,
},
search_for_stop_retrieve_params.SearchForStopRetrieveParams,
search_for_stop_list_params.SearchForStopListParams,
),
),
cast_to=SearchForStopRetrieveResponse,
cast_to=SearchForStopListResponse,
)


Expand All @@ -89,7 +89,7 @@ def with_raw_response(self) -> AsyncSearchForStopResourceWithRawResponse:
def with_streaming_response(self) -> AsyncSearchForStopResourceWithStreamingResponse:
return AsyncSearchForStopResourceWithStreamingResponse(self)

async def retrieve(
async def list(
self,
*,
input: str,
Expand All @@ -100,7 +100,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SearchForStopRetrieveResponse:
) -> SearchForStopListResponse:
"""
Search for a stop based on its name.
Expand Down Expand Up @@ -129,44 +129,44 @@ async def retrieve(
"input": input,
"max_count": max_count,
},
search_for_stop_retrieve_params.SearchForStopRetrieveParams,
search_for_stop_list_params.SearchForStopListParams,
),
),
cast_to=SearchForStopRetrieveResponse,
cast_to=SearchForStopListResponse,
)


class SearchForStopResourceWithRawResponse:
def __init__(self, search_for_stop: SearchForStopResource) -> None:
self._search_for_stop = search_for_stop

self.retrieve = to_raw_response_wrapper(
search_for_stop.retrieve,
self.list = to_raw_response_wrapper(
search_for_stop.list,
)


class AsyncSearchForStopResourceWithRawResponse:
def __init__(self, search_for_stop: AsyncSearchForStopResource) -> None:
self._search_for_stop = search_for_stop

self.retrieve = async_to_raw_response_wrapper(
search_for_stop.retrieve,
self.list = async_to_raw_response_wrapper(
search_for_stop.list,
)


class SearchForStopResourceWithStreamingResponse:
def __init__(self, search_for_stop: SearchForStopResource) -> None:
self._search_for_stop = search_for_stop

self.retrieve = to_streamed_response_wrapper(
search_for_stop.retrieve,
self.list = to_streamed_response_wrapper(
search_for_stop.list,
)


class AsyncSearchForStopResourceWithStreamingResponse:
def __init__(self, search_for_stop: AsyncSearchForStopResource) -> None:
self._search_for_stop = search_for_stop

self.retrieve = async_to_streamed_response_wrapper(
search_for_stop.retrieve,
self.list = async_to_streamed_response_wrapper(
search_for_stop.list,
)
8 changes: 4 additions & 4 deletions src/onebusaway/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@
from .shape_retrieve_response import ShapeRetrieveResponse as ShapeRetrieveResponse
from .agency_retrieve_response import AgencyRetrieveResponse as AgencyRetrieveResponse
from .config_retrieve_response import ConfigRetrieveResponse as ConfigRetrieveResponse
from .search_for_stop_list_params import SearchForStopListParams as SearchForStopListParams
from .stops_for_route_list_params import StopsForRouteListParams as StopsForRouteListParams
from .trip_detail_retrieve_params import TripDetailRetrieveParams as TripDetailRetrieveParams
from .trips_for_route_list_params import TripsForRouteListParams as TripsForRouteListParams
from .search_for_route_list_params import SearchForRouteListParams as SearchForRouteListParams
from .search_for_stop_list_response import SearchForStopListResponse as SearchForStopListResponse
from .stops_for_route_list_response import StopsForRouteListResponse as StopsForRouteListResponse
from .trip_detail_retrieve_response import TripDetailRetrieveResponse as TripDetailRetrieveResponse
from .trips_for_route_list_response import TripsForRouteListResponse as TripsForRouteListResponse
from .current_time_retrieve_response import CurrentTimeRetrieveResponse as CurrentTimeRetrieveResponse
from .search_for_route_list_response import SearchForRouteListResponse as SearchForRouteListResponse
from .stops_for_location_list_params import StopsForLocationListParams as StopsForLocationListParams
from .trips_for_location_list_params import TripsForLocationListParams as TripsForLocationListParams
from .routes_for_agency_list_response import RoutesForAgencyListResponse as RoutesForAgencyListResponse
from .routes_for_location_list_params import RoutesForLocationListParams as RoutesForLocationListParams
from .search_for_stop_retrieve_params import SearchForStopRetrieveParams as SearchForStopRetrieveParams
from .vehicles_for_agency_list_params import VehiclesForAgencyListParams as VehiclesForAgencyListParams
from .search_for_route_retrieve_params import SearchForRouteRetrieveParams as SearchForRouteRetrieveParams
from .stops_for_location_list_response import StopsForLocationListResponse as StopsForLocationListResponse
from .trip_for_vehicle_retrieve_params import TripForVehicleRetrieveParams as TripForVehicleRetrieveParams
from .trips_for_location_list_response import TripsForLocationListResponse as TripsForLocationListResponse
from .arrival_and_departure_list_params import ArrivalAndDepartureListParams as ArrivalAndDepartureListParams
from .routes_for_location_list_response import RoutesForLocationListResponse as RoutesForLocationListResponse
from .schedule_for_stop_retrieve_params import ScheduleForStopRetrieveParams as ScheduleForStopRetrieveParams
from .search_for_stop_retrieve_response import SearchForStopRetrieveResponse as SearchForStopRetrieveResponse
from .stop_ids_for_agency_list_response import StopIDsForAgencyListResponse as StopIDsForAgencyListResponse
from .vehicles_for_agency_list_response import VehiclesForAgencyListResponse as VehiclesForAgencyListResponse
from .route_ids_for_agency_list_response import RouteIDsForAgencyListResponse as RouteIDsForAgencyListResponse
from .schedule_for_route_retrieve_params import ScheduleForRouteRetrieveParams as ScheduleForRouteRetrieveParams
from .search_for_route_retrieve_response import SearchForRouteRetrieveResponse as SearchForRouteRetrieveResponse
from .trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse as TripForVehicleRetrieveResponse
from .arrival_and_departure_list_response import ArrivalAndDepartureListResponse as ArrivalAndDepartureListResponse
from .schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse as ScheduleForStopRetrieveResponse
Expand Down
17 changes: 17 additions & 0 deletions src/onebusaway/types/search_for_route_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, Annotated, TypedDict

from .._utils import PropertyInfo

__all__ = ["SearchForRouteListParams"]


class SearchForRouteListParams(TypedDict, total=False):
input: Required[str]
"""The string to search for."""

max_count: Annotated[int, PropertyInfo(alias="maxCount")]
"""The max number of results to return. Defaults to 20."""
47 changes: 47 additions & 0 deletions src/onebusaway/types/search_for_route_list_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional

from pydantic import Field as FieldInfo

from .._models import BaseModel
from .shared.references import References
from .shared.response_wrapper import ResponseWrapper

__all__ = ["SearchForRouteListResponse", "SearchForRouteListResponseData", "SearchForRouteListResponseDataList"]


class SearchForRouteListResponseDataList(BaseModel):
id: str

agency_id: str = FieldInfo(alias="agencyId")

type: int

color: Optional[str] = None

description: Optional[str] = None

long_name: Optional[str] = FieldInfo(alias="longName", default=None)

null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None)

short_name: Optional[str] = FieldInfo(alias="shortName", default=None)

text_color: Optional[str] = FieldInfo(alias="textColor", default=None)

url: Optional[str] = None


class SearchForRouteListResponseData(BaseModel):
limit_exceeded: bool = FieldInfo(alias="limitExceeded")

list: List[SearchForRouteListResponseDataList]

out_of_range: bool = FieldInfo(alias="outOfRange")

references: References


class SearchForRouteListResponse(ResponseWrapper):
data: Optional[SearchForRouteListResponseData] = None
17 changes: 17 additions & 0 deletions src/onebusaway/types/search_for_stop_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, Annotated, TypedDict

from .._utils import PropertyInfo

__all__ = ["SearchForStopListParams"]


class SearchForStopListParams(TypedDict, total=False):
input: Required[str]
"""The string to search for."""

max_count: Annotated[int, PropertyInfo(alias="maxCount")]
"""The max number of results to return. Defaults to 20."""
Loading

0 comments on commit a87ee9f

Please sign in to comment.