Skip to content

Commit e08078b

Browse files
chore: Update stop retrieval endpoint in StopResource and AsyncStopResource
1 parent 591dabe commit e08078b

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

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()

src/onebusaway/resources/stop_ids_for_agency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def list(
5454
if not agency_id:
5555
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}")
5656
return self._get(
57-
f"/api/where/stop-ids-for-agency/agencyID.json",
57+
f"/api/where/stop-ids-for-agency/{agency_id}.json",
5858
options=make_request_options(
5959
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
6060
),
@@ -97,7 +97,7 @@ async def list(
9797
if not agency_id:
9898
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}")
9999
return await self._get(
100-
f"/api/where/stop-ids-for-agency/agencyID.json",
100+
f"/api/where/stop-ids-for-agency/{agency_id}.json",
101101
options=make_request_options(
102102
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
103103
),

0 commit comments

Comments
 (0)