Skip to content

Commit

Permalink
chore: Update stop retrieval endpoint in StopResource and AsyncStopRe…
Browse files Browse the repository at this point in the history
…source
  • Loading branch information
Ahmedhossamdev committed Jul 27, 2024
1 parent 591dabe commit e08078b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions examples/stop_ids_for_agency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


import onebusaway


def main_sync() -> None:
client = onebusaway.OnebusawaySDK(api_key="TEST")
agency_id = "40";
stop_ids = client.stop_ids_for_agency.list(agency_id)
if stop_ids.data:
for stop_id in stop_ids.data.list:
print(stop_id)


if __name__ == "__main__":
main_sync()
4 changes: 2 additions & 2 deletions src/onebusaway/resources/stop_ids_for_agency.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def list(
if not agency_id:
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}")
return self._get(
f"/api/where/stop-ids-for-agency/agencyID.json",
f"/api/where/stop-ids-for-agency/{agency_id}.json",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -97,7 +97,7 @@ async def list(
if not agency_id:
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}")
return await self._get(
f"/api/where/stop-ids-for-agency/agencyID.json",
f"/api/where/stop-ids-for-agency/{agency_id}.json",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down

0 comments on commit e08078b

Please sign in to comment.