Skip to content

Commit 8d56083

Browse files
Merge pull request #16 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.4
2 parents 7c0ef70 + e08078b commit 8d56083

13 files changed

Lines changed: 328 additions & 5 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.3"
2+
".": "0.1.0-alpha.4"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-44ff52d3676ae12480b775507fe3af8a229d94d6490297ad319f4e37ffef437d.yml
1+
configured_endpoints: 15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-735f145c4ce18bd5a2c869289186f175513bfa496507de7ff0734f9242adf427.yml

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.4 (2024-07-27)
4+
5+
Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
6+
7+
### Features
8+
9+
* **api:** OpenAPI spec update via Stainless API ([#15](https://github.com/OneBusAway/python-sdk/issues/15)) ([171d1b7](https://github.com/OneBusAway/python-sdk/commit/171d1b79ca2cc120d315566f3f861c96a05d8a3b))
10+
311
## 0.1.0-alpha.3 (2024-07-27)
412

513
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ Methods:
8888

8989
- <code title="get /api/where/stop/{stopID}.json">client.stop.<a href="./src/onebusaway/resources/stop.py">retrieve</a>(stop_id) -> <a href="./src/onebusaway/types/stop_retrieve_response.py">StopRetrieveResponse</a></code>
9090

91+
# StopIDsForAgency
92+
93+
Types:
94+
95+
```python
96+
from onebusaway.types import StopIDsForAgencyListResponse
97+
```
98+
99+
Methods:
100+
101+
- <code title="get /api/where/stop-ids-for-agency/{agencyID}.json">client.stop_ids_for_agency.<a href="./src/onebusaway/resources/stop_ids_for_agency.py">list</a>(agency_id) -> <a href="./src/onebusaway/types/stop_ids_for_agency_list_response.py">StopIDsForAgencyListResponse</a></code>
102+
91103
# Route
92104

93105
Types:

examples/stop_ids_for_agency.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
import onebusaway
4+
5+
6+
def main_sync() -> None:
7+
client = onebusaway.OnebusawaySDK(api_key="TEST")
8+
agency_id = "40";
9+
stop_ids = client.stop_ids_for_agency.list(agency_id)
10+
if stop_ids.data:
11+
for stop_id in stop_ids.data.list:
12+
print(stop_id)
13+
14+
15+
if __name__ == "__main__":
16+
main_sync()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onebusaway"
3-
version = "0.1.0-alpha.3"
3+
version = "0.1.0-alpha.4"
44
description = "The official Python library for the onebusaway-sdk API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/onebusaway/_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class OnebusawaySDK(SyncAPIClient):
5353
stops_for_location: resources.StopsForLocationResource
5454
stops_for_route: resources.StopsForRouteResource
5555
stop: resources.StopResource
56+
stop_ids_for_agency: resources.StopIDsForAgencyResource
5657
route: resources.RouteResource
5758
arrival_and_departure: resources.ArrivalAndDepartureResource
5859
trip: resources.TripResource
@@ -123,6 +124,7 @@ def __init__(
123124
self.stops_for_location = resources.StopsForLocationResource(self)
124125
self.stops_for_route = resources.StopsForRouteResource(self)
125126
self.stop = resources.StopResource(self)
127+
self.stop_ids_for_agency = resources.StopIDsForAgencyResource(self)
126128
self.route = resources.RouteResource(self)
127129
self.arrival_and_departure = resources.ArrivalAndDepartureResource(self)
128130
self.trip = resources.TripResource(self)
@@ -253,6 +255,7 @@ class AsyncOnebusawaySDK(AsyncAPIClient):
253255
stops_for_location: resources.AsyncStopsForLocationResource
254256
stops_for_route: resources.AsyncStopsForRouteResource
255257
stop: resources.AsyncStopResource
258+
stop_ids_for_agency: resources.AsyncStopIDsForAgencyResource
256259
route: resources.AsyncRouteResource
257260
arrival_and_departure: resources.AsyncArrivalAndDepartureResource
258261
trip: resources.AsyncTripResource
@@ -323,6 +326,7 @@ def __init__(
323326
self.stops_for_location = resources.AsyncStopsForLocationResource(self)
324327
self.stops_for_route = resources.AsyncStopsForRouteResource(self)
325328
self.stop = resources.AsyncStopResource(self)
329+
self.stop_ids_for_agency = resources.AsyncStopIDsForAgencyResource(self)
326330
self.route = resources.AsyncRouteResource(self)
327331
self.arrival_and_departure = resources.AsyncArrivalAndDepartureResource(self)
328332
self.trip = resources.AsyncTripResource(self)
@@ -456,6 +460,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
456460
self.stops_for_location = resources.StopsForLocationResourceWithRawResponse(client.stops_for_location)
457461
self.stops_for_route = resources.StopsForRouteResourceWithRawResponse(client.stops_for_route)
458462
self.stop = resources.StopResourceWithRawResponse(client.stop)
463+
self.stop_ids_for_agency = resources.StopIDsForAgencyResourceWithRawResponse(client.stop_ids_for_agency)
459464
self.route = resources.RouteResourceWithRawResponse(client.route)
460465
self.arrival_and_departure = resources.ArrivalAndDepartureResourceWithRawResponse(client.arrival_and_departure)
461466
self.trip = resources.TripResourceWithRawResponse(client.trip)
@@ -475,6 +480,7 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
475480
self.stops_for_location = resources.AsyncStopsForLocationResourceWithRawResponse(client.stops_for_location)
476481
self.stops_for_route = resources.AsyncStopsForRouteResourceWithRawResponse(client.stops_for_route)
477482
self.stop = resources.AsyncStopResourceWithRawResponse(client.stop)
483+
self.stop_ids_for_agency = resources.AsyncStopIDsForAgencyResourceWithRawResponse(client.stop_ids_for_agency)
478484
self.route = resources.AsyncRouteResourceWithRawResponse(client.route)
479485
self.arrival_and_departure = resources.AsyncArrivalAndDepartureResourceWithRawResponse(
480486
client.arrival_and_departure
@@ -496,6 +502,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
496502
self.stops_for_location = resources.StopsForLocationResourceWithStreamingResponse(client.stops_for_location)
497503
self.stops_for_route = resources.StopsForRouteResourceWithStreamingResponse(client.stops_for_route)
498504
self.stop = resources.StopResourceWithStreamingResponse(client.stop)
505+
self.stop_ids_for_agency = resources.StopIDsForAgencyResourceWithStreamingResponse(client.stop_ids_for_agency)
499506
self.route = resources.RouteResourceWithStreamingResponse(client.route)
500507
self.arrival_and_departure = resources.ArrivalAndDepartureResourceWithStreamingResponse(
501508
client.arrival_and_departure
@@ -519,6 +526,9 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
519526
)
520527
self.stops_for_route = resources.AsyncStopsForRouteResourceWithStreamingResponse(client.stops_for_route)
521528
self.stop = resources.AsyncStopResourceWithStreamingResponse(client.stop)
529+
self.stop_ids_for_agency = resources.AsyncStopIDsForAgencyResourceWithStreamingResponse(
530+
client.stop_ids_for_agency
531+
)
522532
self.route = resources.AsyncRouteResourceWithStreamingResponse(client.route)
523533
self.arrival_and_departure = resources.AsyncArrivalAndDepartureResourceWithStreamingResponse(
524534
client.arrival_and_departure

src/onebusaway/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "onebusaway"
4-
__version__ = "0.1.0-alpha.3" # x-release-please-version
4+
__version__ = "0.1.0-alpha.4" # x-release-please-version

src/onebusaway/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@
8888
TripsForLocationResourceWithStreamingResponse,
8989
AsyncTripsForLocationResourceWithStreamingResponse,
9090
)
91+
from .stop_ids_for_agency import (
92+
StopIDsForAgencyResource,
93+
AsyncStopIDsForAgencyResource,
94+
StopIDsForAgencyResourceWithRawResponse,
95+
AsyncStopIDsForAgencyResourceWithRawResponse,
96+
StopIDsForAgencyResourceWithStreamingResponse,
97+
AsyncStopIDsForAgencyResourceWithStreamingResponse,
98+
)
9199
from .arrival_and_departure import (
92100
ArrivalAndDepartureResource,
93101
AsyncArrivalAndDepartureResource,
@@ -148,6 +156,12 @@
148156
"AsyncStopResourceWithRawResponse",
149157
"StopResourceWithStreamingResponse",
150158
"AsyncStopResourceWithStreamingResponse",
159+
"StopIDsForAgencyResource",
160+
"AsyncStopIDsForAgencyResource",
161+
"StopIDsForAgencyResourceWithRawResponse",
162+
"AsyncStopIDsForAgencyResourceWithRawResponse",
163+
"StopIDsForAgencyResourceWithStreamingResponse",
164+
"AsyncStopIDsForAgencyResourceWithStreamingResponse",
151165
"RouteResource",
152166
"AsyncRouteResource",
153167
"RouteResourceWithRawResponse",
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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 NOT_GIVEN, Body, Query, Headers, NotGiven
8+
from .._compat import cached_property
9+
from .._resource import SyncAPIResource, AsyncAPIResource
10+
from .._response import (
11+
to_raw_response_wrapper,
12+
to_streamed_response_wrapper,
13+
async_to_raw_response_wrapper,
14+
async_to_streamed_response_wrapper,
15+
)
16+
from .._base_client import make_request_options
17+
from ..types.stop_ids_for_agency_list_response import StopIDsForAgencyListResponse
18+
19+
__all__ = ["StopIDsForAgencyResource", "AsyncStopIDsForAgencyResource"]
20+
21+
22+
class StopIDsForAgencyResource(SyncAPIResource):
23+
@cached_property
24+
def with_raw_response(self) -> StopIDsForAgencyResourceWithRawResponse:
25+
return StopIDsForAgencyResourceWithRawResponse(self)
26+
27+
@cached_property
28+
def with_streaming_response(self) -> StopIDsForAgencyResourceWithStreamingResponse:
29+
return StopIDsForAgencyResourceWithStreamingResponse(self)
30+
31+
def list(
32+
self,
33+
agency_id: str,
34+
*,
35+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
36+
# The extra values given here take precedence over values defined on the client or passed to this method.
37+
extra_headers: Headers | None = None,
38+
extra_query: Query | None = None,
39+
extra_body: Body | None = None,
40+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
41+
) -> StopIDsForAgencyListResponse:
42+
"""
43+
Get stop IDs for a specific agency
44+
45+
Args:
46+
extra_headers: Send extra headers
47+
48+
extra_query: Add additional query parameters to the request
49+
50+
extra_body: Add additional JSON properties to the request
51+
52+
timeout: Override the client-level default timeout for this request, in seconds
53+
"""
54+
if not agency_id:
55+
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}")
56+
return self._get(
57+
f"/api/where/stop-ids-for-agency/{agency_id}.json",
58+
options=make_request_options(
59+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
60+
),
61+
cast_to=StopIDsForAgencyListResponse,
62+
)
63+
64+
65+
class AsyncStopIDsForAgencyResource(AsyncAPIResource):
66+
@cached_property
67+
def with_raw_response(self) -> AsyncStopIDsForAgencyResourceWithRawResponse:
68+
return AsyncStopIDsForAgencyResourceWithRawResponse(self)
69+
70+
@cached_property
71+
def with_streaming_response(self) -> AsyncStopIDsForAgencyResourceWithStreamingResponse:
72+
return AsyncStopIDsForAgencyResourceWithStreamingResponse(self)
73+
74+
async def list(
75+
self,
76+
agency_id: str,
77+
*,
78+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
79+
# The extra values given here take precedence over values defined on the client or passed to this method.
80+
extra_headers: Headers | None = None,
81+
extra_query: Query | None = None,
82+
extra_body: Body | None = None,
83+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
84+
) -> StopIDsForAgencyListResponse:
85+
"""
86+
Get stop IDs for a specific agency
87+
88+
Args:
89+
extra_headers: Send extra headers
90+
91+
extra_query: Add additional query parameters to the request
92+
93+
extra_body: Add additional JSON properties to the request
94+
95+
timeout: Override the client-level default timeout for this request, in seconds
96+
"""
97+
if not agency_id:
98+
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}")
99+
return await self._get(
100+
f"/api/where/stop-ids-for-agency/{agency_id}.json",
101+
options=make_request_options(
102+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
103+
),
104+
cast_to=StopIDsForAgencyListResponse,
105+
)
106+
107+
108+
class StopIDsForAgencyResourceWithRawResponse:
109+
def __init__(self, stop_ids_for_agency: StopIDsForAgencyResource) -> None:
110+
self._stop_ids_for_agency = stop_ids_for_agency
111+
112+
self.list = to_raw_response_wrapper(
113+
stop_ids_for_agency.list,
114+
)
115+
116+
117+
class AsyncStopIDsForAgencyResourceWithRawResponse:
118+
def __init__(self, stop_ids_for_agency: AsyncStopIDsForAgencyResource) -> None:
119+
self._stop_ids_for_agency = stop_ids_for_agency
120+
121+
self.list = async_to_raw_response_wrapper(
122+
stop_ids_for_agency.list,
123+
)
124+
125+
126+
class StopIDsForAgencyResourceWithStreamingResponse:
127+
def __init__(self, stop_ids_for_agency: StopIDsForAgencyResource) -> None:
128+
self._stop_ids_for_agency = stop_ids_for_agency
129+
130+
self.list = to_streamed_response_wrapper(
131+
stop_ids_for_agency.list,
132+
)
133+
134+
135+
class AsyncStopIDsForAgencyResourceWithStreamingResponse:
136+
def __init__(self, stop_ids_for_agency: AsyncStopIDsForAgencyResource) -> None:
137+
self._stop_ids_for_agency = stop_ids_for_agency
138+
139+
self.list = async_to_streamed_response_wrapper(
140+
stop_ids_for_agency.list,
141+
)

0 commit comments

Comments
 (0)