diff --git a/.stats.yml b/.stats.yml
index 6b64c2b..2ca4666 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 15
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-ac10a054ead5e711bd033b417891c1769d631135029ca5bd91e6584420403ee2.yml
+configured_endpoints: 16
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-92606a4bcfb26210a95a7f86b55fb258977f97c375cd3b1f6035ed81a53f2e2c.yml
diff --git a/api.md b/api.md
index 759705b..ac324dd 100644
--- a/api.md
+++ b/api.md
@@ -28,6 +28,18 @@ Methods:
- client.agency.retrieve(agency_id) -> AgencyRetrieveResponse
+# VehiclesForAgency
+
+Types:
+
+```python
+from onebusaway.types import VehiclesForAgencyListResponse
+```
+
+Methods:
+
+- client.vehicles_for_agency.list(agency_id, \*\*params) -> VehiclesForAgencyListResponse
+
# Config
Types:
diff --git a/src/onebusaway/_client.py b/src/onebusaway/_client.py
index 08f81db..a75cc5b 100644
--- a/src/onebusaway/_client.py
+++ b/src/onebusaway/_client.py
@@ -48,6 +48,7 @@
class OnebusawaySDK(SyncAPIClient):
agencies_with_coverage: resources.AgenciesWithCoverageResource
agency: resources.AgencyResource
+ vehicles_for_agency: resources.VehiclesForAgencyResource
config: resources.ConfigResource
current_time: resources.CurrentTimeResource
stops_for_location: resources.StopsForLocationResource
@@ -119,6 +120,7 @@ def __init__(
self.agencies_with_coverage = resources.AgenciesWithCoverageResource(self)
self.agency = resources.AgencyResource(self)
+ self.vehicles_for_agency = resources.VehiclesForAgencyResource(self)
self.config = resources.ConfigResource(self)
self.current_time = resources.CurrentTimeResource(self)
self.stops_for_location = resources.StopsForLocationResource(self)
@@ -249,6 +251,7 @@ def _make_status_error(
class AsyncOnebusawaySDK(AsyncAPIClient):
agencies_with_coverage: resources.AsyncAgenciesWithCoverageResource
agency: resources.AsyncAgencyResource
+ vehicles_for_agency: resources.AsyncVehiclesForAgencyResource
config: resources.AsyncConfigResource
current_time: resources.AsyncCurrentTimeResource
stops_for_location: resources.AsyncStopsForLocationResource
@@ -320,6 +323,7 @@ def __init__(
self.agencies_with_coverage = resources.AsyncAgenciesWithCoverageResource(self)
self.agency = resources.AsyncAgencyResource(self)
+ self.vehicles_for_agency = resources.AsyncVehiclesForAgencyResource(self)
self.config = resources.AsyncConfigResource(self)
self.current_time = resources.AsyncCurrentTimeResource(self)
self.stops_for_location = resources.AsyncStopsForLocationResource(self)
@@ -453,6 +457,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
client.agencies_with_coverage
)
self.agency = resources.AgencyResourceWithRawResponse(client.agency)
+ self.vehicles_for_agency = resources.VehiclesForAgencyResourceWithRawResponse(client.vehicles_for_agency)
self.config = resources.ConfigResourceWithRawResponse(client.config)
self.current_time = resources.CurrentTimeResourceWithRawResponse(client.current_time)
self.stops_for_location = resources.StopsForLocationResourceWithRawResponse(client.stops_for_location)
@@ -473,6 +478,7 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
client.agencies_with_coverage
)
self.agency = resources.AsyncAgencyResourceWithRawResponse(client.agency)
+ self.vehicles_for_agency = resources.AsyncVehiclesForAgencyResourceWithRawResponse(client.vehicles_for_agency)
self.config = resources.AsyncConfigResourceWithRawResponse(client.config)
self.current_time = resources.AsyncCurrentTimeResourceWithRawResponse(client.current_time)
self.stops_for_location = resources.AsyncStopsForLocationResourceWithRawResponse(client.stops_for_location)
@@ -495,6 +501,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
client.agencies_with_coverage
)
self.agency = resources.AgencyResourceWithStreamingResponse(client.agency)
+ self.vehicles_for_agency = resources.VehiclesForAgencyResourceWithStreamingResponse(client.vehicles_for_agency)
self.config = resources.ConfigResourceWithStreamingResponse(client.config)
self.current_time = resources.CurrentTimeResourceWithStreamingResponse(client.current_time)
self.stops_for_location = resources.StopsForLocationResourceWithStreamingResponse(client.stops_for_location)
@@ -517,6 +524,9 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
client.agencies_with_coverage
)
self.agency = resources.AsyncAgencyResourceWithStreamingResponse(client.agency)
+ self.vehicles_for_agency = resources.AsyncVehiclesForAgencyResourceWithStreamingResponse(
+ client.vehicles_for_agency
+ )
self.config = resources.AsyncConfigResourceWithStreamingResponse(client.config)
self.current_time = resources.AsyncCurrentTimeResourceWithStreamingResponse(client.current_time)
self.stops_for_location = resources.AsyncStopsForLocationResourceWithStreamingResponse(
diff --git a/src/onebusaway/resources/__init__.py b/src/onebusaway/resources/__init__.py
index a81c80e..041cf0a 100644
--- a/src/onebusaway/resources/__init__.py
+++ b/src/onebusaway/resources/__init__.py
@@ -96,6 +96,14 @@
StopIDsForAgencyResourceWithStreamingResponse,
AsyncStopIDsForAgencyResourceWithStreamingResponse,
)
+from .vehicles_for_agency import (
+ VehiclesForAgencyResource,
+ AsyncVehiclesForAgencyResource,
+ VehiclesForAgencyResourceWithRawResponse,
+ AsyncVehiclesForAgencyResourceWithRawResponse,
+ VehiclesForAgencyResourceWithStreamingResponse,
+ AsyncVehiclesForAgencyResourceWithStreamingResponse,
+)
from .arrival_and_departure import (
ArrivalAndDepartureResource,
AsyncArrivalAndDepartureResource,
@@ -126,6 +134,12 @@
"AsyncAgencyResourceWithRawResponse",
"AgencyResourceWithStreamingResponse",
"AsyncAgencyResourceWithStreamingResponse",
+ "VehiclesForAgencyResource",
+ "AsyncVehiclesForAgencyResource",
+ "VehiclesForAgencyResourceWithRawResponse",
+ "AsyncVehiclesForAgencyResourceWithRawResponse",
+ "VehiclesForAgencyResourceWithStreamingResponse",
+ "AsyncVehiclesForAgencyResourceWithStreamingResponse",
"ConfigResource",
"AsyncConfigResource",
"ConfigResourceWithRawResponse",
diff --git a/src/onebusaway/resources/vehicles_for_agency.py b/src/onebusaway/resources/vehicles_for_agency.py
new file mode 100644
index 0000000..d2ff9c3
--- /dev/null
+++ b/src/onebusaway/resources/vehicles_for_agency.py
@@ -0,0 +1,162 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..types import vehicles_for_agency_list_params
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from .._base_client import make_request_options
+from ..types.vehicles_for_agency_list_response import VehiclesForAgencyListResponse
+
+__all__ = ["VehiclesForAgencyResource", "AsyncVehiclesForAgencyResource"]
+
+
+class VehiclesForAgencyResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> VehiclesForAgencyResourceWithRawResponse:
+ return VehiclesForAgencyResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> VehiclesForAgencyResourceWithStreamingResponse:
+ return VehiclesForAgencyResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ agency_id: str,
+ *,
+ time: str | NotGiven = NOT_GIVEN,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VehiclesForAgencyListResponse:
+ """
+ Get vehicles for a specific agency
+
+ Args:
+ time: Specific time for querying the status (timestamp format)
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ 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/vehicles-for-agency/agencyID.json",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform({"time": time}, vehicles_for_agency_list_params.VehiclesForAgencyListParams),
+ ),
+ cast_to=VehiclesForAgencyListResponse,
+ )
+
+
+class AsyncVehiclesForAgencyResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncVehiclesForAgencyResourceWithRawResponse:
+ return AsyncVehiclesForAgencyResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncVehiclesForAgencyResourceWithStreamingResponse:
+ return AsyncVehiclesForAgencyResourceWithStreamingResponse(self)
+
+ async def list(
+ self,
+ agency_id: str,
+ *,
+ time: str | NotGiven = NOT_GIVEN,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VehiclesForAgencyListResponse:
+ """
+ Get vehicles for a specific agency
+
+ Args:
+ time: Specific time for querying the status (timestamp format)
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ 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/vehicles-for-agency/agencyID.json",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {"time": time}, vehicles_for_agency_list_params.VehiclesForAgencyListParams
+ ),
+ ),
+ cast_to=VehiclesForAgencyListResponse,
+ )
+
+
+class VehiclesForAgencyResourceWithRawResponse:
+ def __init__(self, vehicles_for_agency: VehiclesForAgencyResource) -> None:
+ self._vehicles_for_agency = vehicles_for_agency
+
+ self.list = to_raw_response_wrapper(
+ vehicles_for_agency.list,
+ )
+
+
+class AsyncVehiclesForAgencyResourceWithRawResponse:
+ def __init__(self, vehicles_for_agency: AsyncVehiclesForAgencyResource) -> None:
+ self._vehicles_for_agency = vehicles_for_agency
+
+ self.list = async_to_raw_response_wrapper(
+ vehicles_for_agency.list,
+ )
+
+
+class VehiclesForAgencyResourceWithStreamingResponse:
+ def __init__(self, vehicles_for_agency: VehiclesForAgencyResource) -> None:
+ self._vehicles_for_agency = vehicles_for_agency
+
+ self.list = to_streamed_response_wrapper(
+ vehicles_for_agency.list,
+ )
+
+
+class AsyncVehiclesForAgencyResourceWithStreamingResponse:
+ def __init__(self, vehicles_for_agency: AsyncVehiclesForAgencyResource) -> None:
+ self._vehicles_for_agency = vehicles_for_agency
+
+ self.list = async_to_streamed_response_wrapper(
+ vehicles_for_agency.list,
+ )
diff --git a/src/onebusaway/types/__init__.py b/src/onebusaway/types/__init__.py
index 6bedc9c..e9da12e 100644
--- a/src/onebusaway/types/__init__.py
+++ b/src/onebusaway/types/__init__.py
@@ -13,9 +13,11 @@
from .stops_for_route_list_response import StopsForRouteListResponse as StopsForRouteListResponse
from .trip_detail_retrieve_response import TripDetailRetrieveResponse as TripDetailRetrieveResponse
from .current_time_retrieve_response import CurrentTimeRetrieveResponse as CurrentTimeRetrieveResponse
+from .vehicles_for_agency_list_params import VehiclesForAgencyListParams as VehiclesForAgencyListParams
from .trip_for_vehicle_retrieve_params import TripForVehicleRetrieveParams as TripForVehicleRetrieveParams
from .arrival_and_departure_list_params import ArrivalAndDepartureListParams as ArrivalAndDepartureListParams
from .stop_ids_for_agency_list_response import StopIDsForAgencyListResponse as StopIDsForAgencyListResponse
+from .vehicles_for_agency_list_response import VehiclesForAgencyListResponse as VehiclesForAgencyListResponse
from .stops_for_location_retrieve_params import StopsForLocationRetrieveParams as StopsForLocationRetrieveParams
from .trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse as TripForVehicleRetrieveResponse
from .trips_for_location_retrieve_params import TripsForLocationRetrieveParams as TripsForLocationRetrieveParams
diff --git a/src/onebusaway/types/vehicles_for_agency_list_params.py b/src/onebusaway/types/vehicles_for_agency_list_params.py
new file mode 100644
index 0000000..ebf92d1
--- /dev/null
+++ b/src/onebusaway/types/vehicles_for_agency_list_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import TypedDict
+
+__all__ = ["VehiclesForAgencyListParams"]
+
+
+class VehiclesForAgencyListParams(TypedDict, total=False):
+ time: str
+ """Specific time for querying the status (timestamp format)"""
diff --git a/src/onebusaway/types/vehicles_for_agency_list_response.py b/src/onebusaway/types/vehicles_for_agency_list_response.py
new file mode 100644
index 0000000..2536066
--- /dev/null
+++ b/src/onebusaway/types/vehicles_for_agency_list_response.py
@@ -0,0 +1,167 @@
+# 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__ = [
+ "VehiclesForAgencyListResponse",
+ "VehiclesForAgencyListResponseData",
+ "VehiclesForAgencyListResponseDataList",
+ "VehiclesForAgencyListResponseDataListLocation",
+ "VehiclesForAgencyListResponseDataListTripStatus",
+ "VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation",
+ "VehiclesForAgencyListResponseDataListTripStatusPosition",
+]
+
+
+class VehiclesForAgencyListResponseDataListLocation(BaseModel):
+ lat: Optional[float] = None
+
+ lon: Optional[float] = None
+
+
+class VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation(BaseModel):
+ lat: Optional[float] = None
+ """Latitude of the last known location of the transit vehicle."""
+
+ lon: Optional[float] = None
+ """Longitude of the last known location of the transit vehicle."""
+
+
+class VehiclesForAgencyListResponseDataListTripStatusPosition(BaseModel):
+ lat: Optional[float] = None
+ """Latitude of the current position of the transit vehicle."""
+
+ lon: Optional[float] = None
+ """Longitude of the current position of the transit vehicle."""
+
+
+class VehiclesForAgencyListResponseDataListTripStatus(BaseModel):
+ active_trip_id: Optional[str] = FieldInfo(alias="activeTripId", default=None)
+ """Trip ID of the trip the vehicle is actively serving."""
+
+ block_trip_sequence: Optional[int] = FieldInfo(alias="blockTripSequence", default=None)
+ """Index of the active trip into the sequence of trips for the active block."""
+
+ closest_stop: Optional[str] = FieldInfo(alias="closestStop", default=None)
+ """ID of the closest stop to the current location of the transit vehicle."""
+
+ closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None)
+ """
+ Time offset from the closest stop to the current position of the transit vehicle
+ (in seconds).
+ """
+
+ distance_along_trip: Optional[float] = FieldInfo(alias="distanceAlongTrip", default=None)
+ """Distance, in meters, the transit vehicle has progressed along the active trip."""
+
+ frequency: Optional[str] = None
+ """Information about frequency-based scheduling, if applicable to the trip."""
+
+ last_known_distance_along_trip: Optional[float] = FieldInfo(alias="lastKnownDistanceAlongTrip", default=None)
+ """
+ Last known distance along the trip received in real-time from the transit
+ vehicle.
+ """
+
+ last_known_location: Optional[VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation] = FieldInfo(
+ alias="lastKnownLocation", default=None
+ )
+ """Last known location of the transit vehicle."""
+
+ last_known_orientation: Optional[float] = FieldInfo(alias="lastKnownOrientation", default=None)
+ """Last known orientation value received in real-time from the transit vehicle."""
+
+ last_location_update_time: Optional[int] = FieldInfo(alias="lastLocationUpdateTime", default=None)
+ """Timestamp of the last known real-time location update from the transit vehicle."""
+
+ last_update_time: Optional[int] = FieldInfo(alias="lastUpdateTime", default=None)
+ """Timestamp of the last known real-time update from the transit vehicle."""
+
+ next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None)
+ """ID of the next stop the transit vehicle is scheduled to arrive at."""
+
+ next_stop_time_offset: Optional[int] = FieldInfo(alias="nextStopTimeOffset", default=None)
+ """
+ Time offset from the next stop to the current position of the transit vehicle
+ (in seconds).
+ """
+
+ occupancy_capacity: Optional[int] = FieldInfo(alias="occupancyCapacity", default=None)
+ """Capacity of the transit vehicle in terms of occupancy."""
+
+ occupancy_count: Optional[int] = FieldInfo(alias="occupancyCount", default=None)
+ """Current count of occupants in the transit vehicle."""
+
+ occupancy_status: Optional[str] = FieldInfo(alias="occupancyStatus", default=None)
+ """Current occupancy status of the transit vehicle."""
+
+ orientation: Optional[float] = None
+ """Orientation of the transit vehicle, represented as an angle in degrees."""
+
+ phase: Optional[str] = None
+ """Current journey phase of the trip."""
+
+ position: Optional[VehiclesForAgencyListResponseDataListTripStatusPosition] = None
+ """Current position of the transit vehicle."""
+
+ predicted: Optional[bool] = None
+ """Indicates if real-time arrival info is available for this trip."""
+
+ scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None)
+ """
+ Distance, in meters, the transit vehicle is scheduled to have progressed along
+ the active trip.
+ """
+
+ schedule_deviation: Optional[int] = FieldInfo(alias="scheduleDeviation", default=None)
+ """Deviation from the schedule in seconds (positive for late, negative for early)."""
+
+ service_date: Optional[int] = FieldInfo(alias="serviceDate", default=None)
+ """
+ Time, in milliseconds since the Unix epoch, of midnight for the start of the
+ service date for the trip.
+ """
+
+ situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None)
+ """References to situation elements (if any) applicable to this trip."""
+
+ status: Optional[str] = None
+ """Current status modifiers for the trip."""
+
+ total_distance_along_trip: Optional[float] = FieldInfo(alias="totalDistanceAlongTrip", default=None)
+ """Total length of the trip, in meters."""
+
+ vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None)
+ """ID of the transit vehicle currently serving the trip."""
+
+
+class VehiclesForAgencyListResponseDataList(BaseModel):
+ last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime")
+
+ last_update_time: int = FieldInfo(alias="lastUpdateTime")
+
+ location: VehiclesForAgencyListResponseDataListLocation
+
+ trip_id: str = FieldInfo(alias="tripId")
+
+ trip_status: VehiclesForAgencyListResponseDataListTripStatus = FieldInfo(alias="tripStatus")
+
+ vehicle_id: str = FieldInfo(alias="vehicleId")
+
+
+class VehiclesForAgencyListResponseData(BaseModel):
+ list: List[VehiclesForAgencyListResponseDataList]
+
+ references: References
+
+ limit_exceeded: Optional[bool] = FieldInfo(alias="limitExceeded", default=None)
+
+
+class VehiclesForAgencyListResponse(ResponseWrapper):
+ data: Optional[VehiclesForAgencyListResponseData] = None
diff --git a/tests/api_resources/test_vehicles_for_agency.py b/tests/api_resources/test_vehicles_for_agency.py
new file mode 100644
index 0000000..5f201f2
--- /dev/null
+++ b/tests/api_resources/test_vehicles_for_agency.py
@@ -0,0 +1,114 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK
+from tests.utils import assert_matches_type
+from onebusaway.types import VehiclesForAgencyListResponse
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestVehiclesForAgency:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_list(self, client: OnebusawaySDK) -> None:
+ vehicles_for_agency = client.vehicles_for_agency.list(
+ agency_id="agencyID",
+ )
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None:
+ vehicles_for_agency = client.vehicles_for_agency.list(
+ agency_id="agencyID",
+ time="time",
+ )
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: OnebusawaySDK) -> None:
+ response = client.vehicles_for_agency.with_raw_response.list(
+ agency_id="agencyID",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vehicles_for_agency = response.parse()
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: OnebusawaySDK) -> None:
+ with client.vehicles_for_agency.with_streaming_response.list(
+ agency_id="agencyID",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vehicles_for_agency = response.parse()
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_list(self, client: OnebusawaySDK) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `agency_id` but received ''"):
+ client.vehicles_for_agency.with_raw_response.list(
+ agency_id="",
+ )
+
+
+class TestAsyncVehiclesForAgency:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None:
+ vehicles_for_agency = await async_client.vehicles_for_agency.list(
+ agency_id="agencyID",
+ )
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None:
+ vehicles_for_agency = await async_client.vehicles_for_agency.list(
+ agency_id="agencyID",
+ time="time",
+ )
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None:
+ response = await async_client.vehicles_for_agency.with_raw_response.list(
+ agency_id="agencyID",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vehicles_for_agency = await response.parse()
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None:
+ async with async_client.vehicles_for_agency.with_streaming_response.list(
+ agency_id="agencyID",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vehicles_for_agency = await response.parse()
+ assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_list(self, async_client: AsyncOnebusawaySDK) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `agency_id` but received ''"):
+ await async_client.vehicles_for_agency.with_raw_response.list(
+ agency_id="",
+ )