From e2d03b34d459ca5954c40af72c0a8ec13ca19f7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 24 Aug 2024 11:35:36 +0000 Subject: [PATCH 1/4] feat(api): OpenAPI spec update via Stainless API (#99) --- api.md | 8 +-- src/onebusaway/resources/search_for_route.py | 36 ++++++------- src/onebusaway/resources/search_for_stop.py | 36 ++++++------- src/onebusaway/types/__init__.py | 8 +-- .../types/search_for_route_list_params.py | 17 +++++++ .../types/search_for_route_list_response.py | 47 +++++++++++++++++ .../types/search_for_stop_list_params.py | 17 +++++++ .../types/search_for_stop_list_response.py | 49 ++++++++++++++++++ tests/api_resources/test_search_for_route.py | 50 +++++++++---------- tests/api_resources/test_search_for_stop.py | 50 +++++++++---------- 10 files changed, 224 insertions(+), 94 deletions(-) create mode 100755 src/onebusaway/types/search_for_route_list_params.py create mode 100755 src/onebusaway/types/search_for_route_list_response.py create mode 100755 src/onebusaway/types/search_for_stop_list_params.py create mode 100755 src/onebusaway/types/search_for_stop_list_response.py diff --git a/api.md b/api.md index 408a5c9..2a318ed 100755 --- a/api.md +++ b/api.md @@ -274,24 +274,24 @@ Methods: Types: ```python -from onebusaway.types import SearchForStopRetrieveResponse +from onebusaway.types import SearchForStopListResponse ``` Methods: -- client.search_for_stop.retrieve(\*\*params) -> SearchForStopRetrieveResponse +- client.search_for_stop.list(\*\*params) -> SearchForStopListResponse # SearchForRoute Types: ```python -from onebusaway.types import SearchForRouteRetrieveResponse +from onebusaway.types import SearchForRouteListResponse ``` Methods: -- client.search_for_route.retrieve(\*\*params) -> SearchForRouteRetrieveResponse +- client.search_for_route.list(\*\*params) -> SearchForRouteListResponse # Block diff --git a/src/onebusaway/resources/search_for_route.py b/src/onebusaway/resources/search_for_route.py index 455fd1a..b12e162 100755 --- a/src/onebusaway/resources/search_for_route.py +++ b/src/onebusaway/resources/search_for_route.py @@ -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, @@ -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"] @@ -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, @@ -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. @@ -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, ) @@ -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, @@ -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. @@ -129,10 +129,10 @@ 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, ) @@ -140,8 +140,8 @@ 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, ) @@ -149,8 +149,8 @@ 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, ) @@ -158,8 +158,8 @@ 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, ) @@ -167,6 +167,6 @@ 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, ) diff --git a/src/onebusaway/resources/search_for_stop.py b/src/onebusaway/resources/search_for_stop.py index 28a068e..8663227 100755 --- a/src/onebusaway/resources/search_for_stop.py +++ b/src/onebusaway/resources/search_for_stop.py @@ -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, @@ -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"] @@ -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, @@ -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. @@ -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, ) @@ -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, @@ -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. @@ -129,10 +129,10 @@ 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, ) @@ -140,8 +140,8 @@ 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, ) @@ -149,8 +149,8 @@ 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, ) @@ -158,8 +158,8 @@ 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, ) @@ -167,6 +167,6 @@ 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, ) diff --git a/src/onebusaway/types/__init__.py b/src/onebusaway/types/__init__.py index 5f9bda3..3d9dab0 100755 --- a/src/onebusaway/types/__init__.py +++ b/src/onebusaway/types/__init__.py @@ -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 diff --git a/src/onebusaway/types/search_for_route_list_params.py b/src/onebusaway/types/search_for_route_list_params.py new file mode 100755 index 0000000..76f767b --- /dev/null +++ b/src/onebusaway/types/search_for_route_list_params.py @@ -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.""" diff --git a/src/onebusaway/types/search_for_route_list_response.py b/src/onebusaway/types/search_for_route_list_response.py new file mode 100755 index 0000000..e54153a --- /dev/null +++ b/src/onebusaway/types/search_for_route_list_response.py @@ -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 diff --git a/src/onebusaway/types/search_for_stop_list_params.py b/src/onebusaway/types/search_for_stop_list_params.py new file mode 100755 index 0000000..012f802 --- /dev/null +++ b/src/onebusaway/types/search_for_stop_list_params.py @@ -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.""" diff --git a/src/onebusaway/types/search_for_stop_list_response.py b/src/onebusaway/types/search_for_stop_list_response.py new file mode 100755 index 0000000..e5a4e29 --- /dev/null +++ b/src/onebusaway/types/search_for_stop_list_response.py @@ -0,0 +1,49 @@ +# 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__ = ["SearchForStopListResponse", "SearchForStopListResponseData", "SearchForStopListResponseDataList"] + + +class SearchForStopListResponseDataList(BaseModel): + id: str + + code: str + + lat: float + + lon: float + + name: str + + direction: Optional[str] = None + + location_type: Optional[int] = FieldInfo(alias="locationType", default=None) + + parent: Optional[str] = None + + route_ids: Optional[List[str]] = FieldInfo(alias="routeIds", default=None) + + static_route_ids: Optional[List[str]] = FieldInfo(alias="staticRouteIds", default=None) + + wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + + +class SearchForStopListResponseData(BaseModel): + limit_exceeded: bool = FieldInfo(alias="limitExceeded") + + list: List[SearchForStopListResponseDataList] + + out_of_range: bool = FieldInfo(alias="outOfRange") + + references: References + + +class SearchForStopListResponse(ResponseWrapper): + data: Optional[SearchForStopListResponseData] = None diff --git a/tests/api_resources/test_search_for_route.py b/tests/api_resources/test_search_for_route.py index e598023..76114f6 100755 --- a/tests/api_resources/test_search_for_route.py +++ b/tests/api_resources/test_search_for_route.py @@ -9,7 +9,7 @@ from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import SearchForRouteRetrieveResponse +from onebusaway.types import SearchForRouteListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,41 +18,41 @@ class TestSearchForRoute: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_retrieve(self, client: OnebusawaySDK) -> None: - search_for_route = client.search_for_route.retrieve( + def test_method_list(self, client: OnebusawaySDK) -> None: + search_for_route = client.search_for_route.list( input="input", ) - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) @parametrize - def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: - search_for_route = client.search_for_route.retrieve( + def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: + search_for_route = client.search_for_route.list( input="input", max_count=0, ) - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) @parametrize - def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: - response = client.search_for_route.with_raw_response.retrieve( + def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.search_for_route.with_raw_response.list( input="input", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_route = response.parse() - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) @parametrize - def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: - with client.search_for_route.with_streaming_response.retrieve( + def test_streaming_response_list(self, client: OnebusawaySDK) -> None: + with client.search_for_route.with_streaming_response.list( input="input", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_route = response.parse() - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -61,40 +61,40 @@ class TestAsyncSearchForRoute: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - search_for_route = await async_client.search_for_route.retrieve( + async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: + search_for_route = await async_client.search_for_route.list( input="input", ) - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: - search_for_route = await async_client.search_for_route.retrieve( + async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: + search_for_route = await async_client.search_for_route.list( input="input", max_count=0, ) - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - response = await async_client.search_for_route.with_raw_response.retrieve( + async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.search_for_route.with_raw_response.list( input="input", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_route = await response.parse() - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - async with async_client.search_for_route.with_streaming_response.retrieve( + async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + async with async_client.search_for_route.with_streaming_response.list( input="input", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_route = await response.parse() - assert_matches_type(SearchForRouteRetrieveResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_search_for_stop.py b/tests/api_resources/test_search_for_stop.py index c2af009..bed17ea 100755 --- a/tests/api_resources/test_search_for_stop.py +++ b/tests/api_resources/test_search_for_stop.py @@ -9,7 +9,7 @@ from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import SearchForStopRetrieveResponse +from onebusaway.types import SearchForStopListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,41 +18,41 @@ class TestSearchForStop: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_retrieve(self, client: OnebusawaySDK) -> None: - search_for_stop = client.search_for_stop.retrieve( + def test_method_list(self, client: OnebusawaySDK) -> None: + search_for_stop = client.search_for_stop.list( input="input", ) - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) @parametrize - def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: - search_for_stop = client.search_for_stop.retrieve( + def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: + search_for_stop = client.search_for_stop.list( input="input", max_count=0, ) - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) @parametrize - def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: - response = client.search_for_stop.with_raw_response.retrieve( + def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.search_for_stop.with_raw_response.list( input="input", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_stop = response.parse() - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) @parametrize - def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: - with client.search_for_stop.with_streaming_response.retrieve( + def test_streaming_response_list(self, client: OnebusawaySDK) -> None: + with client.search_for_stop.with_streaming_response.list( input="input", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_stop = response.parse() - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) assert cast(Any, response.is_closed) is True @@ -61,40 +61,40 @@ class TestAsyncSearchForStop: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - search_for_stop = await async_client.search_for_stop.retrieve( + async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: + search_for_stop = await async_client.search_for_stop.list( input="input", ) - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: - search_for_stop = await async_client.search_for_stop.retrieve( + async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: + search_for_stop = await async_client.search_for_stop.list( input="input", max_count=0, ) - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - response = await async_client.search_for_stop.with_raw_response.retrieve( + async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.search_for_stop.with_raw_response.list( input="input", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_stop = await response.parse() - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - async with async_client.search_for_stop.with_streaming_response.retrieve( + async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + async with async_client.search_for_stop.with_streaming_response.list( input="input", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search_for_stop = await response.parse() - assert_matches_type(SearchForStopRetrieveResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) assert cast(Any, response.is_closed) is True From bf9931b74fef8f97a4b4dab40ba34b84afe61098 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 24 Aug 2024 11:35:56 +0000 Subject: [PATCH 2/4] release: 0.1.0-alpha.19 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/onebusaway/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3cf71e6..b386bef 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.18" + ".": "0.1.0-alpha.19" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f403d7..69e29a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.19 (2024-08-24) + +Full Changelog: [v0.1.0-alpha.18...v0.1.0-alpha.19](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.18...v0.1.0-alpha.19) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#99](https://github.com/OneBusAway/python-sdk/issues/99)) ([e2d03b3](https://github.com/OneBusAway/python-sdk/commit/e2d03b34d459ca5954c40af72c0a8ec13ca19f7e)) + ## 0.1.0-alpha.18 (2024-08-20) Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.17...v0.1.0-alpha.18) diff --git a/pyproject.toml b/pyproject.toml index 6482a9b..9927c24 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "onebusaway" -version = "0.1.0-alpha.18" +version = "0.1.0-alpha.19" description = "The official Python library for the onebusaway-sdk API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/onebusaway/_version.py b/src/onebusaway/_version.py index 64d65a3..89a9515 100755 --- a/src/onebusaway/_version.py +++ b/src/onebusaway/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "onebusaway" -__version__ = "0.1.0-alpha.18" # x-release-please-version +__version__ = "0.1.0-alpha.19" # x-release-please-version From 38f39dd90ffdc2e1a73344a58661438824e6990f Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Sat, 24 Aug 2024 14:46:08 +0300 Subject: [PATCH 3/4] refactor: use list rather than retrieve --- examples/search_for_route.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/search_for_route.py b/examples/search_for_route.py index 2d078d6..94f22f9 100644 --- a/examples/search_for_route.py +++ b/examples/search_for_route.py @@ -15,6 +15,6 @@ search_input = "crystal" # Retrieve the search results. -response = oba.search_for_route.retrieve(input=search_input) +response = oba.search_for_route.list(input=search_input) print(response.data) From c2f5413de7fb443dcd63e474fa80e6f082b3d247 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Sat, 24 Aug 2024 14:46:21 +0300 Subject: [PATCH 4/4] refactor: use list instead of retrieve --- examples/search_for_stop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/search_for_stop.py b/examples/search_for_stop.py index 75ecdeb..d969ffc 100644 --- a/examples/search_for_stop.py +++ b/examples/search_for_stop.py @@ -15,6 +15,6 @@ search_input = "crystal" # Retrieve the search results. -response = oba.search_for_stop.retrieve(input=search_input, max_count=5) +response = oba.search_for_stop.list(input=search_input, max_count=5) print(response.data)