Skip to content

Commit 6367613

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#68)
1 parent bf43bf1 commit 6367613

13 files changed

+756
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-5140605804e4ff2f23c4401b0747441e07daeefb864695a4389e734b83eb07e8.yml
1+
configured_endpoints: 24
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-9c3d349c8e661f7dc8c2585d02f334bb6ba3456f0d929c44d46454a0d190af7b.yml

api.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,27 @@ Methods:
250250
Methods:
251251

252252
- <code title="get /api/where/report-problem-with-stop/{stopID}.json">client.report_problem_with_stop.<a href="./src/onebusaway/resources/report_problem_with_stop.py">retrieve</a>(stop_id, \*\*<a href="src/onebusaway/types/report_problem_with_stop_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/shared/response_wrapper.py">ResponseWrapper</a></code>
253+
254+
# SearchForStop
255+
256+
Types:
257+
258+
```python
259+
from onebusaway.types import SearchForStopRetrieveResponse
260+
```
261+
262+
Methods:
263+
264+
- <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>
265+
266+
# SearchForRoute
267+
268+
Types:
269+
270+
```python
271+
from onebusaway.types import SearchForRouteRetrieveResponse
272+
```
273+
274+
Methods:
275+
276+
- <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>

src/onebusaway/_client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class OnebusawaySDK(SyncAPIClient):
6767
trip_details: resources.TripDetailsResource
6868
trip_for_vehicle: resources.TripForVehicleResource
6969
report_problem_with_stop: resources.ReportProblemWithStopResource
70+
search_for_stop: resources.SearchForStopResource
71+
search_for_route: resources.SearchForRouteResource
7072
with_raw_response: OnebusawaySDKWithRawResponse
7173
with_streaming_response: OnebusawaySDKWithStreamedResponse
7274

@@ -145,6 +147,8 @@ def __init__(
145147
self.trip_details = resources.TripDetailsResource(self)
146148
self.trip_for_vehicle = resources.TripForVehicleResource(self)
147149
self.report_problem_with_stop = resources.ReportProblemWithStopResource(self)
150+
self.search_for_stop = resources.SearchForStopResource(self)
151+
self.search_for_route = resources.SearchForRouteResource(self)
148152
self.with_raw_response = OnebusawaySDKWithRawResponse(self)
149153
self.with_streaming_response = OnebusawaySDKWithStreamedResponse(self)
150154

@@ -283,6 +287,8 @@ class AsyncOnebusawaySDK(AsyncAPIClient):
283287
trip_details: resources.AsyncTripDetailsResource
284288
trip_for_vehicle: resources.AsyncTripForVehicleResource
285289
report_problem_with_stop: resources.AsyncReportProblemWithStopResource
290+
search_for_stop: resources.AsyncSearchForStopResource
291+
search_for_route: resources.AsyncSearchForRouteResource
286292
with_raw_response: AsyncOnebusawaySDKWithRawResponse
287293
with_streaming_response: AsyncOnebusawaySDKWithStreamedResponse
288294

@@ -361,6 +367,8 @@ def __init__(
361367
self.trip_details = resources.AsyncTripDetailsResource(self)
362368
self.trip_for_vehicle = resources.AsyncTripForVehicleResource(self)
363369
self.report_problem_with_stop = resources.AsyncReportProblemWithStopResource(self)
370+
self.search_for_stop = resources.AsyncSearchForStopResource(self)
371+
self.search_for_route = resources.AsyncSearchForRouteResource(self)
364372
self.with_raw_response = AsyncOnebusawaySDKWithRawResponse(self)
365373
self.with_streaming_response = AsyncOnebusawaySDKWithStreamedResponse(self)
366374

@@ -504,6 +512,8 @@ def __init__(self, client: OnebusawaySDK) -> None:
504512
self.report_problem_with_stop = resources.ReportProblemWithStopResourceWithRawResponse(
505513
client.report_problem_with_stop
506514
)
515+
self.search_for_stop = resources.SearchForStopResourceWithRawResponse(client.search_for_stop)
516+
self.search_for_route = resources.SearchForRouteResourceWithRawResponse(client.search_for_route)
507517

508518

509519
class AsyncOnebusawaySDKWithRawResponse:
@@ -535,6 +545,8 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
535545
self.report_problem_with_stop = resources.AsyncReportProblemWithStopResourceWithRawResponse(
536546
client.report_problem_with_stop
537547
)
548+
self.search_for_stop = resources.AsyncSearchForStopResourceWithRawResponse(client.search_for_stop)
549+
self.search_for_route = resources.AsyncSearchForRouteResourceWithRawResponse(client.search_for_route)
538550

539551

540552
class OnebusawaySDKWithStreamedResponse:
@@ -568,6 +580,8 @@ def __init__(self, client: OnebusawaySDK) -> None:
568580
self.report_problem_with_stop = resources.ReportProblemWithStopResourceWithStreamingResponse(
569581
client.report_problem_with_stop
570582
)
583+
self.search_for_stop = resources.SearchForStopResourceWithStreamingResponse(client.search_for_stop)
584+
self.search_for_route = resources.SearchForRouteResourceWithStreamingResponse(client.search_for_route)
571585

572586

573587
class AsyncOnebusawaySDKWithStreamedResponse:
@@ -613,6 +627,8 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
613627
self.report_problem_with_stop = resources.AsyncReportProblemWithStopResourceWithStreamingResponse(
614628
client.report_problem_with_stop
615629
)
630+
self.search_for_stop = resources.AsyncSearchForStopResourceWithStreamingResponse(client.search_for_stop)
631+
self.search_for_route = resources.AsyncSearchForRouteResourceWithStreamingResponse(client.search_for_route)
616632

617633

618634
Client = OnebusawaySDK

src/onebusaway/resources/__init__.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
TripDetailsResourceWithStreamingResponse,
5757
AsyncTripDetailsResourceWithStreamingResponse,
5858
)
59+
from .search_for_stop import (
60+
SearchForStopResource,
61+
AsyncSearchForStopResource,
62+
SearchForStopResourceWithRawResponse,
63+
AsyncSearchForStopResourceWithRawResponse,
64+
SearchForStopResourceWithStreamingResponse,
65+
AsyncSearchForStopResourceWithStreamingResponse,
66+
)
5967
from .stops_for_route import (
6068
StopsForRouteResource,
6169
AsyncStopsForRouteResource,
@@ -64,6 +72,14 @@
6472
StopsForRouteResourceWithStreamingResponse,
6573
AsyncStopsForRouteResourceWithStreamingResponse,
6674
)
75+
from .search_for_route import (
76+
SearchForRouteResource,
77+
AsyncSearchForRouteResource,
78+
SearchForRouteResourceWithRawResponse,
79+
AsyncSearchForRouteResourceWithRawResponse,
80+
SearchForRouteResourceWithStreamingResponse,
81+
AsyncSearchForRouteResourceWithStreamingResponse,
82+
)
6783
from .trip_for_vehicle import (
6884
TripForVehicleResource,
6985
AsyncTripForVehicleResource,
@@ -296,4 +312,16 @@
296312
"AsyncReportProblemWithStopResourceWithRawResponse",
297313
"ReportProblemWithStopResourceWithStreamingResponse",
298314
"AsyncReportProblemWithStopResourceWithStreamingResponse",
315+
"SearchForStopResource",
316+
"AsyncSearchForStopResource",
317+
"SearchForStopResourceWithRawResponse",
318+
"AsyncSearchForStopResourceWithRawResponse",
319+
"SearchForStopResourceWithStreamingResponse",
320+
"AsyncSearchForStopResourceWithStreamingResponse",
321+
"SearchForRouteResource",
322+
"AsyncSearchForRouteResource",
323+
"SearchForRouteResourceWithRawResponse",
324+
"AsyncSearchForRouteResourceWithRawResponse",
325+
"SearchForRouteResourceWithStreamingResponse",
326+
"AsyncSearchForRouteResourceWithStreamingResponse",
299327
]
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..types import search_for_route_retrieve_params
8+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9+
from .._utils import (
10+
maybe_transform,
11+
async_maybe_transform,
12+
)
13+
from .._compat import cached_property
14+
from .._resource import SyncAPIResource, AsyncAPIResource
15+
from .._response import (
16+
to_raw_response_wrapper,
17+
to_streamed_response_wrapper,
18+
async_to_raw_response_wrapper,
19+
async_to_streamed_response_wrapper,
20+
)
21+
from .._base_client import make_request_options
22+
from ..types.search_for_route_retrieve_response import SearchForRouteRetrieveResponse
23+
24+
__all__ = ["SearchForRouteResource", "AsyncSearchForRouteResource"]
25+
26+
27+
class SearchForRouteResource(SyncAPIResource):
28+
@cached_property
29+
def with_raw_response(self) -> SearchForRouteResourceWithRawResponse:
30+
return SearchForRouteResourceWithRawResponse(self)
31+
32+
@cached_property
33+
def with_streaming_response(self) -> SearchForRouteResourceWithStreamingResponse:
34+
return SearchForRouteResourceWithStreamingResponse(self)
35+
36+
def retrieve(
37+
self,
38+
*,
39+
input: str,
40+
max_count: int | NotGiven = NOT_GIVEN,
41+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
42+
# The extra values given here take precedence over values defined on the client or passed to this method.
43+
extra_headers: Headers | None = None,
44+
extra_query: Query | None = None,
45+
extra_body: Body | None = None,
46+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
47+
) -> SearchForRouteRetrieveResponse:
48+
"""
49+
Search for a route based on its name.
50+
51+
Args:
52+
input: The string to search for.
53+
54+
max_count: The max number of results to return. Defaults to 20.
55+
56+
extra_headers: Send extra headers
57+
58+
extra_query: Add additional query parameters to the request
59+
60+
extra_body: Add additional JSON properties to the request
61+
62+
timeout: Override the client-level default timeout for this request, in seconds
63+
"""
64+
return self._get(
65+
"/api/where/search/route.json",
66+
options=make_request_options(
67+
extra_headers=extra_headers,
68+
extra_query=extra_query,
69+
extra_body=extra_body,
70+
timeout=timeout,
71+
query=maybe_transform(
72+
{
73+
"input": input,
74+
"max_count": max_count,
75+
},
76+
search_for_route_retrieve_params.SearchForRouteRetrieveParams,
77+
),
78+
),
79+
cast_to=SearchForRouteRetrieveResponse,
80+
)
81+
82+
83+
class AsyncSearchForRouteResource(AsyncAPIResource):
84+
@cached_property
85+
def with_raw_response(self) -> AsyncSearchForRouteResourceWithRawResponse:
86+
return AsyncSearchForRouteResourceWithRawResponse(self)
87+
88+
@cached_property
89+
def with_streaming_response(self) -> AsyncSearchForRouteResourceWithStreamingResponse:
90+
return AsyncSearchForRouteResourceWithStreamingResponse(self)
91+
92+
async def retrieve(
93+
self,
94+
*,
95+
input: str,
96+
max_count: int | NotGiven = NOT_GIVEN,
97+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
98+
# The extra values given here take precedence over values defined on the client or passed to this method.
99+
extra_headers: Headers | None = None,
100+
extra_query: Query | None = None,
101+
extra_body: Body | None = None,
102+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
103+
) -> SearchForRouteRetrieveResponse:
104+
"""
105+
Search for a route based on its name.
106+
107+
Args:
108+
input: The string to search for.
109+
110+
max_count: The max number of results to return. Defaults to 20.
111+
112+
extra_headers: Send extra headers
113+
114+
extra_query: Add additional query parameters to the request
115+
116+
extra_body: Add additional JSON properties to the request
117+
118+
timeout: Override the client-level default timeout for this request, in seconds
119+
"""
120+
return await self._get(
121+
"/api/where/search/route.json",
122+
options=make_request_options(
123+
extra_headers=extra_headers,
124+
extra_query=extra_query,
125+
extra_body=extra_body,
126+
timeout=timeout,
127+
query=await async_maybe_transform(
128+
{
129+
"input": input,
130+
"max_count": max_count,
131+
},
132+
search_for_route_retrieve_params.SearchForRouteRetrieveParams,
133+
),
134+
),
135+
cast_to=SearchForRouteRetrieveResponse,
136+
)
137+
138+
139+
class SearchForRouteResourceWithRawResponse:
140+
def __init__(self, search_for_route: SearchForRouteResource) -> None:
141+
self._search_for_route = search_for_route
142+
143+
self.retrieve = to_raw_response_wrapper(
144+
search_for_route.retrieve,
145+
)
146+
147+
148+
class AsyncSearchForRouteResourceWithRawResponse:
149+
def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None:
150+
self._search_for_route = search_for_route
151+
152+
self.retrieve = async_to_raw_response_wrapper(
153+
search_for_route.retrieve,
154+
)
155+
156+
157+
class SearchForRouteResourceWithStreamingResponse:
158+
def __init__(self, search_for_route: SearchForRouteResource) -> None:
159+
self._search_for_route = search_for_route
160+
161+
self.retrieve = to_streamed_response_wrapper(
162+
search_for_route.retrieve,
163+
)
164+
165+
166+
class AsyncSearchForRouteResourceWithStreamingResponse:
167+
def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None:
168+
self._search_for_route = search_for_route
169+
170+
self.retrieve = async_to_streamed_response_wrapper(
171+
search_for_route.retrieve,
172+
)

0 commit comments

Comments
 (0)