From d301a0cf24104ff0d791046c99093f3c47365bf3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 16:36:22 +0000 Subject: [PATCH 1/3] chore(internal): codegen related update (#288) --- README.md | 21 +- requirements-dev.lock | 12 +- requirements.lock | 12 +- scripts/utils/ruffen-docs.py | 4 +- src/onebusaway/__init__.py | 84 +-- src/onebusaway/_base_client.py | 13 +- src/onebusaway/_client.py | 527 ++++--------- src/onebusaway/_constants.py | 2 +- src/onebusaway/_exceptions.py | 46 +- src/onebusaway/_resource.py | 12 +- src/onebusaway/_response.py | 11 +- src/onebusaway/_streaming.py | 12 +- src/onebusaway/_types.py | 4 + src/onebusaway/_utils/_typing.py | 7 +- src/onebusaway/resources/__init__.py | 451 ++--------- .../resources/agencies_with_coverage.py | 73 +- src/onebusaway/resources/agency.py | 85 +-- .../resources/arrival_and_departure.py | 258 +++---- src/onebusaway/resources/block.py | 85 +-- src/onebusaway/resources/config.py | 73 +- src/onebusaway/resources/current_time.py | 73 +- .../resources/report_problem_with_stop.py | 157 ++-- .../resources/report_problem_with_trip.py | 211 +++--- src/onebusaway/resources/route.py | 85 +-- .../resources/route_ids_for_agency.py | 85 +-- src/onebusaway/resources/routes_for_agency.py | 85 +-- .../resources/routes_for_location.py | 147 ++-- .../resources/schedule_for_route.py | 120 ++- src/onebusaway/resources/schedule_for_stop.py | 118 ++- src/onebusaway/resources/search_for_route.py | 115 ++- src/onebusaway/resources/search_for_stop.py | 115 ++- src/onebusaway/resources/shape.py | 85 +-- src/onebusaway/resources/stop.py | 85 +-- .../resources/stop_ids_for_agency.py | 85 +-- src/onebusaway/resources/stops_for_agency.py | 85 +-- .../resources/stops_for_location.py | 147 ++-- src/onebusaway/resources/stops_for_route.py | 127 ++-- src/onebusaway/resources/trip.py | 85 +-- src/onebusaway/resources/trip_details.py | 151 ++-- src/onebusaway/resources/trip_for_vehicle.py | 143 ++-- .../resources/trips_for_location.py | 155 ++-- src/onebusaway/resources/trips_for_route.py | 135 ++-- .../resources/vehicles_for_agency.py | 111 ++- src/onebusaway/types/__init__.py | 78 +- .../agencies_with_coverage_list_response.py | 26 +- .../types/agency_retrieve_response.py | 20 +- .../arrival_and_departure_list_params.py | 13 +- .../arrival_and_departure_list_response.py | 138 ++-- .../arrival_and_departure_retrieve_params.py | 9 +- ...arrival_and_departure_retrieve_response.py | 132 ++-- .../types/block_retrieve_response.py | 58 +- .../types/config_retrieve_response.py | 68 +- .../types/current_time_retrieve_response.py | 16 +- ...eport_problem_with_stop_retrieve_params.py | 9 +- ...eport_problem_with_trip_retrieve_params.py | 18 +- .../route_ids_for_agency_list_response.py | 15 +- .../types/route_retrieve_response.py | 24 +- .../types/routes_for_agency_list_response.py | 26 +- .../types/routes_for_location_list_params.py | 9 +- .../routes_for_location_list_response.py | 32 +- .../schedule_for_route_retrieve_params.py | 13 +- .../schedule_for_route_retrieve_response.py | 99 +-- .../schedule_for_stop_retrieve_params.py | 13 +- .../schedule_for_stop_retrieve_response.py | 72 +- .../types/search_for_route_list_params.py | 9 +- .../types/search_for_route_list_response.py | 28 +- .../types/search_for_stop_list_params.py | 9 +- .../types/search_for_stop_list_response.py | 26 +- .../types/shape_retrieve_response.py | 12 +- src/onebusaway/types/shared/__init__.py | 2 +- src/onebusaway/types/shared/references.py | 144 ++-- .../types/shared/response_wrapper.py | 10 +- .../stop_ids_for_agency_list_response.py | 15 +- .../types/stop_retrieve_response.py | 22 +- .../types/stops_for_agency_list_response.py | 23 +- .../types/stops_for_location_list_params.py | 9 +- .../types/stops_for_location_list_response.py | 26 +- .../types/stops_for_route_list_params.py | 9 +- .../types/stops_for_route_list_response.py | 36 +- .../types/trip_detail_retrieve_params.py | 9 +- .../types/trip_detail_retrieve_response.py | 98 +-- .../types/trip_for_vehicle_retrieve_params.py | 9 +- .../trip_for_vehicle_retrieve_response.py | 98 +-- .../types/trip_retrieve_response.py | 34 +- .../types/trips_for_location_list_params.py | 9 +- .../types/trips_for_location_list_response.py | 102 ++- .../types/trips_for_route_list_params.py | 9 +- .../types/trips_for_route_list_response.py | 100 ++- .../types/vehicles_for_agency_list_params.py | 7 +- .../vehicles_for_agency_list_response.py | 88 +-- tests/__init__.py | 2 +- tests/api_resources/__init__.py | 2 +- .../test_agencies_with_coverage.py | 50 +- tests/api_resources/test_agency.py | 60 +- .../test_arrival_and_departure.py | 120 +-- tests/api_resources/test_block.py | 60 +- tests/api_resources/test_config.py | 50 +- tests/api_resources/test_current_time.py | 50 +- .../test_report_problem_with_stop.py | 65 +- .../test_report_problem_with_trip.py | 65 +- tests/api_resources/test_route.py | 60 +- .../test_route_ids_for_agency.py | 60 +- tests/api_resources/test_routes_for_agency.py | 60 +- .../api_resources/test_routes_for_location.py | 55 +- .../api_resources/test_schedule_for_route.py | 66 +- tests/api_resources/test_schedule_for_stop.py | 66 +- tests/api_resources/test_search_for_route.py | 55 +- tests/api_resources/test_search_for_stop.py | 55 +- tests/api_resources/test_shape.py | 60 +- tests/api_resources/test_stop.py | 60 +- .../api_resources/test_stop_ids_for_agency.py | 60 +- tests/api_resources/test_stops_for_agency.py | 60 +- .../api_resources/test_stops_for_location.py | 55 +- tests/api_resources/test_stops_for_route.py | 65 +- tests/api_resources/test_trip.py | 60 +- tests/api_resources/test_trip_details.py | 65 +- tests/api_resources/test_trip_for_vehicle.py | 65 +- .../api_resources/test_trips_for_location.py | 55 +- tests/api_resources/test_trips_for_route.py | 65 +- .../api_resources/test_vehicles_for_agency.py | 65 +- tests/conftest.py | 22 +- tests/test_client.py | 713 +++++++----------- tests/test_models.py | 11 +- tests/test_streaming.py | 20 +- tests/test_transform.py | 16 +- 125 files changed, 3805 insertions(+), 5041 deletions(-) diff --git a/README.md b/README.md index 8bc5b4e..fdae5e7 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,8 @@ client = AsyncOnebusawaySDK( api_key=os.environ.get("ONEBUSAWAY_API_KEY"), # This is the default and can be omitted ) - async def main() -> None: - current_time = await client.current_time.retrieve() - + current_time = await client.current_time.retrieve() asyncio.run(main()) ``` @@ -92,7 +90,7 @@ try: client.current_time.retrieve() except onebusaway.APIConnectionError as e: print("The server could not be reached") - print(e.__cause__) # an underlying Exception, likely raised within httpx. + print(e.__cause__) # an underlying Exception, likely raised within httpx. except onebusaway.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") except onebusaway.APIStatusError as e: @@ -132,7 +130,7 @@ client = OnebusawaySDK( ) # Or, configure per-request: -client.with_options(max_retries=5).current_time.retrieve() +client.with_options(max_retries = 5).current_time.retrieve() ``` ### Timeouts @@ -155,7 +153,7 @@ client = OnebusawaySDK( ) # Override per-request: -client.with_options(timeout=5.0).current_time.retrieve() +client.with_options(timeout = 5.0).current_time.retrieve() ``` On timeout, an `APITimeoutError` is thrown. @@ -214,11 +212,11 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.current_time.with_streaming_response.retrieve() as response: - print(response.headers.get("X-My-Header")) +with client.current_time.with_streaming_response.retrieve() as response : + print(response.headers.get('X-My-Header')) for line in response.iter_lines(): - print(line) + print(line) ``` The context manager is required so that the response will reliably be closed. @@ -272,10 +270,7 @@ from onebusaway import OnebusawaySDK, DefaultHttpxClient client = OnebusawaySDK( # Or use the `ONEBUSAWAY_SDK_BASE_URL` env var base_url="http://my.test.server.example.com:8083", - http_client=DefaultHttpxClient( - proxy="http://my.test.proxy.example.com", - transport=httpx.HTTPTransport(local_address="0.0.0.0"), - ), + http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")), ) ``` diff --git a/requirements-dev.lock b/requirements-dev.lock index e00b078..1f3d089 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -14,7 +14,7 @@ annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via httpx - # via onebusaway + # via sdk-pythonpackagename argcomplete==3.1.2 # via nox certifi==2023.7.22 @@ -26,7 +26,7 @@ dirty-equals==0.6.0 distlib==0.3.7 # via virtualenv distro==1.8.0 - # via onebusaway + # via sdk-pythonpackagename exceptiongroup==1.2.2 # via anyio # via pytest @@ -37,8 +37,8 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.28.1 - # via onebusaway # via respx + # via sdk-pythonpackagename idna==3.4 # via anyio # via httpx @@ -64,7 +64,7 @@ platformdirs==3.11.0 pluggy==1.5.0 # via pytest pydantic==2.10.3 - # via onebusaway + # via sdk-pythonpackagename pydantic-core==2.27.1 # via pydantic pygments==2.18.0 @@ -86,7 +86,7 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via onebusaway + # via sdk-pythonpackagename time-machine==2.9.0 tomli==2.0.2 # via mypy @@ -94,10 +94,10 @@ tomli==2.0.2 typing-extensions==4.12.2 # via anyio # via mypy - # via onebusaway # via pydantic # via pydantic-core # via pyright + # via sdk-pythonpackagename virtualenv==20.24.5 # via nox zipp==3.17.0 diff --git a/requirements.lock b/requirements.lock index cf5c8e0..26eb37b 100644 --- a/requirements.lock +++ b/requirements.lock @@ -14,12 +14,12 @@ annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via httpx - # via onebusaway + # via sdk-pythonpackagename certifi==2023.7.22 # via httpcore # via httpx distro==1.8.0 - # via onebusaway + # via sdk-pythonpackagename exceptiongroup==1.2.2 # via anyio h11==0.14.0 @@ -27,19 +27,19 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.28.1 - # via onebusaway + # via sdk-pythonpackagename idna==3.4 # via anyio # via httpx pydantic==2.10.3 - # via onebusaway + # via sdk-pythonpackagename pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio - # via onebusaway + # via sdk-pythonpackagename typing-extensions==4.12.2 # via anyio - # via onebusaway # via pydantic # via pydantic-core + # via sdk-pythonpackagename diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py index 0cf2bd2..37b3d94 100644 --- a/scripts/utils/ruffen-docs.py +++ b/scripts/utils/ruffen-docs.py @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str: with _collect_error(match): code = format_code_block(code) code = textwrap.indent(code, match["indent"]) - return f"{match['before']}{code}{match['after']}" + return f'{match["before"]}{code}{match["after"]}' def _pycon_match(match: Match[str]) -> str: code = "" @@ -97,7 +97,7 @@ def finish_fragment() -> None: def _md_pycon_match(match: Match[str]) -> str: code = _pycon_match(match) code = textwrap.indent(code, match["indent"]) - return f"{match['before']}{code}{match['after']}" + return f'{match["before"]}{code}{match["after"]}' src = MD_RE.sub(_md_match, src) src = MD_PYCON_RE.sub(_md_pycon_match, src) diff --git a/src/onebusaway/__init__.py b/src/onebusaway/__init__.py index 2e0349f..e2acc95 100644 --- a/src/onebusaway/__init__.py +++ b/src/onebusaway/__init__.py @@ -1,82 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._version import __version__, __title__ +from ._client import Timeout,Transport,RequestOptions,Client,AsyncClient,Stream,AsyncStream,OnebusawaySDK,AsyncOnebusawaySDK +from ._exceptions import OnebusawaySDKError,APIError,APIStatusError,APITimeoutError,APIConnectionError,APIResponseValidationError,BadRequestError,AuthenticationError,PermissionDeniedError,NotFoundError,ConflictError,UnprocessableEntityError,RateLimitError,InternalServerError +from ._types import NoneType,Transport,ProxiesTypes,NotGiven,NOT_GIVEN,Omit from ._utils import file_from_path -from ._client import ( - Client, - Stream, - Timeout, - Transport, - AsyncClient, - AsyncStream, - OnebusawaySDK, - RequestOptions, - AsyncOnebusawaySDK, -) from ._models import BaseModel -from ._version import __title__, __version__ -from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse -from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS -from ._exceptions import ( - APIError, - ConflictError, - NotFoundError, - APIStatusError, - RateLimitError, - APITimeoutError, - BadRequestError, - APIConnectionError, - OnebusawaySDKError, - AuthenticationError, - InternalServerError, - PermissionDeniedError, - UnprocessableEntityError, - APIResponseValidationError, -) -from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._constants import DEFAULT_TIMEOUT,DEFAULT_MAX_RETRIES,DEFAULT_CONNECTION_LIMITS +from ._base_client import DefaultHttpxClient,DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging +from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse -__all__ = [ - "types", - "__version__", - "__title__", - "NoneType", - "Transport", - "ProxiesTypes", - "NotGiven", - "NOT_GIVEN", - "Omit", - "OnebusawaySDKError", - "APIError", - "APIStatusError", - "APITimeoutError", - "APIConnectionError", - "APIResponseValidationError", - "BadRequestError", - "AuthenticationError", - "PermissionDeniedError", - "NotFoundError", - "ConflictError", - "UnprocessableEntityError", - "RateLimitError", - "InternalServerError", - "Timeout", - "RequestOptions", - "Client", - "AsyncClient", - "Stream", - "AsyncStream", - "OnebusawaySDK", - "AsyncOnebusawaySDK", - "file_from_path", - "BaseModel", - "DEFAULT_TIMEOUT", - "DEFAULT_MAX_RETRIES", - "DEFAULT_CONNECTION_LIMITS", - "DefaultHttpxClient", - "DefaultAsyncHttpxClient", -] +__all__ = ["types", "__version__", "__title__", "NoneType", "Transport", "ProxiesTypes", "NotGiven", "NOT_GIVEN", "Omit", "OnebusawaySDKError", "APIError", "APIStatusError", "APITimeoutError", "APIConnectionError", "APIResponseValidationError", "BadRequestError", "AuthenticationError", "PermissionDeniedError", "NotFoundError", "ConflictError", "UnprocessableEntityError", "RateLimitError", "InternalServerError", "Timeout", "RequestOptions", "Client", "AsyncClient", "Stream", "AsyncStream", "OnebusawaySDK", "AsyncOnebusawaySDK", "file_from_path", "BaseModel", "DEFAULT_TIMEOUT", "DEFAULT_MAX_RETRIES", "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient"] _setup_logging() @@ -88,7 +24,7 @@ for __name in __all__: if not __name.startswith("__"): try: - __locals[__name].__module__ = "onebusaway" + setattr(__locals[__name], "__module__", "onebusaway") except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. - pass + pass \ No newline at end of file diff --git a/src/onebusaway/_base_client.py b/src/onebusaway/_base_client.py index 8ee4250..26cbf6c 100644 --- a/src/onebusaway/_base_client.py +++ b/src/onebusaway/_base_client.py @@ -9,6 +9,7 @@ import inspect import logging import platform +import warnings import email.utils from types import TracebackType from random import random @@ -83,6 +84,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._legacy_response import LegacyAPIResponse log: logging.Logger = logging.getLogger(__name__) @@ -203,7 +205,7 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if PYDANTIC_V2 and getattr(self, '__pydantic_private__', None) is None: self.__pydantic_private__ = {} self._model = model @@ -291,7 +293,7 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if PYDANTIC_V2 and getattr(self, '__pydantic_private__', None) is None: self.__pydantic_private__ = {} self._model = model @@ -608,7 +610,7 @@ def default_headers(self) -> dict[str, str | Omit]: "Accept": "application/json", "Content-Type": "application/json", "User-Agent": self.user_agent, - **self.platform_headers(), +**self.platform_headers(), **self.auth_headers, **self._custom_headers, } @@ -994,6 +996,7 @@ def _request( response.reason_phrase, response.headers, ) + try: response.raise_for_status() @@ -1069,6 +1072,8 @@ def _process_response( stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, retries_taken: int = 0, ) -> ResponseT: + + origin = get_origin(cast_to) or cast_to if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): @@ -1592,6 +1597,8 @@ async def _process_response( stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, retries_taken: int = 0, ) -> ResponseT: + + origin = get_origin(cast_to) or cast_to if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): diff --git a/src/onebusaway/_client.py b/src/onebusaway/_client.py index e14128b..dce7036 100644 --- a/src/onebusaway/_client.py +++ b/src/onebusaway/_client.py @@ -2,77 +2,48 @@ from __future__ import annotations +import httpx + import os -from typing import Any, Union, Mapping -from typing_extensions import Self, override -import httpx +from ._streaming import AsyncStream as AsyncStream, Stream as Stream + +from typing import Union, Mapping, Any + +from ._exceptions import OnebusawaySDKError, APIStatusError + +from typing_extensions import override, Self + +from ._utils import get_async_library + +from .resources import agencies_with_coverage, agency, vehicles_for_agency, config, current_time, stops_for_location, stops_for_route, stops_for_agency, stop, stop_ids_for_agency, schedule_for_stop, route, route_ids_for_agency, routes_for_location, routes_for_agency, schedule_for_route, arrival_and_departure, trip, trips_for_location, trip_details, trip_for_vehicle, trips_for_route, report_problem_with_stop, report_problem_with_trip, search_for_stop, search_for_route, block, shape from . import _exceptions -from ._qs import Querystring -from ._types import ( - NOT_GIVEN, - Omit, - Timeout, - NotGiven, - Transport, - ProxiesTypes, - RequestOptions, -) -from ._utils import ( - is_given, - get_async_library, -) + +import os +import asyncio +import warnings +from typing_extensions import Literal + +import httpx + from ._version import __version__ -from .resources import ( - stop, - trip, - block, - route, - shape, - agency, - config, - current_time, - trip_details, - search_for_stop, - stops_for_route, - trips_for_route, - search_for_route, - stops_for_agency, - trip_for_vehicle, - routes_for_agency, - schedule_for_stop, - schedule_for_route, - stops_for_location, - trips_for_location, - routes_for_location, - stop_ids_for_agency, - vehicles_for_agency, - route_ids_for_agency, - arrival_and_departure, - agencies_with_coverage, - report_problem_with_stop, - report_problem_with_trip, -) -from ._streaming import Stream as Stream, AsyncStream as AsyncStream -from ._exceptions import APIStatusError, OnebusawaySDKError +from ._qs import Querystring +from ._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, maybe_coerce_integer, maybe_coerce_float, maybe_coerce_boolean, is_given +from ._types import Omit, NotGiven, Timeout, Transport, ProxiesTypes, RequestOptions, Headers, NoneType, Query, Body, NOT_GIVEN from ._base_client import ( + DEFAULT_CONNECTION_LIMITS, + DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, + ResponseT, + SyncHttpxClientWrapper, + AsyncHttpxClientWrapper, SyncAPIClient, AsyncAPIClient, + make_request_options, ) -__all__ = [ - "Timeout", - "Transport", - "ProxiesTypes", - "RequestOptions", - "OnebusawaySDK", - "AsyncOnebusawaySDK", - "Client", - "AsyncClient", -] - +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "OnebusawaySDK", "AsyncOnebusawaySDK", "Client", "AsyncClient"] class OnebusawaySDK(SyncAPIClient): agencies_with_coverage: agencies_with_coverage.AgenciesWithCoverageResource @@ -109,56 +80,38 @@ class OnebusawaySDK(SyncAPIClient): # client options api_key: str - def __init__( - self, - *, - api_key: str | None = None, - base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, - max_retries: int = DEFAULT_MAX_RETRIES, - default_headers: Mapping[str, str] | None = None, - default_query: Mapping[str, object] | None = None, - # Configure a custom httpx client. - # We provide a `DefaultHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. - # See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details. - http_client: httpx.Client | None = None, - # Enable or disable schema validation for data returned by the API. - # When enabled an error APIResponseValidationError is raised - # if the API responds with invalid data for the expected schema. - # - # This parameter may be removed or changed in the future. - # If you rely on this feature, please open a GitHub issue - # outlining your use-case to help us decide if it should be - # part of our public interface in the future. - _strict_response_validation: bool = False, - ) -> None: + def __init__(self, *, api_key: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, + # Configure a custom httpx client. + # We provide a `DefaultHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details. + http_client: httpx.Client | None = None, + # Enable or disable schema validation for data returned by the API. + # When enabled an error APIResponseValidationError is raised + # if the API responds with invalid data for the expected schema. + # + # This parameter may be removed or changed in the future. + # If you rely on this feature, please open a GitHub issue + # outlining your use-case to help us decide if it should be + # part of our public interface in the future. + _strict_response_validation: bool = False) -> None: """Construct a new synchronous OnebusawaySDK client instance. This automatically infers the `api_key` argument from the `ONEBUSAWAY_API_KEY` environment variable if it is not provided. """ if api_key is None: - api_key = os.environ.get("ONEBUSAWAY_API_KEY") + api_key = os.environ.get("ONEBUSAWAY_API_KEY") if api_key is None: - raise OnebusawaySDKError( - "The api_key client option must be set either by passing api_key to the client or by setting the ONEBUSAWAY_API_KEY environment variable" - ) + raise OnebusawaySDKError( + "The api_key client option must be set either by passing api_key to the client or by setting the ONEBUSAWAY_API_KEY environment variable" + ) self.api_key = api_key if base_url is None: - base_url = os.environ.get("ONEBUSAWAY_SDK_BASE_URL") + base_url = os.environ.get("ONEBUSAWAY_SDK_BASE_URL") if base_url is None: - base_url = f"https://api.pugetsound.onebusaway.org" - - super().__init__( - version=__version__, - base_url=base_url, - max_retries=max_retries, - timeout=timeout, - http_client=http_client, - custom_headers=default_headers, - custom_query=default_query, - _strict_response_validation=_strict_response_validation, - ) + base_url = f"https://api.pugetsound.onebusaway.org" + + super().__init__(version=__version__, base_url=base_url, max_retries=max_retries, timeout=timeout, http_client=http_client, custom_headers=default_headers, custom_query=default_query, _strict_response_validation=_strict_response_validation) self.agencies_with_coverage = agencies_with_coverage.AgenciesWithCoverageResource(self) self.agency = agency.AgencyResource(self) @@ -205,42 +158,33 @@ def auth_headers(self) -> dict[str, str]: @override def default_headers(self) -> dict[str, str | Omit]: return { - **super().default_headers, - "X-Stainless-Async": "false", - **self._custom_headers, + **super().default_headers, + "X-Stainless-Async": "false", + **self._custom_headers, } @property @override def default_query(self) -> dict[str, object]: return { - **super().default_query, - "key": self.api_key, - **self._custom_query, + **super().default_query, + "key": self.api_key, + **self._custom_query, } - def copy( - self, - *, - api_key: str | None = None, - base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, - default_headers: Mapping[str, str] | None = None, - set_default_headers: Mapping[str, str] | None = None, - default_query: Mapping[str, object] | None = None, - set_default_query: Mapping[str, object] | None = None, - _extra_kwargs: Mapping[str, Any] = {}, - ) -> Self: + def copy(self, *, api_key: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, max_retries: int | NotGiven = NOT_GIVEN, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, set_default_query: Mapping[str, object] | None = None, _extra_kwargs: Mapping[str, Any] = {}) -> Self: """ Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + raise ValueError( + 'The `default_headers` and `set_default_headers` arguments are mutually exclusive' + ) if default_query is not None and set_default_query is not None: - raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + raise ValueError( + 'The `default_query` and `set_default_query` arguments are mutually exclusive' + ) headers = self._custom_headers if default_headers is not None: @@ -255,29 +199,14 @@ def copy( params = set_default_query http_client = http_client or self._client - return self.__class__( - api_key=api_key or self.api_key, - base_url=base_url or self.base_url, - timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, - http_client=http_client, - max_retries=max_retries if is_given(max_retries) else self.max_retries, - default_headers=headers, - default_query=params, - **_extra_kwargs, - ) + return self.__class__(api_key = api_key or self.api_key, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, max_retries=max_retries if is_given(max_retries) else self.max_retries, default_headers=headers, default_query=params, **_extra_kwargs) # Alias for `copy` for nicer inline usage, e.g. # client.with_options(timeout=10).foo.create(...) with_options = copy @override - def _make_status_error( - self, - err_msg: str, - *, - body: object, - response: httpx.Response, - ) -> APIStatusError: + def _make_status_error(self, err_msg: str, *, body: object, response: httpx.Response,) -> APIStatusError: if response.status_code == 400: return _exceptions.BadRequestError(err_msg, response=response, body=body) @@ -303,7 +232,6 @@ def _make_status_error( return _exceptions.InternalServerError(err_msg, response=response, body=body) return APIStatusError(err_msg, response=response, body=body) - class AsyncOnebusawaySDK(AsyncAPIClient): agencies_with_coverage: agencies_with_coverage.AsyncAgenciesWithCoverageResource agency: agency.AsyncAgencyResource @@ -339,56 +267,38 @@ class AsyncOnebusawaySDK(AsyncAPIClient): # client options api_key: str - def __init__( - self, - *, - api_key: str | None = None, - base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, - max_retries: int = DEFAULT_MAX_RETRIES, - default_headers: Mapping[str, str] | None = None, - default_query: Mapping[str, object] | None = None, - # Configure a custom httpx client. - # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. - # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. - http_client: httpx.AsyncClient | None = None, - # Enable or disable schema validation for data returned by the API. - # When enabled an error APIResponseValidationError is raised - # if the API responds with invalid data for the expected schema. - # - # This parameter may be removed or changed in the future. - # If you rely on this feature, please open a GitHub issue - # outlining your use-case to help us decide if it should be - # part of our public interface in the future. - _strict_response_validation: bool = False, - ) -> None: + def __init__(self, *, api_key: str | None = None, base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, + # Configure a custom httpx client. + # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. + http_client: httpx.AsyncClient | None = None, + # Enable or disable schema validation for data returned by the API. + # When enabled an error APIResponseValidationError is raised + # if the API responds with invalid data for the expected schema. + # + # This parameter may be removed or changed in the future. + # If you rely on this feature, please open a GitHub issue + # outlining your use-case to help us decide if it should be + # part of our public interface in the future. + _strict_response_validation: bool = False) -> None: """Construct a new async AsyncOnebusawaySDK client instance. This automatically infers the `api_key` argument from the `ONEBUSAWAY_API_KEY` environment variable if it is not provided. """ if api_key is None: - api_key = os.environ.get("ONEBUSAWAY_API_KEY") + api_key = os.environ.get("ONEBUSAWAY_API_KEY") if api_key is None: - raise OnebusawaySDKError( - "The api_key client option must be set either by passing api_key to the client or by setting the ONEBUSAWAY_API_KEY environment variable" - ) + raise OnebusawaySDKError( + "The api_key client option must be set either by passing api_key to the client or by setting the ONEBUSAWAY_API_KEY environment variable" + ) self.api_key = api_key if base_url is None: - base_url = os.environ.get("ONEBUSAWAY_SDK_BASE_URL") + base_url = os.environ.get("ONEBUSAWAY_SDK_BASE_URL") if base_url is None: - base_url = f"https://api.pugetsound.onebusaway.org" - - super().__init__( - version=__version__, - base_url=base_url, - max_retries=max_retries, - timeout=timeout, - http_client=http_client, - custom_headers=default_headers, - custom_query=default_query, - _strict_response_validation=_strict_response_validation, - ) + base_url = f"https://api.pugetsound.onebusaway.org" + + super().__init__(version=__version__, base_url=base_url, max_retries=max_retries, timeout=timeout, http_client=http_client, custom_headers=default_headers, custom_query=default_query, _strict_response_validation=_strict_response_validation) self.agencies_with_coverage = agencies_with_coverage.AsyncAgenciesWithCoverageResource(self) self.agency = agency.AsyncAgencyResource(self) @@ -435,42 +345,33 @@ def auth_headers(self) -> dict[str, str]: @override def default_headers(self) -> dict[str, str | Omit]: return { - **super().default_headers, - "X-Stainless-Async": f"async:{get_async_library()}", - **self._custom_headers, + **super().default_headers, + "X-Stainless-Async": f'async:{get_async_library()}', + **self._custom_headers, } @property @override def default_query(self) -> dict[str, object]: return { - **super().default_query, - "key": self.api_key, - **self._custom_query, + **super().default_query, + "key": self.api_key, + **self._custom_query, } - def copy( - self, - *, - api_key: str | None = None, - base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, - default_headers: Mapping[str, str] | None = None, - set_default_headers: Mapping[str, str] | None = None, - default_query: Mapping[str, object] | None = None, - set_default_query: Mapping[str, object] | None = None, - _extra_kwargs: Mapping[str, Any] = {}, - ) -> Self: + def copy(self, *, api_key: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, max_retries: int | NotGiven = NOT_GIVEN, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, set_default_query: Mapping[str, object] | None = None, _extra_kwargs: Mapping[str, Any] = {}) -> Self: """ Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + raise ValueError( + 'The `default_headers` and `set_default_headers` arguments are mutually exclusive' + ) if default_query is not None and set_default_query is not None: - raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + raise ValueError( + 'The `default_query` and `set_default_query` arguments are mutually exclusive' + ) headers = self._custom_headers if default_headers is not None: @@ -485,29 +386,14 @@ def copy( params = set_default_query http_client = http_client or self._client - return self.__class__( - api_key=api_key or self.api_key, - base_url=base_url or self.base_url, - timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, - http_client=http_client, - max_retries=max_retries if is_given(max_retries) else self.max_retries, - default_headers=headers, - default_query=params, - **_extra_kwargs, - ) + return self.__class__(api_key = api_key or self.api_key, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, max_retries=max_retries if is_given(max_retries) else self.max_retries, default_headers=headers, default_query=params, **_extra_kwargs) # Alias for `copy` for nicer inline usage, e.g. # client.with_options(timeout=10).foo.create(...) with_options = copy @override - def _make_status_error( - self, - err_msg: str, - *, - body: object, - response: httpx.Response, - ) -> APIStatusError: + def _make_status_error(self, err_msg: str, *, body: object, response: httpx.Response,) -> APIStatusError: if response.status_code == 400: return _exceptions.BadRequestError(err_msg, response=response, body=body) @@ -533,235 +419,130 @@ def _make_status_error( return _exceptions.InternalServerError(err_msg, response=response, body=body) return APIStatusError(err_msg, response=response, body=body) - class OnebusawaySDKWithRawResponse: def __init__(self, client: OnebusawaySDK) -> None: - self.agencies_with_coverage = agencies_with_coverage.AgenciesWithCoverageResourceWithRawResponse( - client.agencies_with_coverage - ) + self.agencies_with_coverage = agencies_with_coverage.AgenciesWithCoverageResourceWithRawResponse(client.agencies_with_coverage) self.agency = agency.AgencyResourceWithRawResponse(client.agency) - self.vehicles_for_agency = vehicles_for_agency.VehiclesForAgencyResourceWithRawResponse( - client.vehicles_for_agency - ) + self.vehicles_for_agency = vehicles_for_agency.VehiclesForAgencyResourceWithRawResponse(client.vehicles_for_agency) self.config = config.ConfigResourceWithRawResponse(client.config) self.current_time = current_time.CurrentTimeResourceWithRawResponse(client.current_time) self.stops_for_location = stops_for_location.StopsForLocationResourceWithRawResponse(client.stops_for_location) self.stops_for_route = stops_for_route.StopsForRouteResourceWithRawResponse(client.stops_for_route) self.stops_for_agency = stops_for_agency.StopsForAgencyResourceWithRawResponse(client.stops_for_agency) self.stop = stop.StopResourceWithRawResponse(client.stop) - self.stop_ids_for_agency = stop_ids_for_agency.StopIDsForAgencyResourceWithRawResponse( - client.stop_ids_for_agency - ) + self.stop_ids_for_agency = stop_ids_for_agency.StopIDsForAgencyResourceWithRawResponse(client.stop_ids_for_agency) self.schedule_for_stop = schedule_for_stop.ScheduleForStopResourceWithRawResponse(client.schedule_for_stop) self.route = route.RouteResourceWithRawResponse(client.route) - self.route_ids_for_agency = route_ids_for_agency.RouteIDsForAgencyResourceWithRawResponse( - client.route_ids_for_agency - ) - self.routes_for_location = routes_for_location.RoutesForLocationResourceWithRawResponse( - client.routes_for_location - ) + self.route_ids_for_agency = route_ids_for_agency.RouteIDsForAgencyResourceWithRawResponse(client.route_ids_for_agency) + self.routes_for_location = routes_for_location.RoutesForLocationResourceWithRawResponse(client.routes_for_location) self.routes_for_agency = routes_for_agency.RoutesForAgencyResourceWithRawResponse(client.routes_for_agency) self.schedule_for_route = schedule_for_route.ScheduleForRouteResourceWithRawResponse(client.schedule_for_route) - self.arrival_and_departure = arrival_and_departure.ArrivalAndDepartureResourceWithRawResponse( - client.arrival_and_departure - ) + self.arrival_and_departure = arrival_and_departure.ArrivalAndDepartureResourceWithRawResponse(client.arrival_and_departure) self.trip = trip.TripResourceWithRawResponse(client.trip) self.trips_for_location = trips_for_location.TripsForLocationResourceWithRawResponse(client.trips_for_location) self.trip_details = trip_details.TripDetailsResourceWithRawResponse(client.trip_details) self.trip_for_vehicle = trip_for_vehicle.TripForVehicleResourceWithRawResponse(client.trip_for_vehicle) self.trips_for_route = trips_for_route.TripsForRouteResourceWithRawResponse(client.trips_for_route) - self.report_problem_with_stop = report_problem_with_stop.ReportProblemWithStopResourceWithRawResponse( - client.report_problem_with_stop - ) - self.report_problem_with_trip = report_problem_with_trip.ReportProblemWithTripResourceWithRawResponse( - client.report_problem_with_trip - ) + self.report_problem_with_stop = report_problem_with_stop.ReportProblemWithStopResourceWithRawResponse(client.report_problem_with_stop) + self.report_problem_with_trip = report_problem_with_trip.ReportProblemWithTripResourceWithRawResponse(client.report_problem_with_trip) self.search_for_stop = search_for_stop.SearchForStopResourceWithRawResponse(client.search_for_stop) self.search_for_route = search_for_route.SearchForRouteResourceWithRawResponse(client.search_for_route) self.block = block.BlockResourceWithRawResponse(client.block) self.shape = shape.ShapeResourceWithRawResponse(client.shape) - class AsyncOnebusawaySDKWithRawResponse: def __init__(self, client: AsyncOnebusawaySDK) -> None: - self.agencies_with_coverage = agencies_with_coverage.AsyncAgenciesWithCoverageResourceWithRawResponse( - client.agencies_with_coverage - ) + self.agencies_with_coverage = agencies_with_coverage.AsyncAgenciesWithCoverageResourceWithRawResponse(client.agencies_with_coverage) self.agency = agency.AsyncAgencyResourceWithRawResponse(client.agency) - self.vehicles_for_agency = vehicles_for_agency.AsyncVehiclesForAgencyResourceWithRawResponse( - client.vehicles_for_agency - ) + self.vehicles_for_agency = vehicles_for_agency.AsyncVehiclesForAgencyResourceWithRawResponse(client.vehicles_for_agency) self.config = config.AsyncConfigResourceWithRawResponse(client.config) self.current_time = current_time.AsyncCurrentTimeResourceWithRawResponse(client.current_time) - self.stops_for_location = stops_for_location.AsyncStopsForLocationResourceWithRawResponse( - client.stops_for_location - ) + self.stops_for_location = stops_for_location.AsyncStopsForLocationResourceWithRawResponse(client.stops_for_location) self.stops_for_route = stops_for_route.AsyncStopsForRouteResourceWithRawResponse(client.stops_for_route) self.stops_for_agency = stops_for_agency.AsyncStopsForAgencyResourceWithRawResponse(client.stops_for_agency) self.stop = stop.AsyncStopResourceWithRawResponse(client.stop) - self.stop_ids_for_agency = stop_ids_for_agency.AsyncStopIDsForAgencyResourceWithRawResponse( - client.stop_ids_for_agency - ) + self.stop_ids_for_agency = stop_ids_for_agency.AsyncStopIDsForAgencyResourceWithRawResponse(client.stop_ids_for_agency) self.schedule_for_stop = schedule_for_stop.AsyncScheduleForStopResourceWithRawResponse(client.schedule_for_stop) self.route = route.AsyncRouteResourceWithRawResponse(client.route) - self.route_ids_for_agency = route_ids_for_agency.AsyncRouteIDsForAgencyResourceWithRawResponse( - client.route_ids_for_agency - ) - self.routes_for_location = routes_for_location.AsyncRoutesForLocationResourceWithRawResponse( - client.routes_for_location - ) + self.route_ids_for_agency = route_ids_for_agency.AsyncRouteIDsForAgencyResourceWithRawResponse(client.route_ids_for_agency) + self.routes_for_location = routes_for_location.AsyncRoutesForLocationResourceWithRawResponse(client.routes_for_location) self.routes_for_agency = routes_for_agency.AsyncRoutesForAgencyResourceWithRawResponse(client.routes_for_agency) - self.schedule_for_route = schedule_for_route.AsyncScheduleForRouteResourceWithRawResponse( - client.schedule_for_route - ) - self.arrival_and_departure = arrival_and_departure.AsyncArrivalAndDepartureResourceWithRawResponse( - client.arrival_and_departure - ) + self.schedule_for_route = schedule_for_route.AsyncScheduleForRouteResourceWithRawResponse(client.schedule_for_route) + self.arrival_and_departure = arrival_and_departure.AsyncArrivalAndDepartureResourceWithRawResponse(client.arrival_and_departure) self.trip = trip.AsyncTripResourceWithRawResponse(client.trip) - self.trips_for_location = trips_for_location.AsyncTripsForLocationResourceWithRawResponse( - client.trips_for_location - ) + self.trips_for_location = trips_for_location.AsyncTripsForLocationResourceWithRawResponse(client.trips_for_location) self.trip_details = trip_details.AsyncTripDetailsResourceWithRawResponse(client.trip_details) self.trip_for_vehicle = trip_for_vehicle.AsyncTripForVehicleResourceWithRawResponse(client.trip_for_vehicle) self.trips_for_route = trips_for_route.AsyncTripsForRouteResourceWithRawResponse(client.trips_for_route) - self.report_problem_with_stop = report_problem_with_stop.AsyncReportProblemWithStopResourceWithRawResponse( - client.report_problem_with_stop - ) - self.report_problem_with_trip = report_problem_with_trip.AsyncReportProblemWithTripResourceWithRawResponse( - client.report_problem_with_trip - ) + self.report_problem_with_stop = report_problem_with_stop.AsyncReportProblemWithStopResourceWithRawResponse(client.report_problem_with_stop) + self.report_problem_with_trip = report_problem_with_trip.AsyncReportProblemWithTripResourceWithRawResponse(client.report_problem_with_trip) self.search_for_stop = search_for_stop.AsyncSearchForStopResourceWithRawResponse(client.search_for_stop) self.search_for_route = search_for_route.AsyncSearchForRouteResourceWithRawResponse(client.search_for_route) self.block = block.AsyncBlockResourceWithRawResponse(client.block) self.shape = shape.AsyncShapeResourceWithRawResponse(client.shape) - class OnebusawaySDKWithStreamedResponse: def __init__(self, client: OnebusawaySDK) -> None: - self.agencies_with_coverage = agencies_with_coverage.AgenciesWithCoverageResourceWithStreamingResponse( - client.agencies_with_coverage - ) + self.agencies_with_coverage = agencies_with_coverage.AgenciesWithCoverageResourceWithStreamingResponse(client.agencies_with_coverage) self.agency = agency.AgencyResourceWithStreamingResponse(client.agency) - self.vehicles_for_agency = vehicles_for_agency.VehiclesForAgencyResourceWithStreamingResponse( - client.vehicles_for_agency - ) + self.vehicles_for_agency = vehicles_for_agency.VehiclesForAgencyResourceWithStreamingResponse(client.vehicles_for_agency) self.config = config.ConfigResourceWithStreamingResponse(client.config) self.current_time = current_time.CurrentTimeResourceWithStreamingResponse(client.current_time) - self.stops_for_location = stops_for_location.StopsForLocationResourceWithStreamingResponse( - client.stops_for_location - ) + self.stops_for_location = stops_for_location.StopsForLocationResourceWithStreamingResponse(client.stops_for_location) self.stops_for_route = stops_for_route.StopsForRouteResourceWithStreamingResponse(client.stops_for_route) self.stops_for_agency = stops_for_agency.StopsForAgencyResourceWithStreamingResponse(client.stops_for_agency) self.stop = stop.StopResourceWithStreamingResponse(client.stop) - self.stop_ids_for_agency = stop_ids_for_agency.StopIDsForAgencyResourceWithStreamingResponse( - client.stop_ids_for_agency - ) - self.schedule_for_stop = schedule_for_stop.ScheduleForStopResourceWithStreamingResponse( - client.schedule_for_stop - ) + self.stop_ids_for_agency = stop_ids_for_agency.StopIDsForAgencyResourceWithStreamingResponse(client.stop_ids_for_agency) + self.schedule_for_stop = schedule_for_stop.ScheduleForStopResourceWithStreamingResponse(client.schedule_for_stop) self.route = route.RouteResourceWithStreamingResponse(client.route) - self.route_ids_for_agency = route_ids_for_agency.RouteIDsForAgencyResourceWithStreamingResponse( - client.route_ids_for_agency - ) - self.routes_for_location = routes_for_location.RoutesForLocationResourceWithStreamingResponse( - client.routes_for_location - ) - self.routes_for_agency = routes_for_agency.RoutesForAgencyResourceWithStreamingResponse( - client.routes_for_agency - ) - self.schedule_for_route = schedule_for_route.ScheduleForRouteResourceWithStreamingResponse( - client.schedule_for_route - ) - self.arrival_and_departure = arrival_and_departure.ArrivalAndDepartureResourceWithStreamingResponse( - client.arrival_and_departure - ) + self.route_ids_for_agency = route_ids_for_agency.RouteIDsForAgencyResourceWithStreamingResponse(client.route_ids_for_agency) + self.routes_for_location = routes_for_location.RoutesForLocationResourceWithStreamingResponse(client.routes_for_location) + self.routes_for_agency = routes_for_agency.RoutesForAgencyResourceWithStreamingResponse(client.routes_for_agency) + self.schedule_for_route = schedule_for_route.ScheduleForRouteResourceWithStreamingResponse(client.schedule_for_route) + self.arrival_and_departure = arrival_and_departure.ArrivalAndDepartureResourceWithStreamingResponse(client.arrival_and_departure) self.trip = trip.TripResourceWithStreamingResponse(client.trip) - self.trips_for_location = trips_for_location.TripsForLocationResourceWithStreamingResponse( - client.trips_for_location - ) + self.trips_for_location = trips_for_location.TripsForLocationResourceWithStreamingResponse(client.trips_for_location) self.trip_details = trip_details.TripDetailsResourceWithStreamingResponse(client.trip_details) self.trip_for_vehicle = trip_for_vehicle.TripForVehicleResourceWithStreamingResponse(client.trip_for_vehicle) self.trips_for_route = trips_for_route.TripsForRouteResourceWithStreamingResponse(client.trips_for_route) - self.report_problem_with_stop = report_problem_with_stop.ReportProblemWithStopResourceWithStreamingResponse( - client.report_problem_with_stop - ) - self.report_problem_with_trip = report_problem_with_trip.ReportProblemWithTripResourceWithStreamingResponse( - client.report_problem_with_trip - ) + self.report_problem_with_stop = report_problem_with_stop.ReportProblemWithStopResourceWithStreamingResponse(client.report_problem_with_stop) + self.report_problem_with_trip = report_problem_with_trip.ReportProblemWithTripResourceWithStreamingResponse(client.report_problem_with_trip) self.search_for_stop = search_for_stop.SearchForStopResourceWithStreamingResponse(client.search_for_stop) self.search_for_route = search_for_route.SearchForRouteResourceWithStreamingResponse(client.search_for_route) self.block = block.BlockResourceWithStreamingResponse(client.block) self.shape = shape.ShapeResourceWithStreamingResponse(client.shape) - class AsyncOnebusawaySDKWithStreamedResponse: def __init__(self, client: AsyncOnebusawaySDK) -> None: - self.agencies_with_coverage = agencies_with_coverage.AsyncAgenciesWithCoverageResourceWithStreamingResponse( - client.agencies_with_coverage - ) + self.agencies_with_coverage = agencies_with_coverage.AsyncAgenciesWithCoverageResourceWithStreamingResponse(client.agencies_with_coverage) self.agency = agency.AsyncAgencyResourceWithStreamingResponse(client.agency) - self.vehicles_for_agency = vehicles_for_agency.AsyncVehiclesForAgencyResourceWithStreamingResponse( - client.vehicles_for_agency - ) + self.vehicles_for_agency = vehicles_for_agency.AsyncVehiclesForAgencyResourceWithStreamingResponse(client.vehicles_for_agency) self.config = config.AsyncConfigResourceWithStreamingResponse(client.config) self.current_time = current_time.AsyncCurrentTimeResourceWithStreamingResponse(client.current_time) - self.stops_for_location = stops_for_location.AsyncStopsForLocationResourceWithStreamingResponse( - client.stops_for_location - ) + self.stops_for_location = stops_for_location.AsyncStopsForLocationResourceWithStreamingResponse(client.stops_for_location) self.stops_for_route = stops_for_route.AsyncStopsForRouteResourceWithStreamingResponse(client.stops_for_route) - self.stops_for_agency = stops_for_agency.AsyncStopsForAgencyResourceWithStreamingResponse( - client.stops_for_agency - ) + self.stops_for_agency = stops_for_agency.AsyncStopsForAgencyResourceWithStreamingResponse(client.stops_for_agency) self.stop = stop.AsyncStopResourceWithStreamingResponse(client.stop) - self.stop_ids_for_agency = stop_ids_for_agency.AsyncStopIDsForAgencyResourceWithStreamingResponse( - client.stop_ids_for_agency - ) - self.schedule_for_stop = schedule_for_stop.AsyncScheduleForStopResourceWithStreamingResponse( - client.schedule_for_stop - ) + self.stop_ids_for_agency = stop_ids_for_agency.AsyncStopIDsForAgencyResourceWithStreamingResponse(client.stop_ids_for_agency) + self.schedule_for_stop = schedule_for_stop.AsyncScheduleForStopResourceWithStreamingResponse(client.schedule_for_stop) self.route = route.AsyncRouteResourceWithStreamingResponse(client.route) - self.route_ids_for_agency = route_ids_for_agency.AsyncRouteIDsForAgencyResourceWithStreamingResponse( - client.route_ids_for_agency - ) - self.routes_for_location = routes_for_location.AsyncRoutesForLocationResourceWithStreamingResponse( - client.routes_for_location - ) - self.routes_for_agency = routes_for_agency.AsyncRoutesForAgencyResourceWithStreamingResponse( - client.routes_for_agency - ) - self.schedule_for_route = schedule_for_route.AsyncScheduleForRouteResourceWithStreamingResponse( - client.schedule_for_route - ) - self.arrival_and_departure = arrival_and_departure.AsyncArrivalAndDepartureResourceWithStreamingResponse( - client.arrival_and_departure - ) + self.route_ids_for_agency = route_ids_for_agency.AsyncRouteIDsForAgencyResourceWithStreamingResponse(client.route_ids_for_agency) + self.routes_for_location = routes_for_location.AsyncRoutesForLocationResourceWithStreamingResponse(client.routes_for_location) + self.routes_for_agency = routes_for_agency.AsyncRoutesForAgencyResourceWithStreamingResponse(client.routes_for_agency) + self.schedule_for_route = schedule_for_route.AsyncScheduleForRouteResourceWithStreamingResponse(client.schedule_for_route) + self.arrival_and_departure = arrival_and_departure.AsyncArrivalAndDepartureResourceWithStreamingResponse(client.arrival_and_departure) self.trip = trip.AsyncTripResourceWithStreamingResponse(client.trip) - self.trips_for_location = trips_for_location.AsyncTripsForLocationResourceWithStreamingResponse( - client.trips_for_location - ) + self.trips_for_location = trips_for_location.AsyncTripsForLocationResourceWithStreamingResponse(client.trips_for_location) self.trip_details = trip_details.AsyncTripDetailsResourceWithStreamingResponse(client.trip_details) - self.trip_for_vehicle = trip_for_vehicle.AsyncTripForVehicleResourceWithStreamingResponse( - client.trip_for_vehicle - ) + self.trip_for_vehicle = trip_for_vehicle.AsyncTripForVehicleResourceWithStreamingResponse(client.trip_for_vehicle) self.trips_for_route = trips_for_route.AsyncTripsForRouteResourceWithStreamingResponse(client.trips_for_route) - self.report_problem_with_stop = ( - report_problem_with_stop.AsyncReportProblemWithStopResourceWithStreamingResponse( - client.report_problem_with_stop - ) - ) - self.report_problem_with_trip = ( - report_problem_with_trip.AsyncReportProblemWithTripResourceWithStreamingResponse( - client.report_problem_with_trip - ) - ) + self.report_problem_with_stop = report_problem_with_stop.AsyncReportProblemWithStopResourceWithStreamingResponse(client.report_problem_with_stop) + self.report_problem_with_trip = report_problem_with_trip.AsyncReportProblemWithTripResourceWithStreamingResponse(client.report_problem_with_trip) self.search_for_stop = search_for_stop.AsyncSearchForStopResourceWithStreamingResponse(client.search_for_stop) - self.search_for_route = search_for_route.AsyncSearchForRouteResourceWithStreamingResponse( - client.search_for_route - ) + self.search_for_route = search_for_route.AsyncSearchForRouteResourceWithStreamingResponse(client.search_for_route) self.block = block.AsyncBlockResourceWithStreamingResponse(client.block) self.shape = shape.AsyncShapeResourceWithStreamingResponse(client.shape) - Client = OnebusawaySDK -AsyncClient = AsyncOnebusawaySDK +AsyncClient = AsyncOnebusawaySDK \ No newline at end of file diff --git a/src/onebusaway/_constants.py b/src/onebusaway/_constants.py index 6ddf2c7..f32ba27 100644 --- a/src/onebusaway/_constants.py +++ b/src/onebusaway/_constants.py @@ -11,4 +11,4 @@ DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) INITIAL_RETRY_DELAY = 0.5 -MAX_RETRY_DELAY = 8.0 +MAX_RETRY_DELAY = 8.0 \ No newline at end of file diff --git a/src/onebusaway/_exceptions.py b/src/onebusaway/_exceptions.py index c76aabb..af310bb 100644 --- a/src/onebusaway/_exceptions.py +++ b/src/onebusaway/_exceptions.py @@ -2,26 +2,15 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx -__all__ = [ - "BadRequestError", - "AuthenticationError", - "PermissionDeniedError", - "NotFoundError", - "ConflictError", - "UnprocessableEntityError", - "RateLimitError", - "InternalServerError", -] +from typing_extensions import Literal +__all__ = ["BadRequestError", "AuthenticationError", "PermissionDeniedError", "NotFoundError", "ConflictError", "UnprocessableEntityError", "RateLimitError", "InternalServerError"] class OnebusawaySDKError(Exception): pass - class APIError(OnebusawaySDKError): message: str request: httpx.Request @@ -43,7 +32,6 @@ def __init__(self, message: str, request: httpx.Request, *, body: object | None) self.message = message self.body = body - class APIResponseValidationError(APIError): response: httpx.Response status_code: int @@ -53,10 +41,8 @@ def __init__(self, response: httpx.Response, body: object | None, *, message: st self.response = response self.status_code = response.status_code - class APIStatusError(APIError): """Raised when an API response has a status code of 4xx or 5xx.""" - response: httpx.Response status_code: int @@ -65,44 +51,34 @@ def __init__(self, message: str, *, response: httpx.Response, body: object | Non self.response = response self.status_code = response.status_code - class APIConnectionError(APIError): def __init__(self, *, message: str = "Connection error.", request: httpx.Request) -> None: super().__init__(message, request, body=None) - class APITimeoutError(APIConnectionError): def __init__(self, request: httpx.Request) -> None: - super().__init__(message="Request timed out.", request=request) - + super().__init__(message= "Request timed out.", request=request) class BadRequestError(APIStatusError): - status_code: Literal[400] = 400 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[400] = 400 # pyright: ignore[reportIncompatibleVariableOverride] class AuthenticationError(APIStatusError): - status_code: Literal[401] = 401 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[401] = 401 # pyright: ignore[reportIncompatibleVariableOverride] class PermissionDeniedError(APIStatusError): - status_code: Literal[403] = 403 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[403] = 403 # pyright: ignore[reportIncompatibleVariableOverride] class NotFoundError(APIStatusError): - status_code: Literal[404] = 404 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[404] = 404 # pyright: ignore[reportIncompatibleVariableOverride] class ConflictError(APIStatusError): - status_code: Literal[409] = 409 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[409] = 409 # pyright: ignore[reportIncompatibleVariableOverride] class UnprocessableEntityError(APIStatusError): - status_code: Literal[422] = 422 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[422] = 422 # pyright: ignore[reportIncompatibleVariableOverride] class RateLimitError(APIStatusError): - status_code: Literal[429] = 429 # pyright: ignore[reportIncompatibleVariableOverride] - + status_code: Literal[429] = 429 # pyright: ignore[reportIncompatibleVariableOverride] class InternalServerError(APIStatusError): - pass + pass \ No newline at end of file diff --git a/src/onebusaway/_resource.py b/src/onebusaway/_resource.py index 153115b..cda700b 100644 --- a/src/onebusaway/_resource.py +++ b/src/onebusaway/_resource.py @@ -3,13 +3,12 @@ from __future__ import annotations import time -from typing import TYPE_CHECKING - import anyio -if TYPE_CHECKING: - from ._client import OnebusawaySDK, AsyncOnebusawaySDK +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from ._client import OnebusawaySDK, AsyncOnebusawaySDK class SyncAPIResource: _client: OnebusawaySDK @@ -24,8 +23,7 @@ def __init__(self, client: OnebusawaySDK) -> None: self._get_api_list = client.get_api_list def _sleep(self, seconds: float) -> None: - time.sleep(seconds) - + time.sleep(seconds) class AsyncAPIResource: _client: AsyncOnebusawaySDK @@ -40,4 +38,4 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None: self._get_api_list = client.get_api_list async def _sleep(self, seconds: float) -> None: - await anyio.sleep(seconds) + await anyio.sleep(seconds) \ No newline at end of file diff --git a/src/onebusaway/_response.py b/src/onebusaway/_response.py index 16b6f2b..02db195 100644 --- a/src/onebusaway/_response.py +++ b/src/onebusaway/_response.py @@ -25,12 +25,14 @@ import pydantic from ._types import NoneType -from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base +from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base, is_type_alias_type +from ._streaming import extract_stream_chunk_type from ._models import BaseModel, is_basemodel from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type from ._exceptions import OnebusawaySDKError, APIResponseValidationError + if TYPE_CHECKING: from ._models import FinalRequestOptions from ._base_client import BaseClient @@ -138,6 +140,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: origin = get_origin(cast_to) or cast_to + + if self._is_sse_stream: if to: if not is_stream_class_type(to): @@ -197,6 +201,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to == bool: return cast(R, response.text.lower() == "true") + if origin == APIResponse: raise RuntimeError("Unexpected state - cast_to is `APIResponse`") @@ -270,6 +275,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: class APIResponse(BaseAPIResponse[R]): + + @overload def parse(self, *, to: type[_T]) -> _T: ... @@ -372,6 +379,8 @@ def iter_lines(self) -> Iterator[str]: class AsyncAPIResponse(BaseAPIResponse[R]): + + @overload async def parse(self, *, to: type[_T]) -> _T: ... diff --git a/src/onebusaway/_streaming.py b/src/onebusaway/_streaming.py index 957b8da..9b91d7e 100644 --- a/src/onebusaway/_streaming.py +++ b/src/onebusaway/_streaming.py @@ -9,7 +9,9 @@ import httpx -from ._utils import extract_type_var_from_base +from ._utils import is_mapping, is_dict, extract_type_var_from_base +from ._exceptions import APIError +from ._response import APIResponse, AsyncAPIResponse if TYPE_CHECKING: from ._client import OnebusawaySDK, AsyncOnebusawaySDK @@ -53,10 +55,10 @@ def __stream__(self) -> Iterator[_T]: response = self.response process_data = self._client._process_response_data iterator = self._iter_events() - + for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - + # Ensure the entire stream is consumed for _sse in iterator: ... @@ -117,10 +119,10 @@ async def __stream__(self) -> AsyncIterator[_T]: response = self.response process_data = self._client._process_response_data iterator = self._iter_events() - + async for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - + # Ensure the entire stream is consumed async for _sse in iterator: ... diff --git a/src/onebusaway/_types.py b/src/onebusaway/_types.py index a457723..515085c 100644 --- a/src/onebusaway/_types.py +++ b/src/onebusaway/_types.py @@ -1,6 +1,7 @@ from __future__ import annotations from os import PathLike +from abc import ABC, abstractmethod from typing import ( IO, TYPE_CHECKING, @@ -13,8 +14,10 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, + AsyncIterator, ) from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable @@ -25,6 +28,7 @@ if TYPE_CHECKING: from ._models import BaseModel from ._response import APIResponse, AsyncAPIResponse + from ._legacy_response import HttpxBinaryResponseContent Transport = BaseTransport AsyncTransport = AsyncBaseTransport diff --git a/src/onebusaway/_utils/_typing.py b/src/onebusaway/_utils/_typing.py index 278749b..5e9600b 100644 --- a/src/onebusaway/_utils/_typing.py +++ b/src/onebusaway/_utils/_typing.py @@ -49,17 +49,16 @@ def is_typevar(typ: type) -> bool: if sys.version_info >= (3, 12): _TYPE_ALIAS_TYPES = (*_TYPE_ALIAS_TYPES, typing.TypeAliasType) - def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]: """Return whether the provided argument is an instance of `TypeAliasType`. ```python type Int = int is_type_alias_type(Int) - # > True - Str = TypeAliasType("Str", str) + #> True + Str = TypeAliasType('Str', str) is_type_alias_type(Str) - # > True + #> True ``` """ return isinstance(tp, _TYPE_ALIAS_TYPES) diff --git a/src/onebusaway/resources/__init__.py b/src/onebusaway/resources/__init__.py index 0a958d2..3482e97 100644 --- a/src/onebusaway/resources/__init__.py +++ b/src/onebusaway/resources/__init__.py @@ -1,397 +1,60 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .stop import ( - StopResource, - AsyncStopResource, - StopResourceWithRawResponse, - AsyncStopResourceWithRawResponse, - StopResourceWithStreamingResponse, - AsyncStopResourceWithStreamingResponse, -) -from .trip import ( - TripResource, - AsyncTripResource, - TripResourceWithRawResponse, - AsyncTripResourceWithRawResponse, - TripResourceWithStreamingResponse, - AsyncTripResourceWithStreamingResponse, -) -from .block import ( - BlockResource, - AsyncBlockResource, - BlockResourceWithRawResponse, - AsyncBlockResourceWithRawResponse, - BlockResourceWithStreamingResponse, - AsyncBlockResourceWithStreamingResponse, -) -from .route import ( - RouteResource, - AsyncRouteResource, - RouteResourceWithRawResponse, - AsyncRouteResourceWithRawResponse, - RouteResourceWithStreamingResponse, - AsyncRouteResourceWithStreamingResponse, -) -from .shape import ( - ShapeResource, - AsyncShapeResource, - ShapeResourceWithRawResponse, - AsyncShapeResourceWithRawResponse, - ShapeResourceWithStreamingResponse, - AsyncShapeResourceWithStreamingResponse, -) -from .agency import ( - AgencyResource, - AsyncAgencyResource, - AgencyResourceWithRawResponse, - AsyncAgencyResourceWithRawResponse, - AgencyResourceWithStreamingResponse, - AsyncAgencyResourceWithStreamingResponse, -) -from .config import ( - ConfigResource, - AsyncConfigResource, - ConfigResourceWithRawResponse, - AsyncConfigResourceWithRawResponse, - ConfigResourceWithStreamingResponse, - AsyncConfigResourceWithStreamingResponse, -) -from .current_time import ( - CurrentTimeResource, - AsyncCurrentTimeResource, - CurrentTimeResourceWithRawResponse, - AsyncCurrentTimeResourceWithRawResponse, - CurrentTimeResourceWithStreamingResponse, - AsyncCurrentTimeResourceWithStreamingResponse, -) -from .trip_details import ( - TripDetailsResource, - AsyncTripDetailsResource, - TripDetailsResourceWithRawResponse, - AsyncTripDetailsResourceWithRawResponse, - TripDetailsResourceWithStreamingResponse, - AsyncTripDetailsResourceWithStreamingResponse, -) -from .search_for_stop import ( - SearchForStopResource, - AsyncSearchForStopResource, - SearchForStopResourceWithRawResponse, - AsyncSearchForStopResourceWithRawResponse, - SearchForStopResourceWithStreamingResponse, - AsyncSearchForStopResourceWithStreamingResponse, -) -from .stops_for_route import ( - StopsForRouteResource, - AsyncStopsForRouteResource, - StopsForRouteResourceWithRawResponse, - AsyncStopsForRouteResourceWithRawResponse, - StopsForRouteResourceWithStreamingResponse, - AsyncStopsForRouteResourceWithStreamingResponse, -) -from .trips_for_route import ( - TripsForRouteResource, - AsyncTripsForRouteResource, - TripsForRouteResourceWithRawResponse, - AsyncTripsForRouteResourceWithRawResponse, - TripsForRouteResourceWithStreamingResponse, - AsyncTripsForRouteResourceWithStreamingResponse, -) -from .search_for_route import ( - SearchForRouteResource, - AsyncSearchForRouteResource, - SearchForRouteResourceWithRawResponse, - AsyncSearchForRouteResourceWithRawResponse, - SearchForRouteResourceWithStreamingResponse, - AsyncSearchForRouteResourceWithStreamingResponse, -) -from .stops_for_agency import ( - StopsForAgencyResource, - AsyncStopsForAgencyResource, - StopsForAgencyResourceWithRawResponse, - AsyncStopsForAgencyResourceWithRawResponse, - StopsForAgencyResourceWithStreamingResponse, - AsyncStopsForAgencyResourceWithStreamingResponse, -) -from .trip_for_vehicle import ( - TripForVehicleResource, - AsyncTripForVehicleResource, - TripForVehicleResourceWithRawResponse, - AsyncTripForVehicleResourceWithRawResponse, - TripForVehicleResourceWithStreamingResponse, - AsyncTripForVehicleResourceWithStreamingResponse, -) -from .routes_for_agency import ( - RoutesForAgencyResource, - AsyncRoutesForAgencyResource, - RoutesForAgencyResourceWithRawResponse, - AsyncRoutesForAgencyResourceWithRawResponse, - RoutesForAgencyResourceWithStreamingResponse, - AsyncRoutesForAgencyResourceWithStreamingResponse, -) -from .schedule_for_stop import ( - ScheduleForStopResource, - AsyncScheduleForStopResource, - ScheduleForStopResourceWithRawResponse, - AsyncScheduleForStopResourceWithRawResponse, - ScheduleForStopResourceWithStreamingResponse, - AsyncScheduleForStopResourceWithStreamingResponse, -) -from .schedule_for_route import ( - ScheduleForRouteResource, - AsyncScheduleForRouteResource, - ScheduleForRouteResourceWithRawResponse, - AsyncScheduleForRouteResourceWithRawResponse, - ScheduleForRouteResourceWithStreamingResponse, - AsyncScheduleForRouteResourceWithStreamingResponse, -) -from .stops_for_location import ( - StopsForLocationResource, - AsyncStopsForLocationResource, - StopsForLocationResourceWithRawResponse, - AsyncStopsForLocationResourceWithRawResponse, - StopsForLocationResourceWithStreamingResponse, - AsyncStopsForLocationResourceWithStreamingResponse, -) -from .trips_for_location import ( - TripsForLocationResource, - AsyncTripsForLocationResource, - TripsForLocationResourceWithRawResponse, - AsyncTripsForLocationResourceWithRawResponse, - TripsForLocationResourceWithStreamingResponse, - AsyncTripsForLocationResourceWithStreamingResponse, -) -from .routes_for_location import ( - RoutesForLocationResource, - AsyncRoutesForLocationResource, - RoutesForLocationResourceWithRawResponse, - AsyncRoutesForLocationResourceWithRawResponse, - RoutesForLocationResourceWithStreamingResponse, - AsyncRoutesForLocationResourceWithStreamingResponse, -) -from .stop_ids_for_agency import ( - StopIDsForAgencyResource, - AsyncStopIDsForAgencyResource, - StopIDsForAgencyResourceWithRawResponse, - AsyncStopIDsForAgencyResourceWithRawResponse, - StopIDsForAgencyResourceWithStreamingResponse, - AsyncStopIDsForAgencyResourceWithStreamingResponse, -) -from .vehicles_for_agency import ( - VehiclesForAgencyResource, - AsyncVehiclesForAgencyResource, - VehiclesForAgencyResourceWithRawResponse, - AsyncVehiclesForAgencyResourceWithRawResponse, - VehiclesForAgencyResourceWithStreamingResponse, - AsyncVehiclesForAgencyResourceWithStreamingResponse, -) -from .route_ids_for_agency import ( - RouteIDsForAgencyResource, - AsyncRouteIDsForAgencyResource, - RouteIDsForAgencyResourceWithRawResponse, - AsyncRouteIDsForAgencyResourceWithRawResponse, - RouteIDsForAgencyResourceWithStreamingResponse, - AsyncRouteIDsForAgencyResourceWithStreamingResponse, -) -from .arrival_and_departure import ( - ArrivalAndDepartureResource, - AsyncArrivalAndDepartureResource, - ArrivalAndDepartureResourceWithRawResponse, - AsyncArrivalAndDepartureResourceWithRawResponse, - ArrivalAndDepartureResourceWithStreamingResponse, - AsyncArrivalAndDepartureResourceWithStreamingResponse, -) -from .agencies_with_coverage import ( - AgenciesWithCoverageResource, - AsyncAgenciesWithCoverageResource, - AgenciesWithCoverageResourceWithRawResponse, - AsyncAgenciesWithCoverageResourceWithRawResponse, - AgenciesWithCoverageResourceWithStreamingResponse, - AsyncAgenciesWithCoverageResourceWithStreamingResponse, -) -from .report_problem_with_stop import ( - ReportProblemWithStopResource, - AsyncReportProblemWithStopResource, - ReportProblemWithStopResourceWithRawResponse, - AsyncReportProblemWithStopResourceWithRawResponse, - ReportProblemWithStopResourceWithStreamingResponse, - AsyncReportProblemWithStopResourceWithStreamingResponse, -) -from .report_problem_with_trip import ( - ReportProblemWithTripResource, - AsyncReportProblemWithTripResource, - ReportProblemWithTripResourceWithRawResponse, - AsyncReportProblemWithTripResourceWithRawResponse, - ReportProblemWithTripResourceWithStreamingResponse, - AsyncReportProblemWithTripResourceWithStreamingResponse, -) +from .agencies_with_coverage import AgenciesWithCoverageResource, AsyncAgenciesWithCoverageResource +from .agencies_with_coverage import AgenciesWithCoverageResourceWithRawResponse, AsyncAgenciesWithCoverageResourceWithRawResponse, AgenciesWithCoverageResourceWithStreamingResponse, AsyncAgenciesWithCoverageResourceWithStreamingResponse +from .agency import AgencyResource, AsyncAgencyResource +from .agency import AgencyResourceWithRawResponse, AsyncAgencyResourceWithRawResponse, AgencyResourceWithStreamingResponse, AsyncAgencyResourceWithStreamingResponse +from .vehicles_for_agency import VehiclesForAgencyResource, AsyncVehiclesForAgencyResource +from .vehicles_for_agency import VehiclesForAgencyResourceWithRawResponse, AsyncVehiclesForAgencyResourceWithRawResponse, VehiclesForAgencyResourceWithStreamingResponse, AsyncVehiclesForAgencyResourceWithStreamingResponse +from .config import ConfigResource, AsyncConfigResource +from .config import ConfigResourceWithRawResponse, AsyncConfigResourceWithRawResponse, ConfigResourceWithStreamingResponse, AsyncConfigResourceWithStreamingResponse +from .current_time import CurrentTimeResource, AsyncCurrentTimeResource +from .current_time import CurrentTimeResourceWithRawResponse, AsyncCurrentTimeResourceWithRawResponse, CurrentTimeResourceWithStreamingResponse, AsyncCurrentTimeResourceWithStreamingResponse +from .stops_for_location import StopsForLocationResource, AsyncStopsForLocationResource +from .stops_for_location import StopsForLocationResourceWithRawResponse, AsyncStopsForLocationResourceWithRawResponse, StopsForLocationResourceWithStreamingResponse, AsyncStopsForLocationResourceWithStreamingResponse +from .stops_for_route import StopsForRouteResource, AsyncStopsForRouteResource +from .stops_for_route import StopsForRouteResourceWithRawResponse, AsyncStopsForRouteResourceWithRawResponse, StopsForRouteResourceWithStreamingResponse, AsyncStopsForRouteResourceWithStreamingResponse +from .stops_for_agency import StopsForAgencyResource, AsyncStopsForAgencyResource +from .stops_for_agency import StopsForAgencyResourceWithRawResponse, AsyncStopsForAgencyResourceWithRawResponse, StopsForAgencyResourceWithStreamingResponse, AsyncStopsForAgencyResourceWithStreamingResponse +from .stop import StopResource, AsyncStopResource +from .stop import StopResourceWithRawResponse, AsyncStopResourceWithRawResponse, StopResourceWithStreamingResponse, AsyncStopResourceWithStreamingResponse +from .stop_ids_for_agency import StopIDsForAgencyResource, AsyncStopIDsForAgencyResource +from .stop_ids_for_agency import StopIDsForAgencyResourceWithRawResponse, AsyncStopIDsForAgencyResourceWithRawResponse, StopIDsForAgencyResourceWithStreamingResponse, AsyncStopIDsForAgencyResourceWithStreamingResponse +from .schedule_for_stop import ScheduleForStopResource, AsyncScheduleForStopResource +from .schedule_for_stop import ScheduleForStopResourceWithRawResponse, AsyncScheduleForStopResourceWithRawResponse, ScheduleForStopResourceWithStreamingResponse, AsyncScheduleForStopResourceWithStreamingResponse +from .route import RouteResource, AsyncRouteResource +from .route import RouteResourceWithRawResponse, AsyncRouteResourceWithRawResponse, RouteResourceWithStreamingResponse, AsyncRouteResourceWithStreamingResponse +from .route_ids_for_agency import RouteIDsForAgencyResource, AsyncRouteIDsForAgencyResource +from .route_ids_for_agency import RouteIDsForAgencyResourceWithRawResponse, AsyncRouteIDsForAgencyResourceWithRawResponse, RouteIDsForAgencyResourceWithStreamingResponse, AsyncRouteIDsForAgencyResourceWithStreamingResponse +from .routes_for_location import RoutesForLocationResource, AsyncRoutesForLocationResource +from .routes_for_location import RoutesForLocationResourceWithRawResponse, AsyncRoutesForLocationResourceWithRawResponse, RoutesForLocationResourceWithStreamingResponse, AsyncRoutesForLocationResourceWithStreamingResponse +from .routes_for_agency import RoutesForAgencyResource, AsyncRoutesForAgencyResource +from .routes_for_agency import RoutesForAgencyResourceWithRawResponse, AsyncRoutesForAgencyResourceWithRawResponse, RoutesForAgencyResourceWithStreamingResponse, AsyncRoutesForAgencyResourceWithStreamingResponse +from .schedule_for_route import ScheduleForRouteResource, AsyncScheduleForRouteResource +from .schedule_for_route import ScheduleForRouteResourceWithRawResponse, AsyncScheduleForRouteResourceWithRawResponse, ScheduleForRouteResourceWithStreamingResponse, AsyncScheduleForRouteResourceWithStreamingResponse +from .arrival_and_departure import ArrivalAndDepartureResource, AsyncArrivalAndDepartureResource +from .arrival_and_departure import ArrivalAndDepartureResourceWithRawResponse, AsyncArrivalAndDepartureResourceWithRawResponse, ArrivalAndDepartureResourceWithStreamingResponse, AsyncArrivalAndDepartureResourceWithStreamingResponse +from .trip import TripResource, AsyncTripResource +from .trip import TripResourceWithRawResponse, AsyncTripResourceWithRawResponse, TripResourceWithStreamingResponse, AsyncTripResourceWithStreamingResponse +from .trips_for_location import TripsForLocationResource, AsyncTripsForLocationResource +from .trips_for_location import TripsForLocationResourceWithRawResponse, AsyncTripsForLocationResourceWithRawResponse, TripsForLocationResourceWithStreamingResponse, AsyncTripsForLocationResourceWithStreamingResponse +from .trip_details import TripDetailsResource, AsyncTripDetailsResource +from .trip_details import TripDetailsResourceWithRawResponse, AsyncTripDetailsResourceWithRawResponse, TripDetailsResourceWithStreamingResponse, AsyncTripDetailsResourceWithStreamingResponse +from .trip_for_vehicle import TripForVehicleResource, AsyncTripForVehicleResource +from .trip_for_vehicle import TripForVehicleResourceWithRawResponse, AsyncTripForVehicleResourceWithRawResponse, TripForVehicleResourceWithStreamingResponse, AsyncTripForVehicleResourceWithStreamingResponse +from .trips_for_route import TripsForRouteResource, AsyncTripsForRouteResource +from .trips_for_route import TripsForRouteResourceWithRawResponse, AsyncTripsForRouteResourceWithRawResponse, TripsForRouteResourceWithStreamingResponse, AsyncTripsForRouteResourceWithStreamingResponse +from .report_problem_with_stop import ReportProblemWithStopResource, AsyncReportProblemWithStopResource +from .report_problem_with_stop import ReportProblemWithStopResourceWithRawResponse, AsyncReportProblemWithStopResourceWithRawResponse, ReportProblemWithStopResourceWithStreamingResponse, AsyncReportProblemWithStopResourceWithStreamingResponse +from .report_problem_with_trip import ReportProblemWithTripResource, AsyncReportProblemWithTripResource +from .report_problem_with_trip import ReportProblemWithTripResourceWithRawResponse, AsyncReportProblemWithTripResourceWithRawResponse, ReportProblemWithTripResourceWithStreamingResponse, AsyncReportProblemWithTripResourceWithStreamingResponse +from .search_for_stop import SearchForStopResource, AsyncSearchForStopResource +from .search_for_stop import SearchForStopResourceWithRawResponse, AsyncSearchForStopResourceWithRawResponse, SearchForStopResourceWithStreamingResponse, AsyncSearchForStopResourceWithStreamingResponse +from .search_for_route import SearchForRouteResource, AsyncSearchForRouteResource +from .search_for_route import SearchForRouteResourceWithRawResponse, AsyncSearchForRouteResourceWithRawResponse, SearchForRouteResourceWithStreamingResponse, AsyncSearchForRouteResourceWithStreamingResponse +from .block import BlockResource, AsyncBlockResource +from .block import BlockResourceWithRawResponse, AsyncBlockResourceWithRawResponse, BlockResourceWithStreamingResponse, AsyncBlockResourceWithStreamingResponse +from .shape import ShapeResource, AsyncShapeResource +from .shape import ShapeResourceWithRawResponse, AsyncShapeResourceWithRawResponse, ShapeResourceWithStreamingResponse, AsyncShapeResourceWithStreamingResponse -__all__ = [ - "AgenciesWithCoverageResource", - "AsyncAgenciesWithCoverageResource", - "AgenciesWithCoverageResourceWithRawResponse", - "AsyncAgenciesWithCoverageResourceWithRawResponse", - "AgenciesWithCoverageResourceWithStreamingResponse", - "AsyncAgenciesWithCoverageResourceWithStreamingResponse", - "AgencyResource", - "AsyncAgencyResource", - "AgencyResourceWithRawResponse", - "AsyncAgencyResourceWithRawResponse", - "AgencyResourceWithStreamingResponse", - "AsyncAgencyResourceWithStreamingResponse", - "VehiclesForAgencyResource", - "AsyncVehiclesForAgencyResource", - "VehiclesForAgencyResourceWithRawResponse", - "AsyncVehiclesForAgencyResourceWithRawResponse", - "VehiclesForAgencyResourceWithStreamingResponse", - "AsyncVehiclesForAgencyResourceWithStreamingResponse", - "ConfigResource", - "AsyncConfigResource", - "ConfigResourceWithRawResponse", - "AsyncConfigResourceWithRawResponse", - "ConfigResourceWithStreamingResponse", - "AsyncConfigResourceWithStreamingResponse", - "CurrentTimeResource", - "AsyncCurrentTimeResource", - "CurrentTimeResourceWithRawResponse", - "AsyncCurrentTimeResourceWithRawResponse", - "CurrentTimeResourceWithStreamingResponse", - "AsyncCurrentTimeResourceWithStreamingResponse", - "StopsForLocationResource", - "AsyncStopsForLocationResource", - "StopsForLocationResourceWithRawResponse", - "AsyncStopsForLocationResourceWithRawResponse", - "StopsForLocationResourceWithStreamingResponse", - "AsyncStopsForLocationResourceWithStreamingResponse", - "StopsForRouteResource", - "AsyncStopsForRouteResource", - "StopsForRouteResourceWithRawResponse", - "AsyncStopsForRouteResourceWithRawResponse", - "StopsForRouteResourceWithStreamingResponse", - "AsyncStopsForRouteResourceWithStreamingResponse", - "StopsForAgencyResource", - "AsyncStopsForAgencyResource", - "StopsForAgencyResourceWithRawResponse", - "AsyncStopsForAgencyResourceWithRawResponse", - "StopsForAgencyResourceWithStreamingResponse", - "AsyncStopsForAgencyResourceWithStreamingResponse", - "StopResource", - "AsyncStopResource", - "StopResourceWithRawResponse", - "AsyncStopResourceWithRawResponse", - "StopResourceWithStreamingResponse", - "AsyncStopResourceWithStreamingResponse", - "StopIDsForAgencyResource", - "AsyncStopIDsForAgencyResource", - "StopIDsForAgencyResourceWithRawResponse", - "AsyncStopIDsForAgencyResourceWithRawResponse", - "StopIDsForAgencyResourceWithStreamingResponse", - "AsyncStopIDsForAgencyResourceWithStreamingResponse", - "ScheduleForStopResource", - "AsyncScheduleForStopResource", - "ScheduleForStopResourceWithRawResponse", - "AsyncScheduleForStopResourceWithRawResponse", - "ScheduleForStopResourceWithStreamingResponse", - "AsyncScheduleForStopResourceWithStreamingResponse", - "RouteResource", - "AsyncRouteResource", - "RouteResourceWithRawResponse", - "AsyncRouteResourceWithRawResponse", - "RouteResourceWithStreamingResponse", - "AsyncRouteResourceWithStreamingResponse", - "RouteIDsForAgencyResource", - "AsyncRouteIDsForAgencyResource", - "RouteIDsForAgencyResourceWithRawResponse", - "AsyncRouteIDsForAgencyResourceWithRawResponse", - "RouteIDsForAgencyResourceWithStreamingResponse", - "AsyncRouteIDsForAgencyResourceWithStreamingResponse", - "RoutesForLocationResource", - "AsyncRoutesForLocationResource", - "RoutesForLocationResourceWithRawResponse", - "AsyncRoutesForLocationResourceWithRawResponse", - "RoutesForLocationResourceWithStreamingResponse", - "AsyncRoutesForLocationResourceWithStreamingResponse", - "RoutesForAgencyResource", - "AsyncRoutesForAgencyResource", - "RoutesForAgencyResourceWithRawResponse", - "AsyncRoutesForAgencyResourceWithRawResponse", - "RoutesForAgencyResourceWithStreamingResponse", - "AsyncRoutesForAgencyResourceWithStreamingResponse", - "ScheduleForRouteResource", - "AsyncScheduleForRouteResource", - "ScheduleForRouteResourceWithRawResponse", - "AsyncScheduleForRouteResourceWithRawResponse", - "ScheduleForRouteResourceWithStreamingResponse", - "AsyncScheduleForRouteResourceWithStreamingResponse", - "ArrivalAndDepartureResource", - "AsyncArrivalAndDepartureResource", - "ArrivalAndDepartureResourceWithRawResponse", - "AsyncArrivalAndDepartureResourceWithRawResponse", - "ArrivalAndDepartureResourceWithStreamingResponse", - "AsyncArrivalAndDepartureResourceWithStreamingResponse", - "TripResource", - "AsyncTripResource", - "TripResourceWithRawResponse", - "AsyncTripResourceWithRawResponse", - "TripResourceWithStreamingResponse", - "AsyncTripResourceWithStreamingResponse", - "TripsForLocationResource", - "AsyncTripsForLocationResource", - "TripsForLocationResourceWithRawResponse", - "AsyncTripsForLocationResourceWithRawResponse", - "TripsForLocationResourceWithStreamingResponse", - "AsyncTripsForLocationResourceWithStreamingResponse", - "TripDetailsResource", - "AsyncTripDetailsResource", - "TripDetailsResourceWithRawResponse", - "AsyncTripDetailsResourceWithRawResponse", - "TripDetailsResourceWithStreamingResponse", - "AsyncTripDetailsResourceWithStreamingResponse", - "TripForVehicleResource", - "AsyncTripForVehicleResource", - "TripForVehicleResourceWithRawResponse", - "AsyncTripForVehicleResourceWithRawResponse", - "TripForVehicleResourceWithStreamingResponse", - "AsyncTripForVehicleResourceWithStreamingResponse", - "TripsForRouteResource", - "AsyncTripsForRouteResource", - "TripsForRouteResourceWithRawResponse", - "AsyncTripsForRouteResourceWithRawResponse", - "TripsForRouteResourceWithStreamingResponse", - "AsyncTripsForRouteResourceWithStreamingResponse", - "ReportProblemWithStopResource", - "AsyncReportProblemWithStopResource", - "ReportProblemWithStopResourceWithRawResponse", - "AsyncReportProblemWithStopResourceWithRawResponse", - "ReportProblemWithStopResourceWithStreamingResponse", - "AsyncReportProblemWithStopResourceWithStreamingResponse", - "ReportProblemWithTripResource", - "AsyncReportProblemWithTripResource", - "ReportProblemWithTripResourceWithRawResponse", - "AsyncReportProblemWithTripResourceWithRawResponse", - "ReportProblemWithTripResourceWithStreamingResponse", - "AsyncReportProblemWithTripResourceWithStreamingResponse", - "SearchForStopResource", - "AsyncSearchForStopResource", - "SearchForStopResourceWithRawResponse", - "AsyncSearchForStopResourceWithRawResponse", - "SearchForStopResourceWithStreamingResponse", - "AsyncSearchForStopResourceWithStreamingResponse", - "SearchForRouteResource", - "AsyncSearchForRouteResource", - "SearchForRouteResourceWithRawResponse", - "AsyncSearchForRouteResourceWithRawResponse", - "SearchForRouteResourceWithStreamingResponse", - "AsyncSearchForRouteResourceWithStreamingResponse", - "BlockResource", - "AsyncBlockResource", - "BlockResourceWithRawResponse", - "AsyncBlockResourceWithRawResponse", - "BlockResourceWithStreamingResponse", - "AsyncBlockResourceWithStreamingResponse", - "ShapeResource", - "AsyncShapeResource", - "ShapeResourceWithRawResponse", - "AsyncShapeResourceWithRawResponse", - "ShapeResourceWithStreamingResponse", - "AsyncShapeResourceWithStreamingResponse", -] +__all__ = ["AgenciesWithCoverageResource", "AsyncAgenciesWithCoverageResource", "AgenciesWithCoverageResourceWithRawResponse", "AsyncAgenciesWithCoverageResourceWithRawResponse", "AgenciesWithCoverageResourceWithStreamingResponse", "AsyncAgenciesWithCoverageResourceWithStreamingResponse", "AgencyResource", "AsyncAgencyResource", "AgencyResourceWithRawResponse", "AsyncAgencyResourceWithRawResponse", "AgencyResourceWithStreamingResponse", "AsyncAgencyResourceWithStreamingResponse", "VehiclesForAgencyResource", "AsyncVehiclesForAgencyResource", "VehiclesForAgencyResourceWithRawResponse", "AsyncVehiclesForAgencyResourceWithRawResponse", "VehiclesForAgencyResourceWithStreamingResponse", "AsyncVehiclesForAgencyResourceWithStreamingResponse", "ConfigResource", "AsyncConfigResource", "ConfigResourceWithRawResponse", "AsyncConfigResourceWithRawResponse", "ConfigResourceWithStreamingResponse", "AsyncConfigResourceWithStreamingResponse", "CurrentTimeResource", "AsyncCurrentTimeResource", "CurrentTimeResourceWithRawResponse", "AsyncCurrentTimeResourceWithRawResponse", "CurrentTimeResourceWithStreamingResponse", "AsyncCurrentTimeResourceWithStreamingResponse", "StopsForLocationResource", "AsyncStopsForLocationResource", "StopsForLocationResourceWithRawResponse", "AsyncStopsForLocationResourceWithRawResponse", "StopsForLocationResourceWithStreamingResponse", "AsyncStopsForLocationResourceWithStreamingResponse", "StopsForRouteResource", "AsyncStopsForRouteResource", "StopsForRouteResourceWithRawResponse", "AsyncStopsForRouteResourceWithRawResponse", "StopsForRouteResourceWithStreamingResponse", "AsyncStopsForRouteResourceWithStreamingResponse", "StopsForAgencyResource", "AsyncStopsForAgencyResource", "StopsForAgencyResourceWithRawResponse", "AsyncStopsForAgencyResourceWithRawResponse", "StopsForAgencyResourceWithStreamingResponse", "AsyncStopsForAgencyResourceWithStreamingResponse", "StopResource", "AsyncStopResource", "StopResourceWithRawResponse", "AsyncStopResourceWithRawResponse", "StopResourceWithStreamingResponse", "AsyncStopResourceWithStreamingResponse", "StopIDsForAgencyResource", "AsyncStopIDsForAgencyResource", "StopIDsForAgencyResourceWithRawResponse", "AsyncStopIDsForAgencyResourceWithRawResponse", "StopIDsForAgencyResourceWithStreamingResponse", "AsyncStopIDsForAgencyResourceWithStreamingResponse", "ScheduleForStopResource", "AsyncScheduleForStopResource", "ScheduleForStopResourceWithRawResponse", "AsyncScheduleForStopResourceWithRawResponse", "ScheduleForStopResourceWithStreamingResponse", "AsyncScheduleForStopResourceWithStreamingResponse", "RouteResource", "AsyncRouteResource", "RouteResourceWithRawResponse", "AsyncRouteResourceWithRawResponse", "RouteResourceWithStreamingResponse", "AsyncRouteResourceWithStreamingResponse", "RouteIDsForAgencyResource", "AsyncRouteIDsForAgencyResource", "RouteIDsForAgencyResourceWithRawResponse", "AsyncRouteIDsForAgencyResourceWithRawResponse", "RouteIDsForAgencyResourceWithStreamingResponse", "AsyncRouteIDsForAgencyResourceWithStreamingResponse", "RoutesForLocationResource", "AsyncRoutesForLocationResource", "RoutesForLocationResourceWithRawResponse", "AsyncRoutesForLocationResourceWithRawResponse", "RoutesForLocationResourceWithStreamingResponse", "AsyncRoutesForLocationResourceWithStreamingResponse", "RoutesForAgencyResource", "AsyncRoutesForAgencyResource", "RoutesForAgencyResourceWithRawResponse", "AsyncRoutesForAgencyResourceWithRawResponse", "RoutesForAgencyResourceWithStreamingResponse", "AsyncRoutesForAgencyResourceWithStreamingResponse", "ScheduleForRouteResource", "AsyncScheduleForRouteResource", "ScheduleForRouteResourceWithRawResponse", "AsyncScheduleForRouteResourceWithRawResponse", "ScheduleForRouteResourceWithStreamingResponse", "AsyncScheduleForRouteResourceWithStreamingResponse", "ArrivalAndDepartureResource", "AsyncArrivalAndDepartureResource", "ArrivalAndDepartureResourceWithRawResponse", "AsyncArrivalAndDepartureResourceWithRawResponse", "ArrivalAndDepartureResourceWithStreamingResponse", "AsyncArrivalAndDepartureResourceWithStreamingResponse", "TripResource", "AsyncTripResource", "TripResourceWithRawResponse", "AsyncTripResourceWithRawResponse", "TripResourceWithStreamingResponse", "AsyncTripResourceWithStreamingResponse", "TripsForLocationResource", "AsyncTripsForLocationResource", "TripsForLocationResourceWithRawResponse", "AsyncTripsForLocationResourceWithRawResponse", "TripsForLocationResourceWithStreamingResponse", "AsyncTripsForLocationResourceWithStreamingResponse", "TripDetailsResource", "AsyncTripDetailsResource", "TripDetailsResourceWithRawResponse", "AsyncTripDetailsResourceWithRawResponse", "TripDetailsResourceWithStreamingResponse", "AsyncTripDetailsResourceWithStreamingResponse", "TripForVehicleResource", "AsyncTripForVehicleResource", "TripForVehicleResourceWithRawResponse", "AsyncTripForVehicleResourceWithRawResponse", "TripForVehicleResourceWithStreamingResponse", "AsyncTripForVehicleResourceWithStreamingResponse", "TripsForRouteResource", "AsyncTripsForRouteResource", "TripsForRouteResourceWithRawResponse", "AsyncTripsForRouteResourceWithRawResponse", "TripsForRouteResourceWithStreamingResponse", "AsyncTripsForRouteResourceWithStreamingResponse", "ReportProblemWithStopResource", "AsyncReportProblemWithStopResource", "ReportProblemWithStopResourceWithRawResponse", "AsyncReportProblemWithStopResourceWithRawResponse", "ReportProblemWithStopResourceWithStreamingResponse", "AsyncReportProblemWithStopResourceWithStreamingResponse", "ReportProblemWithTripResource", "AsyncReportProblemWithTripResource", "ReportProblemWithTripResourceWithRawResponse", "AsyncReportProblemWithTripResourceWithRawResponse", "ReportProblemWithTripResourceWithStreamingResponse", "AsyncReportProblemWithTripResourceWithStreamingResponse", "SearchForStopResource", "AsyncSearchForStopResource", "SearchForStopResourceWithRawResponse", "AsyncSearchForStopResourceWithRawResponse", "SearchForStopResourceWithStreamingResponse", "AsyncSearchForStopResourceWithStreamingResponse", "SearchForRouteResource", "AsyncSearchForRouteResource", "SearchForRouteResourceWithRawResponse", "AsyncSearchForRouteResourceWithRawResponse", "SearchForRouteResourceWithStreamingResponse", "AsyncSearchForRouteResourceWithStreamingResponse", "BlockResource", "AsyncBlockResource", "BlockResourceWithRawResponse", "AsyncBlockResourceWithRawResponse", "BlockResourceWithStreamingResponse", "AsyncBlockResourceWithStreamingResponse", "ShapeResource", "AsyncShapeResource", "ShapeResourceWithRawResponse", "AsyncShapeResourceWithRawResponse", "ShapeResourceWithStreamingResponse", "AsyncShapeResourceWithStreamingResponse"] \ No newline at end of file diff --git a/src/onebusaway/resources/agencies_with_coverage.py b/src/onebusaway/resources/agencies_with_coverage.py index f543a88..2fa6042 100644 --- a/src/onebusaway/resources/agencies_with_coverage.py +++ b/src/onebusaway/resources/agencies_with_coverage.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.agencies_with_coverage_list_response import AgenciesWithCoverageListResponse -__all__ = ["AgenciesWithCoverageResource", "AsyncAgenciesWithCoverageResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["AgenciesWithCoverageResource", "AsyncAgenciesWithCoverageResource"] class AgenciesWithCoverageResource(SyncAPIResource): @cached_property @@ -39,29 +41,24 @@ def with_streaming_response(self) -> AgenciesWithCoverageResourceWithStreamingRe """ return AgenciesWithCoverageResourceWithStreamingResponse(self) - def list( - self, - *, - # 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, - ) -> AgenciesWithCoverageListResponse: + def list(self, + *, + # 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,) -> AgenciesWithCoverageListResponse: """ Returns a list of all transit agencies currently supported by OneBusAway along with the center of their coverage area. """ return self._get( "/api/where/agencies-with-coverage.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=AgenciesWithCoverageListResponse, ) - class AsyncAgenciesWithCoverageResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAgenciesWithCoverageResourceWithRawResponse: @@ -82,29 +79,24 @@ def with_streaming_response(self) -> AsyncAgenciesWithCoverageResourceWithStream """ return AsyncAgenciesWithCoverageResourceWithStreamingResponse(self) - async def list( - self, - *, - # 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, - ) -> AgenciesWithCoverageListResponse: + async def list(self, + *, + # 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,) -> AgenciesWithCoverageListResponse: """ Returns a list of all transit agencies currently supported by OneBusAway along with the center of their coverage area. """ return await self._get( "/api/where/agencies-with-coverage.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=AgenciesWithCoverageListResponse, ) - class AgenciesWithCoverageResourceWithRawResponse: def __init__(self, agencies_with_coverage: AgenciesWithCoverageResource) -> None: self._agencies_with_coverage = agencies_with_coverage @@ -113,7 +105,6 @@ def __init__(self, agencies_with_coverage: AgenciesWithCoverageResource) -> None agencies_with_coverage.list, ) - class AsyncAgenciesWithCoverageResourceWithRawResponse: def __init__(self, agencies_with_coverage: AsyncAgenciesWithCoverageResource) -> None: self._agencies_with_coverage = agencies_with_coverage @@ -122,7 +113,6 @@ def __init__(self, agencies_with_coverage: AsyncAgenciesWithCoverageResource) -> agencies_with_coverage.list, ) - class AgenciesWithCoverageResourceWithStreamingResponse: def __init__(self, agencies_with_coverage: AgenciesWithCoverageResource) -> None: self._agencies_with_coverage = agencies_with_coverage @@ -131,11 +121,10 @@ def __init__(self, agencies_with_coverage: AgenciesWithCoverageResource) -> None agencies_with_coverage.list, ) - class AsyncAgenciesWithCoverageResourceWithStreamingResponse: def __init__(self, agencies_with_coverage: AsyncAgenciesWithCoverageResource) -> None: self._agencies_with_coverage = agencies_with_coverage self.list = async_to_streamed_response_wrapper( agencies_with_coverage.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/agency.py b/src/onebusaway/resources/agency.py index 9141792..2d8da26 100644 --- a/src/onebusaway/resources/agency.py +++ b/src/onebusaway/resources/agency.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.agency_retrieve_response import AgencyRetrieveResponse -__all__ = ["AgencyResource", "AsyncAgencyResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["AgencyResource", "AsyncAgencyResource"] class AgencyResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> AgencyResourceWithStreamingResponse: """ return AgencyResourceWithStreamingResponse(self) - def retrieve( - self, - agency_id: str, - *, - # 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, - ) -> AgencyRetrieveResponse: + def retrieve(self, + agency_id: str, + *, + # 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,) -> AgencyRetrieveResponse: """ Retrieve information for a specific transit agency identified by its unique ID. @@ -63,16 +63,15 @@ def retrieve( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return self._get( f"/api/where/agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=AgencyRetrieveResponse, ) - class AsyncAgencyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAgencyResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncAgencyResourceWithStreamingResponse: """ return AsyncAgencyResourceWithStreamingResponse(self) - async def retrieve( - self, - agency_id: str, - *, - # 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, - ) -> AgencyRetrieveResponse: + async def retrieve(self, + agency_id: str, + *, + # 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,) -> AgencyRetrieveResponse: """ Retrieve information for a specific transit agency identified by its unique ID. @@ -117,16 +114,15 @@ async def retrieve( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return await self._get( f"/api/where/agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=AgencyRetrieveResponse, ) - class AgencyResourceWithRawResponse: def __init__(self, agency: AgencyResource) -> None: self._agency = agency @@ -135,7 +131,6 @@ def __init__(self, agency: AgencyResource) -> None: agency.retrieve, ) - class AsyncAgencyResourceWithRawResponse: def __init__(self, agency: AsyncAgencyResource) -> None: self._agency = agency @@ -144,7 +139,6 @@ def __init__(self, agency: AsyncAgencyResource) -> None: agency.retrieve, ) - class AgencyResourceWithStreamingResponse: def __init__(self, agency: AgencyResource) -> None: self._agency = agency @@ -153,11 +147,10 @@ def __init__(self, agency: AgencyResource) -> None: agency.retrieve, ) - class AsyncAgencyResourceWithStreamingResponse: def __init__(self, agency: AsyncAgencyResource) -> None: self._agency = agency self.retrieve = async_to_streamed_response_wrapper( agency.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/arrival_and_departure.py b/src/onebusaway/resources/arrival_and_departure.py index 8323a51..7bba1a2 100644 --- a/src/onebusaway/resources/arrival_and_departure.py +++ b/src/onebusaway/resources/arrival_and_departure.py @@ -2,31 +2,34 @@ from __future__ import annotations -from typing import Union -from datetime import datetime - import httpx -from ..types import arrival_and_departure_list_params, arrival_and_departure_retrieve_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 ..types.arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse + from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + from ..types.arrival_and_departure_list_response import ArrivalAndDepartureListResponse -from ..types.arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse -__all__ = ["ArrivalAndDepartureResource", "AsyncArrivalAndDepartureResource"] +from typing import Union +from datetime import datetime + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import arrival_and_departure_retrieve_params +from ..types import arrival_and_departure_list_params + +__all__ = ["ArrivalAndDepartureResource", "AsyncArrivalAndDepartureResource"] class ArrivalAndDepartureResource(SyncAPIResource): @cached_property @@ -48,22 +51,20 @@ def with_streaming_response(self) -> ArrivalAndDepartureResourceWithStreamingRes """ return ArrivalAndDepartureResourceWithStreamingResponse(self) - def retrieve( - self, - stop_id: str, - *, - service_date: int, - trip_id: str, - stop_sequence: int | NotGiven = NOT_GIVEN, - time: int | NotGiven = NOT_GIVEN, - vehicle_id: 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, - ) -> ArrivalAndDepartureRetrieveResponse: + def retrieve(self, + stop_id: str, + *, + service_date: int, + trip_id: str, + stop_sequence: int | NotGiven = NOT_GIVEN, + time: int | NotGiven = NOT_GIVEN, + vehicle_id: 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,) -> ArrivalAndDepartureRetrieveResponse: """ arrival-and-departure-for-stop @@ -77,42 +78,33 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return self._get( f"/api/where/arrival-and-departure-for-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "service_date": service_date, - "trip_id": trip_id, - "stop_sequence": stop_sequence, - "time": time, - "vehicle_id": vehicle_id, - }, - arrival_and_departure_retrieve_params.ArrivalAndDepartureRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "service_date": service_date, + "trip_id": trip_id, + "stop_sequence": stop_sequence, + "time": time, + "vehicle_id": vehicle_id, + }, arrival_and_departure_retrieve_params.ArrivalAndDepartureRetrieveParams)), cast_to=ArrivalAndDepartureRetrieveResponse, ) - def list( - self, - stop_id: str, - *, - minutes_after: int | NotGiven = NOT_GIVEN, - minutes_before: int | NotGiven = NOT_GIVEN, - time: Union[str, datetime] | 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, - ) -> ArrivalAndDepartureListResponse: + def list(self, + stop_id: str, + *, + minutes_after: int | NotGiven = NOT_GIVEN, + minutes_before: int | NotGiven = NOT_GIVEN, + time: Union[str, datetime] | 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,) -> ArrivalAndDepartureListResponse: """ arrivals-and-departures-for-stop @@ -132,27 +124,19 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return self._get( f"/api/where/arrivals-and-departures-for-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "minutes_after": minutes_after, - "minutes_before": minutes_before, - "time": time, - }, - arrival_and_departure_list_params.ArrivalAndDepartureListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "minutes_after": minutes_after, + "minutes_before": minutes_before, + "time": time, + }, arrival_and_departure_list_params.ArrivalAndDepartureListParams)), cast_to=ArrivalAndDepartureListResponse, ) - class AsyncArrivalAndDepartureResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncArrivalAndDepartureResourceWithRawResponse: @@ -173,22 +157,20 @@ def with_streaming_response(self) -> AsyncArrivalAndDepartureResourceWithStreami """ return AsyncArrivalAndDepartureResourceWithStreamingResponse(self) - async def retrieve( - self, - stop_id: str, - *, - service_date: int, - trip_id: str, - stop_sequence: int | NotGiven = NOT_GIVEN, - time: int | NotGiven = NOT_GIVEN, - vehicle_id: 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, - ) -> ArrivalAndDepartureRetrieveResponse: + async def retrieve(self, + stop_id: str, + *, + service_date: int, + trip_id: str, + stop_sequence: int | NotGiven = NOT_GIVEN, + time: int | NotGiven = NOT_GIVEN, + vehicle_id: 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,) -> ArrivalAndDepartureRetrieveResponse: """ arrival-and-departure-for-stop @@ -202,42 +184,33 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return await self._get( f"/api/where/arrival-and-departure-for-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "service_date": service_date, - "trip_id": trip_id, - "stop_sequence": stop_sequence, - "time": time, - "vehicle_id": vehicle_id, - }, - arrival_and_departure_retrieve_params.ArrivalAndDepartureRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "service_date": service_date, + "trip_id": trip_id, + "stop_sequence": stop_sequence, + "time": time, + "vehicle_id": vehicle_id, + }, arrival_and_departure_retrieve_params.ArrivalAndDepartureRetrieveParams)), cast_to=ArrivalAndDepartureRetrieveResponse, ) - async def list( - self, - stop_id: str, - *, - minutes_after: int | NotGiven = NOT_GIVEN, - minutes_before: int | NotGiven = NOT_GIVEN, - time: Union[str, datetime] | 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, - ) -> ArrivalAndDepartureListResponse: + async def list(self, + stop_id: str, + *, + minutes_after: int | NotGiven = NOT_GIVEN, + minutes_before: int | NotGiven = NOT_GIVEN, + time: Union[str, datetime] | 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,) -> ArrivalAndDepartureListResponse: """ arrivals-and-departures-for-stop @@ -257,27 +230,19 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return await self._get( f"/api/where/arrivals-and-departures-for-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "minutes_after": minutes_after, - "minutes_before": minutes_before, - "time": time, - }, - arrival_and_departure_list_params.ArrivalAndDepartureListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "minutes_after": minutes_after, + "minutes_before": minutes_before, + "time": time, + }, arrival_and_departure_list_params.ArrivalAndDepartureListParams)), cast_to=ArrivalAndDepartureListResponse, ) - class ArrivalAndDepartureResourceWithRawResponse: def __init__(self, arrival_and_departure: ArrivalAndDepartureResource) -> None: self._arrival_and_departure = arrival_and_departure @@ -289,7 +254,6 @@ def __init__(self, arrival_and_departure: ArrivalAndDepartureResource) -> None: arrival_and_departure.list, ) - class AsyncArrivalAndDepartureResourceWithRawResponse: def __init__(self, arrival_and_departure: AsyncArrivalAndDepartureResource) -> None: self._arrival_and_departure = arrival_and_departure @@ -301,7 +265,6 @@ def __init__(self, arrival_and_departure: AsyncArrivalAndDepartureResource) -> N arrival_and_departure.list, ) - class ArrivalAndDepartureResourceWithStreamingResponse: def __init__(self, arrival_and_departure: ArrivalAndDepartureResource) -> None: self._arrival_and_departure = arrival_and_departure @@ -313,7 +276,6 @@ def __init__(self, arrival_and_departure: ArrivalAndDepartureResource) -> None: arrival_and_departure.list, ) - class AsyncArrivalAndDepartureResourceWithStreamingResponse: def __init__(self, arrival_and_departure: AsyncArrivalAndDepartureResource) -> None: self._arrival_and_departure = arrival_and_departure @@ -323,4 +285,4 @@ def __init__(self, arrival_and_departure: AsyncArrivalAndDepartureResource) -> N ) self.list = async_to_streamed_response_wrapper( arrival_and_departure.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/block.py b/src/onebusaway/resources/block.py index cbee583..ec955eb 100644 --- a/src/onebusaway/resources/block.py +++ b/src/onebusaway/resources/block.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.block_retrieve_response import BlockRetrieveResponse -__all__ = ["BlockResource", "AsyncBlockResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["BlockResource", "AsyncBlockResource"] class BlockResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> BlockResourceWithStreamingResponse: """ return BlockResourceWithStreamingResponse(self) - def retrieve( - self, - block_id: str, - *, - # 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, - ) -> BlockRetrieveResponse: + def retrieve(self, + block_id: str, + *, + # 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,) -> BlockRetrieveResponse: """ Get details of a specific block by ID @@ -63,16 +63,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not block_id: - raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + raise ValueError( + f'Expected a non-empty value for `block_id` but received {block_id!r}' + ) return self._get( f"/api/where/block/{block_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=BlockRetrieveResponse, ) - class AsyncBlockResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBlockResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncBlockResourceWithStreamingResponse: """ return AsyncBlockResourceWithStreamingResponse(self) - async def retrieve( - self, - block_id: str, - *, - # 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, - ) -> BlockRetrieveResponse: + async def retrieve(self, + block_id: str, + *, + # 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,) -> BlockRetrieveResponse: """ Get details of a specific block by ID @@ -117,16 +114,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not block_id: - raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + raise ValueError( + f'Expected a non-empty value for `block_id` but received {block_id!r}' + ) return await self._get( f"/api/where/block/{block_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=BlockRetrieveResponse, ) - class BlockResourceWithRawResponse: def __init__(self, block: BlockResource) -> None: self._block = block @@ -135,7 +131,6 @@ def __init__(self, block: BlockResource) -> None: block.retrieve, ) - class AsyncBlockResourceWithRawResponse: def __init__(self, block: AsyncBlockResource) -> None: self._block = block @@ -144,7 +139,6 @@ def __init__(self, block: AsyncBlockResource) -> None: block.retrieve, ) - class BlockResourceWithStreamingResponse: def __init__(self, block: BlockResource) -> None: self._block = block @@ -153,11 +147,10 @@ def __init__(self, block: BlockResource) -> None: block.retrieve, ) - class AsyncBlockResourceWithStreamingResponse: def __init__(self, block: AsyncBlockResource) -> None: self._block = block self.retrieve = async_to_streamed_response_wrapper( block.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/config.py b/src/onebusaway/resources/config.py index 4b3de23..29269b8 100644 --- a/src/onebusaway/resources/config.py +++ b/src/onebusaway/resources/config.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.config_retrieve_response import ConfigRetrieveResponse -__all__ = ["ConfigResource", "AsyncConfigResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["ConfigResource", "AsyncConfigResource"] class ConfigResource(SyncAPIResource): @cached_property @@ -39,26 +41,21 @@ def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: """ return ConfigResourceWithStreamingResponse(self) - def retrieve( - self, - *, - # 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, - ) -> ConfigRetrieveResponse: + def retrieve(self, + *, + # 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,) -> ConfigRetrieveResponse: """config""" return self._get( "/api/where/config.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=ConfigRetrieveResponse, ) - class AsyncConfigResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConfigResourceWithRawResponse: @@ -79,26 +76,21 @@ def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: """ return AsyncConfigResourceWithStreamingResponse(self) - async def retrieve( - self, - *, - # 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, - ) -> ConfigRetrieveResponse: + async def retrieve(self, + *, + # 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,) -> ConfigRetrieveResponse: """config""" return await self._get( "/api/where/config.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=ConfigRetrieveResponse, ) - class ConfigResourceWithRawResponse: def __init__(self, config: ConfigResource) -> None: self._config = config @@ -107,7 +99,6 @@ def __init__(self, config: ConfigResource) -> None: config.retrieve, ) - class AsyncConfigResourceWithRawResponse: def __init__(self, config: AsyncConfigResource) -> None: self._config = config @@ -116,7 +107,6 @@ def __init__(self, config: AsyncConfigResource) -> None: config.retrieve, ) - class ConfigResourceWithStreamingResponse: def __init__(self, config: ConfigResource) -> None: self._config = config @@ -125,11 +115,10 @@ def __init__(self, config: ConfigResource) -> None: config.retrieve, ) - class AsyncConfigResourceWithStreamingResponse: def __init__(self, config: AsyncConfigResource) -> None: self._config = config self.retrieve = async_to_streamed_response_wrapper( config.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/current_time.py b/src/onebusaway/resources/current_time.py index 1dcc9a8..5dfc9bc 100644 --- a/src/onebusaway/resources/current_time.py +++ b/src/onebusaway/resources/current_time.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.current_time_retrieve_response import CurrentTimeRetrieveResponse -__all__ = ["CurrentTimeResource", "AsyncCurrentTimeResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["CurrentTimeResource", "AsyncCurrentTimeResource"] class CurrentTimeResource(SyncAPIResource): @cached_property @@ -39,26 +41,21 @@ def with_streaming_response(self) -> CurrentTimeResourceWithStreamingResponse: """ return CurrentTimeResourceWithStreamingResponse(self) - def retrieve( - self, - *, - # 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, - ) -> CurrentTimeRetrieveResponse: + def retrieve(self, + *, + # 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,) -> CurrentTimeRetrieveResponse: """current-time""" return self._get( "/api/where/current-time.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=CurrentTimeRetrieveResponse, ) - class AsyncCurrentTimeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCurrentTimeResourceWithRawResponse: @@ -79,26 +76,21 @@ def with_streaming_response(self) -> AsyncCurrentTimeResourceWithStreamingRespon """ return AsyncCurrentTimeResourceWithStreamingResponse(self) - async def retrieve( - self, - *, - # 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, - ) -> CurrentTimeRetrieveResponse: + async def retrieve(self, + *, + # 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,) -> CurrentTimeRetrieveResponse: """current-time""" return await self._get( "/api/where/current-time.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=CurrentTimeRetrieveResponse, ) - class CurrentTimeResourceWithRawResponse: def __init__(self, current_time: CurrentTimeResource) -> None: self._current_time = current_time @@ -107,7 +99,6 @@ def __init__(self, current_time: CurrentTimeResource) -> None: current_time.retrieve, ) - class AsyncCurrentTimeResourceWithRawResponse: def __init__(self, current_time: AsyncCurrentTimeResource) -> None: self._current_time = current_time @@ -116,7 +107,6 @@ def __init__(self, current_time: AsyncCurrentTimeResource) -> None: current_time.retrieve, ) - class CurrentTimeResourceWithStreamingResponse: def __init__(self, current_time: CurrentTimeResource) -> None: self._current_time = current_time @@ -125,11 +115,10 @@ def __init__(self, current_time: CurrentTimeResource) -> None: current_time.retrieve, ) - class AsyncCurrentTimeResourceWithStreamingResponse: def __init__(self, current_time: AsyncCurrentTimeResource) -> None: self._current_time = current_time self.retrieve = async_to_streamed_response_wrapper( current_time.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/report_problem_with_stop.py b/src/onebusaway/resources/report_problem_with_stop.py index d1614f6..34f4c72 100644 --- a/src/onebusaway/resources/report_problem_with_stop.py +++ b/src/onebusaway/resources/report_problem_with_stop.py @@ -2,29 +2,29 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx -from ..types import report_problem_with_stop_retrieve_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.shared.response_wrapper import ResponseWrapper -__all__ = ["ReportProblemWithStopResource", "AsyncReportProblemWithStopResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from typing_extensions import Literal +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import report_problem_with_stop_retrieve_params + +__all__ = ["ReportProblemWithStopResource", "AsyncReportProblemWithStopResource"] class ReportProblemWithStopResource(SyncAPIResource): @cached_property @@ -46,23 +46,20 @@ def with_streaming_response(self) -> ReportProblemWithStopResourceWithStreamingR """ return ReportProblemWithStopResourceWithStreamingResponse(self) - def retrieve( - self, - stop_id: str, - *, - code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"] - | NotGiven = NOT_GIVEN, - user_comment: str | NotGiven = NOT_GIVEN, - user_lat: float | NotGiven = NOT_GIVEN, - user_location_accuracy: float | NotGiven = NOT_GIVEN, - user_lon: float | 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, - ) -> ResponseWrapper: + def retrieve(self, + stop_id: str, + *, + code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"] | NotGiven = NOT_GIVEN, + user_comment: str | NotGiven = NOT_GIVEN, + user_lat: float | NotGiven = NOT_GIVEN, + user_location_accuracy: float | NotGiven = NOT_GIVEN, + user_lon: float | 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,) -> ResponseWrapper: """ Submit a user-generated problem report for a stop @@ -86,29 +83,21 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return self._get( f"/api/where/report-problem-with-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "code": code, - "user_comment": user_comment, - "user_lat": user_lat, - "user_location_accuracy": user_location_accuracy, - "user_lon": user_lon, - }, - report_problem_with_stop_retrieve_params.ReportProblemWithStopRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "code": code, + "user_comment": user_comment, + "user_lat": user_lat, + "user_location_accuracy": user_location_accuracy, + "user_lon": user_lon, + }, report_problem_with_stop_retrieve_params.ReportProblemWithStopRetrieveParams)), cast_to=ResponseWrapper, ) - class AsyncReportProblemWithStopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReportProblemWithStopResourceWithRawResponse: @@ -129,23 +118,20 @@ def with_streaming_response(self) -> AsyncReportProblemWithStopResourceWithStrea """ return AsyncReportProblemWithStopResourceWithStreamingResponse(self) - async def retrieve( - self, - stop_id: str, - *, - code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"] - | NotGiven = NOT_GIVEN, - user_comment: str | NotGiven = NOT_GIVEN, - user_lat: float | NotGiven = NOT_GIVEN, - user_location_accuracy: float | NotGiven = NOT_GIVEN, - user_lon: float | 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, - ) -> ResponseWrapper: + async def retrieve(self, + stop_id: str, + *, + code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"] | NotGiven = NOT_GIVEN, + user_comment: str | NotGiven = NOT_GIVEN, + user_lat: float | NotGiven = NOT_GIVEN, + user_location_accuracy: float | NotGiven = NOT_GIVEN, + user_lon: float | 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,) -> ResponseWrapper: """ Submit a user-generated problem report for a stop @@ -169,29 +155,21 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return await self._get( f"/api/where/report-problem-with-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "code": code, - "user_comment": user_comment, - "user_lat": user_lat, - "user_location_accuracy": user_location_accuracy, - "user_lon": user_lon, - }, - report_problem_with_stop_retrieve_params.ReportProblemWithStopRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "code": code, + "user_comment": user_comment, + "user_lat": user_lat, + "user_location_accuracy": user_location_accuracy, + "user_lon": user_lon, + }, report_problem_with_stop_retrieve_params.ReportProblemWithStopRetrieveParams)), cast_to=ResponseWrapper, ) - class ReportProblemWithStopResourceWithRawResponse: def __init__(self, report_problem_with_stop: ReportProblemWithStopResource) -> None: self._report_problem_with_stop = report_problem_with_stop @@ -200,7 +178,6 @@ def __init__(self, report_problem_with_stop: ReportProblemWithStopResource) -> N report_problem_with_stop.retrieve, ) - class AsyncReportProblemWithStopResourceWithRawResponse: def __init__(self, report_problem_with_stop: AsyncReportProblemWithStopResource) -> None: self._report_problem_with_stop = report_problem_with_stop @@ -209,7 +186,6 @@ def __init__(self, report_problem_with_stop: AsyncReportProblemWithStopResource) report_problem_with_stop.retrieve, ) - class ReportProblemWithStopResourceWithStreamingResponse: def __init__(self, report_problem_with_stop: ReportProblemWithStopResource) -> None: self._report_problem_with_stop = report_problem_with_stop @@ -218,11 +194,10 @@ def __init__(self, report_problem_with_stop: ReportProblemWithStopResource) -> N report_problem_with_stop.retrieve, ) - class AsyncReportProblemWithStopResourceWithStreamingResponse: def __init__(self, report_problem_with_stop: AsyncReportProblemWithStopResource) -> None: self._report_problem_with_stop = report_problem_with_stop self.retrieve = async_to_streamed_response_wrapper( report_problem_with_stop.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/report_problem_with_trip.py b/src/onebusaway/resources/report_problem_with_trip.py index d0f9733..668f903 100644 --- a/src/onebusaway/resources/report_problem_with_trip.py +++ b/src/onebusaway/resources/report_problem_with_trip.py @@ -2,29 +2,29 @@ from __future__ import annotations -from typing_extensions import Literal - import httpx -from ..types import report_problem_with_trip_retrieve_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.shared.response_wrapper import ResponseWrapper -__all__ = ["ReportProblemWithTripResource", "AsyncReportProblemWithTripResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from typing_extensions import Literal +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import report_problem_with_trip_retrieve_params + +__all__ = ["ReportProblemWithTripResource", "AsyncReportProblemWithTripResource"] class ReportProblemWithTripResource(SyncAPIResource): @cached_property @@ -46,35 +46,25 @@ def with_streaming_response(self) -> ReportProblemWithTripResourceWithStreamingR """ return ReportProblemWithTripResourceWithStreamingResponse(self) - def retrieve( - self, - trip_id: str, - *, - code: Literal[ - "vehicle_never_came", - "vehicle_came_early", - "vehicle_came_late", - "wrong_headsign", - "vehicle_does_not_stop_here", - "other", - ] - | NotGiven = NOT_GIVEN, - service_date: int | NotGiven = NOT_GIVEN, - stop_id: str | NotGiven = NOT_GIVEN, - user_comment: str | NotGiven = NOT_GIVEN, - user_lat: float | NotGiven = NOT_GIVEN, - user_location_accuracy: float | NotGiven = NOT_GIVEN, - user_lon: float | NotGiven = NOT_GIVEN, - user_on_vehicle: bool | NotGiven = NOT_GIVEN, - user_vehicle_number: str | NotGiven = NOT_GIVEN, - vehicle_id: 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, - ) -> ResponseWrapper: + def retrieve(self, + trip_id: str, + *, + code: Literal["vehicle_never_came", "vehicle_came_early", "vehicle_came_late", "wrong_headsign", "vehicle_does_not_stop_here", "other"] | NotGiven = NOT_GIVEN, + service_date: int | NotGiven = NOT_GIVEN, + stop_id: str | NotGiven = NOT_GIVEN, + user_comment: str | NotGiven = NOT_GIVEN, + user_lat: float | NotGiven = NOT_GIVEN, + user_location_accuracy: float | NotGiven = NOT_GIVEN, + user_lon: float | NotGiven = NOT_GIVEN, + user_on_vehicle: bool | NotGiven = NOT_GIVEN, + user_vehicle_number: str | NotGiven = NOT_GIVEN, + vehicle_id: 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,) -> ResponseWrapper: """ Submit a user-generated problem report for a particular trip. @@ -108,34 +98,26 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not trip_id: - raise ValueError(f"Expected a non-empty value for `trip_id` but received {trip_id!r}") + raise ValueError( + f'Expected a non-empty value for `trip_id` but received {trip_id!r}' + ) return self._get( f"/api/where/report-problem-with-trip/{trip_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "code": code, - "service_date": service_date, - "stop_id": stop_id, - "user_comment": user_comment, - "user_lat": user_lat, - "user_location_accuracy": user_location_accuracy, - "user_lon": user_lon, - "user_on_vehicle": user_on_vehicle, - "user_vehicle_number": user_vehicle_number, - "vehicle_id": vehicle_id, - }, - report_problem_with_trip_retrieve_params.ReportProblemWithTripRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "code": code, + "service_date": service_date, + "stop_id": stop_id, + "user_comment": user_comment, + "user_lat": user_lat, + "user_location_accuracy": user_location_accuracy, + "user_lon": user_lon, + "user_on_vehicle": user_on_vehicle, + "user_vehicle_number": user_vehicle_number, + "vehicle_id": vehicle_id, + }, report_problem_with_trip_retrieve_params.ReportProblemWithTripRetrieveParams)), cast_to=ResponseWrapper, ) - class AsyncReportProblemWithTripResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReportProblemWithTripResourceWithRawResponse: @@ -156,35 +138,25 @@ def with_streaming_response(self) -> AsyncReportProblemWithTripResourceWithStrea """ return AsyncReportProblemWithTripResourceWithStreamingResponse(self) - async def retrieve( - self, - trip_id: str, - *, - code: Literal[ - "vehicle_never_came", - "vehicle_came_early", - "vehicle_came_late", - "wrong_headsign", - "vehicle_does_not_stop_here", - "other", - ] - | NotGiven = NOT_GIVEN, - service_date: int | NotGiven = NOT_GIVEN, - stop_id: str | NotGiven = NOT_GIVEN, - user_comment: str | NotGiven = NOT_GIVEN, - user_lat: float | NotGiven = NOT_GIVEN, - user_location_accuracy: float | NotGiven = NOT_GIVEN, - user_lon: float | NotGiven = NOT_GIVEN, - user_on_vehicle: bool | NotGiven = NOT_GIVEN, - user_vehicle_number: str | NotGiven = NOT_GIVEN, - vehicle_id: 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, - ) -> ResponseWrapper: + async def retrieve(self, + trip_id: str, + *, + code: Literal["vehicle_never_came", "vehicle_came_early", "vehicle_came_late", "wrong_headsign", "vehicle_does_not_stop_here", "other"] | NotGiven = NOT_GIVEN, + service_date: int | NotGiven = NOT_GIVEN, + stop_id: str | NotGiven = NOT_GIVEN, + user_comment: str | NotGiven = NOT_GIVEN, + user_lat: float | NotGiven = NOT_GIVEN, + user_location_accuracy: float | NotGiven = NOT_GIVEN, + user_lon: float | NotGiven = NOT_GIVEN, + user_on_vehicle: bool | NotGiven = NOT_GIVEN, + user_vehicle_number: str | NotGiven = NOT_GIVEN, + vehicle_id: 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,) -> ResponseWrapper: """ Submit a user-generated problem report for a particular trip. @@ -218,34 +190,26 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not trip_id: - raise ValueError(f"Expected a non-empty value for `trip_id` but received {trip_id!r}") + raise ValueError( + f'Expected a non-empty value for `trip_id` but received {trip_id!r}' + ) return await self._get( f"/api/where/report-problem-with-trip/{trip_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "code": code, - "service_date": service_date, - "stop_id": stop_id, - "user_comment": user_comment, - "user_lat": user_lat, - "user_location_accuracy": user_location_accuracy, - "user_lon": user_lon, - "user_on_vehicle": user_on_vehicle, - "user_vehicle_number": user_vehicle_number, - "vehicle_id": vehicle_id, - }, - report_problem_with_trip_retrieve_params.ReportProblemWithTripRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "code": code, + "service_date": service_date, + "stop_id": stop_id, + "user_comment": user_comment, + "user_lat": user_lat, + "user_location_accuracy": user_location_accuracy, + "user_lon": user_lon, + "user_on_vehicle": user_on_vehicle, + "user_vehicle_number": user_vehicle_number, + "vehicle_id": vehicle_id, + }, report_problem_with_trip_retrieve_params.ReportProblemWithTripRetrieveParams)), cast_to=ResponseWrapper, ) - class ReportProblemWithTripResourceWithRawResponse: def __init__(self, report_problem_with_trip: ReportProblemWithTripResource) -> None: self._report_problem_with_trip = report_problem_with_trip @@ -254,7 +218,6 @@ def __init__(self, report_problem_with_trip: ReportProblemWithTripResource) -> N report_problem_with_trip.retrieve, ) - class AsyncReportProblemWithTripResourceWithRawResponse: def __init__(self, report_problem_with_trip: AsyncReportProblemWithTripResource) -> None: self._report_problem_with_trip = report_problem_with_trip @@ -263,7 +226,6 @@ def __init__(self, report_problem_with_trip: AsyncReportProblemWithTripResource) report_problem_with_trip.retrieve, ) - class ReportProblemWithTripResourceWithStreamingResponse: def __init__(self, report_problem_with_trip: ReportProblemWithTripResource) -> None: self._report_problem_with_trip = report_problem_with_trip @@ -272,11 +234,10 @@ def __init__(self, report_problem_with_trip: ReportProblemWithTripResource) -> N report_problem_with_trip.retrieve, ) - class AsyncReportProblemWithTripResourceWithStreamingResponse: def __init__(self, report_problem_with_trip: AsyncReportProblemWithTripResource) -> None: self._report_problem_with_trip = report_problem_with_trip self.retrieve = async_to_streamed_response_wrapper( report_problem_with_trip.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/route.py b/src/onebusaway/resources/route.py index 62ae14a..5b420e8 100644 --- a/src/onebusaway/resources/route.py +++ b/src/onebusaway/resources/route.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.route_retrieve_response import RouteRetrieveResponse -__all__ = ["RouteResource", "AsyncRouteResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["RouteResource", "AsyncRouteResource"] class RouteResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> RouteResourceWithStreamingResponse: """ return RouteResourceWithStreamingResponse(self) - def retrieve( - self, - route_id: str, - *, - # 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, - ) -> RouteRetrieveResponse: + def retrieve(self, + route_id: str, + *, + # 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,) -> RouteRetrieveResponse: """ Retrieve information for a specific route identified by its unique ID. @@ -63,16 +63,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return self._get( f"/api/where/route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=RouteRetrieveResponse, ) - class AsyncRouteResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRouteResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncRouteResourceWithStreamingResponse: """ return AsyncRouteResourceWithStreamingResponse(self) - async def retrieve( - self, - route_id: str, - *, - # 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, - ) -> RouteRetrieveResponse: + async def retrieve(self, + route_id: str, + *, + # 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,) -> RouteRetrieveResponse: """ Retrieve information for a specific route identified by its unique ID. @@ -117,16 +114,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return await self._get( f"/api/where/route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=RouteRetrieveResponse, ) - class RouteResourceWithRawResponse: def __init__(self, route: RouteResource) -> None: self._route = route @@ -135,7 +131,6 @@ def __init__(self, route: RouteResource) -> None: route.retrieve, ) - class AsyncRouteResourceWithRawResponse: def __init__(self, route: AsyncRouteResource) -> None: self._route = route @@ -144,7 +139,6 @@ def __init__(self, route: AsyncRouteResource) -> None: route.retrieve, ) - class RouteResourceWithStreamingResponse: def __init__(self, route: RouteResource) -> None: self._route = route @@ -153,11 +147,10 @@ def __init__(self, route: RouteResource) -> None: route.retrieve, ) - class AsyncRouteResourceWithStreamingResponse: def __init__(self, route: AsyncRouteResource) -> None: self._route = route self.retrieve = async_to_streamed_response_wrapper( route.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/route_ids_for_agency.py b/src/onebusaway/resources/route_ids_for_agency.py index e5ddfa3..6f21ee9 100644 --- a/src/onebusaway/resources/route_ids_for_agency.py +++ b/src/onebusaway/resources/route_ids_for_agency.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.route_ids_for_agency_list_response import RouteIDsForAgencyListResponse -__all__ = ["RouteIDsForAgencyResource", "AsyncRouteIDsForAgencyResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["RouteIDsForAgencyResource", "AsyncRouteIDsForAgencyResource"] class RouteIDsForAgencyResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> RouteIDsForAgencyResourceWithStreamingRespo """ return RouteIDsForAgencyResourceWithStreamingResponse(self) - def list( - self, - agency_id: str, - *, - # 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, - ) -> RouteIDsForAgencyListResponse: + def list(self, + agency_id: str, + *, + # 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,) -> RouteIDsForAgencyListResponse: """ Get route IDs for a specific agency @@ -63,16 +63,15 @@ def list( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return self._get( f"/api/where/route-ids-for-agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=RouteIDsForAgencyListResponse, ) - class AsyncRouteIDsForAgencyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRouteIDsForAgencyResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncRouteIDsForAgencyResourceWithStreaming """ return AsyncRouteIDsForAgencyResourceWithStreamingResponse(self) - async def list( - self, - agency_id: str, - *, - # 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, - ) -> RouteIDsForAgencyListResponse: + async def list(self, + agency_id: str, + *, + # 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,) -> RouteIDsForAgencyListResponse: """ Get route IDs for a specific agency @@ -117,16 +114,15 @@ async def list( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return await self._get( f"/api/where/route-ids-for-agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=RouteIDsForAgencyListResponse, ) - class RouteIDsForAgencyResourceWithRawResponse: def __init__(self, route_ids_for_agency: RouteIDsForAgencyResource) -> None: self._route_ids_for_agency = route_ids_for_agency @@ -135,7 +131,6 @@ def __init__(self, route_ids_for_agency: RouteIDsForAgencyResource) -> None: route_ids_for_agency.list, ) - class AsyncRouteIDsForAgencyResourceWithRawResponse: def __init__(self, route_ids_for_agency: AsyncRouteIDsForAgencyResource) -> None: self._route_ids_for_agency = route_ids_for_agency @@ -144,7 +139,6 @@ def __init__(self, route_ids_for_agency: AsyncRouteIDsForAgencyResource) -> None route_ids_for_agency.list, ) - class RouteIDsForAgencyResourceWithStreamingResponse: def __init__(self, route_ids_for_agency: RouteIDsForAgencyResource) -> None: self._route_ids_for_agency = route_ids_for_agency @@ -153,11 +147,10 @@ def __init__(self, route_ids_for_agency: RouteIDsForAgencyResource) -> None: route_ids_for_agency.list, ) - class AsyncRouteIDsForAgencyResourceWithStreamingResponse: def __init__(self, route_ids_for_agency: AsyncRouteIDsForAgencyResource) -> None: self._route_ids_for_agency = route_ids_for_agency self.list = async_to_streamed_response_wrapper( route_ids_for_agency.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/routes_for_agency.py b/src/onebusaway/resources/routes_for_agency.py index ff7a8cd..dd9306e 100644 --- a/src/onebusaway/resources/routes_for_agency.py +++ b/src/onebusaway/resources/routes_for_agency.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.routes_for_agency_list_response import RoutesForAgencyListResponse -__all__ = ["RoutesForAgencyResource", "AsyncRoutesForAgencyResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["RoutesForAgencyResource", "AsyncRoutesForAgencyResource"] class RoutesForAgencyResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> RoutesForAgencyResourceWithStreamingRespons """ return RoutesForAgencyResourceWithStreamingResponse(self) - def list( - self, - agency_id: str, - *, - # 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, - ) -> RoutesForAgencyListResponse: + def list(self, + agency_id: str, + *, + # 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,) -> RoutesForAgencyListResponse: """ Retrieve the list of all routes for a particular agency by id @@ -63,16 +63,15 @@ def list( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return self._get( f"/api/where/routes-for-agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=RoutesForAgencyListResponse, ) - class AsyncRoutesForAgencyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRoutesForAgencyResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncRoutesForAgencyResourceWithStreamingRe """ return AsyncRoutesForAgencyResourceWithStreamingResponse(self) - async def list( - self, - agency_id: str, - *, - # 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, - ) -> RoutesForAgencyListResponse: + async def list(self, + agency_id: str, + *, + # 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,) -> RoutesForAgencyListResponse: """ Retrieve the list of all routes for a particular agency by id @@ -117,16 +114,15 @@ async def list( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return await self._get( f"/api/where/routes-for-agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=RoutesForAgencyListResponse, ) - class RoutesForAgencyResourceWithRawResponse: def __init__(self, routes_for_agency: RoutesForAgencyResource) -> None: self._routes_for_agency = routes_for_agency @@ -135,7 +131,6 @@ def __init__(self, routes_for_agency: RoutesForAgencyResource) -> None: routes_for_agency.list, ) - class AsyncRoutesForAgencyResourceWithRawResponse: def __init__(self, routes_for_agency: AsyncRoutesForAgencyResource) -> None: self._routes_for_agency = routes_for_agency @@ -144,7 +139,6 @@ def __init__(self, routes_for_agency: AsyncRoutesForAgencyResource) -> None: routes_for_agency.list, ) - class RoutesForAgencyResourceWithStreamingResponse: def __init__(self, routes_for_agency: RoutesForAgencyResource) -> None: self._routes_for_agency = routes_for_agency @@ -153,11 +147,10 @@ def __init__(self, routes_for_agency: RoutesForAgencyResource) -> None: routes_for_agency.list, ) - class AsyncRoutesForAgencyResourceWithStreamingResponse: def __init__(self, routes_for_agency: AsyncRoutesForAgencyResource) -> None: self._routes_for_agency = routes_for_agency self.list = async_to_streamed_response_wrapper( routes_for_agency.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/routes_for_location.py b/src/onebusaway/resources/routes_for_location.py index d315909..7743b84 100644 --- a/src/onebusaway/resources/routes_for_location.py +++ b/src/onebusaway/resources/routes_for_location.py @@ -4,25 +4,25 @@ import httpx -from ..types import routes_for_location_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.routes_for_location_list_response import RoutesForLocationListResponse -__all__ = ["RoutesForLocationResource", "AsyncRoutesForLocationResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import routes_for_location_list_params +__all__ = ["RoutesForLocationResource", "AsyncRoutesForLocationResource"] class RoutesForLocationResource(SyncAPIResource): @cached_property @@ -44,22 +44,20 @@ def with_streaming_response(self) -> RoutesForLocationResourceWithStreamingRespo """ return RoutesForLocationResourceWithStreamingResponse(self) - def list( - self, - *, - lat: float, - lon: float, - lat_span: float | NotGiven = NOT_GIVEN, - lon_span: float | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - radius: float | 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, - ) -> RoutesForLocationListResponse: + def list(self, + *, + lat: float, + lon: float, + lat_span: float | NotGiven = NOT_GIVEN, + lon_span: float | NotGiven = NOT_GIVEN, + query: str | NotGiven = NOT_GIVEN, + radius: float | 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,) -> RoutesForLocationListResponse: """ routes-for-location @@ -74,27 +72,17 @@ def list( """ return self._get( "/api/where/routes-for-location.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "lat": lat, - "lon": lon, - "lat_span": lat_span, - "lon_span": lon_span, - "query": query, - "radius": radius, - }, - routes_for_location_list_params.RoutesForLocationListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "lat": lat, + "lon": lon, + "lat_span": lat_span, + "lon_span": lon_span, + "query": query, + "radius": radius, + }, routes_for_location_list_params.RoutesForLocationListParams)), cast_to=RoutesForLocationListResponse, ) - class AsyncRoutesForLocationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRoutesForLocationResourceWithRawResponse: @@ -115,22 +103,20 @@ def with_streaming_response(self) -> AsyncRoutesForLocationResourceWithStreaming """ return AsyncRoutesForLocationResourceWithStreamingResponse(self) - async def list( - self, - *, - lat: float, - lon: float, - lat_span: float | NotGiven = NOT_GIVEN, - lon_span: float | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - radius: float | 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, - ) -> RoutesForLocationListResponse: + async def list(self, + *, + lat: float, + lon: float, + lat_span: float | NotGiven = NOT_GIVEN, + lon_span: float | NotGiven = NOT_GIVEN, + query: str | NotGiven = NOT_GIVEN, + radius: float | 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,) -> RoutesForLocationListResponse: """ routes-for-location @@ -145,27 +131,17 @@ async def list( """ return await self._get( "/api/where/routes-for-location.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "lat": lat, - "lon": lon, - "lat_span": lat_span, - "lon_span": lon_span, - "query": query, - "radius": radius, - }, - routes_for_location_list_params.RoutesForLocationListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "lat": lat, + "lon": lon, + "lat_span": lat_span, + "lon_span": lon_span, + "query": query, + "radius": radius, + }, routes_for_location_list_params.RoutesForLocationListParams)), cast_to=RoutesForLocationListResponse, ) - class RoutesForLocationResourceWithRawResponse: def __init__(self, routes_for_location: RoutesForLocationResource) -> None: self._routes_for_location = routes_for_location @@ -174,7 +150,6 @@ def __init__(self, routes_for_location: RoutesForLocationResource) -> None: routes_for_location.list, ) - class AsyncRoutesForLocationResourceWithRawResponse: def __init__(self, routes_for_location: AsyncRoutesForLocationResource) -> None: self._routes_for_location = routes_for_location @@ -183,7 +158,6 @@ def __init__(self, routes_for_location: AsyncRoutesForLocationResource) -> None: routes_for_location.list, ) - class RoutesForLocationResourceWithStreamingResponse: def __init__(self, routes_for_location: RoutesForLocationResource) -> None: self._routes_for_location = routes_for_location @@ -192,11 +166,10 @@ def __init__(self, routes_for_location: RoutesForLocationResource) -> None: routes_for_location.list, ) - class AsyncRoutesForLocationResourceWithStreamingResponse: def __init__(self, routes_for_location: AsyncRoutesForLocationResource) -> None: self._routes_for_location = routes_for_location self.list = async_to_streamed_response_wrapper( routes_for_location.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/schedule_for_route.py b/src/onebusaway/resources/schedule_for_route.py index 3d5509d..66c6a54 100644 --- a/src/onebusaway/resources/schedule_for_route.py +++ b/src/onebusaway/resources/schedule_for_route.py @@ -2,30 +2,31 @@ from __future__ import annotations -from typing import Union -from datetime import date - import httpx -from ..types import schedule_for_route_retrieve_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.schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse -__all__ = ["ScheduleForRouteResource", "AsyncScheduleForRouteResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform +from datetime import date + +from typing import Union + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import schedule_for_route_retrieve_params + +__all__ = ["ScheduleForRouteResource", "AsyncScheduleForRouteResource"] class ScheduleForRouteResource(SyncAPIResource): @cached_property @@ -47,18 +48,16 @@ def with_streaming_response(self) -> ScheduleForRouteResourceWithStreamingRespon """ return ScheduleForRouteResourceWithStreamingResponse(self) - def retrieve( - self, - route_id: str, - *, - date: Union[str, date] | 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, - ) -> ScheduleForRouteRetrieveResponse: + def retrieve(self, + route_id: str, + *, + date: Union[str, date] | 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,) -> ScheduleForRouteRetrieveResponse: """ Retrieve the full schedule for a route on a particular day @@ -75,22 +74,17 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return self._get( f"/api/where/schedule-for-route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - {"date": date}, schedule_for_route_retrieve_params.ScheduleForRouteRetrieveParams - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "date": date + }, schedule_for_route_retrieve_params.ScheduleForRouteRetrieveParams)), cast_to=ScheduleForRouteRetrieveResponse, ) - class AsyncScheduleForRouteResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncScheduleForRouteResourceWithRawResponse: @@ -111,18 +105,16 @@ def with_streaming_response(self) -> AsyncScheduleForRouteResourceWithStreamingR """ return AsyncScheduleForRouteResourceWithStreamingResponse(self) - async def retrieve( - self, - route_id: str, - *, - date: Union[str, date] | 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, - ) -> ScheduleForRouteRetrieveResponse: + async def retrieve(self, + route_id: str, + *, + date: Union[str, date] | 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,) -> ScheduleForRouteRetrieveResponse: """ Retrieve the full schedule for a route on a particular day @@ -139,22 +131,17 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return await self._get( f"/api/where/schedule-for-route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"date": date}, schedule_for_route_retrieve_params.ScheduleForRouteRetrieveParams - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "date": date + }, schedule_for_route_retrieve_params.ScheduleForRouteRetrieveParams)), cast_to=ScheduleForRouteRetrieveResponse, ) - class ScheduleForRouteResourceWithRawResponse: def __init__(self, schedule_for_route: ScheduleForRouteResource) -> None: self._schedule_for_route = schedule_for_route @@ -163,7 +150,6 @@ def __init__(self, schedule_for_route: ScheduleForRouteResource) -> None: schedule_for_route.retrieve, ) - class AsyncScheduleForRouteResourceWithRawResponse: def __init__(self, schedule_for_route: AsyncScheduleForRouteResource) -> None: self._schedule_for_route = schedule_for_route @@ -172,7 +158,6 @@ def __init__(self, schedule_for_route: AsyncScheduleForRouteResource) -> None: schedule_for_route.retrieve, ) - class ScheduleForRouteResourceWithStreamingResponse: def __init__(self, schedule_for_route: ScheduleForRouteResource) -> None: self._schedule_for_route = schedule_for_route @@ -181,11 +166,10 @@ def __init__(self, schedule_for_route: ScheduleForRouteResource) -> None: schedule_for_route.retrieve, ) - class AsyncScheduleForRouteResourceWithStreamingResponse: def __init__(self, schedule_for_route: AsyncScheduleForRouteResource) -> None: self._schedule_for_route = schedule_for_route self.retrieve = async_to_streamed_response_wrapper( schedule_for_route.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/schedule_for_stop.py b/src/onebusaway/resources/schedule_for_stop.py index 78b4d36..5c71e9c 100644 --- a/src/onebusaway/resources/schedule_for_stop.py +++ b/src/onebusaway/resources/schedule_for_stop.py @@ -2,30 +2,31 @@ from __future__ import annotations -from typing import Union -from datetime import date - import httpx -from ..types import schedule_for_stop_retrieve_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.schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse -__all__ = ["ScheduleForStopResource", "AsyncScheduleForStopResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform +from datetime import date + +from typing import Union + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import schedule_for_stop_retrieve_params + +__all__ = ["ScheduleForStopResource", "AsyncScheduleForStopResource"] class ScheduleForStopResource(SyncAPIResource): @cached_property @@ -47,18 +48,16 @@ def with_streaming_response(self) -> ScheduleForStopResourceWithStreamingRespons """ return ScheduleForStopResourceWithStreamingResponse(self) - def retrieve( - self, - stop_id: str, - *, - date: Union[str, date] | 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, - ) -> ScheduleForStopRetrieveResponse: + def retrieve(self, + stop_id: str, + *, + date: Union[str, date] | 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,) -> ScheduleForStopRetrieveResponse: """ Get schedule for a specific stop @@ -75,20 +74,17 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return self._get( f"/api/where/schedule-for-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"date": date}, schedule_for_stop_retrieve_params.ScheduleForStopRetrieveParams), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "date": date + }, schedule_for_stop_retrieve_params.ScheduleForStopRetrieveParams)), cast_to=ScheduleForStopRetrieveResponse, ) - class AsyncScheduleForStopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncScheduleForStopResourceWithRawResponse: @@ -109,18 +105,16 @@ def with_streaming_response(self) -> AsyncScheduleForStopResourceWithStreamingRe """ return AsyncScheduleForStopResourceWithStreamingResponse(self) - async def retrieve( - self, - stop_id: str, - *, - date: Union[str, date] | 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, - ) -> ScheduleForStopRetrieveResponse: + async def retrieve(self, + stop_id: str, + *, + date: Union[str, date] | 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,) -> ScheduleForStopRetrieveResponse: """ Get schedule for a specific stop @@ -137,22 +131,17 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return await self._get( f"/api/where/schedule-for-stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"date": date}, schedule_for_stop_retrieve_params.ScheduleForStopRetrieveParams - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "date": date + }, schedule_for_stop_retrieve_params.ScheduleForStopRetrieveParams)), cast_to=ScheduleForStopRetrieveResponse, ) - class ScheduleForStopResourceWithRawResponse: def __init__(self, schedule_for_stop: ScheduleForStopResource) -> None: self._schedule_for_stop = schedule_for_stop @@ -161,7 +150,6 @@ def __init__(self, schedule_for_stop: ScheduleForStopResource) -> None: schedule_for_stop.retrieve, ) - class AsyncScheduleForStopResourceWithRawResponse: def __init__(self, schedule_for_stop: AsyncScheduleForStopResource) -> None: self._schedule_for_stop = schedule_for_stop @@ -170,7 +158,6 @@ def __init__(self, schedule_for_stop: AsyncScheduleForStopResource) -> None: schedule_for_stop.retrieve, ) - class ScheduleForStopResourceWithStreamingResponse: def __init__(self, schedule_for_stop: ScheduleForStopResource) -> None: self._schedule_for_stop = schedule_for_stop @@ -179,11 +166,10 @@ def __init__(self, schedule_for_stop: ScheduleForStopResource) -> None: schedule_for_stop.retrieve, ) - class AsyncScheduleForStopResourceWithStreamingResponse: def __init__(self, schedule_for_stop: AsyncScheduleForStopResource) -> None: self._schedule_for_stop = schedule_for_stop self.retrieve = async_to_streamed_response_wrapper( schedule_for_stop.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/search_for_route.py b/src/onebusaway/resources/search_for_route.py index fe1d9a2..37f7cb4 100644 --- a/src/onebusaway/resources/search_for_route.py +++ b/src/onebusaway/resources/search_for_route.py @@ -4,25 +4,25 @@ import httpx -from ..types import search_for_route_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.search_for_route_list_response import SearchForRouteListResponse -__all__ = ["SearchForRouteResource", "AsyncSearchForRouteResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import search_for_route_list_params +__all__ = ["SearchForRouteResource", "AsyncSearchForRouteResource"] class SearchForRouteResource(SyncAPIResource): @cached_property @@ -44,18 +44,16 @@ def with_streaming_response(self) -> SearchForRouteResourceWithStreamingResponse """ return SearchForRouteResourceWithStreamingResponse(self) - def list( - self, - *, - input: str, - max_count: int | 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, - ) -> SearchForRouteListResponse: + def list(self, + *, + input: str, + max_count: int | 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,) -> SearchForRouteListResponse: """ Search for a route based on its name. @@ -74,23 +72,13 @@ def list( """ return self._get( "/api/where/search/route.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "input": input, - "max_count": max_count, - }, - search_for_route_list_params.SearchForRouteListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "input": input, + "max_count": max_count, + }, search_for_route_list_params.SearchForRouteListParams)), cast_to=SearchForRouteListResponse, ) - class AsyncSearchForRouteResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSearchForRouteResourceWithRawResponse: @@ -111,18 +99,16 @@ def with_streaming_response(self) -> AsyncSearchForRouteResourceWithStreamingRes """ return AsyncSearchForRouteResourceWithStreamingResponse(self) - async def list( - self, - *, - input: str, - max_count: int | 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, - ) -> SearchForRouteListResponse: + async def list(self, + *, + input: str, + max_count: int | 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,) -> SearchForRouteListResponse: """ Search for a route based on its name. @@ -141,23 +127,13 @@ async def list( """ return await self._get( "/api/where/search/route.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "input": input, - "max_count": max_count, - }, - search_for_route_list_params.SearchForRouteListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "input": input, + "max_count": max_count, + }, search_for_route_list_params.SearchForRouteListParams)), cast_to=SearchForRouteListResponse, ) - class SearchForRouteResourceWithRawResponse: def __init__(self, search_for_route: SearchForRouteResource) -> None: self._search_for_route = search_for_route @@ -166,7 +142,6 @@ def __init__(self, search_for_route: SearchForRouteResource) -> None: search_for_route.list, ) - class AsyncSearchForRouteResourceWithRawResponse: def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None: self._search_for_route = search_for_route @@ -175,7 +150,6 @@ def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None: search_for_route.list, ) - class SearchForRouteResourceWithStreamingResponse: def __init__(self, search_for_route: SearchForRouteResource) -> None: self._search_for_route = search_for_route @@ -184,11 +158,10 @@ def __init__(self, search_for_route: SearchForRouteResource) -> None: search_for_route.list, ) - class AsyncSearchForRouteResourceWithStreamingResponse: def __init__(self, search_for_route: AsyncSearchForRouteResource) -> None: self._search_for_route = search_for_route self.list = async_to_streamed_response_wrapper( search_for_route.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/search_for_stop.py b/src/onebusaway/resources/search_for_stop.py index 8efb8ad..a0320a3 100644 --- a/src/onebusaway/resources/search_for_stop.py +++ b/src/onebusaway/resources/search_for_stop.py @@ -4,25 +4,25 @@ import httpx -from ..types import search_for_stop_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.search_for_stop_list_response import SearchForStopListResponse -__all__ = ["SearchForStopResource", "AsyncSearchForStopResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import search_for_stop_list_params +__all__ = ["SearchForStopResource", "AsyncSearchForStopResource"] class SearchForStopResource(SyncAPIResource): @cached_property @@ -44,18 +44,16 @@ def with_streaming_response(self) -> SearchForStopResourceWithStreamingResponse: """ return SearchForStopResourceWithStreamingResponse(self) - def list( - self, - *, - input: str, - max_count: int | 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, - ) -> SearchForStopListResponse: + def list(self, + *, + input: str, + max_count: int | 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,) -> SearchForStopListResponse: """ Search for a stop based on its name. @@ -74,23 +72,13 @@ def list( """ return self._get( "/api/where/search/stop.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "input": input, - "max_count": max_count, - }, - search_for_stop_list_params.SearchForStopListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "input": input, + "max_count": max_count, + }, search_for_stop_list_params.SearchForStopListParams)), cast_to=SearchForStopListResponse, ) - class AsyncSearchForStopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSearchForStopResourceWithRawResponse: @@ -111,18 +99,16 @@ def with_streaming_response(self) -> AsyncSearchForStopResourceWithStreamingResp """ return AsyncSearchForStopResourceWithStreamingResponse(self) - async def list( - self, - *, - input: str, - max_count: int | 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, - ) -> SearchForStopListResponse: + async def list(self, + *, + input: str, + max_count: int | 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,) -> SearchForStopListResponse: """ Search for a stop based on its name. @@ -141,23 +127,13 @@ async def list( """ return await self._get( "/api/where/search/stop.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "input": input, - "max_count": max_count, - }, - search_for_stop_list_params.SearchForStopListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "input": input, + "max_count": max_count, + }, search_for_stop_list_params.SearchForStopListParams)), cast_to=SearchForStopListResponse, ) - class SearchForStopResourceWithRawResponse: def __init__(self, search_for_stop: SearchForStopResource) -> None: self._search_for_stop = search_for_stop @@ -166,7 +142,6 @@ def __init__(self, search_for_stop: SearchForStopResource) -> None: search_for_stop.list, ) - class AsyncSearchForStopResourceWithRawResponse: def __init__(self, search_for_stop: AsyncSearchForStopResource) -> None: self._search_for_stop = search_for_stop @@ -175,7 +150,6 @@ def __init__(self, search_for_stop: AsyncSearchForStopResource) -> None: search_for_stop.list, ) - class SearchForStopResourceWithStreamingResponse: def __init__(self, search_for_stop: SearchForStopResource) -> None: self._search_for_stop = search_for_stop @@ -184,11 +158,10 @@ def __init__(self, search_for_stop: SearchForStopResource) -> None: search_for_stop.list, ) - class AsyncSearchForStopResourceWithStreamingResponse: def __init__(self, search_for_stop: AsyncSearchForStopResource) -> None: self._search_for_stop = search_for_stop self.list = async_to_streamed_response_wrapper( search_for_stop.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/shape.py b/src/onebusaway/resources/shape.py index 0b4c291..ddc989f 100644 --- a/src/onebusaway/resources/shape.py +++ b/src/onebusaway/resources/shape.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.shape_retrieve_response import ShapeRetrieveResponse -__all__ = ["ShapeResource", "AsyncShapeResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["ShapeResource", "AsyncShapeResource"] class ShapeResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> ShapeResourceWithStreamingResponse: """ return ShapeResourceWithStreamingResponse(self) - def retrieve( - self, - shape_id: str, - *, - # 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, - ) -> ShapeRetrieveResponse: + def retrieve(self, + shape_id: str, + *, + # 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,) -> ShapeRetrieveResponse: """ Retrieve a shape (the path traveled by a transit vehicle) by ID. @@ -63,16 +63,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not shape_id: - raise ValueError(f"Expected a non-empty value for `shape_id` but received {shape_id!r}") + raise ValueError( + f'Expected a non-empty value for `shape_id` but received {shape_id!r}' + ) return self._get( f"/api/where/shape/{shape_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=ShapeRetrieveResponse, ) - class AsyncShapeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncShapeResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncShapeResourceWithStreamingResponse: """ return AsyncShapeResourceWithStreamingResponse(self) - async def retrieve( - self, - shape_id: str, - *, - # 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, - ) -> ShapeRetrieveResponse: + async def retrieve(self, + shape_id: str, + *, + # 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,) -> ShapeRetrieveResponse: """ Retrieve a shape (the path traveled by a transit vehicle) by ID. @@ -117,16 +114,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not shape_id: - raise ValueError(f"Expected a non-empty value for `shape_id` but received {shape_id!r}") + raise ValueError( + f'Expected a non-empty value for `shape_id` but received {shape_id!r}' + ) return await self._get( f"/api/where/shape/{shape_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=ShapeRetrieveResponse, ) - class ShapeResourceWithRawResponse: def __init__(self, shape: ShapeResource) -> None: self._shape = shape @@ -135,7 +131,6 @@ def __init__(self, shape: ShapeResource) -> None: shape.retrieve, ) - class AsyncShapeResourceWithRawResponse: def __init__(self, shape: AsyncShapeResource) -> None: self._shape = shape @@ -144,7 +139,6 @@ def __init__(self, shape: AsyncShapeResource) -> None: shape.retrieve, ) - class ShapeResourceWithStreamingResponse: def __init__(self, shape: ShapeResource) -> None: self._shape = shape @@ -153,11 +147,10 @@ def __init__(self, shape: ShapeResource) -> None: shape.retrieve, ) - class AsyncShapeResourceWithStreamingResponse: def __init__(self, shape: AsyncShapeResource) -> None: self._shape = shape self.retrieve = async_to_streamed_response_wrapper( shape.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/stop.py b/src/onebusaway/resources/stop.py index 502f8ce..ba53226 100644 --- a/src/onebusaway/resources/stop.py +++ b/src/onebusaway/resources/stop.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.stop_retrieve_response import StopRetrieveResponse -__all__ = ["StopResource", "AsyncStopResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["StopResource", "AsyncStopResource"] class StopResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> StopResourceWithStreamingResponse: """ return StopResourceWithStreamingResponse(self) - def retrieve( - self, - stop_id: str, - *, - # 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, - ) -> StopRetrieveResponse: + def retrieve(self, + stop_id: str, + *, + # 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,) -> StopRetrieveResponse: """ Get details of a specific stop @@ -63,16 +63,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return self._get( f"/api/where/stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=StopRetrieveResponse, ) - class AsyncStopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStopResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncStopResourceWithStreamingResponse: """ return AsyncStopResourceWithStreamingResponse(self) - async def retrieve( - self, - stop_id: str, - *, - # 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, - ) -> StopRetrieveResponse: + async def retrieve(self, + stop_id: str, + *, + # 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,) -> StopRetrieveResponse: """ Get details of a specific stop @@ -117,16 +114,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not stop_id: - raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}") + raise ValueError( + f'Expected a non-empty value for `stop_id` but received {stop_id!r}' + ) return await self._get( f"/api/where/stop/{stop_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=StopRetrieveResponse, ) - class StopResourceWithRawResponse: def __init__(self, stop: StopResource) -> None: self._stop = stop @@ -135,7 +131,6 @@ def __init__(self, stop: StopResource) -> None: stop.retrieve, ) - class AsyncStopResourceWithRawResponse: def __init__(self, stop: AsyncStopResource) -> None: self._stop = stop @@ -144,7 +139,6 @@ def __init__(self, stop: AsyncStopResource) -> None: stop.retrieve, ) - class StopResourceWithStreamingResponse: def __init__(self, stop: StopResource) -> None: self._stop = stop @@ -153,11 +147,10 @@ def __init__(self, stop: StopResource) -> None: stop.retrieve, ) - class AsyncStopResourceWithStreamingResponse: def __init__(self, stop: AsyncStopResource) -> None: self._stop = stop self.retrieve = async_to_streamed_response_wrapper( stop.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/stop_ids_for_agency.py b/src/onebusaway/resources/stop_ids_for_agency.py index 3850d16..55a39cd 100644 --- a/src/onebusaway/resources/stop_ids_for_agency.py +++ b/src/onebusaway/resources/stop_ids_for_agency.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.stop_ids_for_agency_list_response import StopIDsForAgencyListResponse -__all__ = ["StopIDsForAgencyResource", "AsyncStopIDsForAgencyResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["StopIDsForAgencyResource", "AsyncStopIDsForAgencyResource"] class StopIDsForAgencyResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> StopIDsForAgencyResourceWithStreamingRespon """ return StopIDsForAgencyResourceWithStreamingResponse(self) - def list( - self, - agency_id: str, - *, - # 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, - ) -> StopIDsForAgencyListResponse: + def list(self, + agency_id: str, + *, + # 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,) -> StopIDsForAgencyListResponse: """ Get stop IDs for a specific agency @@ -63,16 +63,15 @@ def list( 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}") + 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/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=StopIDsForAgencyListResponse, ) - class AsyncStopIDsForAgencyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStopIDsForAgencyResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncStopIDsForAgencyResourceWithStreamingR """ return AsyncStopIDsForAgencyResourceWithStreamingResponse(self) - async def list( - self, - agency_id: str, - *, - # 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, - ) -> StopIDsForAgencyListResponse: + async def list(self, + agency_id: str, + *, + # 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,) -> StopIDsForAgencyListResponse: """ Get stop IDs for a specific agency @@ -117,16 +114,15 @@ async def list( 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}") + 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/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=StopIDsForAgencyListResponse, ) - class StopIDsForAgencyResourceWithRawResponse: def __init__(self, stop_ids_for_agency: StopIDsForAgencyResource) -> None: self._stop_ids_for_agency = stop_ids_for_agency @@ -135,7 +131,6 @@ def __init__(self, stop_ids_for_agency: StopIDsForAgencyResource) -> None: stop_ids_for_agency.list, ) - class AsyncStopIDsForAgencyResourceWithRawResponse: def __init__(self, stop_ids_for_agency: AsyncStopIDsForAgencyResource) -> None: self._stop_ids_for_agency = stop_ids_for_agency @@ -144,7 +139,6 @@ def __init__(self, stop_ids_for_agency: AsyncStopIDsForAgencyResource) -> None: stop_ids_for_agency.list, ) - class StopIDsForAgencyResourceWithStreamingResponse: def __init__(self, stop_ids_for_agency: StopIDsForAgencyResource) -> None: self._stop_ids_for_agency = stop_ids_for_agency @@ -153,11 +147,10 @@ def __init__(self, stop_ids_for_agency: StopIDsForAgencyResource) -> None: stop_ids_for_agency.list, ) - class AsyncStopIDsForAgencyResourceWithStreamingResponse: def __init__(self, stop_ids_for_agency: AsyncStopIDsForAgencyResource) -> None: self._stop_ids_for_agency = stop_ids_for_agency self.list = async_to_streamed_response_wrapper( stop_ids_for_agency.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/stops_for_agency.py b/src/onebusaway/resources/stops_for_agency.py index 834ab5c..9e09796 100644 --- a/src/onebusaway/resources/stops_for_agency.py +++ b/src/onebusaway/resources/stops_for_agency.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.stops_for_agency_list_response import StopsForAgencyListResponse -__all__ = ["StopsForAgencyResource", "AsyncStopsForAgencyResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["StopsForAgencyResource", "AsyncStopsForAgencyResource"] class StopsForAgencyResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> StopsForAgencyResourceWithStreamingResponse """ return StopsForAgencyResourceWithStreamingResponse(self) - def list( - self, - agency_id: str, - *, - # 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, - ) -> StopsForAgencyListResponse: + def list(self, + agency_id: str, + *, + # 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,) -> StopsForAgencyListResponse: """ Get stops for a specific agency @@ -63,16 +63,15 @@ def list( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return self._get( f"/api/where/stops-for-agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=StopsForAgencyListResponse, ) - class AsyncStopsForAgencyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStopsForAgencyResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncStopsForAgencyResourceWithStreamingRes """ return AsyncStopsForAgencyResourceWithStreamingResponse(self) - async def list( - self, - agency_id: str, - *, - # 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, - ) -> StopsForAgencyListResponse: + async def list(self, + agency_id: str, + *, + # 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,) -> StopsForAgencyListResponse: """ Get stops for a specific agency @@ -117,16 +114,15 @@ async def list( 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}") + raise ValueError( + f'Expected a non-empty value for `agency_id` but received {agency_id!r}' + ) return await self._get( f"/api/where/stops-for-agency/{agency_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=StopsForAgencyListResponse, ) - class StopsForAgencyResourceWithRawResponse: def __init__(self, stops_for_agency: StopsForAgencyResource) -> None: self._stops_for_agency = stops_for_agency @@ -135,7 +131,6 @@ def __init__(self, stops_for_agency: StopsForAgencyResource) -> None: stops_for_agency.list, ) - class AsyncStopsForAgencyResourceWithRawResponse: def __init__(self, stops_for_agency: AsyncStopsForAgencyResource) -> None: self._stops_for_agency = stops_for_agency @@ -144,7 +139,6 @@ def __init__(self, stops_for_agency: AsyncStopsForAgencyResource) -> None: stops_for_agency.list, ) - class StopsForAgencyResourceWithStreamingResponse: def __init__(self, stops_for_agency: StopsForAgencyResource) -> None: self._stops_for_agency = stops_for_agency @@ -153,11 +147,10 @@ def __init__(self, stops_for_agency: StopsForAgencyResource) -> None: stops_for_agency.list, ) - class AsyncStopsForAgencyResourceWithStreamingResponse: def __init__(self, stops_for_agency: AsyncStopsForAgencyResource) -> None: self._stops_for_agency = stops_for_agency self.list = async_to_streamed_response_wrapper( stops_for_agency.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/stops_for_location.py b/src/onebusaway/resources/stops_for_location.py index 80322e3..b589d59 100644 --- a/src/onebusaway/resources/stops_for_location.py +++ b/src/onebusaway/resources/stops_for_location.py @@ -4,25 +4,25 @@ import httpx -from ..types import stops_for_location_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.stops_for_location_list_response import StopsForLocationListResponse -__all__ = ["StopsForLocationResource", "AsyncStopsForLocationResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import stops_for_location_list_params +__all__ = ["StopsForLocationResource", "AsyncStopsForLocationResource"] class StopsForLocationResource(SyncAPIResource): @cached_property @@ -44,22 +44,20 @@ def with_streaming_response(self) -> StopsForLocationResourceWithStreamingRespon """ return StopsForLocationResourceWithStreamingResponse(self) - def list( - self, - *, - lat: float, - lon: float, - lat_span: float | NotGiven = NOT_GIVEN, - lon_span: float | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - radius: float | 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, - ) -> StopsForLocationListResponse: + def list(self, + *, + lat: float, + lon: float, + lat_span: float | NotGiven = NOT_GIVEN, + lon_span: float | NotGiven = NOT_GIVEN, + query: str | NotGiven = NOT_GIVEN, + radius: float | 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,) -> StopsForLocationListResponse: """ stops-for-location @@ -82,27 +80,17 @@ def list( """ return self._get( "/api/where/stops-for-location.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "lat": lat, - "lon": lon, - "lat_span": lat_span, - "lon_span": lon_span, - "query": query, - "radius": radius, - }, - stops_for_location_list_params.StopsForLocationListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "lat": lat, + "lon": lon, + "lat_span": lat_span, + "lon_span": lon_span, + "query": query, + "radius": radius, + }, stops_for_location_list_params.StopsForLocationListParams)), cast_to=StopsForLocationListResponse, ) - class AsyncStopsForLocationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStopsForLocationResourceWithRawResponse: @@ -123,22 +111,20 @@ def with_streaming_response(self) -> AsyncStopsForLocationResourceWithStreamingR """ return AsyncStopsForLocationResourceWithStreamingResponse(self) - async def list( - self, - *, - lat: float, - lon: float, - lat_span: float | NotGiven = NOT_GIVEN, - lon_span: float | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - radius: float | 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, - ) -> StopsForLocationListResponse: + async def list(self, + *, + lat: float, + lon: float, + lat_span: float | NotGiven = NOT_GIVEN, + lon_span: float | NotGiven = NOT_GIVEN, + query: str | NotGiven = NOT_GIVEN, + radius: float | 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,) -> StopsForLocationListResponse: """ stops-for-location @@ -161,27 +147,17 @@ async def list( """ return await self._get( "/api/where/stops-for-location.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "lat": lat, - "lon": lon, - "lat_span": lat_span, - "lon_span": lon_span, - "query": query, - "radius": radius, - }, - stops_for_location_list_params.StopsForLocationListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "lat": lat, + "lon": lon, + "lat_span": lat_span, + "lon_span": lon_span, + "query": query, + "radius": radius, + }, stops_for_location_list_params.StopsForLocationListParams)), cast_to=StopsForLocationListResponse, ) - class StopsForLocationResourceWithRawResponse: def __init__(self, stops_for_location: StopsForLocationResource) -> None: self._stops_for_location = stops_for_location @@ -190,7 +166,6 @@ def __init__(self, stops_for_location: StopsForLocationResource) -> None: stops_for_location.list, ) - class AsyncStopsForLocationResourceWithRawResponse: def __init__(self, stops_for_location: AsyncStopsForLocationResource) -> None: self._stops_for_location = stops_for_location @@ -199,7 +174,6 @@ def __init__(self, stops_for_location: AsyncStopsForLocationResource) -> None: stops_for_location.list, ) - class StopsForLocationResourceWithStreamingResponse: def __init__(self, stops_for_location: StopsForLocationResource) -> None: self._stops_for_location = stops_for_location @@ -208,11 +182,10 @@ def __init__(self, stops_for_location: StopsForLocationResource) -> None: stops_for_location.list, ) - class AsyncStopsForLocationResourceWithStreamingResponse: def __init__(self, stops_for_location: AsyncStopsForLocationResource) -> None: self._stops_for_location = stops_for_location self.list = async_to_streamed_response_wrapper( stops_for_location.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/stops_for_route.py b/src/onebusaway/resources/stops_for_route.py index 36f7514..454b725 100644 --- a/src/onebusaway/resources/stops_for_route.py +++ b/src/onebusaway/resources/stops_for_route.py @@ -4,25 +4,25 @@ import httpx -from ..types import stops_for_route_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.stops_for_route_list_response import StopsForRouteListResponse -__all__ = ["StopsForRouteResource", "AsyncStopsForRouteResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import stops_for_route_list_params +__all__ = ["StopsForRouteResource", "AsyncStopsForRouteResource"] class StopsForRouteResource(SyncAPIResource): @cached_property @@ -44,19 +44,17 @@ def with_streaming_response(self) -> StopsForRouteResourceWithStreamingResponse: """ return StopsForRouteResourceWithStreamingResponse(self) - def list( - self, - route_id: str, - *, - include_polylines: bool | NotGiven = NOT_GIVEN, - 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, - ) -> StopsForRouteListResponse: + def list(self, + route_id: str, + *, + include_polylines: bool | NotGiven = NOT_GIVEN, + 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,) -> StopsForRouteListResponse: """ Get stops for a specific route @@ -74,26 +72,18 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return self._get( f"/api/where/stops-for-route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "include_polylines": include_polylines, - "time": time, - }, - stops_for_route_list_params.StopsForRouteListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "include_polylines": include_polylines, + "time": time, + }, stops_for_route_list_params.StopsForRouteListParams)), cast_to=StopsForRouteListResponse, ) - class AsyncStopsForRouteResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStopsForRouteResourceWithRawResponse: @@ -114,19 +104,17 @@ def with_streaming_response(self) -> AsyncStopsForRouteResourceWithStreamingResp """ return AsyncStopsForRouteResourceWithStreamingResponse(self) - async def list( - self, - route_id: str, - *, - include_polylines: bool | NotGiven = NOT_GIVEN, - 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, - ) -> StopsForRouteListResponse: + async def list(self, + route_id: str, + *, + include_polylines: bool | NotGiven = NOT_GIVEN, + 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,) -> StopsForRouteListResponse: """ Get stops for a specific route @@ -144,26 +132,18 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return await self._get( f"/api/where/stops-for-route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "include_polylines": include_polylines, - "time": time, - }, - stops_for_route_list_params.StopsForRouteListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "include_polylines": include_polylines, + "time": time, + }, stops_for_route_list_params.StopsForRouteListParams)), cast_to=StopsForRouteListResponse, ) - class StopsForRouteResourceWithRawResponse: def __init__(self, stops_for_route: StopsForRouteResource) -> None: self._stops_for_route = stops_for_route @@ -172,7 +152,6 @@ def __init__(self, stops_for_route: StopsForRouteResource) -> None: stops_for_route.list, ) - class AsyncStopsForRouteResourceWithRawResponse: def __init__(self, stops_for_route: AsyncStopsForRouteResource) -> None: self._stops_for_route = stops_for_route @@ -181,7 +160,6 @@ def __init__(self, stops_for_route: AsyncStopsForRouteResource) -> None: stops_for_route.list, ) - class StopsForRouteResourceWithStreamingResponse: def __init__(self, stops_for_route: StopsForRouteResource) -> None: self._stops_for_route = stops_for_route @@ -190,11 +168,10 @@ def __init__(self, stops_for_route: StopsForRouteResource) -> None: stops_for_route.list, ) - class AsyncStopsForRouteResourceWithStreamingResponse: def __init__(self, stops_for_route: AsyncStopsForRouteResource) -> None: self._stops_for_route = stops_for_route self.list = async_to_streamed_response_wrapper( stops_for_route.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/trip.py b/src/onebusaway/resources/trip.py index 9b7e137..e5a9bb5 100644 --- a/src/onebusaway/resources/trip.py +++ b/src/onebusaway/resources/trip.py @@ -4,20 +4,22 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.trip_retrieve_response import TripRetrieveResponse -__all__ = ["TripResource", "AsyncTripResource"] +from .._base_client import make_request_options + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + +__all__ = ["TripResource", "AsyncTripResource"] class TripResource(SyncAPIResource): @cached_property @@ -39,17 +41,15 @@ def with_streaming_response(self) -> TripResourceWithStreamingResponse: """ return TripResourceWithStreamingResponse(self) - def retrieve( - self, - trip_id: str, - *, - # 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, - ) -> TripRetrieveResponse: + def retrieve(self, + trip_id: str, + *, + # 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,) -> TripRetrieveResponse: """ Get details of a specific trip @@ -63,16 +63,15 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not trip_id: - raise ValueError(f"Expected a non-empty value for `trip_id` but received {trip_id!r}") + raise ValueError( + f'Expected a non-empty value for `trip_id` but received {trip_id!r}' + ) return self._get( f"/api/where/trip/{trip_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=TripRetrieveResponse, ) - class AsyncTripResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTripResourceWithRawResponse: @@ -93,17 +92,15 @@ def with_streaming_response(self) -> AsyncTripResourceWithStreamingResponse: """ return AsyncTripResourceWithStreamingResponse(self) - async def retrieve( - self, - trip_id: str, - *, - # 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, - ) -> TripRetrieveResponse: + async def retrieve(self, + trip_id: str, + *, + # 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,) -> TripRetrieveResponse: """ Get details of a specific trip @@ -117,16 +114,15 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not trip_id: - raise ValueError(f"Expected a non-empty value for `trip_id` but received {trip_id!r}") + raise ValueError( + f'Expected a non-empty value for `trip_id` but received {trip_id!r}' + ) return await self._get( f"/api/where/trip/{trip_id}.json", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), cast_to=TripRetrieveResponse, ) - class TripResourceWithRawResponse: def __init__(self, trip: TripResource) -> None: self._trip = trip @@ -135,7 +131,6 @@ def __init__(self, trip: TripResource) -> None: trip.retrieve, ) - class AsyncTripResourceWithRawResponse: def __init__(self, trip: AsyncTripResource) -> None: self._trip = trip @@ -144,7 +139,6 @@ def __init__(self, trip: AsyncTripResource) -> None: trip.retrieve, ) - class TripResourceWithStreamingResponse: def __init__(self, trip: TripResource) -> None: self._trip = trip @@ -153,11 +147,10 @@ def __init__(self, trip: TripResource) -> None: trip.retrieve, ) - class AsyncTripResourceWithStreamingResponse: def __init__(self, trip: AsyncTripResource) -> None: self._trip = trip self.retrieve = async_to_streamed_response_wrapper( trip.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/trip_details.py b/src/onebusaway/resources/trip_details.py index 71092c9..cbbb057 100644 --- a/src/onebusaway/resources/trip_details.py +++ b/src/onebusaway/resources/trip_details.py @@ -4,25 +4,25 @@ import httpx -from ..types import trip_detail_retrieve_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.trip_detail_retrieve_response import TripDetailRetrieveResponse -__all__ = ["TripDetailsResource", "AsyncTripDetailsResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import trip_detail_retrieve_params +__all__ = ["TripDetailsResource", "AsyncTripDetailsResource"] class TripDetailsResource(SyncAPIResource): @cached_property @@ -44,22 +44,20 @@ def with_streaming_response(self) -> TripDetailsResourceWithStreamingResponse: """ return TripDetailsResourceWithStreamingResponse(self) - def retrieve( - self, - trip_id: str, - *, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_status: bool | NotGiven = NOT_GIVEN, - include_trip: bool | NotGiven = NOT_GIVEN, - service_date: int | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripDetailRetrieveResponse: + def retrieve(self, + trip_id: str, + *, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_status: bool | NotGiven = NOT_GIVEN, + include_trip: bool | NotGiven = NOT_GIVEN, + service_date: int | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripDetailRetrieveResponse: """ Retrieve Trip Details @@ -86,29 +84,21 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not trip_id: - raise ValueError(f"Expected a non-empty value for `trip_id` but received {trip_id!r}") + raise ValueError( + f'Expected a non-empty value for `trip_id` but received {trip_id!r}' + ) return self._get( f"/api/where/trip-details/{trip_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "include_schedule": include_schedule, - "include_status": include_status, - "include_trip": include_trip, - "service_date": service_date, - "time": time, - }, - trip_detail_retrieve_params.TripDetailRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "include_schedule": include_schedule, + "include_status": include_status, + "include_trip": include_trip, + "service_date": service_date, + "time": time, + }, trip_detail_retrieve_params.TripDetailRetrieveParams)), cast_to=TripDetailRetrieveResponse, ) - class AsyncTripDetailsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTripDetailsResourceWithRawResponse: @@ -129,22 +119,20 @@ def with_streaming_response(self) -> AsyncTripDetailsResourceWithStreamingRespon """ return AsyncTripDetailsResourceWithStreamingResponse(self) - async def retrieve( - self, - trip_id: str, - *, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_status: bool | NotGiven = NOT_GIVEN, - include_trip: bool | NotGiven = NOT_GIVEN, - service_date: int | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripDetailRetrieveResponse: + async def retrieve(self, + trip_id: str, + *, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_status: bool | NotGiven = NOT_GIVEN, + include_trip: bool | NotGiven = NOT_GIVEN, + service_date: int | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripDetailRetrieveResponse: """ Retrieve Trip Details @@ -171,29 +159,21 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not trip_id: - raise ValueError(f"Expected a non-empty value for `trip_id` but received {trip_id!r}") + raise ValueError( + f'Expected a non-empty value for `trip_id` but received {trip_id!r}' + ) return await self._get( f"/api/where/trip-details/{trip_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "include_schedule": include_schedule, - "include_status": include_status, - "include_trip": include_trip, - "service_date": service_date, - "time": time, - }, - trip_detail_retrieve_params.TripDetailRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "include_schedule": include_schedule, + "include_status": include_status, + "include_trip": include_trip, + "service_date": service_date, + "time": time, + }, trip_detail_retrieve_params.TripDetailRetrieveParams)), cast_to=TripDetailRetrieveResponse, ) - class TripDetailsResourceWithRawResponse: def __init__(self, trip_details: TripDetailsResource) -> None: self._trip_details = trip_details @@ -202,7 +182,6 @@ def __init__(self, trip_details: TripDetailsResource) -> None: trip_details.retrieve, ) - class AsyncTripDetailsResourceWithRawResponse: def __init__(self, trip_details: AsyncTripDetailsResource) -> None: self._trip_details = trip_details @@ -211,7 +190,6 @@ def __init__(self, trip_details: AsyncTripDetailsResource) -> None: trip_details.retrieve, ) - class TripDetailsResourceWithStreamingResponse: def __init__(self, trip_details: TripDetailsResource) -> None: self._trip_details = trip_details @@ -220,11 +198,10 @@ def __init__(self, trip_details: TripDetailsResource) -> None: trip_details.retrieve, ) - class AsyncTripDetailsResourceWithStreamingResponse: def __init__(self, trip_details: AsyncTripDetailsResource) -> None: self._trip_details = trip_details self.retrieve = async_to_streamed_response_wrapper( trip_details.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/trip_for_vehicle.py b/src/onebusaway/resources/trip_for_vehicle.py index 4417b48..4327fc7 100644 --- a/src/onebusaway/resources/trip_for_vehicle.py +++ b/src/onebusaway/resources/trip_for_vehicle.py @@ -4,25 +4,25 @@ import httpx -from ..types import trip_for_vehicle_retrieve_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.trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse -__all__ = ["TripForVehicleResource", "AsyncTripForVehicleResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import trip_for_vehicle_retrieve_params +__all__ = ["TripForVehicleResource", "AsyncTripForVehicleResource"] class TripForVehicleResource(SyncAPIResource): @cached_property @@ -44,21 +44,19 @@ def with_streaming_response(self) -> TripForVehicleResourceWithStreamingResponse """ return TripForVehicleResourceWithStreamingResponse(self) - def retrieve( - self, - vehicle_id: str, - *, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_status: bool | NotGiven = NOT_GIVEN, - include_trip: bool | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripForVehicleRetrieveResponse: + def retrieve(self, + vehicle_id: str, + *, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_status: bool | NotGiven = NOT_GIVEN, + include_trip: bool | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripForVehicleRetrieveResponse: """ Retrieve trip for a specific vehicle @@ -83,28 +81,20 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not vehicle_id: - raise ValueError(f"Expected a non-empty value for `vehicle_id` but received {vehicle_id!r}") + raise ValueError( + f'Expected a non-empty value for `vehicle_id` but received {vehicle_id!r}' + ) return self._get( f"/api/where/trip-for-vehicle/{vehicle_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "include_schedule": include_schedule, - "include_status": include_status, - "include_trip": include_trip, - "time": time, - }, - trip_for_vehicle_retrieve_params.TripForVehicleRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "include_schedule": include_schedule, + "include_status": include_status, + "include_trip": include_trip, + "time": time, + }, trip_for_vehicle_retrieve_params.TripForVehicleRetrieveParams)), cast_to=TripForVehicleRetrieveResponse, ) - class AsyncTripForVehicleResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTripForVehicleResourceWithRawResponse: @@ -125,21 +115,19 @@ def with_streaming_response(self) -> AsyncTripForVehicleResourceWithStreamingRes """ return AsyncTripForVehicleResourceWithStreamingResponse(self) - async def retrieve( - self, - vehicle_id: str, - *, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_status: bool | NotGiven = NOT_GIVEN, - include_trip: bool | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripForVehicleRetrieveResponse: + async def retrieve(self, + vehicle_id: str, + *, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_status: bool | NotGiven = NOT_GIVEN, + include_trip: bool | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripForVehicleRetrieveResponse: """ Retrieve trip for a specific vehicle @@ -164,28 +152,20 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not vehicle_id: - raise ValueError(f"Expected a non-empty value for `vehicle_id` but received {vehicle_id!r}") + raise ValueError( + f'Expected a non-empty value for `vehicle_id` but received {vehicle_id!r}' + ) return await self._get( f"/api/where/trip-for-vehicle/{vehicle_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "include_schedule": include_schedule, - "include_status": include_status, - "include_trip": include_trip, - "time": time, - }, - trip_for_vehicle_retrieve_params.TripForVehicleRetrieveParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "include_schedule": include_schedule, + "include_status": include_status, + "include_trip": include_trip, + "time": time, + }, trip_for_vehicle_retrieve_params.TripForVehicleRetrieveParams)), cast_to=TripForVehicleRetrieveResponse, ) - class TripForVehicleResourceWithRawResponse: def __init__(self, trip_for_vehicle: TripForVehicleResource) -> None: self._trip_for_vehicle = trip_for_vehicle @@ -194,7 +174,6 @@ def __init__(self, trip_for_vehicle: TripForVehicleResource) -> None: trip_for_vehicle.retrieve, ) - class AsyncTripForVehicleResourceWithRawResponse: def __init__(self, trip_for_vehicle: AsyncTripForVehicleResource) -> None: self._trip_for_vehicle = trip_for_vehicle @@ -203,7 +182,6 @@ def __init__(self, trip_for_vehicle: AsyncTripForVehicleResource) -> None: trip_for_vehicle.retrieve, ) - class TripForVehicleResourceWithStreamingResponse: def __init__(self, trip_for_vehicle: TripForVehicleResource) -> None: self._trip_for_vehicle = trip_for_vehicle @@ -212,11 +190,10 @@ def __init__(self, trip_for_vehicle: TripForVehicleResource) -> None: trip_for_vehicle.retrieve, ) - class AsyncTripForVehicleResourceWithStreamingResponse: def __init__(self, trip_for_vehicle: AsyncTripForVehicleResource) -> None: self._trip_for_vehicle = trip_for_vehicle self.retrieve = async_to_streamed_response_wrapper( trip_for_vehicle.retrieve, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/trips_for_location.py b/src/onebusaway/resources/trips_for_location.py index 84958f9..ab7ba23 100644 --- a/src/onebusaway/resources/trips_for_location.py +++ b/src/onebusaway/resources/trips_for_location.py @@ -4,25 +4,25 @@ import httpx -from ..types import trips_for_location_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.trips_for_location_list_response import TripsForLocationListResponse -__all__ = ["TripsForLocationResource", "AsyncTripsForLocationResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import trips_for_location_list_params +__all__ = ["TripsForLocationResource", "AsyncTripsForLocationResource"] class TripsForLocationResource(SyncAPIResource): @cached_property @@ -44,23 +44,21 @@ def with_streaming_response(self) -> TripsForLocationResourceWithStreamingRespon """ return TripsForLocationResourceWithStreamingResponse(self) - def list( - self, - *, - lat: float, - lat_span: float, - lon: float, - lon_span: float, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_trip: bool | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripsForLocationListResponse: + def list(self, + *, + lat: float, + lat_span: float, + lon: float, + lon_span: float, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_trip: bool | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripsForLocationListResponse: """ Retrieve trips for a given location @@ -91,28 +89,18 @@ def list( """ return self._get( "/api/where/trips-for-location.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "lat": lat, - "lat_span": lat_span, - "lon": lon, - "lon_span": lon_span, - "include_schedule": include_schedule, - "include_trip": include_trip, - "time": time, - }, - trips_for_location_list_params.TripsForLocationListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "lat": lat, + "lat_span": lat_span, + "lon": lon, + "lon_span": lon_span, + "include_schedule": include_schedule, + "include_trip": include_trip, + "time": time, + }, trips_for_location_list_params.TripsForLocationListParams)), cast_to=TripsForLocationListResponse, ) - class AsyncTripsForLocationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTripsForLocationResourceWithRawResponse: @@ -133,23 +121,21 @@ def with_streaming_response(self) -> AsyncTripsForLocationResourceWithStreamingR """ return AsyncTripsForLocationResourceWithStreamingResponse(self) - async def list( - self, - *, - lat: float, - lat_span: float, - lon: float, - lon_span: float, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_trip: bool | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripsForLocationListResponse: + async def list(self, + *, + lat: float, + lat_span: float, + lon: float, + lon_span: float, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_trip: bool | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripsForLocationListResponse: """ Retrieve trips for a given location @@ -180,28 +166,18 @@ async def list( """ return await self._get( "/api/where/trips-for-location.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "lat": lat, - "lat_span": lat_span, - "lon": lon, - "lon_span": lon_span, - "include_schedule": include_schedule, - "include_trip": include_trip, - "time": time, - }, - trips_for_location_list_params.TripsForLocationListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "lat": lat, + "lat_span": lat_span, + "lon": lon, + "lon_span": lon_span, + "include_schedule": include_schedule, + "include_trip": include_trip, + "time": time, + }, trips_for_location_list_params.TripsForLocationListParams)), cast_to=TripsForLocationListResponse, ) - class TripsForLocationResourceWithRawResponse: def __init__(self, trips_for_location: TripsForLocationResource) -> None: self._trips_for_location = trips_for_location @@ -210,7 +186,6 @@ def __init__(self, trips_for_location: TripsForLocationResource) -> None: trips_for_location.list, ) - class AsyncTripsForLocationResourceWithRawResponse: def __init__(self, trips_for_location: AsyncTripsForLocationResource) -> None: self._trips_for_location = trips_for_location @@ -219,7 +194,6 @@ def __init__(self, trips_for_location: AsyncTripsForLocationResource) -> None: trips_for_location.list, ) - class TripsForLocationResourceWithStreamingResponse: def __init__(self, trips_for_location: TripsForLocationResource) -> None: self._trips_for_location = trips_for_location @@ -228,11 +202,10 @@ def __init__(self, trips_for_location: TripsForLocationResource) -> None: trips_for_location.list, ) - class AsyncTripsForLocationResourceWithStreamingResponse: def __init__(self, trips_for_location: AsyncTripsForLocationResource) -> None: self._trips_for_location = trips_for_location self.list = async_to_streamed_response_wrapper( trips_for_location.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/trips_for_route.py b/src/onebusaway/resources/trips_for_route.py index a5ca21d..690ea60 100644 --- a/src/onebusaway/resources/trips_for_route.py +++ b/src/onebusaway/resources/trips_for_route.py @@ -4,25 +4,25 @@ import httpx -from ..types import trips_for_route_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.trips_for_route_list_response import TripsForRouteListResponse -__all__ = ["TripsForRouteResource", "AsyncTripsForRouteResource"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import trips_for_route_list_params +__all__ = ["TripsForRouteResource", "AsyncTripsForRouteResource"] class TripsForRouteResource(SyncAPIResource): @cached_property @@ -44,20 +44,18 @@ def with_streaming_response(self) -> TripsForRouteResourceWithStreamingResponse: """ return TripsForRouteResourceWithStreamingResponse(self) - def list( - self, - route_id: str, - *, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_status: bool | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripsForRouteListResponse: + def list(self, + route_id: str, + *, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_status: bool | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripsForRouteListResponse: """ Search for active trips for a specific route. @@ -78,27 +76,19 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return self._get( f"/api/where/trips-for-route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "include_schedule": include_schedule, - "include_status": include_status, - "time": time, - }, - trips_for_route_list_params.TripsForRouteListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ + "include_schedule": include_schedule, + "include_status": include_status, + "time": time, + }, trips_for_route_list_params.TripsForRouteListParams)), cast_to=TripsForRouteListResponse, ) - class AsyncTripsForRouteResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTripsForRouteResourceWithRawResponse: @@ -119,20 +109,18 @@ def with_streaming_response(self) -> AsyncTripsForRouteResourceWithStreamingResp """ return AsyncTripsForRouteResourceWithStreamingResponse(self) - async def list( - self, - route_id: str, - *, - include_schedule: bool | NotGiven = NOT_GIVEN, - include_status: bool | NotGiven = NOT_GIVEN, - time: int | 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, - ) -> TripsForRouteListResponse: + async def list(self, + route_id: str, + *, + include_schedule: bool | NotGiven = NOT_GIVEN, + include_status: bool | NotGiven = NOT_GIVEN, + time: int | 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,) -> TripsForRouteListResponse: """ Search for active trips for a specific route. @@ -153,27 +141,19 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + raise ValueError( + f'Expected a non-empty value for `route_id` but received {route_id!r}' + ) return await self._get( f"/api/where/trips-for-route/{route_id}.json", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "include_schedule": include_schedule, - "include_status": include_status, - "time": time, - }, - trips_for_route_list_params.TripsForRouteListParams, - ), - ), + options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ + "include_schedule": include_schedule, + "include_status": include_status, + "time": time, + }, trips_for_route_list_params.TripsForRouteListParams)), cast_to=TripsForRouteListResponse, ) - class TripsForRouteResourceWithRawResponse: def __init__(self, trips_for_route: TripsForRouteResource) -> None: self._trips_for_route = trips_for_route @@ -182,7 +162,6 @@ def __init__(self, trips_for_route: TripsForRouteResource) -> None: trips_for_route.list, ) - class AsyncTripsForRouteResourceWithRawResponse: def __init__(self, trips_for_route: AsyncTripsForRouteResource) -> None: self._trips_for_route = trips_for_route @@ -191,7 +170,6 @@ def __init__(self, trips_for_route: AsyncTripsForRouteResource) -> None: trips_for_route.list, ) - class TripsForRouteResourceWithStreamingResponse: def __init__(self, trips_for_route: TripsForRouteResource) -> None: self._trips_for_route = trips_for_route @@ -200,11 +178,10 @@ def __init__(self, trips_for_route: TripsForRouteResource) -> None: trips_for_route.list, ) - class AsyncTripsForRouteResourceWithStreamingResponse: def __init__(self, trips_for_route: AsyncTripsForRouteResource) -> None: self._trips_for_route = trips_for_route self.list = async_to_streamed_response_wrapper( trips_for_route.list, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/resources/vehicles_for_agency.py b/src/onebusaway/resources/vehicles_for_agency.py index 3f8697d..4126bb6 100644 --- a/src/onebusaway/resources/vehicles_for_agency.py +++ b/src/onebusaway/resources/vehicles_for_agency.py @@ -4,25 +4,25 @@ 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"] +from .._base_client import make_request_options + +from .._utils import maybe_transform, async_maybe_transform + +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper + +import warnings +from typing_extensions import Literal, overload +from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given +from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params +from ..types import vehicles_for_agency_list_params +__all__ = ["VehiclesForAgencyResource", "AsyncVehiclesForAgencyResource"] class VehiclesForAgencyResource(SyncAPIResource): @cached_property @@ -44,18 +44,16 @@ def with_streaming_response(self) -> VehiclesForAgencyResourceWithStreamingRespo """ 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: + 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 @@ -71,20 +69,17 @@ def list( 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}") + 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/{agency_id}.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), - ), + 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: @@ -105,18 +100,16 @@ def with_streaming_response(self) -> AsyncVehiclesForAgencyResourceWithStreaming """ 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: + 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 @@ -132,22 +125,17 @@ async def list( 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}") + 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/{agency_id}.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 - ), - ), + 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 @@ -156,7 +144,6 @@ def __init__(self, vehicles_for_agency: VehiclesForAgencyResource) -> None: vehicles_for_agency.list, ) - class AsyncVehiclesForAgencyResourceWithRawResponse: def __init__(self, vehicles_for_agency: AsyncVehiclesForAgencyResource) -> None: self._vehicles_for_agency = vehicles_for_agency @@ -165,7 +152,6 @@ def __init__(self, vehicles_for_agency: AsyncVehiclesForAgencyResource) -> None: vehicles_for_agency.list, ) - class VehiclesForAgencyResourceWithStreamingResponse: def __init__(self, vehicles_for_agency: VehiclesForAgencyResource) -> None: self._vehicles_for_agency = vehicles_for_agency @@ -174,11 +160,10 @@ def __init__(self, vehicles_for_agency: VehiclesForAgencyResource) -> None: 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, - ) + ) \ No newline at end of file diff --git a/src/onebusaway/types/__init__.py b/src/onebusaway/types/__init__.py index a4bb996..634ab48 100644 --- a/src/onebusaway/types/__init__.py +++ b/src/onebusaway/types/__init__.py @@ -3,54 +3,46 @@ from __future__ import annotations from .shared import References as References, ResponseWrapper as ResponseWrapper -from .stop_retrieve_response import StopRetrieveResponse as StopRetrieveResponse -from .trip_retrieve_response import TripRetrieveResponse as TripRetrieveResponse -from .block_retrieve_response import BlockRetrieveResponse as BlockRetrieveResponse -from .route_retrieve_response import RouteRetrieveResponse as RouteRetrieveResponse -from .shape_retrieve_response import ShapeRetrieveResponse as ShapeRetrieveResponse +from .agencies_with_coverage_list_response import AgenciesWithCoverageListResponse as AgenciesWithCoverageListResponse from .agency_retrieve_response import AgencyRetrieveResponse as AgencyRetrieveResponse +from .vehicles_for_agency_list_response import VehiclesForAgencyListResponse as VehiclesForAgencyListResponse +from .vehicles_for_agency_list_params import VehiclesForAgencyListParams as VehiclesForAgencyListParams from .config_retrieve_response import ConfigRetrieveResponse as ConfigRetrieveResponse -from .search_for_stop_list_params import SearchForStopListParams as SearchForStopListParams -from .stops_for_route_list_params import StopsForRouteListParams as StopsForRouteListParams -from .trip_detail_retrieve_params import TripDetailRetrieveParams as TripDetailRetrieveParams -from .trips_for_route_list_params import TripsForRouteListParams as TripsForRouteListParams -from .search_for_route_list_params import SearchForRouteListParams as SearchForRouteListParams -from .search_for_stop_list_response import SearchForStopListResponse as SearchForStopListResponse -from .stops_for_route_list_response import StopsForRouteListResponse as StopsForRouteListResponse -from .trip_detail_retrieve_response import TripDetailRetrieveResponse as TripDetailRetrieveResponse -from .trips_for_route_list_response import TripsForRouteListResponse as TripsForRouteListResponse from .current_time_retrieve_response import CurrentTimeRetrieveResponse as CurrentTimeRetrieveResponse -from .search_for_route_list_response import SearchForRouteListResponse as SearchForRouteListResponse -from .stops_for_agency_list_response import StopsForAgencyListResponse as StopsForAgencyListResponse -from .stops_for_location_list_params import StopsForLocationListParams as StopsForLocationListParams -from .trips_for_location_list_params import TripsForLocationListParams as TripsForLocationListParams -from .routes_for_agency_list_response import RoutesForAgencyListResponse as RoutesForAgencyListResponse -from .routes_for_location_list_params import RoutesForLocationListParams as RoutesForLocationListParams -from .vehicles_for_agency_list_params import VehiclesForAgencyListParams as VehiclesForAgencyListParams from .stops_for_location_list_response import StopsForLocationListResponse as StopsForLocationListResponse -from .trip_for_vehicle_retrieve_params import TripForVehicleRetrieveParams as TripForVehicleRetrieveParams -from .trips_for_location_list_response import TripsForLocationListResponse as TripsForLocationListResponse -from .arrival_and_departure_list_params import ArrivalAndDepartureListParams as ArrivalAndDepartureListParams -from .routes_for_location_list_response import RoutesForLocationListResponse as RoutesForLocationListResponse -from .schedule_for_stop_retrieve_params import ScheduleForStopRetrieveParams as ScheduleForStopRetrieveParams +from .stops_for_location_list_params import StopsForLocationListParams as StopsForLocationListParams +from .stops_for_route_list_response import StopsForRouteListResponse as StopsForRouteListResponse +from .stops_for_route_list_params import StopsForRouteListParams as StopsForRouteListParams +from .stops_for_agency_list_response import StopsForAgencyListResponse as StopsForAgencyListResponse +from .stop_retrieve_response import StopRetrieveResponse as StopRetrieveResponse from .stop_ids_for_agency_list_response import StopIDsForAgencyListResponse as StopIDsForAgencyListResponse -from .vehicles_for_agency_list_response import VehiclesForAgencyListResponse as VehiclesForAgencyListResponse +from .schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse as ScheduleForStopRetrieveResponse +from .schedule_for_stop_retrieve_params import ScheduleForStopRetrieveParams as ScheduleForStopRetrieveParams +from .route_retrieve_response import RouteRetrieveResponse as RouteRetrieveResponse from .route_ids_for_agency_list_response import RouteIDsForAgencyListResponse as RouteIDsForAgencyListResponse +from .routes_for_location_list_response import RoutesForLocationListResponse as RoutesForLocationListResponse +from .routes_for_location_list_params import RoutesForLocationListParams as RoutesForLocationListParams +from .routes_for_agency_list_response import RoutesForAgencyListResponse as RoutesForAgencyListResponse +from .schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse as ScheduleForRouteRetrieveResponse from .schedule_for_route_retrieve_params import ScheduleForRouteRetrieveParams as ScheduleForRouteRetrieveParams -from .trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse as TripForVehicleRetrieveResponse +from .arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse as ArrivalAndDepartureRetrieveResponse from .arrival_and_departure_list_response import ArrivalAndDepartureListResponse as ArrivalAndDepartureListResponse -from .schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse as ScheduleForStopRetrieveResponse -from .agencies_with_coverage_list_response import AgenciesWithCoverageListResponse as AgenciesWithCoverageListResponse -from .schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse as ScheduleForRouteRetrieveResponse -from .arrival_and_departure_retrieve_params import ( - ArrivalAndDepartureRetrieveParams as ArrivalAndDepartureRetrieveParams, -) -from .arrival_and_departure_retrieve_response import ( - ArrivalAndDepartureRetrieveResponse as ArrivalAndDepartureRetrieveResponse, -) -from .report_problem_with_stop_retrieve_params import ( - ReportProblemWithStopRetrieveParams as ReportProblemWithStopRetrieveParams, -) -from .report_problem_with_trip_retrieve_params import ( - ReportProblemWithTripRetrieveParams as ReportProblemWithTripRetrieveParams, -) +from .arrival_and_departure_retrieve_params import ArrivalAndDepartureRetrieveParams as ArrivalAndDepartureRetrieveParams +from .arrival_and_departure_list_params import ArrivalAndDepartureListParams as ArrivalAndDepartureListParams +from .trip_retrieve_response import TripRetrieveResponse as TripRetrieveResponse +from .trips_for_location_list_response import TripsForLocationListResponse as TripsForLocationListResponse +from .trips_for_location_list_params import TripsForLocationListParams as TripsForLocationListParams +from .trip_detail_retrieve_response import TripDetailRetrieveResponse as TripDetailRetrieveResponse +from .trip_detail_retrieve_params import TripDetailRetrieveParams as TripDetailRetrieveParams +from .trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse as TripForVehicleRetrieveResponse +from .trip_for_vehicle_retrieve_params import TripForVehicleRetrieveParams as TripForVehicleRetrieveParams +from .trips_for_route_list_response import TripsForRouteListResponse as TripsForRouteListResponse +from .trips_for_route_list_params import TripsForRouteListParams as TripsForRouteListParams +from .report_problem_with_stop_retrieve_params import ReportProblemWithStopRetrieveParams as ReportProblemWithStopRetrieveParams +from .report_problem_with_trip_retrieve_params import ReportProblemWithTripRetrieveParams as ReportProblemWithTripRetrieveParams +from .search_for_stop_list_response import SearchForStopListResponse as SearchForStopListResponse +from .search_for_stop_list_params import SearchForStopListParams as SearchForStopListParams +from .search_for_route_list_response import SearchForRouteListResponse as SearchForRouteListResponse +from .search_for_route_list_params import SearchForRouteListParams as SearchForRouteListParams +from .block_retrieve_response import BlockRetrieveResponse as BlockRetrieveResponse +from .shape_retrieve_response import ShapeRetrieveResponse as ShapeRetrieveResponse \ No newline at end of file diff --git a/src/onebusaway/types/agencies_with_coverage_list_response.py b/src/onebusaway/types/agencies_with_coverage_list_response.py index 13f182b..4a5b82d 100644 --- a/src/onebusaway/types/agencies_with_coverage_list_response.py +++ b/src/onebusaway/types/agencies_with_coverage_list_response.py @@ -1,39 +1,35 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "AgenciesWithCoverageListResponse", - "AgenciesWithCoverageListResponseData", - "AgenciesWithCoverageListResponseDataList", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["AgenciesWithCoverageListResponse", "AgenciesWithCoverageListResponseData", "AgenciesWithCoverageListResponseDataList"] class AgenciesWithCoverageListResponseDataList(BaseModel): - agency_id: str = FieldInfo(alias="agencyId") + agency_id: str = FieldInfo(alias = "agencyId") lat: float - lat_span: float = FieldInfo(alias="latSpan") + lat_span: float = FieldInfo(alias = "latSpan") lon: float - lon_span: float = FieldInfo(alias="lonSpan") - + lon_span: float = FieldInfo(alias = "lonSpan") class AgenciesWithCoverageListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[AgenciesWithCoverageListResponseDataList] references: References - class AgenciesWithCoverageListResponse(ResponseWrapper): - data: AgenciesWithCoverageListResponseData + data: AgenciesWithCoverageListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/agency_retrieve_response.py b/src/onebusaway/types/agency_retrieve_response.py index 61d8e79..037963c 100644 --- a/src/onebusaway/types/agency_retrieve_response.py +++ b/src/onebusaway/types/agency_retrieve_response.py @@ -1,15 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["AgencyRetrieveResponse", "AgencyRetrieveResponseData", "AgencyRetrieveResponseDataEntry"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["AgencyRetrieveResponse", "AgencyRetrieveResponseData", "AgencyRetrieveResponseDataEntry"] class AgencyRetrieveResponseDataEntry(BaseModel): id: str @@ -24,22 +26,20 @@ class AgencyRetrieveResponseDataEntry(BaseModel): email: Optional[str] = None - fare_url: Optional[str] = FieldInfo(alias="fareUrl", default=None) + fare_url: Optional[str] = FieldInfo(alias = "fareUrl", default = None) lang: Optional[str] = None phone: Optional[str] = None - private_service: Optional[bool] = FieldInfo(alias="privateService", default=None) - + private_service: Optional[bool] = FieldInfo(alias = "privateService", default = None) class AgencyRetrieveResponseData(BaseModel): entry: AgencyRetrieveResponseDataEntry - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") references: References - class AgencyRetrieveResponse(ResponseWrapper): - data: AgencyRetrieveResponseData + data: AgencyRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/arrival_and_departure_list_params.py b/src/onebusaway/types/arrival_and_departure_list_params.py index fd1f0c0..8205ce6 100644 --- a/src/onebusaway/types/arrival_and_departure_list_params.py +++ b/src/onebusaway/types/arrival_and_departure_list_params.py @@ -2,15 +2,20 @@ from __future__ import annotations +from typing_extensions import TypedDict, Annotated + +from .._utils import PropertyInfo + from typing import Union + from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes from .._utils import PropertyInfo __all__ = ["ArrivalAndDepartureListParams"] - class ArrivalAndDepartureListParams(TypedDict, total=False): minutes_after: Annotated[int, PropertyInfo(alias="minutesAfter")] """Include vehicles arriving or departing in the next n minutes.""" @@ -18,5 +23,5 @@ class ArrivalAndDepartureListParams(TypedDict, total=False): minutes_before: Annotated[int, PropertyInfo(alias="minutesBefore")] """Include vehicles having arrived or departed in the previous n minutes.""" - time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """The specific time for querying the system status.""" + time: Annotated[Union[str, datetime], PropertyInfo(format = "iso8601")] + """The specific time for querying the system status.""" \ No newline at end of file diff --git a/src/onebusaway/types/arrival_and_departure_list_response.py b/src/onebusaway/types/arrival_and_departure_list_response.py index cbabf18..87f8287 100644 --- a/src/onebusaway/types/arrival_and_departure_list_response.py +++ b/src/onebusaway/types/arrival_and_departure_list_response.py @@ -1,23 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "ArrivalAndDepartureListResponse", - "ArrivalAndDepartureListResponseData", - "ArrivalAndDepartureListResponseDataEntry", - "ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture", - "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus", - "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation", - "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["ArrivalAndDepartureListResponse", "ArrivalAndDepartureListResponseData", "ArrivalAndDepartureListResponseDataEntry", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusPosition"] class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation(BaseModel): lat: Optional[float] = None @@ -26,7 +20,6 @@ class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLast lon: Optional[float] = None """Longitude of the last known location of the transit vehicle.""" - class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusPosition(BaseModel): lat: Optional[float] = None """Latitude of the current position of the transit vehicle.""" @@ -34,39 +27,38 @@ class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusPosi lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -75,10 +67,10 @@ class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus(Bas predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -87,10 +79,10 @@ class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus(Bas status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -99,18 +91,16 @@ class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus(Bas frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[ - ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation - ] = FieldInfo(alias="lastKnownLocation", default=None) + last_known_location: Optional[ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation] = 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -122,160 +112,152 @@ class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus(Bas position: Optional[ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + vehicle_id: Optional[str] = FieldInfo(alias = "vehicleId", default = None) """ID of the transit vehicle currently serving the trip.""" - class ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture(BaseModel): - arrival_enabled: bool = FieldInfo(alias="arrivalEnabled") + arrival_enabled: bool = FieldInfo(alias = "arrivalEnabled") """Indicates if riders can arrive on this transit vehicle.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of this arrival’s trip into the sequence of trips for the active block.""" - departure_enabled: bool = FieldInfo(alias="departureEnabled") + departure_enabled: bool = FieldInfo(alias = "departureEnabled") """Indicates if riders can depart from this transit vehicle.""" - number_of_stops_away: int = FieldInfo(alias="numberOfStopsAway") + number_of_stops_away: int = FieldInfo(alias = "numberOfStopsAway") """ Number of stops between the arriving transit vehicle and the current stop (excluding the current stop). """ - predicted_arrival_time: int = FieldInfo(alias="predictedArrivalTime") + predicted_arrival_time: int = FieldInfo(alias = "predictedArrivalTime") """ Predicted arrival time, in milliseconds since Unix epoch (zero if no real-time available). """ - predicted_departure_time: int = FieldInfo(alias="predictedDepartureTime") + predicted_departure_time: int = FieldInfo(alias = "predictedDepartureTime") """ Predicted departure time, in milliseconds since Unix epoch (zero if no real-time available). """ - route_id: str = FieldInfo(alias="routeId") + route_id: str = FieldInfo(alias = "routeId") """The ID of the route for the arriving vehicle.""" - scheduled_arrival_time: int = FieldInfo(alias="scheduledArrivalTime") + scheduled_arrival_time: int = FieldInfo(alias = "scheduledArrivalTime") """Scheduled arrival time, in milliseconds since Unix epoch.""" - scheduled_departure_time: int = FieldInfo(alias="scheduledDepartureTime") + scheduled_departure_time: int = FieldInfo(alias = "scheduledDepartureTime") """Scheduled departure time, in milliseconds since Unix epoch.""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. """ - stop_id: str = FieldInfo(alias="stopId") + stop_id: str = FieldInfo(alias = "stopId") """The ID of the stop the vehicle is arriving at.""" - stop_sequence: int = FieldInfo(alias="stopSequence") + stop_sequence: int = FieldInfo(alias = "stopSequence") """ Index of the stop into the sequence of stops that make up the trip for this arrival. """ - total_stops_in_trip: int = FieldInfo(alias="totalStopsInTrip") + total_stops_in_trip: int = FieldInfo(alias = "totalStopsInTrip") """Total number of stops visited on the trip for this arrival.""" - trip_headsign: str = FieldInfo(alias="tripHeadsign") + trip_headsign: str = FieldInfo(alias = "tripHeadsign") """ Optional trip headsign that potentially overrides the trip headsign in the referenced trip element. """ - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") """The ID of the trip for the arriving vehicle.""" - vehicle_id: str = FieldInfo(alias="vehicleId") + vehicle_id: str = FieldInfo(alias = "vehicleId") """ID of the transit vehicle serving this trip.""" - actual_track: Optional[str] = FieldInfo(alias="actualTrack", default=None) + actual_track: Optional[str] = FieldInfo(alias = "actualTrack", default = None) """The actual track information of the arriving transit vehicle.""" - distance_from_stop: Optional[float] = FieldInfo(alias="distanceFromStop", default=None) + distance_from_stop: Optional[float] = FieldInfo(alias = "distanceFromStop", default = None) """Distance of the arriving transit vehicle from the stop, in meters.""" frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) """Historical occupancy information of the transit vehicle.""" - last_update_time: Optional[int] = FieldInfo(alias="lastUpdateTime", default=None) + last_update_time: Optional[int] = FieldInfo(alias = "lastUpdateTime", default = None) """Timestamp of the last update time for this arrival.""" - occupancy_status: Optional[str] = FieldInfo(alias="occupancyStatus", default=None) + occupancy_status: Optional[str] = FieldInfo(alias = "occupancyStatus", default = None) """Current occupancy status of the transit vehicle.""" predicted: Optional[bool] = None """Indicates if real-time arrival info is available for this trip.""" - predicted_arrival_interval: Optional[str] = FieldInfo(alias="predictedArrivalInterval", default=None) + predicted_arrival_interval: Optional[str] = FieldInfo(alias = "predictedArrivalInterval", default = None) """Interval for predicted arrival time, if available.""" - predicted_departure_interval: Optional[str] = FieldInfo(alias="predictedDepartureInterval", default=None) + predicted_departure_interval: Optional[str] = FieldInfo(alias = "predictedDepartureInterval", default = None) """Interval for predicted departure time, if available.""" - predicted_occupancy: Optional[str] = FieldInfo(alias="predictedOccupancy", default=None) + predicted_occupancy: Optional[str] = FieldInfo(alias = "predictedOccupancy", default = None) """Predicted occupancy status of the transit vehicle.""" - route_long_name: Optional[str] = FieldInfo(alias="routeLongName", default=None) + route_long_name: Optional[str] = FieldInfo(alias = "routeLongName", default = None) """ Optional route long name that potentially overrides the route long name in the referenced route element. """ - route_short_name: Optional[str] = FieldInfo(alias="routeShortName", default=None) + route_short_name: Optional[str] = FieldInfo(alias = "routeShortName", default = None) """ Optional route short name that potentially overrides the route short name in the referenced route element. """ - scheduled_arrival_interval: Optional[str] = FieldInfo(alias="scheduledArrivalInterval", default=None) + scheduled_arrival_interval: Optional[str] = FieldInfo(alias = "scheduledArrivalInterval", default = None) """Interval for scheduled arrival time.""" - scheduled_departure_interval: Optional[str] = FieldInfo(alias="scheduledDepartureInterval", default=None) + scheduled_departure_interval: Optional[str] = FieldInfo(alias = "scheduledDepartureInterval", default = None) """Interval for scheduled departure time.""" - scheduled_track: Optional[str] = FieldInfo(alias="scheduledTrack", default=None) + scheduled_track: Optional[str] = FieldInfo(alias = "scheduledTrack", default = None) """Scheduled track information of the arriving transit vehicle.""" - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this arrival.""" status: Optional[str] = None """Current status of the arrival.""" - trip_status: Optional[ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus] = FieldInfo( - alias="tripStatus", default=None - ) + trip_status: Optional[ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus] = FieldInfo(alias = "tripStatus", default = None) """Trip-specific status for the arriving transit vehicle.""" - class ArrivalAndDepartureListResponseDataEntry(BaseModel): - arrivals_and_departures: List[ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture] = FieldInfo( - alias="arrivalsAndDepartures" - ) - + arrivals_and_departures: List[ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture] = FieldInfo(alias = "arrivalsAndDepartures") class ArrivalAndDepartureListResponseData(BaseModel): entry: ArrivalAndDepartureListResponseDataEntry references: References - class ArrivalAndDepartureListResponse(ResponseWrapper): - data: ArrivalAndDepartureListResponseData + data: ArrivalAndDepartureListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/arrival_and_departure_retrieve_params.py b/src/onebusaway/types/arrival_and_departure_retrieve_params.py index 3451b73..1bddc55 100644 --- a/src/onebusaway/types/arrival_and_departure_retrieve_params.py +++ b/src/onebusaway/types/arrival_and_departure_retrieve_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import TypedDict, Annotated, Required from .._utils import PropertyInfo -__all__ = ["ArrivalAndDepartureRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["ArrivalAndDepartureRetrieveParams"] class ArrivalAndDepartureRetrieveParams(TypedDict, total=False): service_date: Required[Annotated[int, PropertyInfo(alias="serviceDate")]] @@ -18,4 +21,4 @@ class ArrivalAndDepartureRetrieveParams(TypedDict, total=False): time: int - vehicle_id: Annotated[str, PropertyInfo(alias="vehicleId")] + vehicle_id: Annotated[str, PropertyInfo(alias="vehicleId")] \ No newline at end of file diff --git a/src/onebusaway/types/arrival_and_departure_retrieve_response.py b/src/onebusaway/types/arrival_and_departure_retrieve_response.py index a0bc771..78120ae 100644 --- a/src/onebusaway/types/arrival_and_departure_retrieve_response.py +++ b/src/onebusaway/types/arrival_and_departure_retrieve_response.py @@ -1,22 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "ArrivalAndDepartureRetrieveResponse", - "ArrivalAndDepartureRetrieveResponseData", - "ArrivalAndDepartureRetrieveResponseDataEntry", - "ArrivalAndDepartureRetrieveResponseDataEntryTripStatus", - "ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation", - "ArrivalAndDepartureRetrieveResponseDataEntryTripStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["ArrivalAndDepartureRetrieveResponse", "ArrivalAndDepartureRetrieveResponseData", "ArrivalAndDepartureRetrieveResponseDataEntry", "ArrivalAndDepartureRetrieveResponseDataEntryTripStatus", "ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation", "ArrivalAndDepartureRetrieveResponseDataEntryTripStatusPosition"] class ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation(BaseModel): lat: Optional[float] = None @@ -25,7 +20,6 @@ class ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation(Ba lon: Optional[float] = None """Longitude of the last known location of the transit vehicle.""" - class ArrivalAndDepartureRetrieveResponseDataEntryTripStatusPosition(BaseModel): lat: Optional[float] = None """Latitude of the current position of the transit vehicle.""" @@ -33,39 +27,38 @@ class ArrivalAndDepartureRetrieveResponseDataEntryTripStatusPosition(BaseModel): lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class ArrivalAndDepartureRetrieveResponseDataEntryTripStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -74,10 +67,10 @@ class ArrivalAndDepartureRetrieveResponseDataEntryTripStatus(BaseModel): predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -86,10 +79,10 @@ class ArrivalAndDepartureRetrieveResponseDataEntryTripStatus(BaseModel): status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -98,18 +91,16 @@ class ArrivalAndDepartureRetrieveResponseDataEntryTripStatus(BaseModel): frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation] = FieldInfo( - alias="lastKnownLocation", default=None - ) + last_known_location: Optional[ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation] = 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -121,154 +112,149 @@ class ArrivalAndDepartureRetrieveResponseDataEntryTripStatus(BaseModel): position: Optional[ArrivalAndDepartureRetrieveResponseDataEntryTripStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + vehicle_id: Optional[str] = FieldInfo(alias = "vehicleId", default = None) """ID of the transit vehicle currently serving the trip.""" - class ArrivalAndDepartureRetrieveResponseDataEntry(BaseModel): - arrival_enabled: bool = FieldInfo(alias="arrivalEnabled") + arrival_enabled: bool = FieldInfo(alias = "arrivalEnabled") """Indicates if riders can arrive on this transit vehicle.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of this arrival’s trip into the sequence of trips for the active block.""" - departure_enabled: bool = FieldInfo(alias="departureEnabled") + departure_enabled: bool = FieldInfo(alias = "departureEnabled") """Indicates if riders can depart from this transit vehicle.""" - number_of_stops_away: int = FieldInfo(alias="numberOfStopsAway") + number_of_stops_away: int = FieldInfo(alias = "numberOfStopsAway") """ Number of stops between the arriving transit vehicle and the current stop (excluding the current stop). """ - predicted_arrival_time: int = FieldInfo(alias="predictedArrivalTime") + predicted_arrival_time: int = FieldInfo(alias = "predictedArrivalTime") """ Predicted arrival time, in milliseconds since Unix epoch (zero if no real-time available). """ - predicted_departure_time: int = FieldInfo(alias="predictedDepartureTime") + predicted_departure_time: int = FieldInfo(alias = "predictedDepartureTime") """ Predicted departure time, in milliseconds since Unix epoch (zero if no real-time available). """ - route_id: str = FieldInfo(alias="routeId") + route_id: str = FieldInfo(alias = "routeId") """The ID of the route for the arriving vehicle.""" - scheduled_arrival_time: int = FieldInfo(alias="scheduledArrivalTime") + scheduled_arrival_time: int = FieldInfo(alias = "scheduledArrivalTime") """Scheduled arrival time, in milliseconds since Unix epoch.""" - scheduled_departure_time: int = FieldInfo(alias="scheduledDepartureTime") + scheduled_departure_time: int = FieldInfo(alias = "scheduledDepartureTime") """Scheduled departure time, in milliseconds since Unix epoch.""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. """ - stop_id: str = FieldInfo(alias="stopId") + stop_id: str = FieldInfo(alias = "stopId") """The ID of the stop the vehicle is arriving at.""" - stop_sequence: int = FieldInfo(alias="stopSequence") + stop_sequence: int = FieldInfo(alias = "stopSequence") """ Index of the stop into the sequence of stops that make up the trip for this arrival. """ - total_stops_in_trip: int = FieldInfo(alias="totalStopsInTrip") + total_stops_in_trip: int = FieldInfo(alias = "totalStopsInTrip") """Total number of stops visited on the trip for this arrival.""" - trip_headsign: str = FieldInfo(alias="tripHeadsign") + trip_headsign: str = FieldInfo(alias = "tripHeadsign") """ Optional trip headsign that potentially overrides the trip headsign in the referenced trip element. """ - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") """The ID of the trip for the arriving vehicle.""" - vehicle_id: str = FieldInfo(alias="vehicleId") + vehicle_id: str = FieldInfo(alias = "vehicleId") """ID of the transit vehicle serving this trip.""" - actual_track: Optional[str] = FieldInfo(alias="actualTrack", default=None) + actual_track: Optional[str] = FieldInfo(alias = "actualTrack", default = None) """The actual track information of the arriving transit vehicle.""" - distance_from_stop: Optional[float] = FieldInfo(alias="distanceFromStop", default=None) + distance_from_stop: Optional[float] = FieldInfo(alias = "distanceFromStop", default = None) """Distance of the arriving transit vehicle from the stop, in meters.""" frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) """Historical occupancy information of the transit vehicle.""" - last_update_time: Optional[int] = FieldInfo(alias="lastUpdateTime", default=None) + last_update_time: Optional[int] = FieldInfo(alias = "lastUpdateTime", default = None) """Timestamp of the last update time for this arrival.""" - occupancy_status: Optional[str] = FieldInfo(alias="occupancyStatus", default=None) + occupancy_status: Optional[str] = FieldInfo(alias = "occupancyStatus", default = None) """Current occupancy status of the transit vehicle.""" predicted: Optional[bool] = None """Indicates if real-time arrival info is available for this trip.""" - predicted_arrival_interval: Optional[str] = FieldInfo(alias="predictedArrivalInterval", default=None) + predicted_arrival_interval: Optional[str] = FieldInfo(alias = "predictedArrivalInterval", default = None) """Interval for predicted arrival time, if available.""" - predicted_departure_interval: Optional[str] = FieldInfo(alias="predictedDepartureInterval", default=None) + predicted_departure_interval: Optional[str] = FieldInfo(alias = "predictedDepartureInterval", default = None) """Interval for predicted departure time, if available.""" - predicted_occupancy: Optional[str] = FieldInfo(alias="predictedOccupancy", default=None) + predicted_occupancy: Optional[str] = FieldInfo(alias = "predictedOccupancy", default = None) """Predicted occupancy status of the transit vehicle.""" - route_long_name: Optional[str] = FieldInfo(alias="routeLongName", default=None) + route_long_name: Optional[str] = FieldInfo(alias = "routeLongName", default = None) """ Optional route long name that potentially overrides the route long name in the referenced route element. """ - route_short_name: Optional[str] = FieldInfo(alias="routeShortName", default=None) + route_short_name: Optional[str] = FieldInfo(alias = "routeShortName", default = None) """ Optional route short name that potentially overrides the route short name in the referenced route element. """ - scheduled_arrival_interval: Optional[str] = FieldInfo(alias="scheduledArrivalInterval", default=None) + scheduled_arrival_interval: Optional[str] = FieldInfo(alias = "scheduledArrivalInterval", default = None) """Interval for scheduled arrival time.""" - scheduled_departure_interval: Optional[str] = FieldInfo(alias="scheduledDepartureInterval", default=None) + scheduled_departure_interval: Optional[str] = FieldInfo(alias = "scheduledDepartureInterval", default = None) """Interval for scheduled departure time.""" - scheduled_track: Optional[str] = FieldInfo(alias="scheduledTrack", default=None) + scheduled_track: Optional[str] = FieldInfo(alias = "scheduledTrack", default = None) """Scheduled track information of the arriving transit vehicle.""" - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this arrival.""" status: Optional[str] = None """Current status of the arrival.""" - trip_status: Optional[ArrivalAndDepartureRetrieveResponseDataEntryTripStatus] = FieldInfo( - alias="tripStatus", default=None - ) + trip_status: Optional[ArrivalAndDepartureRetrieveResponseDataEntryTripStatus] = FieldInfo(alias = "tripStatus", default = None) """Trip-specific status for the arriving transit vehicle.""" - class ArrivalAndDepartureRetrieveResponseData(BaseModel): entry: ArrivalAndDepartureRetrieveResponseDataEntry references: References - class ArrivalAndDepartureRetrieveResponse(ResponseWrapper): - data: ArrivalAndDepartureRetrieveResponseData + data: ArrivalAndDepartureRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/block_retrieve_response.py b/src/onebusaway/types/block_retrieve_response.py index aecb822..ceb636d 100644 --- a/src/onebusaway/types/block_retrieve_response.py +++ b/src/onebusaway/types/block_retrieve_response.py @@ -1,77 +1,63 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "BlockRetrieveResponse", - "BlockRetrieveResponseData", - "BlockRetrieveResponseDataEntry", - "BlockRetrieveResponseDataEntryConfiguration", - "BlockRetrieveResponseDataEntryConfigurationTrip", - "BlockRetrieveResponseDataEntryConfigurationTripBlockStopTime", - "BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["BlockRetrieveResponse", "BlockRetrieveResponseData", "BlockRetrieveResponseDataEntry", "BlockRetrieveResponseDataEntryConfiguration", "BlockRetrieveResponseDataEntryConfigurationTrip", "BlockRetrieveResponseDataEntryConfigurationTripBlockStopTime", "BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime"] class BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime(BaseModel): - arrival_time: int = FieldInfo(alias="arrivalTime") - - departure_time: int = FieldInfo(alias="departureTime") + arrival_time: int = FieldInfo(alias = "arrivalTime") - stop_id: str = FieldInfo(alias="stopId") + departure_time: int = FieldInfo(alias = "departureTime") - drop_off_type: Optional[int] = FieldInfo(alias="dropOffType", default=None) + stop_id: str = FieldInfo(alias = "stopId") - pickup_type: Optional[int] = FieldInfo(alias="pickupType", default=None) + drop_off_type: Optional[int] = FieldInfo(alias = "dropOffType", default = None) + pickup_type: Optional[int] = FieldInfo(alias = "pickupType", default = None) class BlockRetrieveResponseDataEntryConfigurationTripBlockStopTime(BaseModel): - accumulated_slack_time: float = FieldInfo(alias="accumulatedSlackTime") + accumulated_slack_time: float = FieldInfo(alias = "accumulatedSlackTime") - block_sequence: int = FieldInfo(alias="blockSequence") + block_sequence: int = FieldInfo(alias = "blockSequence") - distance_along_block: float = FieldInfo(alias="distanceAlongBlock") - - stop_time: BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime = FieldInfo(alias="stopTime") + distance_along_block: float = FieldInfo(alias = "distanceAlongBlock") + stop_time: BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime = FieldInfo(alias = "stopTime") class BlockRetrieveResponseDataEntryConfigurationTrip(BaseModel): - accumulated_slack_time: float = FieldInfo(alias="accumulatedSlackTime") - - block_stop_times: List[BlockRetrieveResponseDataEntryConfigurationTripBlockStopTime] = FieldInfo( - alias="blockStopTimes" - ) + accumulated_slack_time: float = FieldInfo(alias = "accumulatedSlackTime") - distance_along_block: float = FieldInfo(alias="distanceAlongBlock") + block_stop_times: List[BlockRetrieveResponseDataEntryConfigurationTripBlockStopTime] = FieldInfo(alias = "blockStopTimes") - trip_id: str = FieldInfo(alias="tripId") + distance_along_block: float = FieldInfo(alias = "distanceAlongBlock") + trip_id: str = FieldInfo(alias = "tripId") class BlockRetrieveResponseDataEntryConfiguration(BaseModel): - active_service_ids: List[str] = FieldInfo(alias="activeServiceIds") + active_service_ids: List[str] = FieldInfo(alias = "activeServiceIds") trips: List[BlockRetrieveResponseDataEntryConfigurationTrip] - inactive_service_ids: Optional[List[str]] = FieldInfo(alias="inactiveServiceIds", default=None) - + inactive_service_ids: Optional[List[str]] = FieldInfo(alias = "inactiveServiceIds", default = None) class BlockRetrieveResponseDataEntry(BaseModel): id: str configurations: List[BlockRetrieveResponseDataEntryConfiguration] - class BlockRetrieveResponseData(BaseModel): entry: BlockRetrieveResponseDataEntry references: References - class BlockRetrieveResponse(ResponseWrapper): - data: BlockRetrieveResponseData + data: BlockRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/config_retrieve_response.py b/src/onebusaway/types/config_retrieve_response.py index eaa7cf9..ace5e26 100644 --- a/src/onebusaway/types/config_retrieve_response.py +++ b/src/onebusaway/types/config_retrieve_response.py @@ -1,82 +1,74 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "ConfigRetrieveResponse", - "ConfigRetrieveResponseData", - "ConfigRetrieveResponseDataEntry", - "ConfigRetrieveResponseDataEntryGitProperties", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["ConfigRetrieveResponse", "ConfigRetrieveResponseData", "ConfigRetrieveResponseDataEntry", "ConfigRetrieveResponseDataEntryGitProperties"] class ConfigRetrieveResponseDataEntryGitProperties(BaseModel): - git_branch: Optional[str] = FieldInfo(alias="git.branch", default=None) - - git_build_host: Optional[str] = FieldInfo(alias="git.build.host", default=None) + git_branch: Optional[str] = FieldInfo(alias = "git.branch", default = None) - git_build_time: Optional[str] = FieldInfo(alias="git.build.time", default=None) + git_build_host: Optional[str] = FieldInfo(alias = "git.build.host", default = None) - git_build_user_email: Optional[str] = FieldInfo(alias="git.build.user.email", default=None) + git_build_time: Optional[str] = FieldInfo(alias = "git.build.time", default = None) - git_build_user_name: Optional[str] = FieldInfo(alias="git.build.user.name", default=None) + git_build_user_email: Optional[str] = FieldInfo(alias = "git.build.user.email", default = None) - git_build_version: Optional[str] = FieldInfo(alias="git.build.version", default=None) + git_build_user_name: Optional[str] = FieldInfo(alias = "git.build.user.name", default = None) - git_closest_tag_commit_count: Optional[str] = FieldInfo(alias="git.closest.tag.commit.count", default=None) + git_build_version: Optional[str] = FieldInfo(alias = "git.build.version", default = None) - git_closest_tag_name: Optional[str] = FieldInfo(alias="git.closest.tag.name", default=None) + git_closest_tag_commit_count: Optional[str] = FieldInfo(alias = "git.closest.tag.commit.count", default = None) - git_commit_id: Optional[str] = FieldInfo(alias="git.commit.id", default=None) + git_closest_tag_name: Optional[str] = FieldInfo(alias = "git.closest.tag.name", default = None) - git_commit_id_abbrev: Optional[str] = FieldInfo(alias="git.commit.id.abbrev", default=None) + git_commit_id: Optional[str] = FieldInfo(alias = "git.commit.id", default = None) - git_commit_id_describe: Optional[str] = FieldInfo(alias="git.commit.id.describe", default=None) + git_commit_id_abbrev: Optional[str] = FieldInfo(alias = "git.commit.id.abbrev", default = None) - git_commit_id_describe_short: Optional[str] = FieldInfo(alias="git.commit.id.describe-short", default=None) + git_commit_id_describe: Optional[str] = FieldInfo(alias = "git.commit.id.describe", default = None) - git_commit_message_full: Optional[str] = FieldInfo(alias="git.commit.message.full", default=None) + git_commit_id_describe_short: Optional[str] = FieldInfo(alias = "git.commit.id.describe-short", default = None) - git_commit_message_short: Optional[str] = FieldInfo(alias="git.commit.message.short", default=None) + git_commit_message_full: Optional[str] = FieldInfo(alias = "git.commit.message.full", default = None) - git_commit_time: Optional[str] = FieldInfo(alias="git.commit.time", default=None) + git_commit_message_short: Optional[str] = FieldInfo(alias = "git.commit.message.short", default = None) - git_commit_user_email: Optional[str] = FieldInfo(alias="git.commit.user.email", default=None) + git_commit_time: Optional[str] = FieldInfo(alias = "git.commit.time", default = None) - git_commit_user_name: Optional[str] = FieldInfo(alias="git.commit.user.name", default=None) + git_commit_user_email: Optional[str] = FieldInfo(alias = "git.commit.user.email", default = None) - git_dirty: Optional[str] = FieldInfo(alias="git.dirty", default=None) + git_commit_user_name: Optional[str] = FieldInfo(alias = "git.commit.user.name", default = None) - git_remote_origin_url: Optional[str] = FieldInfo(alias="git.remote.origin.url", default=None) + git_dirty: Optional[str] = FieldInfo(alias = "git.dirty", default = None) - git_tags: Optional[str] = FieldInfo(alias="git.tags", default=None) + git_remote_origin_url: Optional[str] = FieldInfo(alias = "git.remote.origin.url", default = None) + git_tags: Optional[str] = FieldInfo(alias = "git.tags", default = None) class ConfigRetrieveResponseDataEntry(BaseModel): id: Optional[str] = None - git_properties: Optional[ConfigRetrieveResponseDataEntryGitProperties] = FieldInfo( - alias="gitProperties", default=None - ) + git_properties: Optional[ConfigRetrieveResponseDataEntryGitProperties] = FieldInfo(alias = "gitProperties", default = None) name: Optional[str] = None - service_date_from: Optional[str] = FieldInfo(alias="serviceDateFrom", default=None) - - service_date_to: Optional[str] = FieldInfo(alias="serviceDateTo", default=None) + service_date_from: Optional[str] = FieldInfo(alias = "serviceDateFrom", default = None) + service_date_to: Optional[str] = FieldInfo(alias = "serviceDateTo", default = None) class ConfigRetrieveResponseData(BaseModel): entry: ConfigRetrieveResponseDataEntry references: References - class ConfigRetrieveResponse(ResponseWrapper): - data: ConfigRetrieveResponseData + data: ConfigRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/current_time_retrieve_response.py b/src/onebusaway/types/current_time_retrieve_response.py index 20fddb2..80fc92a 100644 --- a/src/onebusaway/types/current_time_retrieve_response.py +++ b/src/onebusaway/types/current_time_retrieve_response.py @@ -1,27 +1,27 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["CurrentTimeRetrieveResponse", "CurrentTimeRetrieveResponseData", "CurrentTimeRetrieveResponseDataEntry"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["CurrentTimeRetrieveResponse", "CurrentTimeRetrieveResponseData", "CurrentTimeRetrieveResponseDataEntry"] class CurrentTimeRetrieveResponseDataEntry(BaseModel): - readable_time: Optional[str] = FieldInfo(alias="readableTime", default=None) + readable_time: Optional[str] = FieldInfo(alias = "readableTime", default = None) time: Optional[int] = None - class CurrentTimeRetrieveResponseData(BaseModel): entry: CurrentTimeRetrieveResponseDataEntry references: References - class CurrentTimeRetrieveResponse(ResponseWrapper): - data: CurrentTimeRetrieveResponseData + data: CurrentTimeRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/report_problem_with_stop_retrieve_params.py b/src/onebusaway/types/report_problem_with_stop_retrieve_params.py index 609f03f..6889773 100644 --- a/src/onebusaway/types/report_problem_with_stop_retrieve_params.py +++ b/src/onebusaway/types/report_problem_with_stop_retrieve_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import TypedDict, Literal, Annotated from .._utils import PropertyInfo -__all__ = ["ReportProblemWithStopRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["ReportProblemWithStopRetrieveParams"] class ReportProblemWithStopRetrieveParams(TypedDict, total=False): code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"] @@ -23,4 +26,4 @@ class ReportProblemWithStopRetrieveParams(TypedDict, total=False): """The reporting user’s location accuracy, in meters""" user_lon: Annotated[float, PropertyInfo(alias="userLon")] - """The reporting user’s current longitude""" + """The reporting user’s current longitude""" \ No newline at end of file diff --git a/src/onebusaway/types/report_problem_with_trip_retrieve_params.py b/src/onebusaway/types/report_problem_with_trip_retrieve_params.py index f55386d..94dc84e 100644 --- a/src/onebusaway/types/report_problem_with_trip_retrieve_params.py +++ b/src/onebusaway/types/report_problem_with_trip_retrieve_params.py @@ -2,22 +2,18 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import TypedDict, Literal, Annotated from .._utils import PropertyInfo -__all__ = ["ReportProblemWithTripRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["ReportProblemWithTripRetrieveParams"] class ReportProblemWithTripRetrieveParams(TypedDict, total=False): - code: Literal[ - "vehicle_never_came", - "vehicle_came_early", - "vehicle_came_late", - "wrong_headsign", - "vehicle_does_not_stop_here", - "other", - ] + code: Literal["vehicle_never_came", "vehicle_came_early", "vehicle_came_late", "wrong_headsign", "vehicle_does_not_stop_here", "other"] """A string code identifying the nature of the problem""" service_date: Annotated[int, PropertyInfo(alias="serviceDate")] @@ -45,4 +41,4 @@ class ReportProblemWithTripRetrieveParams(TypedDict, total=False): """The vehicle number, as reported by the user""" vehicle_id: Annotated[str, PropertyInfo(alias="vehicleID")] - """The vehicle actively serving the trip""" + """The vehicle actively serving the trip""" \ No newline at end of file diff --git a/src/onebusaway/types/route_ids_for_agency_list_response.py b/src/onebusaway/types/route_ids_for_agency_list_response.py index 193704e..33d3468 100644 --- a/src/onebusaway/types/route_ids_for_agency_list_response.py +++ b/src/onebusaway/types/route_ids_for_agency_list_response.py @@ -1,23 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["RouteIDsForAgencyListResponse", "RouteIDsForAgencyListResponseData"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["RouteIDsForAgencyListResponse", "RouteIDsForAgencyListResponseData"] class RouteIDsForAgencyListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[str] references: References - class RouteIDsForAgencyListResponse(ResponseWrapper): - data: RouteIDsForAgencyListResponseData + data: RouteIDsForAgencyListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/route_retrieve_response.py b/src/onebusaway/types/route_retrieve_response.py index a0dfa1e..f5ca95a 100644 --- a/src/onebusaway/types/route_retrieve_response.py +++ b/src/onebusaway/types/route_retrieve_response.py @@ -1,20 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["RouteRetrieveResponse", "RouteRetrieveResponseData", "RouteRetrieveResponseDataEntry"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["RouteRetrieveResponse", "RouteRetrieveResponseData", "RouteRetrieveResponseDataEntry"] class RouteRetrieveResponseDataEntry(BaseModel): id: str - agency_id: str = FieldInfo(alias="agencyId") + agency_id: str = FieldInfo(alias = "agencyId") type: int @@ -22,22 +24,20 @@ class RouteRetrieveResponseDataEntry(BaseModel): description: Optional[str] = None - long_name: Optional[str] = FieldInfo(alias="longName", default=None) + long_name: Optional[str] = FieldInfo(alias = "longName", default = None) - null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None) + null_safe_short_name: Optional[str] = FieldInfo(alias = "nullSafeShortName", default = None) - short_name: Optional[str] = FieldInfo(alias="shortName", default=None) + short_name: Optional[str] = FieldInfo(alias = "shortName", default = None) - text_color: Optional[str] = FieldInfo(alias="textColor", default=None) + text_color: Optional[str] = FieldInfo(alias = "textColor", default = None) url: Optional[str] = None - class RouteRetrieveResponseData(BaseModel): entry: RouteRetrieveResponseDataEntry references: References - class RouteRetrieveResponse(ResponseWrapper): - data: RouteRetrieveResponseData + data: RouteRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/routes_for_agency_list_response.py b/src/onebusaway/types/routes_for_agency_list_response.py index 672141d..949b1ff 100644 --- a/src/onebusaway/types/routes_for_agency_list_response.py +++ b/src/onebusaway/types/routes_for_agency_list_response.py @@ -1,20 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["RoutesForAgencyListResponse", "RoutesForAgencyListResponseData", "RoutesForAgencyListResponseDataList"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["RoutesForAgencyListResponse", "RoutesForAgencyListResponseData", "RoutesForAgencyListResponseDataList"] class RoutesForAgencyListResponseDataList(BaseModel): id: str - agency_id: str = FieldInfo(alias="agencyId") + agency_id: str = FieldInfo(alias = "agencyId") type: int @@ -22,24 +24,22 @@ class RoutesForAgencyListResponseDataList(BaseModel): description: Optional[str] = None - long_name: Optional[str] = FieldInfo(alias="longName", default=None) + long_name: Optional[str] = FieldInfo(alias = "longName", default = None) - null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None) + null_safe_short_name: Optional[str] = FieldInfo(alias = "nullSafeShortName", default = None) - short_name: Optional[str] = FieldInfo(alias="shortName", default=None) + short_name: Optional[str] = FieldInfo(alias = "shortName", default = None) - text_color: Optional[str] = FieldInfo(alias="textColor", default=None) + text_color: Optional[str] = FieldInfo(alias = "textColor", default = None) url: Optional[str] = None - class RoutesForAgencyListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[RoutesForAgencyListResponseDataList] references: References - class RoutesForAgencyListResponse(ResponseWrapper): - data: RoutesForAgencyListResponseData + data: RoutesForAgencyListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/routes_for_location_list_params.py b/src/onebusaway/types/routes_for_location_list_params.py index 033ec2a..cfabb8c 100644 --- a/src/onebusaway/types/routes_for_location_list_params.py +++ b/src/onebusaway/types/routes_for_location_list_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import TypedDict, Required, Annotated from .._utils import PropertyInfo -__all__ = ["RoutesForLocationListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["RoutesForLocationListParams"] class RoutesForLocationListParams(TypedDict, total=False): lat: Required[float] @@ -20,4 +23,4 @@ class RoutesForLocationListParams(TypedDict, total=False): query: str - radius: float + radius: float \ No newline at end of file diff --git a/src/onebusaway/types/routes_for_location_list_response.py b/src/onebusaway/types/routes_for_location_list_response.py index 0393f01..b91a72c 100644 --- a/src/onebusaway/types/routes_for_location_list_response.py +++ b/src/onebusaway/types/routes_for_location_list_response.py @@ -1,24 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "RoutesForLocationListResponse", - "RoutesForLocationListResponseData", - "RoutesForLocationListResponseDataList", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["RoutesForLocationListResponse", "RoutesForLocationListResponseData", "RoutesForLocationListResponseDataList"] class RoutesForLocationListResponseDataList(BaseModel): id: str - agency_id: str = FieldInfo(alias="agencyId") + agency_id: str = FieldInfo(alias = "agencyId") type: int @@ -26,26 +24,24 @@ class RoutesForLocationListResponseDataList(BaseModel): description: Optional[str] = None - long_name: Optional[str] = FieldInfo(alias="longName", default=None) + long_name: Optional[str] = FieldInfo(alias = "longName", default = None) - null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None) + null_safe_short_name: Optional[str] = FieldInfo(alias = "nullSafeShortName", default = None) - short_name: Optional[str] = FieldInfo(alias="shortName", default=None) + short_name: Optional[str] = FieldInfo(alias = "shortName", default = None) - text_color: Optional[str] = FieldInfo(alias="textColor", default=None) + text_color: Optional[str] = FieldInfo(alias = "textColor", default = None) url: Optional[str] = None - class RoutesForLocationListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[RoutesForLocationListResponseDataList] - out_of_range: bool = FieldInfo(alias="outOfRange") + out_of_range: bool = FieldInfo(alias = "outOfRange") references: References - class RoutesForLocationListResponse(ResponseWrapper): - data: RoutesForLocationListResponseData + data: RoutesForLocationListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/schedule_for_route_retrieve_params.py b/src/onebusaway/types/schedule_for_route_retrieve_params.py index 6d4d029..6b5fa6b 100644 --- a/src/onebusaway/types/schedule_for_route_retrieve_params.py +++ b/src/onebusaway/types/schedule_for_route_retrieve_params.py @@ -3,17 +3,22 @@ from __future__ import annotations import datetime + +from typing_extensions import TypedDict, Annotated + from typing import Union -from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["ScheduleForRouteRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["ScheduleForRouteRetrieveParams"] class ScheduleForRouteRetrieveParams(TypedDict, total=False): - date: Annotated[Union[str, datetime.date], PropertyInfo(format="iso8601")] + date: Annotated[Union[str, datetime.date], PropertyInfo(format = "iso8601")] """ The date for which you want to request a schedule in the format YYYY-MM-DD (optional, defaults to current date) - """ + """ \ No newline at end of file diff --git a/src/onebusaway/types/schedule_for_route_retrieve_response.py b/src/onebusaway/types/schedule_for_route_retrieve_response.py index 8266786..31d487b 100644 --- a/src/onebusaway/types/schedule_for_route_retrieve_response.py +++ b/src/onebusaway/types/schedule_for_route_retrieve_response.py @@ -1,23 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List, Optional -from .._models import BaseModel from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "ScheduleForRouteRetrieveResponse", - "ScheduleForRouteRetrieveResponseData", - "ScheduleForRouteRetrieveResponseDataEntry", - "ScheduleForRouteRetrieveResponseDataEntryStop", - "ScheduleForRouteRetrieveResponseDataEntryStopTripGrouping", - "ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTime", - "ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTimeStopTime", - "ScheduleForRouteRetrieveResponseDataEntryTrip", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["ScheduleForRouteRetrieveResponse", "ScheduleForRouteRetrieveResponseData", "ScheduleForRouteRetrieveResponseDataEntry", "ScheduleForRouteRetrieveResponseDataEntryStop", "ScheduleForRouteRetrieveResponseDataEntryStopTripGrouping", "ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTime", "ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTimeStopTime", "ScheduleForRouteRetrieveResponseDataEntryTrip"] class ScheduleForRouteRetrieveResponseDataEntryStop(BaseModel): id: str @@ -30,102 +22,89 @@ class ScheduleForRouteRetrieveResponseDataEntryStop(BaseModel): parent: str - route_ids: List[str] = FieldInfo(alias="routeIds") + route_ids: List[str] = FieldInfo(alias = "routeIds") - static_route_ids: List[str] = FieldInfo(alias="staticRouteIds") + static_route_ids: List[str] = FieldInfo(alias = "staticRouteIds") code: Optional[str] = None direction: Optional[str] = None - location_type: Optional[int] = FieldInfo(alias="locationType", default=None) - - wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + location_type: Optional[int] = FieldInfo(alias = "locationType", default = None) + wheelchair_boarding: Optional[str] = FieldInfo(alias = "wheelchairBoarding", default = None) class ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTimeStopTime(BaseModel): - arrival_enabled: bool = FieldInfo(alias="arrivalEnabled") + arrival_enabled: bool = FieldInfo(alias = "arrivalEnabled") - arrival_time: int = FieldInfo(alias="arrivalTime") + arrival_time: int = FieldInfo(alias = "arrivalTime") - departure_enabled: bool = FieldInfo(alias="departureEnabled") + departure_enabled: bool = FieldInfo(alias = "departureEnabled") - departure_time: int = FieldInfo(alias="departureTime") + departure_time: int = FieldInfo(alias = "departureTime") - stop_id: str = FieldInfo(alias="stopId") + stop_id: str = FieldInfo(alias = "stopId") - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") - service_id: Optional[str] = FieldInfo(alias="serviceId", default=None) - - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) + service_id: Optional[str] = FieldInfo(alias = "serviceId", default = None) + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) class ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTime(BaseModel): - stop_times: List[ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTimeStopTime] = FieldInfo( - alias="stopTimes" - ) - - trip_id: str = FieldInfo(alias="tripId") + stop_times: List[ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTimeStopTime] = FieldInfo(alias = "stopTimes") + trip_id: str = FieldInfo(alias = "tripId") class ScheduleForRouteRetrieveResponseDataEntryStopTripGrouping(BaseModel): - direction_id: str = FieldInfo(alias="directionId") - - stop_ids: List[str] = FieldInfo(alias="stopIds") + direction_id: str = FieldInfo(alias = "directionId") - trip_headsigns: List[str] = FieldInfo(alias="tripHeadsigns") + stop_ids: List[str] = FieldInfo(alias = "stopIds") - trip_ids: List[str] = FieldInfo(alias="tripIds") + trip_headsigns: List[str] = FieldInfo(alias = "tripHeadsigns") - trips_with_stop_times: Optional[ - List[ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTime] - ] = FieldInfo(alias="tripsWithStopTimes", default=None) + trip_ids: List[str] = FieldInfo(alias = "tripIds") + trips_with_stop_times: Optional[List[ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTime]] = FieldInfo(alias = "tripsWithStopTimes", default = None) class ScheduleForRouteRetrieveResponseDataEntryTrip(BaseModel): id: str - route_id: str = FieldInfo(alias="routeId") + route_id: str = FieldInfo(alias = "routeId") - service_id: str = FieldInfo(alias="serviceId") + service_id: str = FieldInfo(alias = "serviceId") - block_id: Optional[str] = FieldInfo(alias="blockId", default=None) + block_id: Optional[str] = FieldInfo(alias = "blockId", default = None) - direction_id: Optional[str] = FieldInfo(alias="directionId", default=None) + direction_id: Optional[str] = FieldInfo(alias = "directionId", default = None) - peak_offpeak: Optional[int] = FieldInfo(alias="peakOffpeak", default=None) + peak_offpeak: Optional[int] = FieldInfo(alias = "peakOffpeak", default = None) - route_short_name: Optional[str] = FieldInfo(alias="routeShortName", default=None) + route_short_name: Optional[str] = FieldInfo(alias = "routeShortName", default = None) - shape_id: Optional[str] = FieldInfo(alias="shapeId", default=None) + shape_id: Optional[str] = FieldInfo(alias = "shapeId", default = None) - time_zone: Optional[str] = FieldInfo(alias="timeZone", default=None) + time_zone: Optional[str] = FieldInfo(alias = "timeZone", default = None) - trip_headsign: Optional[str] = FieldInfo(alias="tripHeadsign", default=None) - - trip_short_name: Optional[str] = FieldInfo(alias="tripShortName", default=None) + trip_headsign: Optional[str] = FieldInfo(alias = "tripHeadsign", default = None) + trip_short_name: Optional[str] = FieldInfo(alias = "tripShortName", default = None) class ScheduleForRouteRetrieveResponseDataEntry(BaseModel): - route_id: str = FieldInfo(alias="routeId") + route_id: str = FieldInfo(alias = "routeId") - schedule_date: int = FieldInfo(alias="scheduleDate") + schedule_date: int = FieldInfo(alias = "scheduleDate") - service_ids: List[str] = FieldInfo(alias="serviceIds") + service_ids: List[str] = FieldInfo(alias = "serviceIds") stops: List[ScheduleForRouteRetrieveResponseDataEntryStop] - stop_trip_groupings: List[ScheduleForRouteRetrieveResponseDataEntryStopTripGrouping] = FieldInfo( - alias="stopTripGroupings" - ) + stop_trip_groupings: List[ScheduleForRouteRetrieveResponseDataEntryStopTripGrouping] = FieldInfo(alias = "stopTripGroupings") trips: List[ScheduleForRouteRetrieveResponseDataEntryTrip] - class ScheduleForRouteRetrieveResponseData(BaseModel): entry: ScheduleForRouteRetrieveResponseDataEntry - class ScheduleForRouteRetrieveResponse(ResponseWrapper): - data: ScheduleForRouteRetrieveResponseData + data: ScheduleForRouteRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/schedule_for_stop_retrieve_params.py b/src/onebusaway/types/schedule_for_stop_retrieve_params.py index 99b89f7..2fe81c7 100644 --- a/src/onebusaway/types/schedule_for_stop_retrieve_params.py +++ b/src/onebusaway/types/schedule_for_stop_retrieve_params.py @@ -3,17 +3,22 @@ from __future__ import annotations import datetime + +from typing_extensions import TypedDict, Annotated + from typing import Union -from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -__all__ = ["ScheduleForStopRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["ScheduleForStopRetrieveParams"] class ScheduleForStopRetrieveParams(TypedDict, total=False): - date: Annotated[Union[str, datetime.date], PropertyInfo(format="iso8601")] + date: Annotated[Union[str, datetime.date], PropertyInfo(format = "iso8601")] """ The date for which you want to request a schedule in the format YYYY-MM-DD (optional, defaults to the current date) - """ + """ \ No newline at end of file diff --git a/src/onebusaway/types/schedule_for_stop_retrieve_response.py b/src/onebusaway/types/schedule_for_stop_retrieve_response.py index 83d1985..afc6eb7 100644 --- a/src/onebusaway/types/schedule_for_stop_retrieve_response.py +++ b/src/onebusaway/types/schedule_for_stop_retrieve_response.py @@ -1,89 +1,69 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "ScheduleForStopRetrieveResponse", - "ScheduleForStopRetrieveResponseData", - "ScheduleForStopRetrieveResponseDataEntry", - "ScheduleForStopRetrieveResponseDataEntryStopRouteSchedule", - "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionSchedule", - "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime", - "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleFrequency", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["ScheduleForStopRetrieveResponse", "ScheduleForStopRetrieveResponseData", "ScheduleForStopRetrieveResponseDataEntry", "ScheduleForStopRetrieveResponseDataEntryStopRouteSchedule", "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionSchedule", "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime", "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleFrequency"] class ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime(BaseModel): - arrival_enabled: bool = FieldInfo(alias="arrivalEnabled") - - arrival_time: int = FieldInfo(alias="arrivalTime") + arrival_enabled: bool = FieldInfo(alias = "arrivalEnabled") - departure_enabled: bool = FieldInfo(alias="departureEnabled") + arrival_time: int = FieldInfo(alias = "arrivalTime") - departure_time: int = FieldInfo(alias="departureTime") + departure_enabled: bool = FieldInfo(alias = "departureEnabled") - service_id: str = FieldInfo(alias="serviceId") + departure_time: int = FieldInfo(alias = "departureTime") - trip_id: str = FieldInfo(alias="tripId") + service_id: str = FieldInfo(alias = "serviceId") - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) + trip_id: str = FieldInfo(alias = "tripId") + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) class ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleFrequency(BaseModel): - end_time: int = FieldInfo(alias="endTime") + end_time: int = FieldInfo(alias = "endTime") headway: int - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") - service_id: str = FieldInfo(alias="serviceId") + service_id: str = FieldInfo(alias = "serviceId") - start_time: int = FieldInfo(alias="startTime") - - trip_id: str = FieldInfo(alias="tripId") + start_time: int = FieldInfo(alias = "startTime") + trip_id: str = FieldInfo(alias = "tripId") class ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionSchedule(BaseModel): - schedule_stop_times: List[ - ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime - ] = FieldInfo(alias="scheduleStopTimes") - - trip_headsign: str = FieldInfo(alias="tripHeadsign") + schedule_stop_times: List[ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime] = FieldInfo(alias = "scheduleStopTimes") - schedule_frequencies: Optional[ - List[ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleFrequency] - ] = FieldInfo(alias="scheduleFrequencies", default=None) + trip_headsign: str = FieldInfo(alias = "tripHeadsign") + schedule_frequencies: Optional[List[ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleFrequency]] = FieldInfo(alias = "scheduleFrequencies", default = None) class ScheduleForStopRetrieveResponseDataEntryStopRouteSchedule(BaseModel): - route_id: str = FieldInfo(alias="routeId") - - stop_route_direction_schedules: List[ - ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionSchedule - ] = FieldInfo(alias="stopRouteDirectionSchedules") + route_id: str = FieldInfo(alias = "routeId") + stop_route_direction_schedules: List[ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionSchedule] = FieldInfo(alias = "stopRouteDirectionSchedules") class ScheduleForStopRetrieveResponseDataEntry(BaseModel): date: int - stop_id: str = FieldInfo(alias="stopId") - - stop_route_schedules: List[ScheduleForStopRetrieveResponseDataEntryStopRouteSchedule] = FieldInfo( - alias="stopRouteSchedules" - ) + stop_id: str = FieldInfo(alias = "stopId") + stop_route_schedules: List[ScheduleForStopRetrieveResponseDataEntryStopRouteSchedule] = FieldInfo(alias = "stopRouteSchedules") class ScheduleForStopRetrieveResponseData(BaseModel): entry: ScheduleForStopRetrieveResponseDataEntry references: References - class ScheduleForStopRetrieveResponse(ResponseWrapper): - data: ScheduleForStopRetrieveResponseData + data: ScheduleForStopRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/search_for_route_list_params.py b/src/onebusaway/types/search_for_route_list_params.py index 76f767b..979587c 100755 --- a/src/onebusaway/types/search_for_route_list_params.py +++ b/src/onebusaway/types/search_for_route_list_params.py @@ -2,16 +2,19 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import TypedDict, Required, Annotated from .._utils import PropertyInfo -__all__ = ["SearchForRouteListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["SearchForRouteListParams"] class SearchForRouteListParams(TypedDict, total=False): input: Required[str] """The string to search for.""" max_count: Annotated[int, PropertyInfo(alias="maxCount")] - """The max number of results to return. Defaults to 20.""" + """The max number of results to return. Defaults to 20.""" \ No newline at end of file diff --git a/src/onebusaway/types/search_for_route_list_response.py b/src/onebusaway/types/search_for_route_list_response.py index e54153a..6c8e481 100755 --- a/src/onebusaway/types/search_for_route_list_response.py +++ b/src/onebusaway/types/search_for_route_list_response.py @@ -1,20 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["SearchForRouteListResponse", "SearchForRouteListResponseData", "SearchForRouteListResponseDataList"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["SearchForRouteListResponse", "SearchForRouteListResponseData", "SearchForRouteListResponseDataList"] class SearchForRouteListResponseDataList(BaseModel): id: str - agency_id: str = FieldInfo(alias="agencyId") + agency_id: str = FieldInfo(alias = "agencyId") type: int @@ -22,26 +24,24 @@ class SearchForRouteListResponseDataList(BaseModel): description: Optional[str] = None - long_name: Optional[str] = FieldInfo(alias="longName", default=None) + long_name: Optional[str] = FieldInfo(alias = "longName", default = None) - null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None) + null_safe_short_name: Optional[str] = FieldInfo(alias = "nullSafeShortName", default = None) - short_name: Optional[str] = FieldInfo(alias="shortName", default=None) + short_name: Optional[str] = FieldInfo(alias = "shortName", default = None) - text_color: Optional[str] = FieldInfo(alias="textColor", default=None) + text_color: Optional[str] = FieldInfo(alias = "textColor", default = None) url: Optional[str] = None - class SearchForRouteListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[SearchForRouteListResponseDataList] - out_of_range: bool = FieldInfo(alias="outOfRange") + out_of_range: bool = FieldInfo(alias = "outOfRange") references: References - class SearchForRouteListResponse(ResponseWrapper): - data: Optional[SearchForRouteListResponseData] = None + data: Optional[SearchForRouteListResponseData] = None \ No newline at end of file diff --git a/src/onebusaway/types/search_for_stop_list_params.py b/src/onebusaway/types/search_for_stop_list_params.py index 012f802..9cf8c67 100755 --- a/src/onebusaway/types/search_for_stop_list_params.py +++ b/src/onebusaway/types/search_for_stop_list_params.py @@ -2,16 +2,19 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import TypedDict, Required, Annotated from .._utils import PropertyInfo -__all__ = ["SearchForStopListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["SearchForStopListParams"] class SearchForStopListParams(TypedDict, total=False): input: Required[str] """The string to search for.""" max_count: Annotated[int, PropertyInfo(alias="maxCount")] - """The max number of results to return. Defaults to 20.""" + """The max number of results to return. Defaults to 20.""" \ No newline at end of file diff --git a/src/onebusaway/types/search_for_stop_list_response.py b/src/onebusaway/types/search_for_stop_list_response.py index 502455c..1b643cb 100755 --- a/src/onebusaway/types/search_for_stop_list_response.py +++ b/src/onebusaway/types/search_for_stop_list_response.py @@ -1,15 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List, Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["SearchForStopListResponse", "SearchForStopListResponseData", "SearchForStopListResponseDataList"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["SearchForStopListResponse", "SearchForStopListResponseData", "SearchForStopListResponseDataList"] class SearchForStopListResponseDataList(BaseModel): id: str @@ -22,28 +24,26 @@ class SearchForStopListResponseDataList(BaseModel): parent: str - route_ids: List[str] = FieldInfo(alias="routeIds") + route_ids: List[str] = FieldInfo(alias = "routeIds") - static_route_ids: List[str] = FieldInfo(alias="staticRouteIds") + static_route_ids: List[str] = FieldInfo(alias = "staticRouteIds") code: Optional[str] = None direction: Optional[str] = None - location_type: Optional[int] = FieldInfo(alias="locationType", default=None) - - wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + location_type: Optional[int] = FieldInfo(alias = "locationType", default = None) + wheelchair_boarding: Optional[str] = FieldInfo(alias = "wheelchairBoarding", default = None) class SearchForStopListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[SearchForStopListResponseDataList] - out_of_range: bool = FieldInfo(alias="outOfRange") + out_of_range: bool = FieldInfo(alias = "outOfRange") references: References - class SearchForStopListResponse(ResponseWrapper): - data: Optional[SearchForStopListResponseData] = None + data: Optional[SearchForStopListResponseData] = None \ No newline at end of file diff --git a/src/onebusaway/types/shape_retrieve_response.py b/src/onebusaway/types/shape_retrieve_response.py index 07a3b6a..d4e9b0d 100644 --- a/src/onebusaway/types/shape_retrieve_response.py +++ b/src/onebusaway/types/shape_retrieve_response.py @@ -1,13 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .._models import BaseModel + from typing import Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["ShapeRetrieveResponse", "ShapeRetrieveResponseData", "ShapeRetrieveResponseDataEntry"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["ShapeRetrieveResponse", "ShapeRetrieveResponseData", "ShapeRetrieveResponseDataEntry"] class ShapeRetrieveResponseDataEntry(BaseModel): length: int @@ -17,12 +21,10 @@ class ShapeRetrieveResponseDataEntry(BaseModel): levels: Optional[str] = None - class ShapeRetrieveResponseData(BaseModel): entry: ShapeRetrieveResponseDataEntry references: References - class ShapeRetrieveResponse(ResponseWrapper): - data: ShapeRetrieveResponseData + data: ShapeRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/shared/__init__.py b/src/onebusaway/types/shared/__init__.py index 1da019e..5991736 100644 --- a/src/onebusaway/types/shared/__init__.py +++ b/src/onebusaway/types/shared/__init__.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .references import References as References -from .response_wrapper import ResponseWrapper as ResponseWrapper +from .response_wrapper import ResponseWrapper as ResponseWrapper \ No newline at end of file diff --git a/src/onebusaway/types/shared/references.py b/src/onebusaway/types/shared/references.py index 8c6deab..bed6854 100644 --- a/src/onebusaway/types/shared/references.py +++ b/src/onebusaway/types/shared/references.py @@ -1,31 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal +from ..._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from ..._models import BaseModel +from typing_extensions import Literal + +from typing_extensions import Literal -__all__ = [ - "References", - "Agency", - "Route", - "Situation", - "SituationActiveWindow", - "SituationAllAffect", - "SituationConsequence", - "SituationConsequenceConditionDetails", - "SituationConsequenceConditionDetailsDiversionPath", - "SituationDescription", - "SituationPublicationWindow", - "SituationSummary", - "SituationURL", - "Stop", - "StopTime", - "Trip", -] +from pydantic import Field as FieldInfo +__all__ = ["References", "Agency", "Route", "Situation", "SituationActiveWindow", "SituationAllAffect", "SituationConsequence", "SituationConsequenceConditionDetails", "SituationConsequenceConditionDetailsDiversionPath", "SituationDescription", "SituationPublicationWindow", "SituationSummary", "SituationURL", "Stop", "StopTime", "Trip"] class Agency(BaseModel): id: str @@ -40,19 +25,18 @@ class Agency(BaseModel): email: Optional[str] = None - fare_url: Optional[str] = FieldInfo(alias="fareUrl", default=None) + fare_url: Optional[str] = FieldInfo(alias = "fareUrl", default = None) lang: Optional[str] = None phone: Optional[str] = None - private_service: Optional[bool] = FieldInfo(alias="privateService", default=None) - + private_service: Optional[bool] = FieldInfo(alias = "privateService", default = None) class Route(BaseModel): id: str - agency_id: str = FieldInfo(alias="agencyId") + agency_id: str = FieldInfo(alias = "agencyId") type: int @@ -60,45 +44,42 @@ class Route(BaseModel): description: Optional[str] = None - long_name: Optional[str] = FieldInfo(alias="longName", default=None) + long_name: Optional[str] = FieldInfo(alias = "longName", default = None) - null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None) + null_safe_short_name: Optional[str] = FieldInfo(alias = "nullSafeShortName", default = None) - short_name: Optional[str] = FieldInfo(alias="shortName", default=None) + short_name: Optional[str] = FieldInfo(alias = "shortName", default = None) - text_color: Optional[str] = FieldInfo(alias="textColor", default=None) + text_color: Optional[str] = FieldInfo(alias = "textColor", default = None) url: Optional[str] = None - class SituationActiveWindow(BaseModel): - from_: Optional[int] = FieldInfo(alias="from", default=None) + from_: Optional[int] = FieldInfo(alias = "from", default = None) """Start time of the active window as a Unix timestamp.""" to: Optional[int] = None """End time of the active window as a Unix timestamp.""" - class SituationAllAffect(BaseModel): - agency_id: Optional[str] = FieldInfo(alias="agencyId", default=None) + agency_id: Optional[str] = FieldInfo(alias = "agencyId", default = None) """Identifier for the agency.""" - application_id: Optional[str] = FieldInfo(alias="applicationId", default=None) + application_id: Optional[str] = FieldInfo(alias = "applicationId", default = None) """Identifier for the application.""" - direction_id: Optional[str] = FieldInfo(alias="directionId", default=None) + direction_id: Optional[str] = FieldInfo(alias = "directionId", default = None) """Identifier for the direction.""" - route_id: Optional[str] = FieldInfo(alias="routeId", default=None) + route_id: Optional[str] = FieldInfo(alias = "routeId", default = None) """Identifier for the route.""" - stop_id: Optional[str] = FieldInfo(alias="stopId", default=None) + stop_id: Optional[str] = FieldInfo(alias = "stopId", default = None) """Identifier for the stop.""" - trip_id: Optional[str] = FieldInfo(alias="tripId", default=None) + trip_id: Optional[str] = FieldInfo(alias = "tripId", default = None) """Identifier for the trip.""" - class SituationConsequenceConditionDetailsDiversionPath(BaseModel): length: Optional[int] = None """Length of the diversion path.""" @@ -109,23 +90,16 @@ class SituationConsequenceConditionDetailsDiversionPath(BaseModel): points: Optional[str] = None """Points of the diversion path.""" - class SituationConsequenceConditionDetails(BaseModel): - diversion_path: Optional[SituationConsequenceConditionDetailsDiversionPath] = FieldInfo( - alias="diversionPath", default=None - ) - - diversion_stop_ids: Optional[List[str]] = FieldInfo(alias="diversionStopIds", default=None) + diversion_path: Optional[SituationConsequenceConditionDetailsDiversionPath] = FieldInfo(alias = "diversionPath", default = None) + diversion_stop_ids: Optional[List[str]] = FieldInfo(alias = "diversionStopIds", default = None) class SituationConsequence(BaseModel): condition: Optional[str] = None """Condition of the consequence.""" - condition_details: Optional[SituationConsequenceConditionDetails] = FieldInfo( - alias="conditionDetails", default=None - ) - + condition_details: Optional[SituationConsequenceConditionDetails] = FieldInfo(alias = "conditionDetails", default = None) class SituationDescription(BaseModel): lang: Optional[str] = None @@ -134,15 +108,13 @@ class SituationDescription(BaseModel): value: Optional[str] = None """Longer description of the situation.""" - class SituationPublicationWindow(BaseModel): - from_: int = FieldInfo(alias="from") + from_: int = FieldInfo(alias = "from") """Start time of the time window as a Unix timestamp.""" to: int """End time of the time window as a Unix timestamp.""" - class SituationSummary(BaseModel): lang: Optional[str] = None """Language of the summary.""" @@ -150,7 +122,6 @@ class SituationSummary(BaseModel): value: Optional[str] = None """Short summary of the situation.""" - class SituationURL(BaseModel): lang: Optional[str] = None """Language of the URL.""" @@ -158,32 +129,27 @@ class SituationURL(BaseModel): value: Optional[str] = None """URL for more information about the situation.""" - class Situation(BaseModel): id: str """Unique identifier for the situation.""" - creation_time: int = FieldInfo(alias="creationTime") + creation_time: int = FieldInfo(alias = "creationTime") """Unix timestamp of when this situation was created.""" - active_windows: Optional[List[SituationActiveWindow]] = FieldInfo(alias="activeWindows", default=None) + active_windows: Optional[List[SituationActiveWindow]] = FieldInfo(alias = "activeWindows", default = None) - all_affects: Optional[List[SituationAllAffect]] = FieldInfo(alias="allAffects", default=None) + all_affects: Optional[List[SituationAllAffect]] = FieldInfo(alias = "allAffects", default = None) - consequence_message: Optional[str] = FieldInfo(alias="consequenceMessage", default=None) + consequence_message: Optional[str] = FieldInfo(alias = "consequenceMessage", default = None) """Message regarding the consequence of the situation.""" consequences: Optional[List[SituationConsequence]] = None description: Optional[SituationDescription] = None - publication_windows: Optional[List[SituationPublicationWindow]] = FieldInfo( - alias="publicationWindows", default=None - ) + publication_windows: Optional[List[SituationPublicationWindow]] = FieldInfo(alias = "publicationWindows", default = None) - reason: Optional[ - Literal["equipmentReason", "environmentReason", "personnelReason", "miscellaneousReason", "securityAlert"] - ] = None + reason: Optional[Literal["equipmentReason", "environmentReason", "personnelReason", "miscellaneousReason", "securityAlert"]] = None """Reason for the service alert, taken from TPEG codes.""" severity: Optional[str] = None @@ -193,7 +159,6 @@ class Situation(BaseModel): url: Optional[SituationURL] = None - class Stop(BaseModel): id: str @@ -205,56 +170,53 @@ class Stop(BaseModel): parent: str - route_ids: List[str] = FieldInfo(alias="routeIds") + route_ids: List[str] = FieldInfo(alias = "routeIds") - static_route_ids: List[str] = FieldInfo(alias="staticRouteIds") + static_route_ids: List[str] = FieldInfo(alias = "staticRouteIds") code: Optional[str] = None direction: Optional[str] = None - location_type: Optional[int] = FieldInfo(alias="locationType", default=None) - - wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + location_type: Optional[int] = FieldInfo(alias = "locationType", default = None) + wheelchair_boarding: Optional[str] = FieldInfo(alias = "wheelchairBoarding", default = None) class StopTime(BaseModel): - arrival_time: Optional[int] = FieldInfo(alias="arrivalTime", default=None) + arrival_time: Optional[int] = FieldInfo(alias = "arrivalTime", default = None) - departure_time: Optional[int] = FieldInfo(alias="departureTime", default=None) + departure_time: Optional[int] = FieldInfo(alias = "departureTime", default = None) - distance_along_trip: Optional[float] = FieldInfo(alias="distanceAlongTrip", default=None) + distance_along_trip: Optional[float] = FieldInfo(alias = "distanceAlongTrip", default = None) - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) - - stop_id: Optional[str] = FieldInfo(alias="stopId", default=None) + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) + stop_id: Optional[str] = FieldInfo(alias = "stopId", default = None) class Trip(BaseModel): id: str - route_id: str = FieldInfo(alias="routeId") - - service_id: str = FieldInfo(alias="serviceId") + route_id: str = FieldInfo(alias = "routeId") - block_id: Optional[str] = FieldInfo(alias="blockId", default=None) + service_id: str = FieldInfo(alias = "serviceId") - direction_id: Optional[str] = FieldInfo(alias="directionId", default=None) + block_id: Optional[str] = FieldInfo(alias = "blockId", default = None) - peak_offpeak: Optional[int] = FieldInfo(alias="peakOffpeak", default=None) + direction_id: Optional[str] = FieldInfo(alias = "directionId", default = None) - route_short_name: Optional[str] = FieldInfo(alias="routeShortName", default=None) + peak_offpeak: Optional[int] = FieldInfo(alias = "peakOffpeak", default = None) - shape_id: Optional[str] = FieldInfo(alias="shapeId", default=None) + route_short_name: Optional[str] = FieldInfo(alias = "routeShortName", default = None) - time_zone: Optional[str] = FieldInfo(alias="timeZone", default=None) + shape_id: Optional[str] = FieldInfo(alias = "shapeId", default = None) - trip_headsign: Optional[str] = FieldInfo(alias="tripHeadsign", default=None) + time_zone: Optional[str] = FieldInfo(alias = "timeZone", default = None) - trip_short_name: Optional[str] = FieldInfo(alias="tripShortName", default=None) + trip_headsign: Optional[str] = FieldInfo(alias = "tripHeadsign", default = None) + trip_short_name: Optional[str] = FieldInfo(alias = "tripShortName", default = None) class References(BaseModel): agencies: List[Agency] @@ -265,6 +227,6 @@ class References(BaseModel): stops: List[Stop] - stop_times: List[StopTime] = FieldInfo(alias="stopTimes") + stop_times: List[StopTime] = FieldInfo(alias = "stopTimes") - trips: List[Trip] + trips: List[Trip] \ No newline at end of file diff --git a/src/onebusaway/types/shared/response_wrapper.py b/src/onebusaway/types/shared/response_wrapper.py index 72ecc38..fcaf06c 100644 --- a/src/onebusaway/types/shared/response_wrapper.py +++ b/src/onebusaway/types/shared/response_wrapper.py @@ -1,18 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from ..._models import BaseModel -from pydantic import Field as FieldInfo +from typing_extensions import Literal -from ..._models import BaseModel +from pydantic import Field as FieldInfo __all__ = ["ResponseWrapper"] - class ResponseWrapper(BaseModel): code: int - current_time: int = FieldInfo(alias="currentTime") + current_time: int = FieldInfo(alias = "currentTime") text: str - version: int + version: int \ No newline at end of file diff --git a/src/onebusaway/types/stop_ids_for_agency_list_response.py b/src/onebusaway/types/stop_ids_for_agency_list_response.py index 3ae9947..48489cd 100644 --- a/src/onebusaway/types/stop_ids_for_agency_list_response.py +++ b/src/onebusaway/types/stop_ids_for_agency_list_response.py @@ -1,23 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["StopIDsForAgencyListResponse", "StopIDsForAgencyListResponseData"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["StopIDsForAgencyListResponse", "StopIDsForAgencyListResponseData"] class StopIDsForAgencyListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[str] references: References - class StopIDsForAgencyListResponse(ResponseWrapper): - data: StopIDsForAgencyListResponseData + data: StopIDsForAgencyListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/stop_retrieve_response.py b/src/onebusaway/types/stop_retrieve_response.py index 6a69553..eb259c5 100644 --- a/src/onebusaway/types/stop_retrieve_response.py +++ b/src/onebusaway/types/stop_retrieve_response.py @@ -1,15 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List, Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["StopRetrieveResponse", "StopRetrieveResponseData", "StopRetrieveResponseDataEntry"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["StopRetrieveResponse", "StopRetrieveResponseData", "StopRetrieveResponseDataEntry"] class StopRetrieveResponseDataEntry(BaseModel): id: str @@ -22,24 +24,22 @@ class StopRetrieveResponseDataEntry(BaseModel): parent: str - route_ids: List[str] = FieldInfo(alias="routeIds") + route_ids: List[str] = FieldInfo(alias = "routeIds") - static_route_ids: List[str] = FieldInfo(alias="staticRouteIds") + static_route_ids: List[str] = FieldInfo(alias = "staticRouteIds") code: Optional[str] = None direction: Optional[str] = None - location_type: Optional[int] = FieldInfo(alias="locationType", default=None) - - wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + location_type: Optional[int] = FieldInfo(alias = "locationType", default = None) + wheelchair_boarding: Optional[str] = FieldInfo(alias = "wheelchairBoarding", default = None) class StopRetrieveResponseData(BaseModel): entry: StopRetrieveResponseDataEntry references: References - class StopRetrieveResponse(ResponseWrapper): - data: StopRetrieveResponseData + data: StopRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/stops_for_agency_list_response.py b/src/onebusaway/types/stops_for_agency_list_response.py index 422c5ee..bf131b5 100644 --- a/src/onebusaway/types/stops_for_agency_list_response.py +++ b/src/onebusaway/types/stops_for_agency_list_response.py @@ -1,15 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .._models import BaseModel + from typing import List, Optional -from pydantic import Field as FieldInfo +from .shared.response_wrapper import ResponseWrapper -from .._models import BaseModel from .shared.references import References -from .shared.response_wrapper import ResponseWrapper -__all__ = ["StopsForAgencyListResponse", "StopsForAgencyListResponseList"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["StopsForAgencyListResponse", "StopsForAgencyListResponseList"] class StopsForAgencyListResponseList(BaseModel): id: str @@ -22,24 +24,23 @@ class StopsForAgencyListResponseList(BaseModel): parent: str - route_ids: List[str] = FieldInfo(alias="routeIds") + route_ids: List[str] = FieldInfo(alias = "routeIds") - static_route_ids: List[str] = FieldInfo(alias="staticRouteIds") + static_route_ids: List[str] = FieldInfo(alias = "staticRouteIds") code: Optional[str] = None direction: Optional[str] = None - location_type: Optional[int] = FieldInfo(alias="locationType", default=None) - - wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + location_type: Optional[int] = FieldInfo(alias = "locationType", default = None) + wheelchair_boarding: Optional[str] = FieldInfo(alias = "wheelchairBoarding", default = None) class StopsForAgencyListResponse(ResponseWrapper): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[StopsForAgencyListResponseList] references: References - out_of_range: Optional[bool] = FieldInfo(alias="outOfRange", default=None) + out_of_range: Optional[bool] = FieldInfo(alias = "outOfRange", default = None) \ No newline at end of file diff --git a/src/onebusaway/types/stops_for_location_list_params.py b/src/onebusaway/types/stops_for_location_list_params.py index 3174257..6137ce8 100644 --- a/src/onebusaway/types/stops_for_location_list_params.py +++ b/src/onebusaway/types/stops_for_location_list_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import TypedDict, Required, Annotated from .._utils import PropertyInfo -__all__ = ["StopsForLocationListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["StopsForLocationListParams"] class StopsForLocationListParams(TypedDict, total=False): lat: Required[float] @@ -24,4 +27,4 @@ class StopsForLocationListParams(TypedDict, total=False): """A search query string to filter the results""" radius: float - """The radius in meters to search within""" + """The radius in meters to search within""" \ No newline at end of file diff --git a/src/onebusaway/types/stops_for_location_list_response.py b/src/onebusaway/types/stops_for_location_list_response.py index e075eb1..f9d4fca 100644 --- a/src/onebusaway/types/stops_for_location_list_response.py +++ b/src/onebusaway/types/stops_for_location_list_response.py @@ -1,15 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import List, Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["StopsForLocationListResponse", "StopsForLocationListResponseData", "StopsForLocationListResponseDataList"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["StopsForLocationListResponse", "StopsForLocationListResponseData", "StopsForLocationListResponseDataList"] class StopsForLocationListResponseDataList(BaseModel): id: str @@ -22,28 +24,26 @@ class StopsForLocationListResponseDataList(BaseModel): parent: str - route_ids: List[str] = FieldInfo(alias="routeIds") + route_ids: List[str] = FieldInfo(alias = "routeIds") - static_route_ids: List[str] = FieldInfo(alias="staticRouteIds") + static_route_ids: List[str] = FieldInfo(alias = "staticRouteIds") code: Optional[str] = None direction: Optional[str] = None - location_type: Optional[int] = FieldInfo(alias="locationType", default=None) - - wheelchair_boarding: Optional[str] = FieldInfo(alias="wheelchairBoarding", default=None) + location_type: Optional[int] = FieldInfo(alias = "locationType", default = None) + wheelchair_boarding: Optional[str] = FieldInfo(alias = "wheelchairBoarding", default = None) class StopsForLocationListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[StopsForLocationListResponseDataList] references: References - out_of_range: Optional[bool] = FieldInfo(alias="outOfRange", default=None) - + out_of_range: Optional[bool] = FieldInfo(alias = "outOfRange", default = None) class StopsForLocationListResponse(ResponseWrapper): - data: StopsForLocationListResponseData + data: StopsForLocationListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/stops_for_route_list_params.py b/src/onebusaway/types/stops_for_route_list_params.py index ddf40d0..cad8058 100644 --- a/src/onebusaway/types/stops_for_route_list_params.py +++ b/src/onebusaway/types/stops_for_route_list_params.py @@ -2,16 +2,19 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict, Annotated from .._utils import PropertyInfo -__all__ = ["StopsForRouteListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["StopsForRouteListParams"] class StopsForRouteListParams(TypedDict, total=False): include_polylines: Annotated[bool, PropertyInfo(alias="includePolylines")] """Include polyline elements in the response (default true)""" time: str - """Specify service date (YYYY-MM-DD or epoch) (default today)""" + """Specify service date (YYYY-MM-DD or epoch) (default today)""" \ No newline at end of file diff --git a/src/onebusaway/types/stops_for_route_list_response.py b/src/onebusaway/types/stops_for_route_list_response.py index 53cff4e..cd346b6 100644 --- a/src/onebusaway/types/stops_for_route_list_response.py +++ b/src/onebusaway/types/stops_for_route_list_response.py @@ -1,23 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "StopsForRouteListResponse", - "StopsForRouteListResponseData", - "StopsForRouteListResponseDataEntry", - "StopsForRouteListResponseDataEntryPolyline", - "StopsForRouteListResponseDataEntryStopGrouping", - "StopsForRouteListResponseDataEntryStopGroupingName", - "StopsForRouteListResponseDataEntryStopGroupingPolyline", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["StopsForRouteListResponse", "StopsForRouteListResponseData", "StopsForRouteListResponseDataEntry", "StopsForRouteListResponseDataEntryPolyline", "StopsForRouteListResponseDataEntryStopGrouping", "StopsForRouteListResponseDataEntryStopGroupingName", "StopsForRouteListResponseDataEntryStopGroupingPolyline"] class StopsForRouteListResponseDataEntryPolyline(BaseModel): length: Optional[int] = None @@ -26,7 +20,6 @@ class StopsForRouteListResponseDataEntryPolyline(BaseModel): points: Optional[str] = None - class StopsForRouteListResponseDataEntryStopGroupingName(BaseModel): name: Optional[str] = None @@ -34,7 +27,6 @@ class StopsForRouteListResponseDataEntryStopGroupingName(BaseModel): type: Optional[str] = None - class StopsForRouteListResponseDataEntryStopGroupingPolyline(BaseModel): length: Optional[int] = None @@ -42,7 +34,6 @@ class StopsForRouteListResponseDataEntryStopGroupingPolyline(BaseModel): points: Optional[str] = None - class StopsForRouteListResponseDataEntryStopGrouping(BaseModel): id: Optional[str] = None @@ -50,26 +41,21 @@ class StopsForRouteListResponseDataEntryStopGrouping(BaseModel): polylines: Optional[List[StopsForRouteListResponseDataEntryStopGroupingPolyline]] = None - stop_ids: Optional[List[str]] = FieldInfo(alias="stopIds", default=None) - + stop_ids: Optional[List[str]] = FieldInfo(alias = "stopIds", default = None) class StopsForRouteListResponseDataEntry(BaseModel): polylines: Optional[List[StopsForRouteListResponseDataEntryPolyline]] = None - route_id: Optional[str] = FieldInfo(alias="routeId", default=None) + route_id: Optional[str] = FieldInfo(alias = "routeId", default = None) - stop_groupings: Optional[List[StopsForRouteListResponseDataEntryStopGrouping]] = FieldInfo( - alias="stopGroupings", default=None - ) - - stop_ids: Optional[List[str]] = FieldInfo(alias="stopIds", default=None) + stop_groupings: Optional[List[StopsForRouteListResponseDataEntryStopGrouping]] = FieldInfo(alias = "stopGroupings", default = None) + stop_ids: Optional[List[str]] = FieldInfo(alias = "stopIds", default = None) class StopsForRouteListResponseData(BaseModel): entry: StopsForRouteListResponseDataEntry references: References - class StopsForRouteListResponse(ResponseWrapper): - data: StopsForRouteListResponseData + data: StopsForRouteListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/trip_detail_retrieve_params.py b/src/onebusaway/types/trip_detail_retrieve_params.py index a8529bf..658d0a6 100644 --- a/src/onebusaway/types/trip_detail_retrieve_params.py +++ b/src/onebusaway/types/trip_detail_retrieve_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict, Annotated from .._utils import PropertyInfo -__all__ = ["TripDetailRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["TripDetailRetrieveParams"] class TripDetailRetrieveParams(TypedDict, total=False): include_schedule: Annotated[bool, PropertyInfo(alias="includeSchedule")] @@ -32,4 +35,4 @@ class TripDetailRetrieveParams(TypedDict, total=False): """Service date for the trip as Unix time in milliseconds (optional).""" time: int - """Time parameter to query the system at a specific time (optional).""" + """Time parameter to query the system at a specific time (optional).""" \ No newline at end of file diff --git a/src/onebusaway/types/trip_detail_retrieve_response.py b/src/onebusaway/types/trip_detail_retrieve_response.py index 4b76689..1846d1e 100644 --- a/src/onebusaway/types/trip_detail_retrieve_response.py +++ b/src/onebusaway/types/trip_detail_retrieve_response.py @@ -1,51 +1,42 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "TripDetailRetrieveResponse", - "TripDetailRetrieveResponseData", - "TripDetailRetrieveResponseDataEntry", - "TripDetailRetrieveResponseDataEntrySchedule", - "TripDetailRetrieveResponseDataEntryScheduleStopTime", - "TripDetailRetrieveResponseDataEntryStatus", - "TripDetailRetrieveResponseDataEntryStatusLastKnownLocation", - "TripDetailRetrieveResponseDataEntryStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["TripDetailRetrieveResponse", "TripDetailRetrieveResponseData", "TripDetailRetrieveResponseDataEntry", "TripDetailRetrieveResponseDataEntrySchedule", "TripDetailRetrieveResponseDataEntryScheduleStopTime", "TripDetailRetrieveResponseDataEntryStatus", "TripDetailRetrieveResponseDataEntryStatusLastKnownLocation", "TripDetailRetrieveResponseDataEntryStatusPosition"] class TripDetailRetrieveResponseDataEntryScheduleStopTime(BaseModel): - arrival_time: Optional[int] = FieldInfo(alias="arrivalTime", default=None) - - departure_time: Optional[int] = FieldInfo(alias="departureTime", default=None) + arrival_time: Optional[int] = FieldInfo(alias = "arrivalTime", default = None) - distance_along_trip: Optional[float] = FieldInfo(alias="distanceAlongTrip", default=None) + departure_time: Optional[int] = FieldInfo(alias = "departureTime", default = None) - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + distance_along_trip: Optional[float] = FieldInfo(alias = "distanceAlongTrip", default = None) - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) - stop_id: Optional[str] = FieldInfo(alias="stopId", default=None) + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) + stop_id: Optional[str] = FieldInfo(alias = "stopId", default = None) class TripDetailRetrieveResponseDataEntrySchedule(BaseModel): - next_trip_id: str = FieldInfo(alias="nextTripId") + next_trip_id: str = FieldInfo(alias = "nextTripId") - previous_trip_id: str = FieldInfo(alias="previousTripId") + previous_trip_id: str = FieldInfo(alias = "previousTripId") - stop_times: List[TripDetailRetrieveResponseDataEntryScheduleStopTime] = FieldInfo(alias="stopTimes") + stop_times: List[TripDetailRetrieveResponseDataEntryScheduleStopTime] = FieldInfo(alias = "stopTimes") - time_zone: str = FieldInfo(alias="timeZone") + time_zone: str = FieldInfo(alias = "timeZone") frequency: Optional[str] = None - class TripDetailRetrieveResponseDataEntryStatusLastKnownLocation(BaseModel): lat: Optional[float] = None """Latitude of the last known location of the transit vehicle.""" @@ -53,7 +44,6 @@ class TripDetailRetrieveResponseDataEntryStatusLastKnownLocation(BaseModel): lon: Optional[float] = None """Longitude of the last known location of the transit vehicle.""" - class TripDetailRetrieveResponseDataEntryStatusPosition(BaseModel): lat: Optional[float] = None """Latitude of the current position of the transit vehicle.""" @@ -61,39 +51,38 @@ class TripDetailRetrieveResponseDataEntryStatusPosition(BaseModel): lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class TripDetailRetrieveResponseDataEntryStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -102,10 +91,10 @@ class TripDetailRetrieveResponseDataEntryStatus(BaseModel): predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -114,10 +103,10 @@ class TripDetailRetrieveResponseDataEntryStatus(BaseModel): status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -126,18 +115,16 @@ class TripDetailRetrieveResponseDataEntryStatus(BaseModel): frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[TripDetailRetrieveResponseDataEntryStatusLastKnownLocation] = FieldInfo( - alias="lastKnownLocation", default=None - ) + last_known_location: Optional[TripDetailRetrieveResponseDataEntryStatusLastKnownLocation] = 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -149,38 +136,35 @@ class TripDetailRetrieveResponseDataEntryStatus(BaseModel): position: Optional[TripDetailRetrieveResponseDataEntryStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + vehicle_id: Optional[str] = FieldInfo(alias = "vehicleId", default = None) """ID of the transit vehicle currently serving the trip.""" - class TripDetailRetrieveResponseDataEntry(BaseModel): - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") frequency: Optional[str] = None schedule: Optional[TripDetailRetrieveResponseDataEntrySchedule] = None - service_date: Optional[int] = FieldInfo(alias="serviceDate", default=None) + service_date: Optional[int] = FieldInfo(alias = "serviceDate", default = None) - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) status: Optional[TripDetailRetrieveResponseDataEntryStatus] = None - class TripDetailRetrieveResponseData(BaseModel): entry: TripDetailRetrieveResponseDataEntry references: References - class TripDetailRetrieveResponse(ResponseWrapper): - data: TripDetailRetrieveResponseData + data: TripDetailRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/trip_for_vehicle_retrieve_params.py b/src/onebusaway/types/trip_for_vehicle_retrieve_params.py index 3e8240c..325521b 100644 --- a/src/onebusaway/types/trip_for_vehicle_retrieve_params.py +++ b/src/onebusaway/types/trip_for_vehicle_retrieve_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict, Annotated from .._utils import PropertyInfo -__all__ = ["TripForVehicleRetrieveParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["TripForVehicleRetrieveParams"] class TripForVehicleRetrieveParams(TypedDict, total=False): include_schedule: Annotated[bool, PropertyInfo(alias="includeSchedule")] @@ -30,4 +33,4 @@ class TripForVehicleRetrieveParams(TypedDict, total=False): """ time: int - """Time parameter to query the system at a specific time (optional).""" + """Time parameter to query the system at a specific time (optional).""" \ No newline at end of file diff --git a/src/onebusaway/types/trip_for_vehicle_retrieve_response.py b/src/onebusaway/types/trip_for_vehicle_retrieve_response.py index 136b96c..fab9984 100644 --- a/src/onebusaway/types/trip_for_vehicle_retrieve_response.py +++ b/src/onebusaway/types/trip_for_vehicle_retrieve_response.py @@ -1,51 +1,42 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "TripForVehicleRetrieveResponse", - "TripForVehicleRetrieveResponseData", - "TripForVehicleRetrieveResponseDataEntry", - "TripForVehicleRetrieveResponseDataEntrySchedule", - "TripForVehicleRetrieveResponseDataEntryScheduleStopTime", - "TripForVehicleRetrieveResponseDataEntryStatus", - "TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation", - "TripForVehicleRetrieveResponseDataEntryStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["TripForVehicleRetrieveResponse", "TripForVehicleRetrieveResponseData", "TripForVehicleRetrieveResponseDataEntry", "TripForVehicleRetrieveResponseDataEntrySchedule", "TripForVehicleRetrieveResponseDataEntryScheduleStopTime", "TripForVehicleRetrieveResponseDataEntryStatus", "TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation", "TripForVehicleRetrieveResponseDataEntryStatusPosition"] class TripForVehicleRetrieveResponseDataEntryScheduleStopTime(BaseModel): - arrival_time: Optional[int] = FieldInfo(alias="arrivalTime", default=None) - - departure_time: Optional[int] = FieldInfo(alias="departureTime", default=None) + arrival_time: Optional[int] = FieldInfo(alias = "arrivalTime", default = None) - distance_along_trip: Optional[float] = FieldInfo(alias="distanceAlongTrip", default=None) + departure_time: Optional[int] = FieldInfo(alias = "departureTime", default = None) - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + distance_along_trip: Optional[float] = FieldInfo(alias = "distanceAlongTrip", default = None) - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) - stop_id: Optional[str] = FieldInfo(alias="stopId", default=None) + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) + stop_id: Optional[str] = FieldInfo(alias = "stopId", default = None) class TripForVehicleRetrieveResponseDataEntrySchedule(BaseModel): - next_trip_id: str = FieldInfo(alias="nextTripId") + next_trip_id: str = FieldInfo(alias = "nextTripId") - previous_trip_id: str = FieldInfo(alias="previousTripId") + previous_trip_id: str = FieldInfo(alias = "previousTripId") - stop_times: List[TripForVehicleRetrieveResponseDataEntryScheduleStopTime] = FieldInfo(alias="stopTimes") + stop_times: List[TripForVehicleRetrieveResponseDataEntryScheduleStopTime] = FieldInfo(alias = "stopTimes") - time_zone: str = FieldInfo(alias="timeZone") + time_zone: str = FieldInfo(alias = "timeZone") frequency: Optional[str] = None - class TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation(BaseModel): lat: Optional[float] = None """Latitude of the last known location of the transit vehicle.""" @@ -53,7 +44,6 @@ class TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation(BaseModel): lon: Optional[float] = None """Longitude of the last known location of the transit vehicle.""" - class TripForVehicleRetrieveResponseDataEntryStatusPosition(BaseModel): lat: Optional[float] = None """Latitude of the current position of the transit vehicle.""" @@ -61,39 +51,38 @@ class TripForVehicleRetrieveResponseDataEntryStatusPosition(BaseModel): lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class TripForVehicleRetrieveResponseDataEntryStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -102,10 +91,10 @@ class TripForVehicleRetrieveResponseDataEntryStatus(BaseModel): predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -114,10 +103,10 @@ class TripForVehicleRetrieveResponseDataEntryStatus(BaseModel): status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -126,18 +115,16 @@ class TripForVehicleRetrieveResponseDataEntryStatus(BaseModel): frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation] = FieldInfo( - alias="lastKnownLocation", default=None - ) + last_known_location: Optional[TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation] = 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -149,38 +136,35 @@ class TripForVehicleRetrieveResponseDataEntryStatus(BaseModel): position: Optional[TripForVehicleRetrieveResponseDataEntryStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + vehicle_id: Optional[str] = FieldInfo(alias = "vehicleId", default = None) """ID of the transit vehicle currently serving the trip.""" - class TripForVehicleRetrieveResponseDataEntry(BaseModel): - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") frequency: Optional[str] = None schedule: Optional[TripForVehicleRetrieveResponseDataEntrySchedule] = None - service_date: Optional[int] = FieldInfo(alias="serviceDate", default=None) + service_date: Optional[int] = FieldInfo(alias = "serviceDate", default = None) - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) status: Optional[TripForVehicleRetrieveResponseDataEntryStatus] = None - class TripForVehicleRetrieveResponseData(BaseModel): entry: TripForVehicleRetrieveResponseDataEntry references: References - class TripForVehicleRetrieveResponse(ResponseWrapper): - data: TripForVehicleRetrieveResponseData + data: TripForVehicleRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/trip_retrieve_response.py b/src/onebusaway/types/trip_retrieve_response.py index 152bfa2..37fbab7 100644 --- a/src/onebusaway/types/trip_retrieve_response.py +++ b/src/onebusaway/types/trip_retrieve_response.py @@ -1,45 +1,45 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = ["TripRetrieveResponse", "TripRetrieveResponseData", "TripRetrieveResponseDataEntry"] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["TripRetrieveResponse", "TripRetrieveResponseData", "TripRetrieveResponseDataEntry"] class TripRetrieveResponseDataEntry(BaseModel): id: str - route_id: str = FieldInfo(alias="routeId") + route_id: str = FieldInfo(alias = "routeId") - service_id: str = FieldInfo(alias="serviceId") + service_id: str = FieldInfo(alias = "serviceId") - block_id: Optional[str] = FieldInfo(alias="blockId", default=None) + block_id: Optional[str] = FieldInfo(alias = "blockId", default = None) - direction_id: Optional[str] = FieldInfo(alias="directionId", default=None) + direction_id: Optional[str] = FieldInfo(alias = "directionId", default = None) - peak_offpeak: Optional[int] = FieldInfo(alias="peakOffpeak", default=None) + peak_offpeak: Optional[int] = FieldInfo(alias = "peakOffpeak", default = None) - route_short_name: Optional[str] = FieldInfo(alias="routeShortName", default=None) + route_short_name: Optional[str] = FieldInfo(alias = "routeShortName", default = None) - shape_id: Optional[str] = FieldInfo(alias="shapeId", default=None) + shape_id: Optional[str] = FieldInfo(alias = "shapeId", default = None) - time_zone: Optional[str] = FieldInfo(alias="timeZone", default=None) + time_zone: Optional[str] = FieldInfo(alias = "timeZone", default = None) - trip_headsign: Optional[str] = FieldInfo(alias="tripHeadsign", default=None) - - trip_short_name: Optional[str] = FieldInfo(alias="tripShortName", default=None) + trip_headsign: Optional[str] = FieldInfo(alias = "tripHeadsign", default = None) + trip_short_name: Optional[str] = FieldInfo(alias = "tripShortName", default = None) class TripRetrieveResponseData(BaseModel): entry: TripRetrieveResponseDataEntry references: References - class TripRetrieveResponse(ResponseWrapper): - data: TripRetrieveResponseData + data: TripRetrieveResponseData \ No newline at end of file diff --git a/src/onebusaway/types/trips_for_location_list_params.py b/src/onebusaway/types/trips_for_location_list_params.py index 69a9186..6962798 100644 --- a/src/onebusaway/types/trips_for_location_list_params.py +++ b/src/onebusaway/types/trips_for_location_list_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import TypedDict, Required, Annotated from .._utils import PropertyInfo -__all__ = ["TripsForLocationListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["TripsForLocationListParams"] class TripsForLocationListParams(TypedDict, total=False): lat: Required[float] @@ -35,4 +38,4 @@ class TripsForLocationListParams(TypedDict, total=False): """ time: int - """Specific time for the query. Defaults to the current time.""" + """Specific time for the query. Defaults to the current time.""" \ No newline at end of file diff --git a/src/onebusaway/types/trips_for_location_list_response.py b/src/onebusaway/types/trips_for_location_list_response.py index 68ae881..5e3c087 100644 --- a/src/onebusaway/types/trips_for_location_list_response.py +++ b/src/onebusaway/types/trips_for_location_list_response.py @@ -1,51 +1,42 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "TripsForLocationListResponse", - "TripsForLocationListResponseData", - "TripsForLocationListResponseDataList", - "TripsForLocationListResponseDataListSchedule", - "TripsForLocationListResponseDataListScheduleStopTime", - "TripsForLocationListResponseDataListStatus", - "TripsForLocationListResponseDataListStatusLastKnownLocation", - "TripsForLocationListResponseDataListStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["TripsForLocationListResponse", "TripsForLocationListResponseData", "TripsForLocationListResponseDataList", "TripsForLocationListResponseDataListSchedule", "TripsForLocationListResponseDataListScheduleStopTime", "TripsForLocationListResponseDataListStatus", "TripsForLocationListResponseDataListStatusLastKnownLocation", "TripsForLocationListResponseDataListStatusPosition"] class TripsForLocationListResponseDataListScheduleStopTime(BaseModel): - arrival_time: Optional[int] = FieldInfo(alias="arrivalTime", default=None) - - departure_time: Optional[int] = FieldInfo(alias="departureTime", default=None) + arrival_time: Optional[int] = FieldInfo(alias = "arrivalTime", default = None) - distance_along_trip: Optional[float] = FieldInfo(alias="distanceAlongTrip", default=None) + departure_time: Optional[int] = FieldInfo(alias = "departureTime", default = None) - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + distance_along_trip: Optional[float] = FieldInfo(alias = "distanceAlongTrip", default = None) - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) - stop_id: Optional[str] = FieldInfo(alias="stopId", default=None) + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) + stop_id: Optional[str] = FieldInfo(alias = "stopId", default = None) class TripsForLocationListResponseDataListSchedule(BaseModel): - next_trip_id: str = FieldInfo(alias="nextTripId") + next_trip_id: str = FieldInfo(alias = "nextTripId") - previous_trip_id: str = FieldInfo(alias="previousTripId") + previous_trip_id: str = FieldInfo(alias = "previousTripId") - stop_times: List[TripsForLocationListResponseDataListScheduleStopTime] = FieldInfo(alias="stopTimes") + stop_times: List[TripsForLocationListResponseDataListScheduleStopTime] = FieldInfo(alias = "stopTimes") - time_zone: str = FieldInfo(alias="timeZone") + time_zone: str = FieldInfo(alias = "timeZone") frequency: Optional[str] = None - class TripsForLocationListResponseDataListStatusLastKnownLocation(BaseModel): lat: Optional[float] = None """Latitude of the last known location of the transit vehicle.""" @@ -53,7 +44,6 @@ class TripsForLocationListResponseDataListStatusLastKnownLocation(BaseModel): lon: Optional[float] = None """Longitude of the last known location of the transit vehicle.""" - class TripsForLocationListResponseDataListStatusPosition(BaseModel): lat: Optional[float] = None """Latitude of the current position of the transit vehicle.""" @@ -61,39 +51,38 @@ class TripsForLocationListResponseDataListStatusPosition(BaseModel): lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class TripsForLocationListResponseDataListStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -102,10 +91,10 @@ class TripsForLocationListResponseDataListStatus(BaseModel): predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -114,10 +103,10 @@ class TripsForLocationListResponseDataListStatus(BaseModel): status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -126,18 +115,16 @@ class TripsForLocationListResponseDataListStatus(BaseModel): frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[TripsForLocationListResponseDataListStatusLastKnownLocation] = FieldInfo( - alias="lastKnownLocation", default=None - ) + last_known_location: Optional[TripsForLocationListResponseDataListStatusLastKnownLocation] = 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -149,44 +136,41 @@ class TripsForLocationListResponseDataListStatus(BaseModel): position: Optional[TripsForLocationListResponseDataListStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + vehicle_id: Optional[str] = FieldInfo(alias = "vehicleId", default = None) """ID of the transit vehicle currently serving the trip.""" - class TripsForLocationListResponseDataList(BaseModel): schedule: TripsForLocationListResponseDataListSchedule status: TripsForLocationListResponseDataListStatus - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") frequency: Optional[str] = None - service_date: Optional[int] = FieldInfo(alias="serviceDate", default=None) - - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + service_date: Optional[int] = FieldInfo(alias = "serviceDate", default = None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) class TripsForLocationListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") """Indicates if the limit of trips has been exceeded""" list: List[TripsForLocationListResponseDataList] references: References - out_of_range: Optional[bool] = FieldInfo(alias="outOfRange", default=None) + out_of_range: Optional[bool] = FieldInfo(alias = "outOfRange", default = None) """Indicates if the search location is out of range""" - class TripsForLocationListResponse(ResponseWrapper): - data: TripsForLocationListResponseData + data: TripsForLocationListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/trips_for_route_list_params.py b/src/onebusaway/types/trips_for_route_list_params.py index c2f7ec0..d3bf43f 100644 --- a/src/onebusaway/types/trips_for_route_list_params.py +++ b/src/onebusaway/types/trips_for_route_list_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict, Annotated from .._utils import PropertyInfo -__all__ = ["TripsForRouteListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["TripsForRouteListParams"] class TripsForRouteListParams(TypedDict, total=False): include_schedule: Annotated[bool, PropertyInfo(alias="includeSchedule")] @@ -20,4 +23,4 @@ class TripsForRouteListParams(TypedDict, total=False): """ time: int - """Query the system at a specific time. Useful for testing.""" + """Query the system at a specific time. Useful for testing.""" \ No newline at end of file diff --git a/src/onebusaway/types/trips_for_route_list_response.py b/src/onebusaway/types/trips_for_route_list_response.py index f9bc2d8..efb7b6e 100644 --- a/src/onebusaway/types/trips_for_route_list_response.py +++ b/src/onebusaway/types/trips_for_route_list_response.py @@ -1,51 +1,42 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "TripsForRouteListResponse", - "TripsForRouteListResponseData", - "TripsForRouteListResponseDataList", - "TripsForRouteListResponseDataListSchedule", - "TripsForRouteListResponseDataListScheduleStopTime", - "TripsForRouteListResponseDataListStatus", - "TripsForRouteListResponseDataListStatusLastKnownLocation", - "TripsForRouteListResponseDataListStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__all__ = ["TripsForRouteListResponse", "TripsForRouteListResponseData", "TripsForRouteListResponseDataList", "TripsForRouteListResponseDataListSchedule", "TripsForRouteListResponseDataListScheduleStopTime", "TripsForRouteListResponseDataListStatus", "TripsForRouteListResponseDataListStatusLastKnownLocation", "TripsForRouteListResponseDataListStatusPosition"] class TripsForRouteListResponseDataListScheduleStopTime(BaseModel): - arrival_time: Optional[int] = FieldInfo(alias="arrivalTime", default=None) - - departure_time: Optional[int] = FieldInfo(alias="departureTime", default=None) + arrival_time: Optional[int] = FieldInfo(alias = "arrivalTime", default = None) - distance_along_trip: Optional[float] = FieldInfo(alias="distanceAlongTrip", default=None) + departure_time: Optional[int] = FieldInfo(alias = "departureTime", default = None) - historical_occupancy: Optional[str] = FieldInfo(alias="historicalOccupancy", default=None) + distance_along_trip: Optional[float] = FieldInfo(alias = "distanceAlongTrip", default = None) - stop_headsign: Optional[str] = FieldInfo(alias="stopHeadsign", default=None) + historical_occupancy: Optional[str] = FieldInfo(alias = "historicalOccupancy", default = None) - stop_id: Optional[str] = FieldInfo(alias="stopId", default=None) + stop_headsign: Optional[str] = FieldInfo(alias = "stopHeadsign", default = None) + stop_id: Optional[str] = FieldInfo(alias = "stopId", default = None) class TripsForRouteListResponseDataListSchedule(BaseModel): - next_trip_id: str = FieldInfo(alias="nextTripId") + next_trip_id: str = FieldInfo(alias = "nextTripId") - previous_trip_id: str = FieldInfo(alias="previousTripId") + previous_trip_id: str = FieldInfo(alias = "previousTripId") - stop_times: List[TripsForRouteListResponseDataListScheduleStopTime] = FieldInfo(alias="stopTimes") + stop_times: List[TripsForRouteListResponseDataListScheduleStopTime] = FieldInfo(alias = "stopTimes") - time_zone: str = FieldInfo(alias="timeZone") + time_zone: str = FieldInfo(alias = "timeZone") frequency: Optional[str] = None - class TripsForRouteListResponseDataListStatusLastKnownLocation(BaseModel): lat: Optional[float] = None """Latitude of the last known location of the transit vehicle.""" @@ -53,7 +44,6 @@ class TripsForRouteListResponseDataListStatusLastKnownLocation(BaseModel): lon: Optional[float] = None """Longitude of the last known location of the transit vehicle.""" - class TripsForRouteListResponseDataListStatusPosition(BaseModel): lat: Optional[float] = None """Latitude of the current position of the transit vehicle.""" @@ -61,39 +51,38 @@ class TripsForRouteListResponseDataListStatusPosition(BaseModel): lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class TripsForRouteListResponseDataListStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -102,10 +91,10 @@ class TripsForRouteListResponseDataListStatus(BaseModel): predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -114,10 +103,10 @@ class TripsForRouteListResponseDataListStatus(BaseModel): status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -126,18 +115,16 @@ class TripsForRouteListResponseDataListStatus(BaseModel): frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[TripsForRouteListResponseDataListStatusLastKnownLocation] = FieldInfo( - alias="lastKnownLocation", default=None - ) + last_known_location: Optional[TripsForRouteListResponseDataListStatusLastKnownLocation] = 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -149,40 +136,37 @@ class TripsForRouteListResponseDataListStatus(BaseModel): position: Optional[TripsForRouteListResponseDataListStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + vehicle_id: Optional[str] = FieldInfo(alias = "vehicleId", default = None) """ID of the transit vehicle currently serving the trip.""" - class TripsForRouteListResponseDataList(BaseModel): schedule: TripsForRouteListResponseDataListSchedule status: TripsForRouteListResponseDataListStatus - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") frequency: Optional[str] = None - service_date: Optional[int] = FieldInfo(alias="serviceDate", default=None) - - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + service_date: Optional[int] = FieldInfo(alias = "serviceDate", default = None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) class TripsForRouteListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[TripsForRouteListResponseDataList] references: References - class TripsForRouteListResponse(ResponseWrapper): - data: TripsForRouteListResponseData + data: TripsForRouteListResponseData \ No newline at end of file diff --git a/src/onebusaway/types/vehicles_for_agency_list_params.py b/src/onebusaway/types/vehicles_for_agency_list_params.py index ebf92d1..05937c8 100644 --- a/src/onebusaway/types/vehicles_for_agency_list_params.py +++ b/src/onebusaway/types/vehicles_for_agency_list_params.py @@ -4,9 +4,12 @@ from typing_extensions import TypedDict -__all__ = ["VehiclesForAgencyListParams"] +from typing_extensions import Literal, TypedDict, Required, Annotated +from .._types import FileTypes +from .._utils import PropertyInfo +__all__ = ["VehiclesForAgencyListParams"] class VehiclesForAgencyListParams(TypedDict, total=False): time: str - """Specific time for querying the status (timestamp format)""" + """Specific time for querying the status (timestamp format)""" \ No newline at end of file diff --git a/src/onebusaway/types/vehicles_for_agency_list_response.py b/src/onebusaway/types/vehicles_for_agency_list_response.py index 34601dd..cd8ac35 100644 --- a/src/onebusaway/types/vehicles_for_agency_list_response.py +++ b/src/onebusaway/types/vehicles_for_agency_list_response.py @@ -1,30 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel -from pydantic import Field as FieldInfo +from typing import Optional, List -from .._models import BaseModel from .shared.references import References + from .shared.response_wrapper import ResponseWrapper -__all__ = [ - "VehiclesForAgencyListResponse", - "VehiclesForAgencyListResponseData", - "VehiclesForAgencyListResponseDataList", - "VehiclesForAgencyListResponseDataListLocation", - "VehiclesForAgencyListResponseDataListTripStatus", - "VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation", - "VehiclesForAgencyListResponseDataListTripStatusPosition", -] +from typing_extensions import Literal +from pydantic import Field as FieldInfo +__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.""" @@ -32,7 +25,6 @@ class VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation(BaseModel 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.""" @@ -40,39 +32,38 @@ class VehiclesForAgencyListResponseDataListTripStatusPosition(BaseModel): lon: Optional[float] = None """Longitude of the current position of the transit vehicle.""" - class VehiclesForAgencyListResponseDataListTripStatus(BaseModel): - active_trip_id: str = FieldInfo(alias="activeTripId") + active_trip_id: str = FieldInfo(alias = "activeTripId") """Trip ID of the trip the vehicle is actively serving.""" - block_trip_sequence: int = FieldInfo(alias="blockTripSequence") + block_trip_sequence: int = FieldInfo(alias = "blockTripSequence") """Index of the active trip into the sequence of trips for the active block.""" - closest_stop: str = FieldInfo(alias="closestStop") + closest_stop: str = FieldInfo(alias = "closestStop") """ID of the closest stop to the current location of the transit vehicle.""" - distance_along_trip: float = FieldInfo(alias="distanceAlongTrip") + distance_along_trip: float = FieldInfo(alias = "distanceAlongTrip") """Distance, in meters, the transit vehicle has progressed along the active trip.""" - last_known_distance_along_trip: float = FieldInfo(alias="lastKnownDistanceAlongTrip") + last_known_distance_along_trip: float = FieldInfo(alias = "lastKnownDistanceAlongTrip") """ Last known distance along the trip received in real-time from the transit vehicle. """ - last_location_update_time: int = FieldInfo(alias="lastLocationUpdateTime") + last_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") """Timestamp of the last known real-time location update from the transit vehicle.""" - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") """Timestamp of the last known real-time update from the transit vehicle.""" - occupancy_capacity: int = FieldInfo(alias="occupancyCapacity") + occupancy_capacity: int = FieldInfo(alias = "occupancyCapacity") """Capacity of the transit vehicle in terms of occupancy.""" - occupancy_count: int = FieldInfo(alias="occupancyCount") + occupancy_count: int = FieldInfo(alias = "occupancyCount") """Current count of occupants in the transit vehicle.""" - occupancy_status: str = FieldInfo(alias="occupancyStatus") + occupancy_status: str = FieldInfo(alias = "occupancyStatus") """Current occupancy status of the transit vehicle.""" phase: str @@ -81,10 +72,10 @@ class VehiclesForAgencyListResponseDataListTripStatus(BaseModel): predicted: bool """Indicates if real-time arrival info is available for this trip.""" - schedule_deviation: int = FieldInfo(alias="scheduleDeviation") + schedule_deviation: int = FieldInfo(alias = "scheduleDeviation") """Deviation from the schedule in seconds (positive for late, negative for early).""" - service_date: int = FieldInfo(alias="serviceDate") + service_date: int = FieldInfo(alias = "serviceDate") """ Time, in milliseconds since the Unix epoch, of midnight for the start of the service date for the trip. @@ -93,10 +84,10 @@ class VehiclesForAgencyListResponseDataListTripStatus(BaseModel): status: str """Current status modifiers for the trip.""" - total_distance_along_trip: float = FieldInfo(alias="totalDistanceAlongTrip") + total_distance_along_trip: float = FieldInfo(alias = "totalDistanceAlongTrip") """Total length of the trip, in meters.""" - closest_stop_time_offset: Optional[int] = FieldInfo(alias="closestStopTimeOffset", default=None) + 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). @@ -105,18 +96,16 @@ class VehiclesForAgencyListResponseDataListTripStatus(BaseModel): frequency: Optional[str] = None """Information about frequency-based scheduling, if applicable to the trip.""" - last_known_location: Optional[VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation] = FieldInfo( - alias="lastKnownLocation", default=None - ) + 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: Optional[float] = FieldInfo(alias = "lastKnownOrientation", default = None) """Last known orientation value received in real-time from the transit vehicle.""" - next_stop: Optional[str] = FieldInfo(alias="nextStop", default=None) + 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) + 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). @@ -128,50 +117,47 @@ class VehiclesForAgencyListResponseDataListTripStatus(BaseModel): position: Optional[VehiclesForAgencyListResponseDataListTripStatusPosition] = None """Current position of the transit vehicle.""" - scheduled_distance_along_trip: Optional[float] = FieldInfo(alias="scheduledDistanceAlongTrip", default=None) + 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. """ - situation_ids: Optional[List[str]] = FieldInfo(alias="situationIds", default=None) + situation_ids: Optional[List[str]] = FieldInfo(alias = "situationIds", default = None) """References to situation elements (if any) applicable to this trip.""" - vehicle_id: Optional[str] = FieldInfo(alias="vehicleId", default=None) + 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_location_update_time: int = FieldInfo(alias = "lastLocationUpdateTime") - last_update_time: int = FieldInfo(alias="lastUpdateTime") + last_update_time: int = FieldInfo(alias = "lastUpdateTime") location: VehiclesForAgencyListResponseDataListLocation - trip_id: str = FieldInfo(alias="tripId") + trip_id: str = FieldInfo(alias = "tripId") - trip_status: VehiclesForAgencyListResponseDataListTripStatus = FieldInfo(alias="tripStatus") + trip_status: VehiclesForAgencyListResponseDataListTripStatus = FieldInfo(alias = "tripStatus") - vehicle_id: str = FieldInfo(alias="vehicleId") + vehicle_id: str = FieldInfo(alias = "vehicleId") - occupancy_capacity: Optional[int] = FieldInfo(alias="occupancyCapacity", default=None) + occupancy_capacity: Optional[int] = FieldInfo(alias = "occupancyCapacity", default = None) - occupancy_count: Optional[int] = FieldInfo(alias="occupancyCount", default=None) + occupancy_count: Optional[int] = FieldInfo(alias = "occupancyCount", default = None) - occupancy_status: Optional[str] = FieldInfo(alias="occupancyStatus", default=None) + occupancy_status: Optional[str] = FieldInfo(alias = "occupancyStatus", default = None) phase: Optional[str] = None status: Optional[str] = None - class VehiclesForAgencyListResponseData(BaseModel): - limit_exceeded: bool = FieldInfo(alias="limitExceeded") + limit_exceeded: bool = FieldInfo(alias = "limitExceeded") list: List[VehiclesForAgencyListResponseDataList] references: References - class VehiclesForAgencyListResponse(ResponseWrapper): - data: VehiclesForAgencyListResponseData + data: VehiclesForAgencyListResponseData \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py index fd8019a..bd67c17 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. \ No newline at end of file diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py index fd8019a..bd67c17 100644 --- a/tests/api_resources/__init__.py +++ b/tests/api_resources/__init__.py @@ -1 +1 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. \ No newline at end of file diff --git a/tests/api_resources/test_agencies_with_coverage.py b/tests/api_resources/test_agencies_with_coverage.py index fad1087..5b49882 100644 --- a/tests/api_resources/test_agencies_with_coverage.py +++ b/tests/api_resources/test_agencies_with_coverage.py @@ -2,71 +2,77 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import AgenciesWithCoverageListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import AgenciesWithCoverageListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestAgenciesWithCoverage: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: agencies_with_coverage = client.agencies_with_coverage.list() - assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=["response"]) + assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.agencies_with_coverage.with_raw_response.list() assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agencies_with_coverage = response.parse() - assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=["response"]) + assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: - with client.agencies_with_coverage.with_streaming_response.list() as response: + with client.agencies_with_coverage.with_streaming_response.list() as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agencies_with_coverage = response.parse() - assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=["response"]) + assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncAgenciesWithCoverage: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: agencies_with_coverage = await async_client.agencies_with_coverage.list() - assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=["response"]) + assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.agencies_with_coverage.with_raw_response.list() assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agencies_with_coverage = await response.parse() - assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=["response"]) + assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: - async with async_client.agencies_with_coverage.with_streaming_response.list() as response: + async with async_client.agencies_with_coverage.with_streaming_response.list() as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agencies_with_coverage = await response.parse() - assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=["response"]) + assert_matches_type(AgenciesWithCoverageListResponse, agencies_with_coverage, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_agency.py b/tests/api_resources/test_agency.py index 05b83a8..bdfd649 100644 --- a/tests/api_resources/test_agency.py +++ b/tests/api_resources/test_agency.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import AgencyRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import AgencyRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestAgency: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: agency = client.agency.retrieve( "agencyID", ) - assert_matches_type(AgencyRetrieveResponse, agency, path=["response"]) + assert_matches_type(AgencyRetrieveResponse, agency, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.agency.with_raw_response.retrieve( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agency = response.parse() - assert_matches_type(AgencyRetrieveResponse, agency, path=["response"]) + assert_matches_type(AgencyRetrieveResponse, agency, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.agency.with_streaming_response.retrieve( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agency = response.parse() - assert_matches_type(AgencyRetrieveResponse, agency, path=["response"]) + assert_matches_type(AgencyRetrieveResponse, agency, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agency_id` but received ''"): - client.agency.with_raw_response.retrieve( - "", - ) - - + client.agency.with_raw_response.retrieve( + "", + ) class TestAsyncAgency: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: agency = await async_client.agency.retrieve( "agencyID", ) - assert_matches_type(AgencyRetrieveResponse, agency, path=["response"]) + assert_matches_type(AgencyRetrieveResponse, agency, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.agency.with_raw_response.retrieve( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agency = await response.parse() - assert_matches_type(AgencyRetrieveResponse, agency, path=["response"]) + assert_matches_type(AgencyRetrieveResponse, agency, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.agency.with_streaming_response.retrieve( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' agency = await response.parse() - assert_matches_type(AgencyRetrieveResponse, agency, path=["response"]) + assert_matches_type(AgencyRetrieveResponse, agency, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agency_id` but received ''"): - await async_client.agency.with_raw_response.retrieve( - "", - ) + await async_client.agency.with_raw_response.retrieve( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_arrival_and_departure.py b/tests/api_resources/test_arrival_and_departure.py index 0ba8109..f371046 100644 --- a/tests/api_resources/test_arrival_and_departure.py +++ b/tests/api_resources/test_arrival_and_departure.py @@ -2,24 +2,29 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import ArrivalAndDepartureRetrieveResponse, ArrivalAndDepartureListResponse + +from typing import cast, Any +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import ( - ArrivalAndDepartureListResponse, - ArrivalAndDepartureRetrieveResponse, -) +from onebusaway.types import arrival_and_departure_retrieve_params +from onebusaway.types import arrival_and_departure_list_params +from onebusaway._utils import parse_datetime from onebusaway._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestArrivalAndDeparture: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: @@ -28,7 +33,7 @@ def test_method_retrieve(self, client: OnebusawaySDK) -> None: service_date=0, trip_id="tripId", ) - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -40,10 +45,11 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: time=0, vehicle_id="vehicleId", ) - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.arrival_and_departure.with_raw_response.retrieve( stop_id="1_75403", service_date=0, @@ -51,9 +57,9 @@ def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = response.parse() - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: @@ -61,30 +67,30 @@ def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: stop_id="1_75403", service_date=0, trip_id="tripId", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = response.parse() - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - client.arrival_and_departure.with_raw_response.retrieve( - stop_id="", - service_date=0, - trip_id="tripId", - ) + client.arrival_and_departure.with_raw_response.retrieve( + stop_id="", + service_date=0, + trip_id="tripId", + ) @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: arrival_and_departure = client.arrival_and_departure.list( stop_id="1_75403", ) - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -94,42 +100,42 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: minutes_before=0, time=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.arrival_and_departure.with_raw_response.list( stop_id="1_75403", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = response.parse() - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.arrival_and_departure.with_streaming_response.list( stop_id="1_75403", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = response.parse() - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, 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 `stop_id` but received ''"): - client.arrival_and_departure.with_raw_response.list( - stop_id="", - ) - - + client.arrival_and_departure.with_raw_response.list( + stop_id="", + ) class TestAsyncArrivalAndDeparture: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: @@ -138,7 +144,7 @@ async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: service_date=0, trip_id="tripId", ) - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -150,10 +156,11 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw time=0, vehicle_id="vehicleId", ) - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.arrival_and_departure.with_raw_response.retrieve( stop_id="1_75403", service_date=0, @@ -161,9 +168,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = await response.parse() - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: @@ -171,30 +178,30 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySD stop_id="1_75403", service_date=0, trip_id="tripId", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = await response.parse() - assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureRetrieveResponse, arrival_and_departure, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - await async_client.arrival_and_departure.with_raw_response.retrieve( - stop_id="", - service_date=0, - trip_id="tripId", - ) + await async_client.arrival_and_departure.with_raw_response.retrieve( + stop_id="", + service_date=0, + trip_id="tripId", + ) @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: arrival_and_departure = await async_client.arrival_and_departure.list( stop_id="1_75403", ) - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -204,35 +211,36 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD minutes_before=0, time=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.arrival_and_departure.with_raw_response.list( stop_id="1_75403", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = await response.parse() - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.arrival_and_departure.with_streaming_response.list( stop_id="1_75403", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' arrival_and_departure = await response.parse() - assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, path=["response"]) + assert_matches_type(ArrivalAndDepartureListResponse, arrival_and_departure, 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 `stop_id` but received ''"): - await async_client.arrival_and_departure.with_raw_response.list( - stop_id="", - ) + await async_client.arrival_and_departure.with_raw_response.list( + stop_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_block.py b/tests/api_resources/test_block.py index a07a29b..0adb879 100644 --- a/tests/api_resources/test_block.py +++ b/tests/api_resources/test_block.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import BlockRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import BlockRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestBlock: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: block = client.block.retrieve( "blockID", ) - assert_matches_type(BlockRetrieveResponse, block, path=["response"]) + assert_matches_type(BlockRetrieveResponse, block, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.block.with_raw_response.retrieve( "blockID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' block = response.parse() - assert_matches_type(BlockRetrieveResponse, block, path=["response"]) + assert_matches_type(BlockRetrieveResponse, block, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.block.with_streaming_response.retrieve( "blockID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' block = response.parse() - assert_matches_type(BlockRetrieveResponse, block, path=["response"]) + assert_matches_type(BlockRetrieveResponse, block, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): - client.block.with_raw_response.retrieve( - "", - ) - - + client.block.with_raw_response.retrieve( + "", + ) class TestAsyncBlock: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: block = await async_client.block.retrieve( "blockID", ) - assert_matches_type(BlockRetrieveResponse, block, path=["response"]) + assert_matches_type(BlockRetrieveResponse, block, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.block.with_raw_response.retrieve( "blockID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' block = await response.parse() - assert_matches_type(BlockRetrieveResponse, block, path=["response"]) + assert_matches_type(BlockRetrieveResponse, block, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.block.with_streaming_response.retrieve( "blockID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' block = await response.parse() - assert_matches_type(BlockRetrieveResponse, block, path=["response"]) + assert_matches_type(BlockRetrieveResponse, block, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): - await async_client.block.with_raw_response.retrieve( - "", - ) + await async_client.block.with_raw_response.retrieve( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_config.py b/tests/api_resources/test_config.py index 62bdd91..5692c29 100644 --- a/tests/api_resources/test_config.py +++ b/tests/api_resources/test_config.py @@ -2,71 +2,77 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import ConfigRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import ConfigRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestConfig: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: config = client.config.retrieve() - assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) + assert_matches_type(ConfigRetrieveResponse, config, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.config.with_raw_response.retrieve() assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' config = response.parse() - assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) + assert_matches_type(ConfigRetrieveResponse, config, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: - with client.config.with_streaming_response.retrieve() as response: + with client.config.with_streaming_response.retrieve() as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' config = response.parse() - assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) + assert_matches_type(ConfigRetrieveResponse, config, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncConfig: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: config = await async_client.config.retrieve() - assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) + assert_matches_type(ConfigRetrieveResponse, config, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.config.with_raw_response.retrieve() assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' config = await response.parse() - assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) + assert_matches_type(ConfigRetrieveResponse, config, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - async with async_client.config.with_streaming_response.retrieve() as response: + async with async_client.config.with_streaming_response.retrieve() as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' config = await response.parse() - assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) + assert_matches_type(ConfigRetrieveResponse, config, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_current_time.py b/tests/api_resources/test_current_time.py index 1a05528..a43fb0c 100644 --- a/tests/api_resources/test_current_time.py +++ b/tests/api_resources/test_current_time.py @@ -2,71 +2,77 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import CurrentTimeRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import CurrentTimeRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestCurrentTime: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: current_time = client.current_time.retrieve() - assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=["response"]) + assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.current_time.with_raw_response.retrieve() assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' current_time = response.parse() - assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=["response"]) + assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: - with client.current_time.with_streaming_response.retrieve() as response: + with client.current_time.with_streaming_response.retrieve() as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' current_time = response.parse() - assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=["response"]) + assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncCurrentTime: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: current_time = await async_client.current_time.retrieve() - assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=["response"]) + assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.current_time.with_raw_response.retrieve() assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' current_time = await response.parse() - assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=["response"]) + assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: - async with async_client.current_time.with_streaming_response.retrieve() as response: + async with async_client.current_time.with_streaming_response.retrieve() as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' current_time = await response.parse() - assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=["response"]) + assert_matches_type(CurrentTimeRetrieveResponse, current_time, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_report_problem_with_stop.py b/tests/api_resources/test_report_problem_with_stop.py index 0b15883..f7a4f54 100644 --- a/tests/api_resources/test_report_problem_with_stop.py +++ b/tests/api_resources/test_report_problem_with_stop.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types.shared import ResponseWrapper +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types.shared import ResponseWrapper +from onebusaway.types import report_problem_with_stop_retrieve_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestReportProblemWithStop: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: report_problem_with_stop = client.report_problem_with_stop.retrieve( stop_id="stopID", ) - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -34,49 +40,49 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: user_location_accuracy=0, user_lon=0, ) - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.report_problem_with_stop.with_raw_response.retrieve( stop_id="stopID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_stop = response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.report_problem_with_stop.with_streaming_response.retrieve( stop_id="stopID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_stop = response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - client.report_problem_with_stop.with_raw_response.retrieve( - stop_id="", - ) - - + client.report_problem_with_stop.with_raw_response.retrieve( + stop_id="", + ) class TestAsyncReportProblemWithStop: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: report_problem_with_stop = await async_client.report_problem_with_stop.retrieve( stop_id="stopID", ) - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -88,35 +94,36 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw user_location_accuracy=0, user_lon=0, ) - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.report_problem_with_stop.with_raw_response.retrieve( stop_id="stopID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_stop = await response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.report_problem_with_stop.with_streaming_response.retrieve( stop_id="stopID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_stop = await response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_stop, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_stop, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - await async_client.report_problem_with_stop.with_raw_response.retrieve( - stop_id="", - ) + await async_client.report_problem_with_stop.with_raw_response.retrieve( + stop_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_report_problem_with_trip.py b/tests/api_resources/test_report_problem_with_trip.py index 0bc9cf2..8b23611 100644 --- a/tests/api_resources/test_report_problem_with_trip.py +++ b/tests/api_resources/test_report_problem_with_trip.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types.shared import ResponseWrapper +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types.shared import ResponseWrapper +from onebusaway.types import report_problem_with_trip_retrieve_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestReportProblemWithTrip: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: report_problem_with_trip = client.report_problem_with_trip.retrieve( trip_id="tripID", ) - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -39,49 +45,49 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: user_vehicle_number="userVehicleNumber", vehicle_id="vehicleID", ) - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.report_problem_with_trip.with_raw_response.retrieve( trip_id="tripID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_trip = response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.report_problem_with_trip.with_streaming_response.retrieve( trip_id="tripID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_trip = response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `trip_id` but received ''"): - client.report_problem_with_trip.with_raw_response.retrieve( - trip_id="", - ) - - + client.report_problem_with_trip.with_raw_response.retrieve( + trip_id="", + ) class TestAsyncReportProblemWithTrip: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: report_problem_with_trip = await async_client.report_problem_with_trip.retrieve( trip_id="tripID", ) - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -98,35 +104,36 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw user_vehicle_number="userVehicleNumber", vehicle_id="vehicleID", ) - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.report_problem_with_trip.with_raw_response.retrieve( trip_id="tripID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_trip = await response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.report_problem_with_trip.with_streaming_response.retrieve( trip_id="tripID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' report_problem_with_trip = await response.parse() - assert_matches_type(ResponseWrapper, report_problem_with_trip, path=["response"]) + assert_matches_type(ResponseWrapper, report_problem_with_trip, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `trip_id` but received ''"): - await async_client.report_problem_with_trip.with_raw_response.retrieve( - trip_id="", - ) + await async_client.report_problem_with_trip.with_raw_response.retrieve( + trip_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_route.py b/tests/api_resources/test_route.py index 8b773cf..b27ce01 100644 --- a/tests/api_resources/test_route.py +++ b/tests/api_resources/test_route.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import RouteRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import RouteRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestRoute: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: route = client.route.retrieve( "routeID", ) - assert_matches_type(RouteRetrieveResponse, route, path=["response"]) + assert_matches_type(RouteRetrieveResponse, route, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.route.with_raw_response.retrieve( "routeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route = response.parse() - assert_matches_type(RouteRetrieveResponse, route, path=["response"]) + assert_matches_type(RouteRetrieveResponse, route, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.route.with_streaming_response.retrieve( "routeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route = response.parse() - assert_matches_type(RouteRetrieveResponse, route, path=["response"]) + assert_matches_type(RouteRetrieveResponse, route, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - client.route.with_raw_response.retrieve( - "", - ) - - + client.route.with_raw_response.retrieve( + "", + ) class TestAsyncRoute: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: route = await async_client.route.retrieve( "routeID", ) - assert_matches_type(RouteRetrieveResponse, route, path=["response"]) + assert_matches_type(RouteRetrieveResponse, route, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.route.with_raw_response.retrieve( "routeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route = await response.parse() - assert_matches_type(RouteRetrieveResponse, route, path=["response"]) + assert_matches_type(RouteRetrieveResponse, route, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.route.with_streaming_response.retrieve( "routeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route = await response.parse() - assert_matches_type(RouteRetrieveResponse, route, path=["response"]) + assert_matches_type(RouteRetrieveResponse, route, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - await async_client.route.with_raw_response.retrieve( - "", - ) + await async_client.route.with_raw_response.retrieve( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_route_ids_for_agency.py b/tests/api_resources/test_route_ids_for_agency.py index 867c19a..f8ded3c 100644 --- a/tests/api_resources/test_route_ids_for_agency.py +++ b/tests/api_resources/test_route_ids_for_agency.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import RouteIDsForAgencyListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import RouteIDsForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestRouteIDsForAgency: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: route_ids_for_agency = client.route_ids_for_agency.list( "agencyID", ) - assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=["response"]) + assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.route_ids_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route_ids_for_agency = response.parse() - assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=["response"]) + assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.route_ids_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route_ids_for_agency = response.parse() - assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=["response"]) + assert_matches_type(RouteIDsForAgencyListResponse, route_ids_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.route_ids_for_agency.with_raw_response.list( - "", - ) - - + client.route_ids_for_agency.with_raw_response.list( + "", + ) class TestAsyncRouteIDsForAgency: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: route_ids_for_agency = await async_client.route_ids_for_agency.list( "agencyID", ) - assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=["response"]) + assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.route_ids_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route_ids_for_agency = await response.parse() - assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=["response"]) + assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.route_ids_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' route_ids_for_agency = await response.parse() - assert_matches_type(RouteIDsForAgencyListResponse, route_ids_for_agency, path=["response"]) + assert_matches_type(RouteIDsForAgencyListResponse, route_ids_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.route_ids_for_agency.with_raw_response.list( - "", - ) + await async_client.route_ids_for_agency.with_raw_response.list( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_routes_for_agency.py b/tests/api_resources/test_routes_for_agency.py index 1fe2d56..225d1f2 100644 --- a/tests/api_resources/test_routes_for_agency.py +++ b/tests/api_resources/test_routes_for_agency.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import RoutesForAgencyListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import RoutesForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestRoutesForAgency: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: routes_for_agency = client.routes_for_agency.list( "agencyID", ) - assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=["response"]) + assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.routes_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_agency = response.parse() - assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=["response"]) + assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.routes_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_agency = response.parse() - assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=["response"]) + assert_matches_type(RoutesForAgencyListResponse, routes_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.routes_for_agency.with_raw_response.list( - "", - ) - - + client.routes_for_agency.with_raw_response.list( + "", + ) class TestAsyncRoutesForAgency: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: routes_for_agency = await async_client.routes_for_agency.list( "agencyID", ) - assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=["response"]) + assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.routes_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_agency = await response.parse() - assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=["response"]) + assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.routes_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_agency = await response.parse() - assert_matches_type(RoutesForAgencyListResponse, routes_for_agency, path=["response"]) + assert_matches_type(RoutesForAgencyListResponse, routes_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.routes_for_agency.with_raw_response.list( - "", - ) + await async_client.routes_for_agency.with_raw_response.list( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_routes_for_location.py b/tests/api_resources/test_routes_for_location.py index 55fbc31..35716ba 100644 --- a/tests/api_resources/test_routes_for_location.py +++ b/tests/api_resources/test_routes_for_location.py @@ -2,20 +2,26 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import RoutesForLocationListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import RoutesForLocationListResponse +from onebusaway.types import routes_for_location_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestRoutesForLocation: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: @@ -23,7 +29,7 @@ def test_method_list(self, client: OnebusawaySDK) -> None: lat=0, lon=0, ) - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -35,37 +41,37 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: query="query", radius=0, ) - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.routes_for_location.with_raw_response.list( lat=0, lon=0, ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_location = response.parse() - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.routes_for_location.with_streaming_response.list( lat=0, lon=0, - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_location = response.parse() - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncRoutesForLocation: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: @@ -73,7 +79,7 @@ async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: lat=0, lon=0, ) - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -85,30 +91,31 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD query="query", radius=0, ) - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.routes_for_location.with_raw_response.list( lat=0, lon=0, ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_location = await response.parse() - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.routes_for_location.with_streaming_response.list( lat=0, lon=0, - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' routes_for_location = await response.parse() - assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=["response"]) + assert_matches_type(RoutesForLocationListResponse, routes_for_location, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_schedule_for_route.py b/tests/api_resources/test_schedule_for_route.py index 6973a7e..4dd1a1d 100644 --- a/tests/api_resources/test_schedule_for_route.py +++ b/tests/api_resources/test_schedule_for_route.py @@ -2,28 +2,35 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import ScheduleForRouteRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import ScheduleForRouteRetrieveResponse +from onebusaway.types import schedule_for_route_retrieve_params +from onebusaway._utils import parse_date from onebusaway._utils import parse_date base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestScheduleForRoute: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: schedule_for_route = client.schedule_for_route.retrieve( route_id="1_100223", ) - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -31,49 +38,49 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: route_id="1_100223", date=parse_date("2019-12-27"), ) - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.schedule_for_route.with_raw_response.retrieve( route_id="1_100223", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_route = response.parse() - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.schedule_for_route.with_streaming_response.retrieve( route_id="1_100223", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_route = response.parse() - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - client.schedule_for_route.with_raw_response.retrieve( - route_id="", - ) - - + client.schedule_for_route.with_raw_response.retrieve( + route_id="", + ) class TestAsyncScheduleForRoute: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: schedule_for_route = await async_client.schedule_for_route.retrieve( route_id="1_100223", ) - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -81,35 +88,36 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw route_id="1_100223", date=parse_date("2019-12-27"), ) - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.schedule_for_route.with_raw_response.retrieve( route_id="1_100223", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_route = await response.parse() - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.schedule_for_route.with_streaming_response.retrieve( route_id="1_100223", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_route = await response.parse() - assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=["response"]) + assert_matches_type(ScheduleForRouteRetrieveResponse, schedule_for_route, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - await async_client.schedule_for_route.with_raw_response.retrieve( - route_id="", - ) + await async_client.schedule_for_route.with_raw_response.retrieve( + route_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_schedule_for_stop.py b/tests/api_resources/test_schedule_for_stop.py index 0154e44..ad705cf 100644 --- a/tests/api_resources/test_schedule_for_stop.py +++ b/tests/api_resources/test_schedule_for_stop.py @@ -2,28 +2,35 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import ScheduleForStopRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import ScheduleForStopRetrieveResponse +from onebusaway.types import schedule_for_stop_retrieve_params +from onebusaway._utils import parse_date from onebusaway._utils import parse_date base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestScheduleForStop: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: schedule_for_stop = client.schedule_for_stop.retrieve( stop_id="stopID", ) - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -31,49 +38,49 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: stop_id="stopID", date=parse_date("2019-12-27"), ) - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.schedule_for_stop.with_raw_response.retrieve( stop_id="stopID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_stop = response.parse() - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.schedule_for_stop.with_streaming_response.retrieve( stop_id="stopID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_stop = response.parse() - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - client.schedule_for_stop.with_raw_response.retrieve( - stop_id="", - ) - - + client.schedule_for_stop.with_raw_response.retrieve( + stop_id="", + ) class TestAsyncScheduleForStop: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: schedule_for_stop = await async_client.schedule_for_stop.retrieve( stop_id="stopID", ) - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -81,35 +88,36 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw stop_id="stopID", date=parse_date("2019-12-27"), ) - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.schedule_for_stop.with_raw_response.retrieve( stop_id="stopID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_stop = await response.parse() - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.schedule_for_stop.with_streaming_response.retrieve( stop_id="stopID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' schedule_for_stop = await response.parse() - assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=["response"]) + assert_matches_type(ScheduleForStopRetrieveResponse, schedule_for_stop, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - await async_client.schedule_for_stop.with_raw_response.retrieve( - stop_id="", - ) + await async_client.schedule_for_stop.with_raw_response.retrieve( + stop_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_search_for_route.py b/tests/api_resources/test_search_for_route.py index 76114f6..220353c 100644 --- a/tests/api_resources/test_search_for_route.py +++ b/tests/api_resources/test_search_for_route.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import SearchForRouteListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import SearchForRouteListResponse +from onebusaway.types import search_for_route_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestSearchForRoute: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: search_for_route = client.search_for_route.list( input="input", ) - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -30,42 +36,42 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: input="input", max_count=0, ) - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.search_for_route.with_raw_response.list( input="input", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_route = response.parse() - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.search_for_route.with_streaming_response.list( input="input", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_route = response.parse() - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncSearchForRoute: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: search_for_route = await async_client.search_for_route.list( input="input", ) - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -73,28 +79,29 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD input="input", max_count=0, ) - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.search_for_route.with_raw_response.list( input="input", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_route = await response.parse() - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.search_for_route.with_streaming_response.list( input="input", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_route = await response.parse() - assert_matches_type(SearchForRouteListResponse, search_for_route, path=["response"]) + assert_matches_type(SearchForRouteListResponse, search_for_route, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_search_for_stop.py b/tests/api_resources/test_search_for_stop.py index bed17ea..aa138a1 100644 --- a/tests/api_resources/test_search_for_stop.py +++ b/tests/api_resources/test_search_for_stop.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import SearchForStopListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import SearchForStopListResponse +from onebusaway.types import search_for_stop_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestSearchForStop: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: search_for_stop = client.search_for_stop.list( input="input", ) - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -30,42 +36,42 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: input="input", max_count=0, ) - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.search_for_stop.with_raw_response.list( input="input", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_stop = response.parse() - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.search_for_stop.with_streaming_response.list( input="input", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_stop = response.parse() - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncSearchForStop: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: search_for_stop = await async_client.search_for_stop.list( input="input", ) - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -73,28 +79,29 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD input="input", max_count=0, ) - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.search_for_stop.with_raw_response.list( input="input", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_stop = await response.parse() - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.search_for_stop.with_streaming_response.list( input="input", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' search_for_stop = await response.parse() - assert_matches_type(SearchForStopListResponse, search_for_stop, path=["response"]) + assert_matches_type(SearchForStopListResponse, search_for_stop, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_shape.py b/tests/api_resources/test_shape.py index 369da7d..4ef8019 100644 --- a/tests/api_resources/test_shape.py +++ b/tests/api_resources/test_shape.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import ShapeRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import ShapeRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestShape: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: shape = client.shape.retrieve( "shapeID", ) - assert_matches_type(ShapeRetrieveResponse, shape, path=["response"]) + assert_matches_type(ShapeRetrieveResponse, shape, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.shape.with_raw_response.retrieve( "shapeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' shape = response.parse() - assert_matches_type(ShapeRetrieveResponse, shape, path=["response"]) + assert_matches_type(ShapeRetrieveResponse, shape, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.shape.with_streaming_response.retrieve( "shapeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' shape = response.parse() - assert_matches_type(ShapeRetrieveResponse, shape, path=["response"]) + assert_matches_type(ShapeRetrieveResponse, shape, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `shape_id` but received ''"): - client.shape.with_raw_response.retrieve( - "", - ) - - + client.shape.with_raw_response.retrieve( + "", + ) class TestAsyncShape: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: shape = await async_client.shape.retrieve( "shapeID", ) - assert_matches_type(ShapeRetrieveResponse, shape, path=["response"]) + assert_matches_type(ShapeRetrieveResponse, shape, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.shape.with_raw_response.retrieve( "shapeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' shape = await response.parse() - assert_matches_type(ShapeRetrieveResponse, shape, path=["response"]) + assert_matches_type(ShapeRetrieveResponse, shape, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.shape.with_streaming_response.retrieve( "shapeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' shape = await response.parse() - assert_matches_type(ShapeRetrieveResponse, shape, path=["response"]) + assert_matches_type(ShapeRetrieveResponse, shape, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `shape_id` but received ''"): - await async_client.shape.with_raw_response.retrieve( - "", - ) + await async_client.shape.with_raw_response.retrieve( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_stop.py b/tests/api_resources/test_stop.py index 9286176..eacc5ad 100644 --- a/tests/api_resources/test_stop.py +++ b/tests/api_resources/test_stop.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import StopRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import StopRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestStop: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: stop = client.stop.retrieve( "stopID", ) - assert_matches_type(StopRetrieveResponse, stop, path=["response"]) + assert_matches_type(StopRetrieveResponse, stop, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.stop.with_raw_response.retrieve( "stopID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop = response.parse() - assert_matches_type(StopRetrieveResponse, stop, path=["response"]) + assert_matches_type(StopRetrieveResponse, stop, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.stop.with_streaming_response.retrieve( "stopID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop = response.parse() - assert_matches_type(StopRetrieveResponse, stop, path=["response"]) + assert_matches_type(StopRetrieveResponse, stop, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - client.stop.with_raw_response.retrieve( - "", - ) - - + client.stop.with_raw_response.retrieve( + "", + ) class TestAsyncStop: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: stop = await async_client.stop.retrieve( "stopID", ) - assert_matches_type(StopRetrieveResponse, stop, path=["response"]) + assert_matches_type(StopRetrieveResponse, stop, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.stop.with_raw_response.retrieve( "stopID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop = await response.parse() - assert_matches_type(StopRetrieveResponse, stop, path=["response"]) + assert_matches_type(StopRetrieveResponse, stop, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.stop.with_streaming_response.retrieve( "stopID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop = await response.parse() - assert_matches_type(StopRetrieveResponse, stop, path=["response"]) + assert_matches_type(StopRetrieveResponse, stop, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `stop_id` but received ''"): - await async_client.stop.with_raw_response.retrieve( - "", - ) + await async_client.stop.with_raw_response.retrieve( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_stop_ids_for_agency.py b/tests/api_resources/test_stop_ids_for_agency.py index 923a743..56c9414 100644 --- a/tests/api_resources/test_stop_ids_for_agency.py +++ b/tests/api_resources/test_stop_ids_for_agency.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import StopIDsForAgencyListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import StopIDsForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestStopIDsForAgency: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: stop_ids_for_agency = client.stop_ids_for_agency.list( "agencyID", ) - assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=["response"]) + assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.stop_ids_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop_ids_for_agency = response.parse() - assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=["response"]) + assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.stop_ids_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop_ids_for_agency = response.parse() - assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=["response"]) + assert_matches_type(StopIDsForAgencyListResponse, stop_ids_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.stop_ids_for_agency.with_raw_response.list( - "", - ) - - + client.stop_ids_for_agency.with_raw_response.list( + "", + ) class TestAsyncStopIDsForAgency: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: stop_ids_for_agency = await async_client.stop_ids_for_agency.list( "agencyID", ) - assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=["response"]) + assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.stop_ids_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop_ids_for_agency = await response.parse() - assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=["response"]) + assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.stop_ids_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stop_ids_for_agency = await response.parse() - assert_matches_type(StopIDsForAgencyListResponse, stop_ids_for_agency, path=["response"]) + assert_matches_type(StopIDsForAgencyListResponse, stop_ids_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.stop_ids_for_agency.with_raw_response.list( - "", - ) + await async_client.stop_ids_for_agency.with_raw_response.list( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_stops_for_agency.py b/tests/api_resources/test_stops_for_agency.py index 7c6538e..71230d1 100644 --- a/tests/api_resources/test_stops_for_agency.py +++ b/tests/api_resources/test_stops_for_agency.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import StopsForAgencyListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import StopsForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestStopsForAgency: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: stops_for_agency = client.stops_for_agency.list( "agencyID", ) - assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=["response"]) + assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.stops_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_agency = response.parse() - assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=["response"]) + assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.stops_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_agency = response.parse() - assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=["response"]) + assert_matches_type(StopsForAgencyListResponse, stops_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.stops_for_agency.with_raw_response.list( - "", - ) - - + client.stops_for_agency.with_raw_response.list( + "", + ) class TestAsyncStopsForAgency: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: stops_for_agency = await async_client.stops_for_agency.list( "agencyID", ) - assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=["response"]) + assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.stops_for_agency.with_raw_response.list( "agencyID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_agency = await response.parse() - assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=["response"]) + assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.stops_for_agency.with_streaming_response.list( "agencyID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_agency = await response.parse() - assert_matches_type(StopsForAgencyListResponse, stops_for_agency, path=["response"]) + assert_matches_type(StopsForAgencyListResponse, stops_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.stops_for_agency.with_raw_response.list( - "", - ) + await async_client.stops_for_agency.with_raw_response.list( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_stops_for_location.py b/tests/api_resources/test_stops_for_location.py index fcb2f07..520184f 100644 --- a/tests/api_resources/test_stops_for_location.py +++ b/tests/api_resources/test_stops_for_location.py @@ -2,20 +2,26 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import StopsForLocationListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import StopsForLocationListResponse +from onebusaway.types import stops_for_location_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestStopsForLocation: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: @@ -23,7 +29,7 @@ def test_method_list(self, client: OnebusawaySDK) -> None: lat=0, lon=0, ) - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -35,37 +41,37 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: query="query", radius=0, ) - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.stops_for_location.with_raw_response.list( lat=0, lon=0, ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_location = response.parse() - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.stops_for_location.with_streaming_response.list( lat=0, lon=0, - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_location = response.parse() - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncStopsForLocation: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: @@ -73,7 +79,7 @@ async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: lat=0, lon=0, ) - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -85,30 +91,31 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD query="query", radius=0, ) - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.stops_for_location.with_raw_response.list( lat=0, lon=0, ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_location = await response.parse() - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.stops_for_location.with_streaming_response.list( lat=0, lon=0, - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_location = await response.parse() - assert_matches_type(StopsForLocationListResponse, stops_for_location, path=["response"]) + assert_matches_type(StopsForLocationListResponse, stops_for_location, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_stops_for_route.py b/tests/api_resources/test_stops_for_route.py index e062f7d..4e6787a 100644 --- a/tests/api_resources/test_stops_for_route.py +++ b/tests/api_resources/test_stops_for_route.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import StopsForRouteListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import StopsForRouteListResponse +from onebusaway.types import stops_for_route_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestStopsForRoute: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: stops_for_route = client.stops_for_route.list( route_id="routeID", ) - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -31,49 +37,49 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: include_polylines=True, time="time", ) - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.stops_for_route.with_raw_response.list( route_id="routeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_route = response.parse() - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.stops_for_route.with_streaming_response.list( route_id="routeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_route = response.parse() - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, 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 `route_id` but received ''"): - client.stops_for_route.with_raw_response.list( - route_id="", - ) - - + client.stops_for_route.with_raw_response.list( + route_id="", + ) class TestAsyncStopsForRoute: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: stops_for_route = await async_client.stops_for_route.list( route_id="routeID", ) - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -82,35 +88,36 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD include_polylines=True, time="time", ) - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.stops_for_route.with_raw_response.list( route_id="routeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_route = await response.parse() - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.stops_for_route.with_streaming_response.list( route_id="routeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' stops_for_route = await response.parse() - assert_matches_type(StopsForRouteListResponse, stops_for_route, path=["response"]) + assert_matches_type(StopsForRouteListResponse, stops_for_route, 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 `route_id` but received ''"): - await async_client.stops_for_route.with_raw_response.list( - route_id="", - ) + await async_client.stops_for_route.with_raw_response.list( + route_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_trip.py b/tests/api_resources/test_trip.py index ef2bd7f..7c39766 100644 --- a/tests/api_resources/test_trip.py +++ b/tests/api_resources/test_trip.py @@ -2,97 +2,103 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import TripRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import TripRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestTrip: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: trip = client.trip.retrieve( "tripID", ) - assert_matches_type(TripRetrieveResponse, trip, path=["response"]) + assert_matches_type(TripRetrieveResponse, trip, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.trip.with_raw_response.retrieve( "tripID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip = response.parse() - assert_matches_type(TripRetrieveResponse, trip, path=["response"]) + assert_matches_type(TripRetrieveResponse, trip, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.trip.with_streaming_response.retrieve( "tripID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip = response.parse() - assert_matches_type(TripRetrieveResponse, trip, path=["response"]) + assert_matches_type(TripRetrieveResponse, trip, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `trip_id` but received ''"): - client.trip.with_raw_response.retrieve( - "", - ) - - + client.trip.with_raw_response.retrieve( + "", + ) class TestAsyncTrip: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: trip = await async_client.trip.retrieve( "tripID", ) - assert_matches_type(TripRetrieveResponse, trip, path=["response"]) + assert_matches_type(TripRetrieveResponse, trip, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.trip.with_raw_response.retrieve( "tripID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip = await response.parse() - assert_matches_type(TripRetrieveResponse, trip, path=["response"]) + assert_matches_type(TripRetrieveResponse, trip, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.trip.with_streaming_response.retrieve( "tripID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip = await response.parse() - assert_matches_type(TripRetrieveResponse, trip, path=["response"]) + assert_matches_type(TripRetrieveResponse, trip, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `trip_id` but received ''"): - await async_client.trip.with_raw_response.retrieve( - "", - ) + await async_client.trip.with_raw_response.retrieve( + "", + ) \ No newline at end of file diff --git a/tests/api_resources/test_trip_details.py b/tests/api_resources/test_trip_details.py index 82d00d9..0db299e 100644 --- a/tests/api_resources/test_trip_details.py +++ b/tests/api_resources/test_trip_details.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import TripDetailRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import TripDetailRetrieveResponse +from onebusaway.types import trip_detail_retrieve_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestTripDetails: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: trip_detail = client.trip_details.retrieve( trip_id="tripID", ) - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -34,49 +40,49 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: service_date=0, time=0, ) - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.trip_details.with_raw_response.retrieve( trip_id="tripID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_detail = response.parse() - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.trip_details.with_streaming_response.retrieve( trip_id="tripID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_detail = response.parse() - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `trip_id` but received ''"): - client.trip_details.with_raw_response.retrieve( - trip_id="", - ) - - + client.trip_details.with_raw_response.retrieve( + trip_id="", + ) class TestAsyncTripDetails: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: trip_detail = await async_client.trip_details.retrieve( trip_id="tripID", ) - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -88,35 +94,36 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw service_date=0, time=0, ) - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.trip_details.with_raw_response.retrieve( trip_id="tripID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_detail = await response.parse() - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.trip_details.with_streaming_response.retrieve( trip_id="tripID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_detail = await response.parse() - assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=["response"]) + assert_matches_type(TripDetailRetrieveResponse, trip_detail, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `trip_id` but received ''"): - await async_client.trip_details.with_raw_response.retrieve( - trip_id="", - ) + await async_client.trip_details.with_raw_response.retrieve( + trip_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_trip_for_vehicle.py b/tests/api_resources/test_trip_for_vehicle.py index be96fa6..0a2d84f 100644 --- a/tests/api_resources/test_trip_for_vehicle.py +++ b/tests/api_resources/test_trip_for_vehicle.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import TripForVehicleRetrieveResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import TripForVehicleRetrieveResponse +from onebusaway.types import trip_for_vehicle_retrieve_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestTripForVehicle: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_retrieve(self, client: OnebusawaySDK) -> None: trip_for_vehicle = client.trip_for_vehicle.retrieve( vehicle_id="vehicleID", ) - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) @parametrize def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: @@ -33,49 +39,49 @@ def test_method_retrieve_with_all_params(self, client: OnebusawaySDK) -> None: include_trip=True, time=0, ) - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) @parametrize def test_raw_response_retrieve(self, client: OnebusawaySDK) -> None: + response = client.trip_for_vehicle.with_raw_response.retrieve( vehicle_id="vehicleID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_for_vehicle = response.parse() - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) @parametrize def test_streaming_response_retrieve(self, client: OnebusawaySDK) -> None: with client.trip_for_vehicle.with_streaming_response.retrieve( vehicle_id="vehicleID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_for_vehicle = response.parse() - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: OnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vehicle_id` but received ''"): - client.trip_for_vehicle.with_raw_response.retrieve( - vehicle_id="", - ) - - + client.trip_for_vehicle.with_raw_response.retrieve( + vehicle_id="", + ) class TestAsyncTripForVehicle: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: trip_for_vehicle = await async_client.trip_for_vehicle.retrieve( vehicle_id="vehicleID", ) - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -86,35 +92,36 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOnebusaw include_trip=True, time=0, ) - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.trip_for_vehicle.with_raw_response.retrieve( vehicle_id="vehicleID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_for_vehicle = await response.parse() - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.trip_for_vehicle.with_streaming_response.retrieve( vehicle_id="vehicleID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trip_for_vehicle = await response.parse() - assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=["response"]) + assert_matches_type(TripForVehicleRetrieveResponse, trip_for_vehicle, path=['response']) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncOnebusawaySDK) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vehicle_id` but received ''"): - await async_client.trip_for_vehicle.with_raw_response.retrieve( - vehicle_id="", - ) + await async_client.trip_for_vehicle.with_raw_response.retrieve( + vehicle_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_trips_for_location.py b/tests/api_resources/test_trips_for_location.py index 050d552..c3dbfa3 100644 --- a/tests/api_resources/test_trips_for_location.py +++ b/tests/api_resources/test_trips_for_location.py @@ -2,20 +2,26 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import TripsForLocationListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import TripsForLocationListResponse +from onebusaway.types import trips_for_location_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestTripsForLocation: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: @@ -25,7 +31,7 @@ def test_method_list(self, client: OnebusawaySDK) -> None: lon=0, lon_span=0, ) - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -38,10 +44,11 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: include_trip=True, time=0, ) - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.trips_for_location.with_raw_response.list( lat=0, lat_span=0, @@ -50,9 +57,9 @@ def test_raw_response_list(self, client: OnebusawaySDK) -> None: ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_location = response.parse() - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: @@ -61,18 +68,17 @@ def test_streaming_response_list(self, client: OnebusawaySDK) -> None: lat_span=0, lon=0, lon_span=0, - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_location = response.parse() - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) assert cast(Any, response.is_closed) is True - - class TestAsyncTripsForLocation: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: @@ -82,7 +88,7 @@ async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: lon=0, lon_span=0, ) - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -95,10 +101,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD include_trip=True, time=0, ) - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.trips_for_location.with_raw_response.list( lat=0, lat_span=0, @@ -107,9 +114,9 @@ async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_location = await response.parse() - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: @@ -118,11 +125,11 @@ async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) - lat_span=0, lon=0, lon_span=0, - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_location = await response.parse() - assert_matches_type(TripsForLocationListResponse, trips_for_location, path=["response"]) + assert_matches_type(TripsForLocationListResponse, trips_for_location, path=['response']) - assert cast(Any, response.is_closed) is True + assert cast(Any, response.is_closed) is True \ No newline at end of file diff --git a/tests/api_resources/test_trips_for_route.py b/tests/api_resources/test_trips_for_route.py index 0ef4092..b301f38 100644 --- a/tests/api_resources/test_trips_for_route.py +++ b/tests/api_resources/test_trips_for_route.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import TripsForRouteListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import TripsForRouteListResponse +from onebusaway.types import trips_for_route_list_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - class TestTripsForRoute: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize def test_method_list(self, client: OnebusawaySDK) -> None: trips_for_route = client.trips_for_route.list( route_id="routeID", ) - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -32,49 +38,49 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: include_status=True, time=0, ) - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, path=['response']) @parametrize def test_raw_response_list(self, client: OnebusawaySDK) -> None: + response = client.trips_for_route.with_raw_response.list( route_id="routeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_route = response.parse() - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, path=['response']) @parametrize def test_streaming_response_list(self, client: OnebusawaySDK) -> None: with client.trips_for_route.with_streaming_response.list( route_id="routeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_route = response.parse() - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, 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 `route_id` but received ''"): - client.trips_for_route.with_raw_response.list( - route_id="", - ) - - + client.trips_for_route.with_raw_response.list( + route_id="", + ) class TestAsyncTripsForRoute: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + @parametrize async def test_method_list(self, async_client: AsyncOnebusawaySDK) -> None: trips_for_route = await async_client.trips_for_route.list( route_id="routeID", ) - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -84,35 +90,36 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD include_status=True, time=0, ) - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, path=['response']) @parametrize async def test_raw_response_list(self, async_client: AsyncOnebusawaySDK) -> None: + response = await async_client.trips_for_route.with_raw_response.list( route_id="routeID", ) assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_route = await response.parse() - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, path=['response']) @parametrize async def test_streaming_response_list(self, async_client: AsyncOnebusawaySDK) -> None: async with async_client.trips_for_route.with_streaming_response.list( route_id="routeID", - ) as response: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + assert response.http_request.headers.get('X-Stainless-Lang') == 'python' trips_for_route = await response.parse() - assert_matches_type(TripsForRouteListResponse, trips_for_route, path=["response"]) + assert_matches_type(TripsForRouteListResponse, trips_for_route, 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 `route_id` but received ''"): - await async_client.trips_for_route.with_raw_response.list( - route_id="", - ) + await async_client.trips_for_route.with_raw_response.list( + route_id="", + ) \ No newline at end of file diff --git a/tests/api_resources/test_vehicles_for_agency.py b/tests/api_resources/test_vehicles_for_agency.py index 5f201f2..4d2e659 100644 --- a/tests/api_resources/test_vehicles_for_agency.py +++ b/tests/api_resources/test_vehicles_for_agency.py @@ -2,27 +2,33 @@ from __future__ import annotations -import os -from typing import Any, cast +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK -import pytest +from onebusaway.types import VehiclesForAgencyListResponse +from typing import cast, Any + +import os +import pytest +import httpx +from typing_extensions import get_args +from respx import MockRouter from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import VehiclesForAgencyListResponse +from onebusaway.types import vehicles_for_agency_list_params 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 = 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"]) + assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=['response']) @parametrize def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: @@ -30,49 +36,49 @@ def test_method_list_with_all_params(self, client: OnebusawaySDK) -> None: agency_id="agencyID", time="time", ) - assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"]) + 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" + 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_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: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + 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_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="", - ) - - + 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 = 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"]) + assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=['response']) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySDK) -> None: @@ -80,35 +86,36 @@ async def test_method_list_with_all_params(self, async_client: AsyncOnebusawaySD agency_id="agencyID", time="time", ) - assert_matches_type(VehiclesForAgencyListResponse, vehicles_for_agency, path=["response"]) + 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" + 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_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: + ) as response : assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + 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_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="", - ) + await async_client.vehicles_for_agency.with_raw_response.list( + agency_id="", + ) \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index d166173..763d201 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,16 +1,18 @@ from __future__ import annotations -import os import logging -from typing import TYPE_CHECKING, Iterator, AsyncIterator +from typing import Iterator import pytest from pytest_asyncio import is_async_test +import os +from typing import TYPE_CHECKING, AsyncIterator + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK if TYPE_CHECKING: - from _pytest.fixtures import FixtureRequest + from _pytest.fixtures import FixtureRequest pytest.register_assert_rewrite("tests.utils") @@ -30,22 +32,20 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: api_key = "My API Key" - @pytest.fixture(scope="session") def client(request: FixtureRequest) -> Iterator[OnebusawaySDK]: - strict = getattr(request, "param", True) + strict = getattr(request, 'param', True) if not isinstance(strict, bool): - raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") + raise TypeError(f'Unexpected fixture parameter type {type(strict)}, expected {bool}') - with OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: + with OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client : yield client - @pytest.fixture(scope="session") async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncOnebusawaySDK]: - strict = getattr(request, "param", True) + strict = getattr(request, 'param', True) if not isinstance(strict, bool): - raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") + raise TypeError(f'Unexpected fixture parameter type {type(strict)}, expected {bool}') - async with AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: + async with AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client : yield client diff --git a/tests/test_client.py b/tests/test_client.py index 7b650cc..32505e6 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -2,54 +2,60 @@ from __future__ import annotations -import gc -import os +import httpx + +import subprocess + import sys -import json + import time + +from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK + +from onebusaway._exceptions import APITimeoutError, APIStatusError, APIResponseValidationError + +from typing import cast, Any, Union + +from pydantic import ValidationError + +from typing_extensions import Literal + +from textwrap import dedent + import asyncio +import gc import inspect -import subprocess +import json +import os import tracemalloc import urllib.parse -from typing import Any, Union, cast -from textwrap import dedent from unittest import mock -from typing_extensions import Literal import httpx import pytest from respx import MockRouter -from pydantic import ValidationError from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK, APIResponseValidationError -from onebusaway._types import Omit -from onebusaway._models import BaseModel, FinalRequestOptions +from onebusaway._models import FinalRequestOptions, BaseModel +from onebusaway._types import NOT_GIVEN, Headers, NotGiven, Query, Body, Timeout, Omit +from onebusaway._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, RequestOptions, make_request_options +from onebusaway._streaming import Stream, AsyncStream from onebusaway._constants import RAW_RESPONSE_HEADER -from onebusaway._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError -from onebusaway._base_client import ( - DEFAULT_TIMEOUT, - HTTPX_DEFAULT_TIMEOUT, - BaseClient, - make_request_options, -) - +from onebusaway._response import APIResponse, AsyncAPIResponse +from onebusaway._types import Omit from .utils import update_env base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = "My API Key" - def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - url = httpx.URL(request.url) - return dict(url.params) - + request = client._build_request(FinalRequestOptions(method="get", url='/foo')) + url = httpx.URL(request.url) + return dict(url.params) def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: return 0.1 - def _get_open_connections(client: OnebusawaySDK | AsyncOnebusawaySDK) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -57,7 +63,6 @@ def _get_open_connections(client: OnebusawaySDK | AsyncOnebusawaySDK) -> int: pool = transport._pool return len(pool._requests) - class TestOnebusawaySDK: client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) @@ -72,9 +77,7 @@ def test_raw_response(self, respx_mock: MockRouter) -> None: @pytest.mark.respx(base_url=base_url) def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: - respx_mock.post("/foo").mock( - return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') - ) + respx_mock.post("/foo").mock(return_value=httpx.Response(200, headers={'Content-Type':'application/binary'}, content='{"foo": "bar"}')) response = self.client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 @@ -106,58 +109,58 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) - assert client.default_headers["X-Foo"] == "bar" + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={ + "X-Foo": "bar" + }) + assert client.default_headers['X-Foo'] == 'bar' # does not override the already given value when not specified copied = client.copy() - assert copied.default_headers["X-Foo"] == "bar" + assert copied.default_headers['X-Foo'] == 'bar' # merges already given headers - copied = client.copy(default_headers={"X-Bar": "stainless"}) - assert copied.default_headers["X-Foo"] == "bar" - assert copied.default_headers["X-Bar"] == "stainless" + copied = client.copy(default_headers={'X-Bar': 'stainless'}) + assert copied.default_headers['X-Foo'] == 'bar' + assert copied.default_headers['X-Bar'] == 'stainless' # uses new values for any already given headers - copied = client.copy(default_headers={"X-Foo": "stainless"}) - assert copied.default_headers["X-Foo"] == "stainless" + copied = client.copy(default_headers={'X-Foo': 'stainless'}) + assert copied.default_headers['X-Foo'] == 'stainless' # set_default_headers # completely overrides already set values copied = client.copy(set_default_headers={}) - assert copied.default_headers.get("X-Foo") is None + assert copied.default_headers.get('X-Foo') is None - copied = client.copy(set_default_headers={"X-Bar": "Robert"}) - assert copied.default_headers["X-Bar"] == "Robert" + copied = client.copy(set_default_headers={'X-Bar': 'Robert'}) + assert copied.default_headers['X-Bar'] == 'Robert' with pytest.raises( - ValueError, - match="`default_headers` and `set_default_headers` arguments are mutually exclusive", + ValueError, + match='`default_headers` and `set_default_headers` arguments are mutually exclusive', ): - client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.copy(set_default_headers={}, default_headers={'X-Foo': 'Bar'}) def test_copy_default_query(self) -> None: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"} - ) - assert _get_params(client)["foo"] == "bar" + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={ + "foo": "bar" + }) + assert _get_params(client)['foo'] == 'bar' # does not override the already given value when not specified copied = client.copy() - assert _get_params(copied)["foo"] == "bar" + assert _get_params(copied)['foo'] == 'bar' # merges already given params - copied = client.copy(default_query={"bar": "stainless"}) + copied = client.copy(default_query={'bar': 'stainless'}) params = _get_params(copied) - assert params["foo"] == "bar" - assert params["bar"] == "stainless" + assert params['foo'] == 'bar' + assert params['bar'] == 'stainless' # uses new values for any already given headers - copied = client.copy(default_query={"foo": "stainless"}) - assert _get_params(copied)["foo"] == "stainless" + copied = client.copy(default_query={'foo': 'stainless'}) + assert _get_params(copied)['foo'] == 'stainless' # set_default_query @@ -165,21 +168,21 @@ def test_copy_default_query(self) -> None: copied = client.copy(set_default_query={}) assert _get_params(copied) == {"key": api_key} - copied = client.copy(set_default_query={"bar": "Robert"}) - assert _get_params(copied)["bar"] == "Robert" + copied = client.copy(set_default_query={'bar': 'Robert'}) + assert _get_params(copied)['bar'] == 'Robert' with pytest.raises( - ValueError, - # TODO: update - match="`default_query` and `set_default_query` arguments are mutually exclusive", + ValueError, + # TODO: update + match='`default_query` and `set_default_query` arguments are mutually exclusive', ): - client.copy(set_default_query={}, default_query={"foo": "Bar", "key": api_key}) + client.copy(set_default_query={}, default_query={'foo': 'Bar', "key": api_key}) def test_copy_signature(self) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( - # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + # mypy doesn't like that we access the `__init__` property. + self.client.__init__, # type: ignore[misc] ) copy_signature = inspect.signature(self.client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} @@ -265,9 +268,7 @@ def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) def test_client_timeout_option(self) -> None: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0) - ) + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0)) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -276,70 +277,54 @@ def test_client_timeout_option(self) -> None: def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client - ) + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore - assert timeout == httpx.Timeout(None) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(None) # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client - ) + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore - assert timeout == DEFAULT_TIMEOUT + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client - ) + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore - assert timeout == DEFAULT_TIMEOUT # our default + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # our default async def test_invalid_http_client(self) -> None: - with pytest.raises(TypeError, match="Invalid `http_client` arg"): - async with httpx.AsyncClient() as http_client: - OnebusawaySDK( - base_url=base_url, - api_key=api_key, - _strict_response_validation=True, - http_client=cast(Any, http_client), - ) + with pytest.raises(TypeError, match='Invalid `http_client` arg') : + async with httpx.AsyncClient() as http_client : + OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=cast(Any, http_client)) def test_default_headers_option(self) -> None: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - assert request.headers.get("x-foo") == "bar" - assert request.headers.get("x-stainless-lang") == "python" - - client2 = OnebusawaySDK( - base_url=base_url, - api_key=api_key, - _strict_response_validation=True, - default_headers={ - "X-Foo": "stainless", - "X-Stainless-Lang": "my-overriding-header", - }, - ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) - assert request.headers.get("x-foo") == "stainless" - assert request.headers.get("x-stainless-lang") == "my-overriding-header" + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={ + "X-Foo": "bar" + }) + request = client._build_request(FinalRequestOptions(method="get", url='/foo')) + assert request.headers.get('x-foo') == 'bar' + assert request.headers.get('x-stainless-lang') == 'python' + + client2 = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={ + "X-Foo": "stainless", + "X-Stainless-Lang": "my-overriding-header", + }) + request = client2._build_request(FinalRequestOptions(method="get", url='/foo')) + assert request.headers.get('x-foo') == 'stainless' + assert request.headers.get('x-stainless-lang') == 'my-overriding-header' def test_default_query_option(self) -> None: - client = OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"} - ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={ + "query_param": "bar" + }) + request = client._build_request(FinalRequestOptions(method="get", url='/foo')) url = httpx.URL(request.url) assert dict(url.params) == {"query_param": "bar", "key": api_key} @@ -351,7 +336,7 @@ def test_default_query_option(self) -> None: ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overridden", "key": api_key} + assert dict(url.params) == {'foo': 'baz', "query_param": "overridden", "key": api_key} def test_request_extra_json(self) -> None: request = self.client._build_request( @@ -434,7 +419,7 @@ def test_request_extra_query(self) -> None: ), ) params = dict(request.url.params) - assert params == {"bar": "1", "foo": "2", "key": api_key} + assert params == {'bar': '1', 'foo': '2', "key": api_key} # `extra_query` takes priority over `query` when keys clash request = self.client._build_request( @@ -448,7 +433,7 @@ def test_request_extra_query(self) -> None: ), ) params = dict(request.url.params) - assert params == {"foo": "2", "key": api_key} + assert params == {'foo': '2', "key": api_key} def test_multipart_repeating_array(self, client: OnebusawaySDK) -> None: request = client._build_request( @@ -487,29 +472,27 @@ class Model1(BaseModel): class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get('/foo').mock(return_value=httpx.Response(200, json={'foo': 'bar'})) response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) - assert response.foo == "bar" - + assert response.foo == 'bar' @pytest.mark.respx(base_url=base_url) def test_union_response_different_types(self, respx_mock: MockRouter) -> None: """Union of objects with the same field name using a different type""" - class Model1(BaseModel): foo: int class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get('/foo').mock(return_value=httpx.Response(200, json={'foo': 'bar'})) response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) - assert response.foo == "bar" + assert response.foo == 'bar' - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) + respx_mock.get('/foo').mock(return_value=httpx.Response(200, json={'foo': 1})) response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) @@ -520,7 +503,6 @@ def test_non_application_json_content_type_for_json_data(self, respx_mock: MockR """ Response that sets Content-Type to something other than application/json but returns json data """ - class Model(BaseModel): foo: int @@ -537,9 +519,7 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = OnebusawaySDK( - base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True - ) + client = OnebusawaySDK(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -547,25 +527,11 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" def test_base_url_env(self) -> None: - with update_env(ONEBUSAWAY_SDK_BASE_URL="http://localhost:5000/from/env"): - client = OnebusawaySDK(api_key=api_key, _strict_response_validation=True) - assert client.base_url == "http://localhost:5000/from/env/" + with update_env(ONEBUSAWAY_SDK_BASE_URL='http://localhost:5000/from/env'): + client = OnebusawaySDK(api_key=api_key, _strict_response_validation=True) + assert client.base_url == 'http://localhost:5000/from/env/' - @pytest.mark.parametrize( - "client", - [ - OnebusawaySDK( - base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True - ), - OnebusawaySDK( - base_url="http://localhost:5000/custom/path/", - api_key=api_key, - _strict_response_validation=True, - http_client=httpx.Client(), - ), - ], - ids=["standard", "custom http client"], - ) + @pytest.mark.parametrize("client", [OnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), OnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, http_client=httpx.Client())], ids = ["standard", "custom http client"]) def test_base_url_trailing_slash(self, client: OnebusawaySDK) -> None: request = client._build_request( FinalRequestOptions( @@ -577,21 +543,7 @@ def test_base_url_trailing_slash(self, client: OnebusawaySDK) -> None: expected_url = f"http://localhost:5000/custom/path/foo?key={urllib.parse.quote_plus(client.api_key)}" assert request.url == expected_url - @pytest.mark.parametrize( - "client", - [ - OnebusawaySDK( - base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True - ), - OnebusawaySDK( - base_url="http://localhost:5000/custom/path/", - api_key=api_key, - _strict_response_validation=True, - http_client=httpx.Client(), - ), - ], - ids=["standard", "custom http client"], - ) + @pytest.mark.parametrize("client", [OnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), OnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, http_client=httpx.Client())], ids = ["standard", "custom http client"]) def test_base_url_no_trailing_slash(self, client: OnebusawaySDK) -> None: request = client._build_request( FinalRequestOptions( @@ -603,21 +555,7 @@ def test_base_url_no_trailing_slash(self, client: OnebusawaySDK) -> None: expected_url = f"http://localhost:5000/custom/path/foo?key={urllib.parse.quote_plus(client.api_key)}" assert request.url == expected_url - @pytest.mark.parametrize( - "client", - [ - OnebusawaySDK( - base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True - ), - OnebusawaySDK( - base_url="http://localhost:5000/custom/path/", - api_key=api_key, - _strict_response_validation=True, - http_client=httpx.Client(), - ), - ], - ids=["standard", "custom http client"], - ) + @pytest.mark.parametrize("client", [OnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), OnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, http_client=httpx.Client())], ids = ["standard", "custom http client"]) def test_absolute_request_url(self, client: OnebusawaySDK) -> None: request = client._build_request( FinalRequestOptions( @@ -643,9 +581,9 @@ def test_copied_client_does_not_close_http(self) -> None: def test_client_context_manager(self) -> None: client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) with client as c2: - assert c2 is client - assert not c2.is_closed() - assert not client.is_closed() + assert c2 is client + assert not c2.is_closed() + assert not client.is_closed() assert client.is_closed() @pytest.mark.respx(base_url=base_url) @@ -662,9 +600,7 @@ class Model(BaseModel): def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - OnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None) - ) + OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None)) @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: @@ -676,7 +612,7 @@ class Model(BaseModel): strict_client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): - strict_client.get("/foo", cast_to=Model) + strict_client.get("/foo", cast_to=Model) client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=False) @@ -684,26 +620,26 @@ class Model(BaseModel): assert isinstance(response, str) # type: ignore[unreachable] @pytest.mark.parametrize( - "remaining_retries,retry_after,timeout", - [ - [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], - [3, "60", 60], - [3, "61", 0.5], - [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], - [-1100, "", 8], # test large number potentially overflowing - ], - ) + "remaining_retries,retry_after,timeout", + [ + [ 3, "20", 20 ], + [ 3, "0", 0.5 ], + [ 3, "-10", 0.5 ], + [ 3, "60", 60 ], + [ 3, "61", 0.5 ], + [ 3, "Fri, 29 Sep 2023 16:26:57 GMT", 20 ], + [ 3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5 ], + [ 3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5 ], + [ 3, "Fri, 29 Sep 2023 16:27:37 GMT", 60 ], + [ 3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5 ], + [ 3, "99999999999999999999999999999999999", 0.5 ], + [ 3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5 ], + [ 3, "", 0.5 ], + [ 2, "", 0.5 * 2.0 ], + [ 1, "", 0.5 * 4.0 ], + [-1100, "", 8], # test large number potentially overflowing + ], + ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: client = OnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) @@ -711,7 +647,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("onebusaway._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -719,11 +655,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No respx_mock.get("/api/where/current-time.json").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - self.client.get( - "/api/where/current-time.json", - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + self.client.get("/api/where/current-time.json", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) assert _get_open_connections(self.client) == 0 @@ -733,11 +665,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non respx_mock.get("/api/where/current-time.json").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - self.client.get( - "/api/where/current-time.json", - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + self.client.get("/api/where/current-time.json", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) assert _get_open_connections(self.client) == 0 @@ -750,7 +678,7 @@ def test_retries_taken( client: OnebusawaySDK, failures_before_success: int, failure_mode: Literal["status", "exception"], - respx_mock: MockRouter, + respx_mock: MockRouter ) -> None: client = client.with_options(max_retries=4) @@ -761,7 +689,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: if nb_retries < failures_before_success: nb_retries += 1 if failure_mode == "exception": - raise RuntimeError("oops") + raise RuntimeError("oops") return httpx.Response(500) return httpx.Response(200) @@ -776,7 +704,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @mock.patch("onebusaway._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_omit_retry_count_header( - self, client: OnebusawaySDK, failures_before_success: int, respx_mock: MockRouter + self, + client: OnebusawaySDK, + failures_before_success: int, + respx_mock: MockRouter ) -> None: client = client.with_options(max_retries=4) @@ -791,15 +722,18 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/where/current-time.json").mock(side_effect=retry_handler) - response = client.current_time.with_raw_response.retrieve(extra_headers={"x-stainless-retry-count": Omit()}) + response = client.current_time.with_raw_response.retrieve(extra_headers={'x-stainless-retry-count': Omit()}) - assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + assert len(response.http_request.headers.get_list('x-stainless-retry-count')) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("onebusaway._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_overwrite_retry_count_header( - self, client: OnebusawaySDK, failures_before_success: int, respx_mock: MockRouter + self, + client: OnebusawaySDK, + failures_before_success: int, + respx_mock: MockRouter ) -> None: client = client.with_options(max_retries=4) @@ -814,11 +748,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/where/current-time.json").mock(side_effect=retry_handler) - response = client.current_time.with_raw_response.retrieve(extra_headers={"x-stainless-retry-count": "42"}) - - assert response.http_request.headers.get("x-stainless-retry-count") == "42" - + response = client.current_time.with_raw_response.retrieve(extra_headers={'x-stainless-retry-count': '42'}) + assert response.http_request.headers.get('x-stainless-retry-count') == '42' class TestAsyncOnebusawaySDK: client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) @@ -835,9 +767,7 @@ async def test_raw_response(self, respx_mock: MockRouter) -> None: @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: - respx_mock.post("/foo").mock( - return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') - ) + respx_mock.post("/foo").mock(return_value=httpx.Response(200, headers={'Content-Type':'application/binary'}, content='{"foo": "bar"}')) response = await self.client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 @@ -869,58 +799,58 @@ def test_copy_default_options(self) -> None: assert isinstance(self.client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) - assert client.default_headers["X-Foo"] == "bar" + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={ + "X-Foo": "bar" + }) + assert client.default_headers['X-Foo'] == 'bar' # does not override the already given value when not specified copied = client.copy() - assert copied.default_headers["X-Foo"] == "bar" + assert copied.default_headers['X-Foo'] == 'bar' # merges already given headers - copied = client.copy(default_headers={"X-Bar": "stainless"}) - assert copied.default_headers["X-Foo"] == "bar" - assert copied.default_headers["X-Bar"] == "stainless" + copied = client.copy(default_headers={'X-Bar': 'stainless'}) + assert copied.default_headers['X-Foo'] == 'bar' + assert copied.default_headers['X-Bar'] == 'stainless' # uses new values for any already given headers - copied = client.copy(default_headers={"X-Foo": "stainless"}) - assert copied.default_headers["X-Foo"] == "stainless" + copied = client.copy(default_headers={'X-Foo': 'stainless'}) + assert copied.default_headers['X-Foo'] == 'stainless' # set_default_headers # completely overrides already set values copied = client.copy(set_default_headers={}) - assert copied.default_headers.get("X-Foo") is None + assert copied.default_headers.get('X-Foo') is None - copied = client.copy(set_default_headers={"X-Bar": "Robert"}) - assert copied.default_headers["X-Bar"] == "Robert" + copied = client.copy(set_default_headers={'X-Bar': 'Robert'}) + assert copied.default_headers['X-Bar'] == 'Robert' with pytest.raises( - ValueError, - match="`default_headers` and `set_default_headers` arguments are mutually exclusive", + ValueError, + match='`default_headers` and `set_default_headers` arguments are mutually exclusive', ): - client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.copy(set_default_headers={}, default_headers={'X-Foo': 'Bar'}) def test_copy_default_query(self) -> None: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"} - ) - assert _get_params(client)["foo"] == "bar" + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={ + "foo": "bar" + }) + assert _get_params(client)['foo'] == 'bar' # does not override the already given value when not specified copied = client.copy() - assert _get_params(copied)["foo"] == "bar" + assert _get_params(copied)['foo'] == 'bar' # merges already given params - copied = client.copy(default_query={"bar": "stainless"}) + copied = client.copy(default_query={'bar': 'stainless'}) params = _get_params(copied) - assert params["foo"] == "bar" - assert params["bar"] == "stainless" + assert params['foo'] == 'bar' + assert params['bar'] == 'stainless' # uses new values for any already given headers - copied = client.copy(default_query={"foo": "stainless"}) - assert _get_params(copied)["foo"] == "stainless" + copied = client.copy(default_query={'foo': 'stainless'}) + assert _get_params(copied)['foo'] == 'stainless' # set_default_query @@ -928,21 +858,21 @@ def test_copy_default_query(self) -> None: copied = client.copy(set_default_query={}) assert _get_params(copied) == {"key": api_key} - copied = client.copy(set_default_query={"bar": "Robert"}) - assert _get_params(copied)["bar"] == "Robert" + copied = client.copy(set_default_query={'bar': 'Robert'}) + assert _get_params(copied)['bar'] == 'Robert' with pytest.raises( - ValueError, - # TODO: update - match="`default_query` and `set_default_query` arguments are mutually exclusive", + ValueError, + # TODO: update + match='`default_query` and `set_default_query` arguments are mutually exclusive', ): - client.copy(set_default_query={}, default_query={"foo": "Bar"}) + client.copy(set_default_query={}, default_query={'foo': 'Bar'}) def test_copy_signature(self) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( - # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + # mypy doesn't like that we access the `__init__` property. + self.client.__init__, # type: ignore[misc] ) copy_signature = inspect.signature(self.client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} @@ -1027,9 +957,7 @@ async def test_request_timeout(self) -> None: assert timeout == httpx.Timeout(100.0) async def test_client_timeout_option(self) -> None: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0) - ) + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0)) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1038,70 +966,54 @@ async def test_client_timeout_option(self) -> None: async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client - ) + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore - assert timeout == httpx.Timeout(None) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(None) # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client - ) + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore - assert timeout == DEFAULT_TIMEOUT + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client - ) + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore - assert timeout == DEFAULT_TIMEOUT # our default + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # our default def test_invalid_http_client(self) -> None: - with pytest.raises(TypeError, match="Invalid `http_client` arg"): - with httpx.Client() as http_client: - AsyncOnebusawaySDK( - base_url=base_url, - api_key=api_key, - _strict_response_validation=True, - http_client=cast(Any, http_client), - ) + with pytest.raises(TypeError, match='Invalid `http_client` arg') : + with httpx.Client() as http_client : + AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=cast(Any, http_client)) def test_default_headers_option(self) -> None: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} - ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) - assert request.headers.get("x-foo") == "bar" - assert request.headers.get("x-stainless-lang") == "python" - - client2 = AsyncOnebusawaySDK( - base_url=base_url, - api_key=api_key, - _strict_response_validation=True, - default_headers={ - "X-Foo": "stainless", - "X-Stainless-Lang": "my-overriding-header", - }, - ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) - assert request.headers.get("x-foo") == "stainless" - assert request.headers.get("x-stainless-lang") == "my-overriding-header" + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={ + "X-Foo": "bar" + }) + request = client._build_request(FinalRequestOptions(method="get", url='/foo')) + assert request.headers.get('x-foo') == 'bar' + assert request.headers.get('x-stainless-lang') == 'python' + + client2 = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={ + "X-Foo": "stainless", + "X-Stainless-Lang": "my-overriding-header", + }) + request = client2._build_request(FinalRequestOptions(method="get", url='/foo')) + assert request.headers.get('x-foo') == 'stainless' + assert request.headers.get('x-stainless-lang') == 'my-overriding-header' def test_default_query_option(self) -> None: - client = AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"} - ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={ + "query_param": "bar" + }) + request = client._build_request(FinalRequestOptions(method="get", url='/foo')) url = httpx.URL(request.url) # Include the 'key' in the expected params assert dict(url.params) == {"query_param": "bar", "key": api_key} @@ -1114,7 +1026,7 @@ def test_default_query_option(self) -> None: ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overridden", "key": api_key} + assert dict(url.params) == {'foo': 'baz', "query_param": "overridden", "key": api_key} def test_request_extra_json(self) -> None: request = self.client._build_request( @@ -1197,7 +1109,7 @@ def test_request_extra_query(self) -> None: ), ) params = dict(request.url.params) - assert params == {"bar": "1", "foo": "2", "key": api_key} + assert params == {'bar': '1', 'foo': '2', "key": api_key} # `extra_query` takes priority over `query` when keys clash request = self.client._build_request( FinalRequestOptions( @@ -1210,7 +1122,7 @@ def test_request_extra_query(self) -> None: ), ) params = dict(request.url.params) - assert params == {"foo": "2", "key": api_key} + assert params == {'foo': '2', "key": api_key} def test_multipart_repeating_array(self, async_client: AsyncOnebusawaySDK) -> None: request = async_client._build_request( @@ -1249,29 +1161,27 @@ class Model1(BaseModel): class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get('/foo').mock(return_value=httpx.Response(200, json={'foo': 'bar'})) response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) - assert response.foo == "bar" - + assert response.foo == 'bar' @pytest.mark.respx(base_url=base_url) async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: """Union of objects with the same field name using a different type""" - class Model1(BaseModel): foo: int class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get('/foo').mock(return_value=httpx.Response(200, json={'foo': 'bar'})) response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) - assert response.foo == "bar" + assert response.foo == 'bar' - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) + respx_mock.get('/foo').mock(return_value=httpx.Response(200, json={'foo': 1})) response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) @@ -1282,7 +1192,6 @@ async def test_non_application_json_content_type_for_json_data(self, respx_mock: """ Response that sets Content-Type to something other than application/json but returns json data """ - class Model(BaseModel): foo: int @@ -1299,9 +1208,7 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = AsyncOnebusawaySDK( - base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True - ) + client = AsyncOnebusawaySDK(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -1309,25 +1216,11 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" def test_base_url_env(self) -> None: - with update_env(ONEBUSAWAY_SDK_BASE_URL="http://localhost:5000/from/env"): - client = AsyncOnebusawaySDK(api_key=api_key, _strict_response_validation=True) - assert client.base_url == "http://localhost:5000/from/env/" + with update_env(ONEBUSAWAY_SDK_BASE_URL='http://localhost:5000/from/env'): + client = AsyncOnebusawaySDK(api_key=api_key, _strict_response_validation=True) + assert client.base_url == 'http://localhost:5000/from/env/' - @pytest.mark.parametrize( - "client", - [ - AsyncOnebusawaySDK( - base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True - ), - AsyncOnebusawaySDK( - base_url="http://localhost:5000/custom/path/", - api_key=api_key, - _strict_response_validation=True, - http_client=httpx.AsyncClient(), - ), - ], - ids=["standard", "custom http client"], - ) + @pytest.mark.parametrize("client", [AsyncOnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), AsyncOnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, http_client=httpx.AsyncClient())], ids = ["standard", "custom http client"]) def test_base_url_trailing_slash(self, client: AsyncOnebusawaySDK) -> None: request = client._build_request( FinalRequestOptions( @@ -1339,21 +1232,7 @@ def test_base_url_trailing_slash(self, client: AsyncOnebusawaySDK) -> None: excepted_url = f"http://localhost:5000/custom/path/foo?key={urllib.parse.quote_plus(client.api_key)}" assert request.url == excepted_url - @pytest.mark.parametrize( - "client", - [ - AsyncOnebusawaySDK( - base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True - ), - AsyncOnebusawaySDK( - base_url="http://localhost:5000/custom/path/", - api_key=api_key, - _strict_response_validation=True, - http_client=httpx.AsyncClient(), - ), - ], - ids=["standard", "custom http client"], - ) + @pytest.mark.parametrize("client", [AsyncOnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), AsyncOnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, http_client=httpx.AsyncClient())], ids = ["standard", "custom http client"]) def test_base_url_no_trailing_slash(self, client: AsyncOnebusawaySDK) -> None: request = client._build_request( FinalRequestOptions( @@ -1366,21 +1245,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncOnebusawaySDK) -> None: expected_url = f"http://localhost:5000/custom/path/foo?key={urllib.parse.quote_plus(client.api_key)}" assert request.url == expected_url - @pytest.mark.parametrize( - "client", - [ - AsyncOnebusawaySDK( - base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True - ), - AsyncOnebusawaySDK( - base_url="http://localhost:5000/custom/path/", - api_key=api_key, - _strict_response_validation=True, - http_client=httpx.AsyncClient(), - ), - ], - ids=["standard", "custom http client"], - ) + @pytest.mark.parametrize("client", [AsyncOnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), AsyncOnebusawaySDK(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, http_client=httpx.AsyncClient())], ids = ["standard", "custom http client"]) def test_absolute_request_url(self, client: AsyncOnebusawaySDK) -> None: request = client._build_request( FinalRequestOptions( @@ -1407,9 +1272,9 @@ async def test_copied_client_does_not_close_http(self) -> None: async def test_client_context_manager(self) -> None: client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) async with client as c2: - assert c2 is client - assert not c2.is_closed() - assert not client.is_closed() + assert c2 is client + assert not c2.is_closed() + assert not client.is_closed() assert client.is_closed() @pytest.mark.respx(base_url=base_url) @@ -1427,9 +1292,7 @@ class Model(BaseModel): async def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - AsyncOnebusawaySDK( - base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None) - ) + AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None)) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio @@ -1442,7 +1305,7 @@ class Model(BaseModel): strict_client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): - await strict_client.get("/foo", cast_to=Model) + await strict_client.get("/foo", cast_to=Model) client = AsyncOnebusawaySDK(base_url=base_url, api_key=api_key, _strict_response_validation=False) @@ -1450,26 +1313,26 @@ class Model(BaseModel): assert isinstance(response, str) # type: ignore[unreachable] @pytest.mark.parametrize( - "remaining_retries,retry_after,timeout", - [ - [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], - [3, "60", 60], - [3, "61", 0.5], - [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], - [-1100, "", 8], # test large number potentially overflowing - ], - ) + "remaining_retries,retry_after,timeout", + [ + [ 3, "20", 20 ], + [ 3, "0", 0.5 ], + [ 3, "-10", 0.5 ], + [ 3, "60", 60 ], + [ 3, "61", 0.5 ], + [ 3, "Fri, 29 Sep 2023 16:26:57 GMT", 20 ], + [ 3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5 ], + [ 3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5 ], + [ 3, "Fri, 29 Sep 2023 16:27:37 GMT", 60 ], + [ 3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5 ], + [ 3, "99999999999999999999999999999999999", 0.5 ], + [ 3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5 ], + [ 3, "", 0.5 ], + [ 2, "", 0.5 * 2.0 ], + [ 1, "", 0.5 * 4.0 ], + [-1100, "", 8], # test large number potentially overflowing + ], + ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @pytest.mark.asyncio async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: @@ -1478,7 +1341,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("onebusaway._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1486,11 +1349,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) respx_mock.get("/api/where/current-time.json").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await self.client.get( - "/api/where/current-time.json", - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + await self.client.get("/api/where/current-time.json", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) assert _get_open_connections(self.client) == 0 @@ -1500,11 +1359,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) respx_mock.get("/api/where/current-time.json").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await self.client.get( - "/api/where/current-time.json", - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + await self.client.get("/api/where/current-time.json", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) assert _get_open_connections(self.client) == 0 @@ -1518,7 +1373,7 @@ async def test_retries_taken( async_client: AsyncOnebusawaySDK, failures_before_success: int, failure_mode: Literal["status", "exception"], - respx_mock: MockRouter, + respx_mock: MockRouter ) -> None: client = async_client.with_options(max_retries=4) @@ -1529,7 +1384,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: if nb_retries < failures_before_success: nb_retries += 1 if failure_mode == "exception": - raise RuntimeError("oops") + raise RuntimeError("oops") return httpx.Response(500) return httpx.Response(200) @@ -1545,7 +1400,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio async def test_omit_retry_count_header( - self, async_client: AsyncOnebusawaySDK, failures_before_success: int, respx_mock: MockRouter + self, + async_client: AsyncOnebusawaySDK, + failures_before_success: int, + respx_mock: MockRouter ) -> None: client = async_client.with_options(max_retries=4) @@ -1560,18 +1418,19 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/where/current-time.json").mock(side_effect=retry_handler) - response = await client.current_time.with_raw_response.retrieve( - extra_headers={"x-stainless-retry-count": Omit()} - ) + response = await client.current_time.with_raw_response.retrieve(extra_headers={'x-stainless-retry-count': Omit()}) - assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + assert len(response.http_request.headers.get_list('x-stainless-retry-count')) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("onebusaway._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio async def test_overwrite_retry_count_header( - self, async_client: AsyncOnebusawaySDK, failures_before_success: int, respx_mock: MockRouter + self, + async_client: AsyncOnebusawaySDK, + failures_before_success: int, + respx_mock: MockRouter ) -> None: client = async_client.with_options(max_retries=4) @@ -1586,9 +1445,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/where/current-time.json").mock(side_effect=retry_handler) - response = await client.current_time.with_raw_response.retrieve(extra_headers={"x-stainless-retry-count": "42"}) + response = await client.current_time.with_raw_response.retrieve(extra_headers={'x-stainless-retry-count': '42'}) - assert response.http_request.headers.get("x-stainless-retry-count") == "42" + assert response.http_request.headers.get('x-stainless-retry-count') == '42' def test_get_platform(self) -> None: # A previous implementation of asyncify could leave threads unterminated when @@ -1624,13 +1483,17 @@ async def test_main() -> None: return_code = process.poll() if return_code is not None: if return_code != 0: - raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") + raise AssertionError( + "calling get_platform using asyncify resulted in a non-zero exit code" + ) # success break if time.monotonic() - start_time > timeout: process.kill() - raise AssertionError("calling get_platform using asyncify resulted in a hung process") + raise AssertionError( + "calling get_platform using asyncify resulted in a hung process" + ) time.sleep(0.1) diff --git a/tests/test_models.py b/tests/test_models.py index d3499d2..682ff07 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -520,6 +520,7 @@ class Model(BaseModel): assert m3.to_dict(exclude_none=True) == {} assert m3.to_dict(exclude_defaults=True) == {} + class Model2(BaseModel): created_at: datetime @@ -830,20 +831,20 @@ class B(BaseModel): assert UnionType.__discriminator__ is discriminator -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(not PYDANTIC_V2, reason='TypeAliasType is not supported in Pydantic v1') def test_type_alias_type() -> None: Alias = TypeAliasType("Alias", str) class Model(BaseModel): alias: Alias union: Union[int, Alias] - - m = construct_type(value={"alias": "foo", "union": "bar"}, type_=Model) + + m = construct_type(value={'alias': 'foo', 'union': 'bar'}, type_=Model) assert isinstance(m, Model) assert isinstance(m.alias, str) - assert m.alias == "foo" + assert m.alias == 'foo' assert isinstance(m.union, str) - assert m.union == "bar" + assert m.union == 'bar' @pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 64498cb..c82ceb3 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -28,7 +28,9 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_data_missing_event(sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK) -> None: +async def test_data_missing_event( + sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK +) -> None: def body() -> Iterator[bytes]: yield b'data: {"foo":true}\n' yield b"\n" @@ -44,7 +46,9 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_event_missing_data(sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK) -> None: +async def test_event_missing_data( + sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK +) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"\n" @@ -60,7 +64,9 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_events(sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK) -> None: +async def test_multiple_events( + sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK +) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"\n" @@ -82,7 +88,9 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_events_with_data(sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK) -> None: +async def test_multiple_events_with_data( + sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK +) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b'data: {"foo":true}\n' @@ -149,7 +157,9 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_data_lines(sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK) -> None: +async def test_multiple_data_lines( + sync: bool, client: OnebusawaySDK, async_client: AsyncOnebusawaySDK +) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"data: {\n" diff --git a/tests/test_transform.py b/tests/test_transform.py index 352d7ae..ee24d7b 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -191,18 +191,16 @@ async def test_iso8601_format(use_async: bool) -> None: dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") tz = "Z" if PYDANTIC_V2 else "+00:00" assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] - assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] + assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] dt = dt.replace(tzinfo=None) assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] - assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] + assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] assert await transform({"foo": None}, DateDict, use_async) == {"foo": None} # type: ignore[comparison-overlap] - assert await transform(DateModel(foo=None), Any, use_async) == {"foo": None} # type: ignore + assert await transform(DateModel(foo=None), Any, use_async) == {"foo": None} # type: ignore assert await transform({"foo": date.fromisoformat("2023-02-23")}, DateDict, use_async) == {"foo": "2023-02-23"} # type: ignore[comparison-overlap] - assert await transform(DateModel(foo=date.fromisoformat("2023-02-23")), DateDict, use_async) == { - "foo": "2023-02-23" - } # type: ignore[comparison-overlap] + assert await transform(DateModel(foo=date.fromisoformat("2023-02-23")), DateDict, use_async) == {"foo": "2023-02-23"} # type: ignore[comparison-overlap] @parametrize @@ -392,9 +390,11 @@ def my_iter() -> Iterable[Baz8]: @pytest.mark.asyncio async def test_dictionary_items(use_async: bool) -> None: class DictItems(TypedDict): - foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + foo_baz: Annotated[str, PropertyInfo(alias='fooBaz')] - assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == {"foo": {"fooBaz": "bar"}} + assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == { + "foo": {"fooBaz": "bar"} + } class TypedDictIterableUnionStr(TypedDict): From f783dc50eaaf1ca31702d08ded4d09bf4833a558 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 16:36:41 +0000 Subject: [PATCH 2/3] release: 1.8.5 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/onebusaway/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dc8ed9b..2171c6e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.8.4" + ".": "1.8.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3934b2e..7545938 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.8.5 (2025-05-15) + +Full Changelog: [v1.8.4...v1.8.5](https://github.com/OneBusAway/python-sdk/compare/v1.8.4...v1.8.5) + +### Chores + +* **internal:** codegen related update ([#288](https://github.com/OneBusAway/python-sdk/issues/288)) ([d301a0c](https://github.com/OneBusAway/python-sdk/commit/d301a0cf24104ff0d791046c99093f3c47365bf3)) + ## 1.8.4 (2025-03-27) Full Changelog: [v1.8.3...v1.8.4](https://github.com/OneBusAway/python-sdk/compare/v1.8.3...v1.8.4) diff --git a/pyproject.toml b/pyproject.toml index 6b048b7..ee6e992 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "onebusaway" -version = "1.8.4" +version = "1.8.5" description = "The official Python library for the onebusaway-sdk API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/onebusaway/_version.py b/src/onebusaway/_version.py index e4402cd..ac2c376 100644 --- a/src/onebusaway/_version.py +++ b/src/onebusaway/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "onebusaway" -__version__ = "1.8.4" # x-release-please-version +__version__ = "1.8.5" # x-release-please-version From d50bcd8e3c6f4aa4710ff7b8ff322a1d4aa1add4 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Thu, 15 May 2025 19:56:12 +0300 Subject: [PATCH 3/3] chore: rye linting --- src/onebusaway/__init__.py | 41 ++- src/onebusaway/_base_client.py | 2 - src/onebusaway/_client.py | 79 +++-- src/onebusaway/_exceptions.py | 4 +- src/onebusaway/_resource.py | 4 +- src/onebusaway/_response.py | 4 +- src/onebusaway/_streaming.py | 4 +- src/onebusaway/_types.py | 4 - src/onebusaway/resources/__init__.py | 280 ++++++++++++++---- .../resources/agencies_with_coverage.py | 21 +- src/onebusaway/resources/agency.py | 21 +- .../resources/arrival_and_departure.py | 38 ++- src/onebusaway/resources/block.py | 21 +- src/onebusaway/resources/config.py | 21 +- src/onebusaway/resources/current_time.py | 21 +- .../resources/report_problem_with_stop.py | 33 +-- .../resources/report_problem_with_trip.py | 33 +-- src/onebusaway/resources/route.py | 21 +- .../resources/route_ids_for_agency.py | 21 +- src/onebusaway/resources/routes_for_agency.py | 21 +- .../resources/routes_for_location.py | 29 +- .../resources/schedule_for_route.py | 36 ++- src/onebusaway/resources/schedule_for_stop.py | 36 ++- src/onebusaway/resources/search_for_route.py | 29 +- src/onebusaway/resources/search_for_stop.py | 29 +- src/onebusaway/resources/shape.py | 21 +- src/onebusaway/resources/stop.py | 21 +- .../resources/stop_ids_for_agency.py | 21 +- src/onebusaway/resources/stops_for_agency.py | 21 +- .../resources/stops_for_location.py | 29 +- src/onebusaway/resources/stops_for_route.py | 29 +- src/onebusaway/resources/trip.py | 21 +- src/onebusaway/resources/trip_details.py | 29 +- src/onebusaway/resources/trip_for_vehicle.py | 29 +- .../resources/trips_for_location.py | 29 +- src/onebusaway/resources/trips_for_route.py | 29 +- .../resources/vehicles_for_agency.py | 29 +- src/onebusaway/types/__init__.py | 78 ++--- .../agencies_with_coverage_list_response.py | 9 +- .../types/agency_retrieve_response.py | 9 +- .../arrival_and_departure_list_params.py | 8 +- .../arrival_and_departure_list_response.py | 9 +- .../arrival_and_departure_retrieve_params.py | 6 +- ...arrival_and_departure_retrieve_response.py | 9 +- .../types/block_retrieve_response.py | 9 +- .../types/config_retrieve_response.py | 9 +- .../types/current_time_retrieve_response.py | 9 +- ...eport_problem_with_stop_retrieve_params.py | 6 +- ...eport_problem_with_trip_retrieve_params.py | 6 +- .../route_ids_for_agency_list_response.py | 9 +- .../types/route_retrieve_response.py | 9 +- .../types/routes_for_agency_list_response.py | 9 +- .../types/routes_for_location_list_params.py | 6 +- .../routes_for_location_list_response.py | 9 +- .../schedule_for_route_retrieve_params.py | 8 +- .../schedule_for_route_retrieve_response.py | 8 +- .../schedule_for_stop_retrieve_params.py | 8 +- .../schedule_for_stop_retrieve_response.py | 9 +- .../types/search_for_route_list_params.py | 6 +- .../types/search_for_route_list_response.py | 9 +- .../types/search_for_stop_list_params.py | 6 +- .../types/search_for_stop_list_response.py | 9 +- .../types/shape_retrieve_response.py | 7 +- src/onebusaway/types/shared/references.py | 9 +- .../types/shared/response_wrapper.py | 5 +- .../stop_ids_for_agency_list_response.py | 9 +- .../types/stop_retrieve_response.py | 9 +- .../types/stops_for_agency_list_response.py | 9 +- .../types/stops_for_location_list_params.py | 6 +- .../types/stops_for_location_list_response.py | 9 +- .../types/stops_for_route_list_params.py | 6 +- .../types/stops_for_route_list_response.py | 9 +- .../types/trip_detail_retrieve_params.py | 6 +- .../types/trip_detail_retrieve_response.py | 9 +- .../types/trip_for_vehicle_retrieve_params.py | 6 +- .../trip_for_vehicle_retrieve_response.py | 9 +- .../types/trip_retrieve_response.py | 9 +- .../types/trips_for_location_list_params.py | 6 +- .../types/trips_for_location_list_response.py | 9 +- .../types/trips_for_route_list_params.py | 6 +- .../types/trips_for_route_list_response.py | 9 +- .../types/vehicles_for_agency_list_params.py | 4 - .../vehicles_for_agency_list_response.py | 9 +- .../test_agencies_with_coverage.py | 13 +- tests/api_resources/test_agency.py | 13 +- .../test_arrival_and_departure.py | 19 +- tests/api_resources/test_block.py | 13 +- tests/api_resources/test_config.py | 13 +- tests/api_resources/test_current_time.py | 13 +- .../test_report_problem_with_stop.py | 14 +- .../test_report_problem_with_trip.py | 14 +- tests/api_resources/test_route.py | 13 +- .../test_route_ids_for_agency.py | 13 +- tests/api_resources/test_routes_for_agency.py | 13 +- .../api_resources/test_routes_for_location.py | 14 +- .../api_resources/test_schedule_for_route.py | 15 +- tests/api_resources/test_schedule_for_stop.py | 15 +- tests/api_resources/test_search_for_route.py | 14 +- tests/api_resources/test_search_for_stop.py | 14 +- tests/api_resources/test_shape.py | 13 +- tests/api_resources/test_stop.py | 13 +- .../api_resources/test_stop_ids_for_agency.py | 13 +- tests/api_resources/test_stops_for_agency.py | 13 +- .../api_resources/test_stops_for_location.py | 14 +- tests/api_resources/test_stops_for_route.py | 14 +- tests/api_resources/test_trip.py | 13 +- tests/api_resources/test_trip_details.py | 14 +- tests/api_resources/test_trip_for_vehicle.py | 14 +- .../api_resources/test_trips_for_location.py | 14 +- tests/api_resources/test_trips_for_route.py | 14 +- .../api_resources/test_vehicles_for_agency.py | 14 +- tests/conftest.py | 6 +- tests/test_client.py | 45 ++- 113 files changed, 929 insertions(+), 1101 deletions(-) diff --git a/src/onebusaway/__init__.py b/src/onebusaway/__init__.py index e2acc95..948ea95 100644 --- a/src/onebusaway/__init__.py +++ b/src/onebusaway/__init__.py @@ -1,16 +1,41 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from . import types -from ._version import __version__, __title__ -from ._client import Timeout,Transport,RequestOptions,Client,AsyncClient,Stream,AsyncStream,OnebusawaySDK,AsyncOnebusawaySDK -from ._exceptions import OnebusawaySDKError,APIError,APIStatusError,APITimeoutError,APIConnectionError,APIResponseValidationError,BadRequestError,AuthenticationError,PermissionDeniedError,NotFoundError,ConflictError,UnprocessableEntityError,RateLimitError,InternalServerError -from ._types import NoneType,Transport,ProxiesTypes,NotGiven,NOT_GIVEN,Omit +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path +from ._client import ( + Client, + Stream, + Timeout, + Transport, + AsyncClient, + AsyncStream, + OnebusawaySDK, + RequestOptions, + AsyncOnebusawaySDK, +) from ._models import BaseModel -from ._constants import DEFAULT_TIMEOUT,DEFAULT_MAX_RETRIES,DEFAULT_CONNECTION_LIMITS -from ._base_client import DefaultHttpxClient,DefaultAsyncHttpxClient -from ._utils._logs import setup_logging as _setup_logging +from ._version import __title__, __version__ from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse +from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS +from ._exceptions import ( + APIError, + ConflictError, + NotFoundError, + APIStatusError, + RateLimitError, + APITimeoutError, + BadRequestError, + APIConnectionError, + OnebusawaySDKError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, + APIResponseValidationError, +) +from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._utils._logs import setup_logging as _setup_logging __all__ = ["types", "__version__", "__title__", "NoneType", "Transport", "ProxiesTypes", "NotGiven", "NOT_GIVEN", "Omit", "OnebusawaySDKError", "APIError", "APIStatusError", "APITimeoutError", "APIConnectionError", "APIResponseValidationError", "BadRequestError", "AuthenticationError", "PermissionDeniedError", "NotFoundError", "ConflictError", "UnprocessableEntityError", "RateLimitError", "InternalServerError", "Timeout", "RequestOptions", "Client", "AsyncClient", "Stream", "AsyncStream", "OnebusawaySDK", "AsyncOnebusawaySDK", "file_from_path", "BaseModel", "DEFAULT_TIMEOUT", "DEFAULT_MAX_RETRIES", "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient"] @@ -24,7 +49,7 @@ for __name in __all__: if not __name.startswith("__"): try: - setattr(__locals[__name], "__module__", "onebusaway") + __locals[__name].__module__ = "onebusaway" except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. pass \ No newline at end of file diff --git a/src/onebusaway/_base_client.py b/src/onebusaway/_base_client.py index 26cbf6c..f99a333 100644 --- a/src/onebusaway/_base_client.py +++ b/src/onebusaway/_base_client.py @@ -9,7 +9,6 @@ import inspect import logging import platform -import warnings import email.utils from types import TracebackType from random import random @@ -84,7 +83,6 @@ APIConnectionError, APIResponseValidationError, ) -from ._legacy_response import LegacyAPIResponse log: logging.Logger = logging.getLogger(__name__) diff --git a/src/onebusaway/_client.py b/src/onebusaway/_client.py index dce7036..e11449e 100644 --- a/src/onebusaway/_client.py +++ b/src/onebusaway/_client.py @@ -2,45 +2,64 @@ from __future__ import annotations -import httpx - -import os - -from ._streaming import AsyncStream as AsyncStream, Stream as Stream - -from typing import Union, Mapping, Any - -from ._exceptions import OnebusawaySDKError, APIStatusError - -from typing_extensions import override, Self - -from ._utils import get_async_library - -from .resources import agencies_with_coverage, agency, vehicles_for_agency, config, current_time, stops_for_location, stops_for_route, stops_for_agency, stop, stop_ids_for_agency, schedule_for_stop, route, route_ids_for_agency, routes_for_location, routes_for_agency, schedule_for_route, arrival_and_departure, trip, trips_for_location, trip_details, trip_for_vehicle, trips_for_route, report_problem_with_stop, report_problem_with_trip, search_for_stop, search_for_route, block, shape - -from . import _exceptions - import os -import asyncio -import warnings -from typing_extensions import Literal +from typing import Any, Union, Mapping +from typing_extensions import Self, override import httpx -from ._version import __version__ +from . import _exceptions from ._qs import Querystring -from ._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, maybe_coerce_integer, maybe_coerce_float, maybe_coerce_boolean, is_given -from ._types import Omit, NotGiven, Timeout, Transport, ProxiesTypes, RequestOptions, Headers, NoneType, Query, Body, NOT_GIVEN +from ._types import ( + NOT_GIVEN, + Omit, + Timeout, + NotGiven, + Transport, + ProxiesTypes, + RequestOptions, +) +from ._utils import ( + is_given, + get_async_library, +) +from ._version import __version__ +from .resources import ( + stop, + trip, + block, + route, + shape, + agency, + config, + current_time, + trip_details, + search_for_stop, + stops_for_route, + trips_for_route, + search_for_route, + stops_for_agency, + trip_for_vehicle, + routes_for_agency, + schedule_for_stop, + schedule_for_route, + stops_for_location, + trips_for_location, + routes_for_location, + stop_ids_for_agency, + vehicles_for_agency, + route_ids_for_agency, + arrival_and_departure, + agencies_with_coverage, + report_problem_with_stop, + report_problem_with_trip, +) +from ._streaming import Stream as Stream, AsyncStream as AsyncStream +from ._exceptions import APIStatusError, OnebusawaySDKError from ._base_client import ( - DEFAULT_CONNECTION_LIMITS, - DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, - ResponseT, - SyncHttpxClientWrapper, - AsyncHttpxClientWrapper, SyncAPIClient, AsyncAPIClient, - make_request_options, ) __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "OnebusawaySDK", "AsyncOnebusawaySDK", "Client", "AsyncClient"] diff --git a/src/onebusaway/_exceptions.py b/src/onebusaway/_exceptions.py index af310bb..dad6a31 100644 --- a/src/onebusaway/_exceptions.py +++ b/src/onebusaway/_exceptions.py @@ -2,10 +2,10 @@ from __future__ import annotations -import httpx - from typing_extensions import Literal +import httpx + __all__ = ["BadRequestError", "AuthenticationError", "PermissionDeniedError", "NotFoundError", "ConflictError", "UnprocessableEntityError", "RateLimitError", "InternalServerError"] class OnebusawaySDKError(Exception): diff --git a/src/onebusaway/_resource.py b/src/onebusaway/_resource.py index cda700b..e20e5cd 100644 --- a/src/onebusaway/_resource.py +++ b/src/onebusaway/_resource.py @@ -3,10 +3,10 @@ from __future__ import annotations import time -import anyio - from typing import TYPE_CHECKING +import anyio + if TYPE_CHECKING: from ._client import OnebusawaySDK, AsyncOnebusawaySDK diff --git a/src/onebusaway/_response.py b/src/onebusaway/_response.py index 02db195..21c87fc 100644 --- a/src/onebusaway/_response.py +++ b/src/onebusaway/_response.py @@ -25,14 +25,12 @@ import pydantic from ._types import NoneType -from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base, is_type_alias_type -from ._streaming import extract_stream_chunk_type +from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base from ._models import BaseModel, is_basemodel from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type from ._exceptions import OnebusawaySDKError, APIResponseValidationError - if TYPE_CHECKING: from ._models import FinalRequestOptions from ._base_client import BaseClient diff --git a/src/onebusaway/_streaming.py b/src/onebusaway/_streaming.py index 9b91d7e..293ffe5 100644 --- a/src/onebusaway/_streaming.py +++ b/src/onebusaway/_streaming.py @@ -9,9 +9,7 @@ import httpx -from ._utils import is_mapping, is_dict, extract_type_var_from_base -from ._exceptions import APIError -from ._response import APIResponse, AsyncAPIResponse +from ._utils import extract_type_var_from_base if TYPE_CHECKING: from ._client import OnebusawaySDK, AsyncOnebusawaySDK diff --git a/src/onebusaway/_types.py b/src/onebusaway/_types.py index 515085c..a457723 100644 --- a/src/onebusaway/_types.py +++ b/src/onebusaway/_types.py @@ -1,7 +1,6 @@ from __future__ import annotations from os import PathLike -from abc import ABC, abstractmethod from typing import ( IO, TYPE_CHECKING, @@ -14,10 +13,8 @@ Mapping, TypeVar, Callable, - Iterator, Optional, Sequence, - AsyncIterator, ) from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable @@ -28,7 +25,6 @@ if TYPE_CHECKING: from ._models import BaseModel from ._response import APIResponse, AsyncAPIResponse - from ._legacy_response import HttpxBinaryResponseContent Transport = BaseTransport AsyncTransport = AsyncBaseTransport diff --git a/src/onebusaway/resources/__init__.py b/src/onebusaway/resources/__init__.py index 3482e97..c5f49f6 100644 --- a/src/onebusaway/resources/__init__.py +++ b/src/onebusaway/resources/__init__.py @@ -1,60 +1,228 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .agencies_with_coverage import AgenciesWithCoverageResource, AsyncAgenciesWithCoverageResource -from .agencies_with_coverage import AgenciesWithCoverageResourceWithRawResponse, AsyncAgenciesWithCoverageResourceWithRawResponse, AgenciesWithCoverageResourceWithStreamingResponse, AsyncAgenciesWithCoverageResourceWithStreamingResponse -from .agency import AgencyResource, AsyncAgencyResource -from .agency import AgencyResourceWithRawResponse, AsyncAgencyResourceWithRawResponse, AgencyResourceWithStreamingResponse, AsyncAgencyResourceWithStreamingResponse -from .vehicles_for_agency import VehiclesForAgencyResource, AsyncVehiclesForAgencyResource -from .vehicles_for_agency import VehiclesForAgencyResourceWithRawResponse, AsyncVehiclesForAgencyResourceWithRawResponse, VehiclesForAgencyResourceWithStreamingResponse, AsyncVehiclesForAgencyResourceWithStreamingResponse -from .config import ConfigResource, AsyncConfigResource -from .config import ConfigResourceWithRawResponse, AsyncConfigResourceWithRawResponse, ConfigResourceWithStreamingResponse, AsyncConfigResourceWithStreamingResponse -from .current_time import CurrentTimeResource, AsyncCurrentTimeResource -from .current_time import CurrentTimeResourceWithRawResponse, AsyncCurrentTimeResourceWithRawResponse, CurrentTimeResourceWithStreamingResponse, AsyncCurrentTimeResourceWithStreamingResponse -from .stops_for_location import StopsForLocationResource, AsyncStopsForLocationResource -from .stops_for_location import StopsForLocationResourceWithRawResponse, AsyncStopsForLocationResourceWithRawResponse, StopsForLocationResourceWithStreamingResponse, AsyncStopsForLocationResourceWithStreamingResponse -from .stops_for_route import StopsForRouteResource, AsyncStopsForRouteResource -from .stops_for_route import StopsForRouteResourceWithRawResponse, AsyncStopsForRouteResourceWithRawResponse, StopsForRouteResourceWithStreamingResponse, AsyncStopsForRouteResourceWithStreamingResponse -from .stops_for_agency import StopsForAgencyResource, AsyncStopsForAgencyResource -from .stops_for_agency import StopsForAgencyResourceWithRawResponse, AsyncStopsForAgencyResourceWithRawResponse, StopsForAgencyResourceWithStreamingResponse, AsyncStopsForAgencyResourceWithStreamingResponse -from .stop import StopResource, AsyncStopResource -from .stop import StopResourceWithRawResponse, AsyncStopResourceWithRawResponse, StopResourceWithStreamingResponse, AsyncStopResourceWithStreamingResponse -from .stop_ids_for_agency import StopIDsForAgencyResource, AsyncStopIDsForAgencyResource -from .stop_ids_for_agency import StopIDsForAgencyResourceWithRawResponse, AsyncStopIDsForAgencyResourceWithRawResponse, StopIDsForAgencyResourceWithStreamingResponse, AsyncStopIDsForAgencyResourceWithStreamingResponse -from .schedule_for_stop import ScheduleForStopResource, AsyncScheduleForStopResource -from .schedule_for_stop import ScheduleForStopResourceWithRawResponse, AsyncScheduleForStopResourceWithRawResponse, ScheduleForStopResourceWithStreamingResponse, AsyncScheduleForStopResourceWithStreamingResponse -from .route import RouteResource, AsyncRouteResource -from .route import RouteResourceWithRawResponse, AsyncRouteResourceWithRawResponse, RouteResourceWithStreamingResponse, AsyncRouteResourceWithStreamingResponse -from .route_ids_for_agency import RouteIDsForAgencyResource, AsyncRouteIDsForAgencyResource -from .route_ids_for_agency import RouteIDsForAgencyResourceWithRawResponse, AsyncRouteIDsForAgencyResourceWithRawResponse, RouteIDsForAgencyResourceWithStreamingResponse, AsyncRouteIDsForAgencyResourceWithStreamingResponse -from .routes_for_location import RoutesForLocationResource, AsyncRoutesForLocationResource -from .routes_for_location import RoutesForLocationResourceWithRawResponse, AsyncRoutesForLocationResourceWithRawResponse, RoutesForLocationResourceWithStreamingResponse, AsyncRoutesForLocationResourceWithStreamingResponse -from .routes_for_agency import RoutesForAgencyResource, AsyncRoutesForAgencyResource -from .routes_for_agency import RoutesForAgencyResourceWithRawResponse, AsyncRoutesForAgencyResourceWithRawResponse, RoutesForAgencyResourceWithStreamingResponse, AsyncRoutesForAgencyResourceWithStreamingResponse -from .schedule_for_route import ScheduleForRouteResource, AsyncScheduleForRouteResource -from .schedule_for_route import ScheduleForRouteResourceWithRawResponse, AsyncScheduleForRouteResourceWithRawResponse, ScheduleForRouteResourceWithStreamingResponse, AsyncScheduleForRouteResourceWithStreamingResponse -from .arrival_and_departure import ArrivalAndDepartureResource, AsyncArrivalAndDepartureResource -from .arrival_and_departure import ArrivalAndDepartureResourceWithRawResponse, AsyncArrivalAndDepartureResourceWithRawResponse, ArrivalAndDepartureResourceWithStreamingResponse, AsyncArrivalAndDepartureResourceWithStreamingResponse -from .trip import TripResource, AsyncTripResource -from .trip import TripResourceWithRawResponse, AsyncTripResourceWithRawResponse, TripResourceWithStreamingResponse, AsyncTripResourceWithStreamingResponse -from .trips_for_location import TripsForLocationResource, AsyncTripsForLocationResource -from .trips_for_location import TripsForLocationResourceWithRawResponse, AsyncTripsForLocationResourceWithRawResponse, TripsForLocationResourceWithStreamingResponse, AsyncTripsForLocationResourceWithStreamingResponse -from .trip_details import TripDetailsResource, AsyncTripDetailsResource -from .trip_details import TripDetailsResourceWithRawResponse, AsyncTripDetailsResourceWithRawResponse, TripDetailsResourceWithStreamingResponse, AsyncTripDetailsResourceWithStreamingResponse -from .trip_for_vehicle import TripForVehicleResource, AsyncTripForVehicleResource -from .trip_for_vehicle import TripForVehicleResourceWithRawResponse, AsyncTripForVehicleResourceWithRawResponse, TripForVehicleResourceWithStreamingResponse, AsyncTripForVehicleResourceWithStreamingResponse -from .trips_for_route import TripsForRouteResource, AsyncTripsForRouteResource -from .trips_for_route import TripsForRouteResourceWithRawResponse, AsyncTripsForRouteResourceWithRawResponse, TripsForRouteResourceWithStreamingResponse, AsyncTripsForRouteResourceWithStreamingResponse -from .report_problem_with_stop import ReportProblemWithStopResource, AsyncReportProblemWithStopResource -from .report_problem_with_stop import ReportProblemWithStopResourceWithRawResponse, AsyncReportProblemWithStopResourceWithRawResponse, ReportProblemWithStopResourceWithStreamingResponse, AsyncReportProblemWithStopResourceWithStreamingResponse -from .report_problem_with_trip import ReportProblemWithTripResource, AsyncReportProblemWithTripResource -from .report_problem_with_trip import ReportProblemWithTripResourceWithRawResponse, AsyncReportProblemWithTripResourceWithRawResponse, ReportProblemWithTripResourceWithStreamingResponse, AsyncReportProblemWithTripResourceWithStreamingResponse -from .search_for_stop import SearchForStopResource, AsyncSearchForStopResource -from .search_for_stop import SearchForStopResourceWithRawResponse, AsyncSearchForStopResourceWithRawResponse, SearchForStopResourceWithStreamingResponse, AsyncSearchForStopResourceWithStreamingResponse -from .search_for_route import SearchForRouteResource, AsyncSearchForRouteResource -from .search_for_route import SearchForRouteResourceWithRawResponse, AsyncSearchForRouteResourceWithRawResponse, SearchForRouteResourceWithStreamingResponse, AsyncSearchForRouteResourceWithStreamingResponse -from .block import BlockResource, AsyncBlockResource -from .block import BlockResourceWithRawResponse, AsyncBlockResourceWithRawResponse, BlockResourceWithStreamingResponse, AsyncBlockResourceWithStreamingResponse -from .shape import ShapeResource, AsyncShapeResource -from .shape import ShapeResourceWithRawResponse, AsyncShapeResourceWithRawResponse, ShapeResourceWithStreamingResponse, AsyncShapeResourceWithStreamingResponse +from .stop import ( + StopResource, + AsyncStopResource, + StopResourceWithRawResponse, + AsyncStopResourceWithRawResponse, + StopResourceWithStreamingResponse, + AsyncStopResourceWithStreamingResponse, +) +from .trip import ( + TripResource, + AsyncTripResource, + TripResourceWithRawResponse, + AsyncTripResourceWithRawResponse, + TripResourceWithStreamingResponse, + AsyncTripResourceWithStreamingResponse, +) +from .block import ( + BlockResource, + AsyncBlockResource, + BlockResourceWithRawResponse, + AsyncBlockResourceWithRawResponse, + BlockResourceWithStreamingResponse, + AsyncBlockResourceWithStreamingResponse, +) +from .route import ( + RouteResource, + AsyncRouteResource, + RouteResourceWithRawResponse, + AsyncRouteResourceWithRawResponse, + RouteResourceWithStreamingResponse, + AsyncRouteResourceWithStreamingResponse, +) +from .shape import ( + ShapeResource, + AsyncShapeResource, + ShapeResourceWithRawResponse, + AsyncShapeResourceWithRawResponse, + ShapeResourceWithStreamingResponse, + AsyncShapeResourceWithStreamingResponse, +) +from .agency import ( + AgencyResource, + AsyncAgencyResource, + AgencyResourceWithRawResponse, + AsyncAgencyResourceWithRawResponse, + AgencyResourceWithStreamingResponse, + AsyncAgencyResourceWithStreamingResponse, +) +from .config import ( + ConfigResource, + AsyncConfigResource, + ConfigResourceWithRawResponse, + AsyncConfigResourceWithRawResponse, + ConfigResourceWithStreamingResponse, + AsyncConfigResourceWithStreamingResponse, +) +from .current_time import ( + CurrentTimeResource, + AsyncCurrentTimeResource, + CurrentTimeResourceWithRawResponse, + AsyncCurrentTimeResourceWithRawResponse, + CurrentTimeResourceWithStreamingResponse, + AsyncCurrentTimeResourceWithStreamingResponse, +) +from .trip_details import ( + TripDetailsResource, + AsyncTripDetailsResource, + TripDetailsResourceWithRawResponse, + AsyncTripDetailsResourceWithRawResponse, + TripDetailsResourceWithStreamingResponse, + AsyncTripDetailsResourceWithStreamingResponse, +) +from .search_for_stop import ( + SearchForStopResource, + AsyncSearchForStopResource, + SearchForStopResourceWithRawResponse, + AsyncSearchForStopResourceWithRawResponse, + SearchForStopResourceWithStreamingResponse, + AsyncSearchForStopResourceWithStreamingResponse, +) +from .stops_for_route import ( + StopsForRouteResource, + AsyncStopsForRouteResource, + StopsForRouteResourceWithRawResponse, + AsyncStopsForRouteResourceWithRawResponse, + StopsForRouteResourceWithStreamingResponse, + AsyncStopsForRouteResourceWithStreamingResponse, +) +from .trips_for_route import ( + TripsForRouteResource, + AsyncTripsForRouteResource, + TripsForRouteResourceWithRawResponse, + AsyncTripsForRouteResourceWithRawResponse, + TripsForRouteResourceWithStreamingResponse, + AsyncTripsForRouteResourceWithStreamingResponse, +) +from .search_for_route import ( + SearchForRouteResource, + AsyncSearchForRouteResource, + SearchForRouteResourceWithRawResponse, + AsyncSearchForRouteResourceWithRawResponse, + SearchForRouteResourceWithStreamingResponse, + AsyncSearchForRouteResourceWithStreamingResponse, +) +from .stops_for_agency import ( + StopsForAgencyResource, + AsyncStopsForAgencyResource, + StopsForAgencyResourceWithRawResponse, + AsyncStopsForAgencyResourceWithRawResponse, + StopsForAgencyResourceWithStreamingResponse, + AsyncStopsForAgencyResourceWithStreamingResponse, +) +from .trip_for_vehicle import ( + TripForVehicleResource, + AsyncTripForVehicleResource, + TripForVehicleResourceWithRawResponse, + AsyncTripForVehicleResourceWithRawResponse, + TripForVehicleResourceWithStreamingResponse, + AsyncTripForVehicleResourceWithStreamingResponse, +) +from .routes_for_agency import ( + RoutesForAgencyResource, + AsyncRoutesForAgencyResource, + RoutesForAgencyResourceWithRawResponse, + AsyncRoutesForAgencyResourceWithRawResponse, + RoutesForAgencyResourceWithStreamingResponse, + AsyncRoutesForAgencyResourceWithStreamingResponse, +) +from .schedule_for_stop import ( + ScheduleForStopResource, + AsyncScheduleForStopResource, + ScheduleForStopResourceWithRawResponse, + AsyncScheduleForStopResourceWithRawResponse, + ScheduleForStopResourceWithStreamingResponse, + AsyncScheduleForStopResourceWithStreamingResponse, +) +from .schedule_for_route import ( + ScheduleForRouteResource, + AsyncScheduleForRouteResource, + ScheduleForRouteResourceWithRawResponse, + AsyncScheduleForRouteResourceWithRawResponse, + ScheduleForRouteResourceWithStreamingResponse, + AsyncScheduleForRouteResourceWithStreamingResponse, +) +from .stops_for_location import ( + StopsForLocationResource, + AsyncStopsForLocationResource, + StopsForLocationResourceWithRawResponse, + AsyncStopsForLocationResourceWithRawResponse, + StopsForLocationResourceWithStreamingResponse, + AsyncStopsForLocationResourceWithStreamingResponse, +) +from .trips_for_location import ( + TripsForLocationResource, + AsyncTripsForLocationResource, + TripsForLocationResourceWithRawResponse, + AsyncTripsForLocationResourceWithRawResponse, + TripsForLocationResourceWithStreamingResponse, + AsyncTripsForLocationResourceWithStreamingResponse, +) +from .routes_for_location import ( + RoutesForLocationResource, + AsyncRoutesForLocationResource, + RoutesForLocationResourceWithRawResponse, + AsyncRoutesForLocationResourceWithRawResponse, + RoutesForLocationResourceWithStreamingResponse, + AsyncRoutesForLocationResourceWithStreamingResponse, +) +from .stop_ids_for_agency import ( + StopIDsForAgencyResource, + AsyncStopIDsForAgencyResource, + StopIDsForAgencyResourceWithRawResponse, + AsyncStopIDsForAgencyResourceWithRawResponse, + StopIDsForAgencyResourceWithStreamingResponse, + AsyncStopIDsForAgencyResourceWithStreamingResponse, +) +from .vehicles_for_agency import ( + VehiclesForAgencyResource, + AsyncVehiclesForAgencyResource, + VehiclesForAgencyResourceWithRawResponse, + AsyncVehiclesForAgencyResourceWithRawResponse, + VehiclesForAgencyResourceWithStreamingResponse, + AsyncVehiclesForAgencyResourceWithStreamingResponse, +) +from .route_ids_for_agency import ( + RouteIDsForAgencyResource, + AsyncRouteIDsForAgencyResource, + RouteIDsForAgencyResourceWithRawResponse, + AsyncRouteIDsForAgencyResourceWithRawResponse, + RouteIDsForAgencyResourceWithStreamingResponse, + AsyncRouteIDsForAgencyResourceWithStreamingResponse, +) +from .arrival_and_departure import ( + ArrivalAndDepartureResource, + AsyncArrivalAndDepartureResource, + ArrivalAndDepartureResourceWithRawResponse, + AsyncArrivalAndDepartureResourceWithRawResponse, + ArrivalAndDepartureResourceWithStreamingResponse, + AsyncArrivalAndDepartureResourceWithStreamingResponse, +) +from .agencies_with_coverage import ( + AgenciesWithCoverageResource, + AsyncAgenciesWithCoverageResource, + AgenciesWithCoverageResourceWithRawResponse, + AsyncAgenciesWithCoverageResourceWithRawResponse, + AgenciesWithCoverageResourceWithStreamingResponse, + AsyncAgenciesWithCoverageResourceWithStreamingResponse, +) +from .report_problem_with_stop import ( + ReportProblemWithStopResource, + AsyncReportProblemWithStopResource, + ReportProblemWithStopResourceWithRawResponse, + AsyncReportProblemWithStopResourceWithRawResponse, + ReportProblemWithStopResourceWithStreamingResponse, + AsyncReportProblemWithStopResourceWithStreamingResponse, +) +from .report_problem_with_trip import ( + ReportProblemWithTripResource, + AsyncReportProblemWithTripResource, + ReportProblemWithTripResourceWithRawResponse, + AsyncReportProblemWithTripResourceWithRawResponse, + ReportProblemWithTripResourceWithStreamingResponse, + AsyncReportProblemWithTripResourceWithStreamingResponse, +) __all__ = ["AgenciesWithCoverageResource", "AsyncAgenciesWithCoverageResource", "AgenciesWithCoverageResourceWithRawResponse", "AsyncAgenciesWithCoverageResourceWithRawResponse", "AgenciesWithCoverageResourceWithStreamingResponse", "AsyncAgenciesWithCoverageResourceWithStreamingResponse", "AgencyResource", "AsyncAgencyResource", "AgencyResourceWithRawResponse", "AsyncAgencyResourceWithRawResponse", "AgencyResourceWithStreamingResponse", "AsyncAgencyResourceWithStreamingResponse", "VehiclesForAgencyResource", "AsyncVehiclesForAgencyResource", "VehiclesForAgencyResourceWithRawResponse", "AsyncVehiclesForAgencyResourceWithRawResponse", "VehiclesForAgencyResourceWithStreamingResponse", "AsyncVehiclesForAgencyResourceWithStreamingResponse", "ConfigResource", "AsyncConfigResource", "ConfigResourceWithRawResponse", "AsyncConfigResourceWithRawResponse", "ConfigResourceWithStreamingResponse", "AsyncConfigResourceWithStreamingResponse", "CurrentTimeResource", "AsyncCurrentTimeResource", "CurrentTimeResourceWithRawResponse", "AsyncCurrentTimeResourceWithRawResponse", "CurrentTimeResourceWithStreamingResponse", "AsyncCurrentTimeResourceWithStreamingResponse", "StopsForLocationResource", "AsyncStopsForLocationResource", "StopsForLocationResourceWithRawResponse", "AsyncStopsForLocationResourceWithRawResponse", "StopsForLocationResourceWithStreamingResponse", "AsyncStopsForLocationResourceWithStreamingResponse", "StopsForRouteResource", "AsyncStopsForRouteResource", "StopsForRouteResourceWithRawResponse", "AsyncStopsForRouteResourceWithRawResponse", "StopsForRouteResourceWithStreamingResponse", "AsyncStopsForRouteResourceWithStreamingResponse", "StopsForAgencyResource", "AsyncStopsForAgencyResource", "StopsForAgencyResourceWithRawResponse", "AsyncStopsForAgencyResourceWithRawResponse", "StopsForAgencyResourceWithStreamingResponse", "AsyncStopsForAgencyResourceWithStreamingResponse", "StopResource", "AsyncStopResource", "StopResourceWithRawResponse", "AsyncStopResourceWithRawResponse", "StopResourceWithStreamingResponse", "AsyncStopResourceWithStreamingResponse", "StopIDsForAgencyResource", "AsyncStopIDsForAgencyResource", "StopIDsForAgencyResourceWithRawResponse", "AsyncStopIDsForAgencyResourceWithRawResponse", "StopIDsForAgencyResourceWithStreamingResponse", "AsyncStopIDsForAgencyResourceWithStreamingResponse", "ScheduleForStopResource", "AsyncScheduleForStopResource", "ScheduleForStopResourceWithRawResponse", "AsyncScheduleForStopResourceWithRawResponse", "ScheduleForStopResourceWithStreamingResponse", "AsyncScheduleForStopResourceWithStreamingResponse", "RouteResource", "AsyncRouteResource", "RouteResourceWithRawResponse", "AsyncRouteResourceWithRawResponse", "RouteResourceWithStreamingResponse", "AsyncRouteResourceWithStreamingResponse", "RouteIDsForAgencyResource", "AsyncRouteIDsForAgencyResource", "RouteIDsForAgencyResourceWithRawResponse", "AsyncRouteIDsForAgencyResourceWithRawResponse", "RouteIDsForAgencyResourceWithStreamingResponse", "AsyncRouteIDsForAgencyResourceWithStreamingResponse", "RoutesForLocationResource", "AsyncRoutesForLocationResource", "RoutesForLocationResourceWithRawResponse", "AsyncRoutesForLocationResourceWithRawResponse", "RoutesForLocationResourceWithStreamingResponse", "AsyncRoutesForLocationResourceWithStreamingResponse", "RoutesForAgencyResource", "AsyncRoutesForAgencyResource", "RoutesForAgencyResourceWithRawResponse", "AsyncRoutesForAgencyResourceWithRawResponse", "RoutesForAgencyResourceWithStreamingResponse", "AsyncRoutesForAgencyResourceWithStreamingResponse", "ScheduleForRouteResource", "AsyncScheduleForRouteResource", "ScheduleForRouteResourceWithRawResponse", "AsyncScheduleForRouteResourceWithRawResponse", "ScheduleForRouteResourceWithStreamingResponse", "AsyncScheduleForRouteResourceWithStreamingResponse", "ArrivalAndDepartureResource", "AsyncArrivalAndDepartureResource", "ArrivalAndDepartureResourceWithRawResponse", "AsyncArrivalAndDepartureResourceWithRawResponse", "ArrivalAndDepartureResourceWithStreamingResponse", "AsyncArrivalAndDepartureResourceWithStreamingResponse", "TripResource", "AsyncTripResource", "TripResourceWithRawResponse", "AsyncTripResourceWithRawResponse", "TripResourceWithStreamingResponse", "AsyncTripResourceWithStreamingResponse", "TripsForLocationResource", "AsyncTripsForLocationResource", "TripsForLocationResourceWithRawResponse", "AsyncTripsForLocationResourceWithRawResponse", "TripsForLocationResourceWithStreamingResponse", "AsyncTripsForLocationResourceWithStreamingResponse", "TripDetailsResource", "AsyncTripDetailsResource", "TripDetailsResourceWithRawResponse", "AsyncTripDetailsResourceWithRawResponse", "TripDetailsResourceWithStreamingResponse", "AsyncTripDetailsResourceWithStreamingResponse", "TripForVehicleResource", "AsyncTripForVehicleResource", "TripForVehicleResourceWithRawResponse", "AsyncTripForVehicleResourceWithRawResponse", "TripForVehicleResourceWithStreamingResponse", "AsyncTripForVehicleResourceWithStreamingResponse", "TripsForRouteResource", "AsyncTripsForRouteResource", "TripsForRouteResourceWithRawResponse", "AsyncTripsForRouteResourceWithRawResponse", "TripsForRouteResourceWithStreamingResponse", "AsyncTripsForRouteResourceWithStreamingResponse", "ReportProblemWithStopResource", "AsyncReportProblemWithStopResource", "ReportProblemWithStopResourceWithRawResponse", "AsyncReportProblemWithStopResourceWithRawResponse", "ReportProblemWithStopResourceWithStreamingResponse", "AsyncReportProblemWithStopResourceWithStreamingResponse", "ReportProblemWithTripResource", "AsyncReportProblemWithTripResource", "ReportProblemWithTripResourceWithRawResponse", "AsyncReportProblemWithTripResourceWithRawResponse", "ReportProblemWithTripResourceWithStreamingResponse", "AsyncReportProblemWithTripResourceWithStreamingResponse", "SearchForStopResource", "AsyncSearchForStopResource", "SearchForStopResourceWithRawResponse", "AsyncSearchForStopResourceWithRawResponse", "SearchForStopResourceWithStreamingResponse", "AsyncSearchForStopResourceWithStreamingResponse", "SearchForRouteResource", "AsyncSearchForRouteResource", "SearchForRouteResourceWithRawResponse", "AsyncSearchForRouteResourceWithRawResponse", "SearchForRouteResourceWithStreamingResponse", "AsyncSearchForRouteResourceWithStreamingResponse", "BlockResource", "AsyncBlockResource", "BlockResourceWithRawResponse", "AsyncBlockResourceWithRawResponse", "BlockResourceWithStreamingResponse", "AsyncBlockResourceWithStreamingResponse", "ShapeResource", "AsyncShapeResource", "ShapeResourceWithRawResponse", "AsyncShapeResourceWithRawResponse", "ShapeResourceWithStreamingResponse", "AsyncShapeResourceWithStreamingResponse"] \ No newline at end of file diff --git a/src/onebusaway/resources/agencies_with_coverage.py b/src/onebusaway/resources/agencies_with_coverage.py index 2fa6042..ad26d0d 100644 --- a/src/onebusaway/resources/agencies_with_coverage.py +++ b/src/onebusaway/resources/agencies_with_coverage.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.agencies_with_coverage_list_response import AgenciesWithCoverageListResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.agencies_with_coverage_list_response import AgenciesWithCoverageListResponse __all__ = ["AgenciesWithCoverageResource", "AsyncAgenciesWithCoverageResource"] diff --git a/src/onebusaway/resources/agency.py b/src/onebusaway/resources/agency.py index 2d8da26..90ac9ae 100644 --- a/src/onebusaway/resources/agency.py +++ b/src/onebusaway/resources/agency.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.agency_retrieve_response import AgencyRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.agency_retrieve_response import AgencyRetrieveResponse __all__ = ["AgencyResource", "AsyncAgencyResource"] diff --git a/src/onebusaway/resources/arrival_and_departure.py b/src/onebusaway/resources/arrival_and_departure.py index 7bba1a2..3daac58 100644 --- a/src/onebusaway/resources/arrival_and_departure.py +++ b/src/onebusaway/resources/arrival_and_departure.py @@ -2,32 +2,28 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from ..types.arrival_and_departure_list_response import ArrivalAndDepartureListResponse - from typing import Union - from datetime import datetime -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..types import arrival_and_departure_list_params, arrival_and_departure_retrieve_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 ..types import shared_params -from ..types import arrival_and_departure_retrieve_params -from ..types import arrival_and_departure_list_params +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.arrival_and_departure_list_response import ArrivalAndDepartureListResponse +from ..types.arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse __all__ = ["ArrivalAndDepartureResource", "AsyncArrivalAndDepartureResource"] diff --git a/src/onebusaway/resources/block.py b/src/onebusaway/resources/block.py index ec955eb..66e28a8 100644 --- a/src/onebusaway/resources/block.py +++ b/src/onebusaway/resources/block.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.block_retrieve_response import BlockRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.block_retrieve_response import BlockRetrieveResponse __all__ = ["BlockResource", "AsyncBlockResource"] diff --git a/src/onebusaway/resources/config.py b/src/onebusaway/resources/config.py index 29269b8..e52cb1e 100644 --- a/src/onebusaway/resources/config.py +++ b/src/onebusaway/resources/config.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.config_retrieve_response import ConfigRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.config_retrieve_response import ConfigRetrieveResponse __all__ = ["ConfigResource", "AsyncConfigResource"] diff --git a/src/onebusaway/resources/current_time.py b/src/onebusaway/resources/current_time.py index 5dfc9bc..b4b29d5 100644 --- a/src/onebusaway/resources/current_time.py +++ b/src/onebusaway/resources/current_time.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.current_time_retrieve_response import CurrentTimeRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.current_time_retrieve_response import CurrentTimeRetrieveResponse __all__ = ["CurrentTimeResource", "AsyncCurrentTimeResource"] diff --git a/src/onebusaway/resources/report_problem_with_stop.py b/src/onebusaway/resources/report_problem_with_stop.py index 34f4c72..0c26ff9 100644 --- a/src/onebusaway/resources/report_problem_with_stop.py +++ b/src/onebusaway/resources/report_problem_with_stop.py @@ -2,27 +2,26 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.shared.response_wrapper import ResponseWrapper - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - from typing_extensions import Literal -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params from ..types import report_problem_with_stop_retrieve_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.shared.response_wrapper import ResponseWrapper __all__ = ["ReportProblemWithStopResource", "AsyncReportProblemWithStopResource"] diff --git a/src/onebusaway/resources/report_problem_with_trip.py b/src/onebusaway/resources/report_problem_with_trip.py index 668f903..b2506b5 100644 --- a/src/onebusaway/resources/report_problem_with_trip.py +++ b/src/onebusaway/resources/report_problem_with_trip.py @@ -2,27 +2,26 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.shared.response_wrapper import ResponseWrapper - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - from typing_extensions import Literal -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params from ..types import report_problem_with_trip_retrieve_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.shared.response_wrapper import ResponseWrapper __all__ = ["ReportProblemWithTripResource", "AsyncReportProblemWithTripResource"] diff --git a/src/onebusaway/resources/route.py b/src/onebusaway/resources/route.py index 5b420e8..adc785a 100644 --- a/src/onebusaway/resources/route.py +++ b/src/onebusaway/resources/route.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.route_retrieve_response import RouteRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.route_retrieve_response import RouteRetrieveResponse __all__ = ["RouteResource", "AsyncRouteResource"] diff --git a/src/onebusaway/resources/route_ids_for_agency.py b/src/onebusaway/resources/route_ids_for_agency.py index 6f21ee9..7a33d59 100644 --- a/src/onebusaway/resources/route_ids_for_agency.py +++ b/src/onebusaway/resources/route_ids_for_agency.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.route_ids_for_agency_list_response import RouteIDsForAgencyListResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.route_ids_for_agency_list_response import RouteIDsForAgencyListResponse __all__ = ["RouteIDsForAgencyResource", "AsyncRouteIDsForAgencyResource"] diff --git a/src/onebusaway/resources/routes_for_agency.py b/src/onebusaway/resources/routes_for_agency.py index dd9306e..7f1b5ba 100644 --- a/src/onebusaway/resources/routes_for_agency.py +++ b/src/onebusaway/resources/routes_for_agency.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.routes_for_agency_list_response import RoutesForAgencyListResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.routes_for_agency_list_response import RoutesForAgencyListResponse __all__ = ["RoutesForAgencyResource", "AsyncRoutesForAgencyResource"] diff --git a/src/onebusaway/resources/routes_for_location.py b/src/onebusaway/resources/routes_for_location.py index 7743b84..f43e196 100644 --- a/src/onebusaway/resources/routes_for_location.py +++ b/src/onebusaway/resources/routes_for_location.py @@ -4,23 +4,22 @@ import httpx +from ..types import routes_for_location_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 ..types.routes_for_location_list_response import RoutesForLocationListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import routes_for_location_list_params +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.routes_for_location_list_response import RoutesForLocationListResponse __all__ = ["RoutesForLocationResource", "AsyncRoutesForLocationResource"] diff --git a/src/onebusaway/resources/schedule_for_route.py b/src/onebusaway/resources/schedule_for_route.py index 66c6a54..53a5303 100644 --- a/src/onebusaway/resources/schedule_for_route.py +++ b/src/onebusaway/resources/schedule_for_route.py @@ -2,29 +2,27 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from datetime import date - from typing import Union +from datetime import date -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params from ..types import schedule_for_route_retrieve_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.schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse __all__ = ["ScheduleForRouteResource", "AsyncScheduleForRouteResource"] diff --git a/src/onebusaway/resources/schedule_for_stop.py b/src/onebusaway/resources/schedule_for_stop.py index 5c71e9c..f1dd499 100644 --- a/src/onebusaway/resources/schedule_for_stop.py +++ b/src/onebusaway/resources/schedule_for_stop.py @@ -2,29 +2,27 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from datetime import date - from typing import Union +from datetime import date -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params from ..types import schedule_for_stop_retrieve_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.schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse __all__ = ["ScheduleForStopResource", "AsyncScheduleForStopResource"] diff --git a/src/onebusaway/resources/search_for_route.py b/src/onebusaway/resources/search_for_route.py index 37f7cb4..b4b3968 100644 --- a/src/onebusaway/resources/search_for_route.py +++ b/src/onebusaway/resources/search_for_route.py @@ -4,23 +4,22 @@ import httpx +from ..types import search_for_route_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 ..types.search_for_route_list_response import SearchForRouteListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import search_for_route_list_params +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.search_for_route_list_response import SearchForRouteListResponse __all__ = ["SearchForRouteResource", "AsyncSearchForRouteResource"] diff --git a/src/onebusaway/resources/search_for_stop.py b/src/onebusaway/resources/search_for_stop.py index a0320a3..2aba780 100644 --- a/src/onebusaway/resources/search_for_stop.py +++ b/src/onebusaway/resources/search_for_stop.py @@ -4,23 +4,22 @@ import httpx +from ..types import search_for_stop_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 ..types.search_for_stop_list_response import SearchForStopListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import search_for_stop_list_params +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.search_for_stop_list_response import SearchForStopListResponse __all__ = ["SearchForStopResource", "AsyncSearchForStopResource"] diff --git a/src/onebusaway/resources/shape.py b/src/onebusaway/resources/shape.py index ddc989f..7ae390c 100644 --- a/src/onebusaway/resources/shape.py +++ b/src/onebusaway/resources/shape.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.shape_retrieve_response import ShapeRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.shape_retrieve_response import ShapeRetrieveResponse __all__ = ["ShapeResource", "AsyncShapeResource"] diff --git a/src/onebusaway/resources/stop.py b/src/onebusaway/resources/stop.py index ba53226..5d1f22e 100644 --- a/src/onebusaway/resources/stop.py +++ b/src/onebusaway/resources/stop.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.stop_retrieve_response import StopRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.stop_retrieve_response import StopRetrieveResponse __all__ = ["StopResource", "AsyncStopResource"] diff --git a/src/onebusaway/resources/stop_ids_for_agency.py b/src/onebusaway/resources/stop_ids_for_agency.py index 55a39cd..5311acd 100644 --- a/src/onebusaway/resources/stop_ids_for_agency.py +++ b/src/onebusaway/resources/stop_ids_for_agency.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.stop_ids_for_agency_list_response import StopIDsForAgencyListResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.stop_ids_for_agency_list_response import StopIDsForAgencyListResponse __all__ = ["StopIDsForAgencyResource", "AsyncStopIDsForAgencyResource"] diff --git a/src/onebusaway/resources/stops_for_agency.py b/src/onebusaway/resources/stops_for_agency.py index 9e09796..8458527 100644 --- a/src/onebusaway/resources/stops_for_agency.py +++ b/src/onebusaway/resources/stops_for_agency.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.stops_for_agency_list_response import StopsForAgencyListResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.stops_for_agency_list_response import StopsForAgencyListResponse __all__ = ["StopsForAgencyResource", "AsyncStopsForAgencyResource"] diff --git a/src/onebusaway/resources/stops_for_location.py b/src/onebusaway/resources/stops_for_location.py index b589d59..3da78db 100644 --- a/src/onebusaway/resources/stops_for_location.py +++ b/src/onebusaway/resources/stops_for_location.py @@ -4,23 +4,22 @@ import httpx +from ..types import stops_for_location_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 ..types.stops_for_location_list_response import StopsForLocationListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import stops_for_location_list_params +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.stops_for_location_list_response import StopsForLocationListResponse __all__ = ["StopsForLocationResource", "AsyncStopsForLocationResource"] diff --git a/src/onebusaway/resources/stops_for_route.py b/src/onebusaway/resources/stops_for_route.py index 454b725..d4c1d80 100644 --- a/src/onebusaway/resources/stops_for_route.py +++ b/src/onebusaway/resources/stops_for_route.py @@ -4,23 +4,22 @@ import httpx +from ..types import stops_for_route_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 ..types.stops_for_route_list_response import StopsForRouteListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import stops_for_route_list_params +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.stops_for_route_list_response import StopsForRouteListResponse __all__ = ["StopsForRouteResource", "AsyncStopsForRouteResource"] diff --git a/src/onebusaway/resources/trip.py b/src/onebusaway/resources/trip.py index e5a9bb5..c570387 100644 --- a/src/onebusaway/resources/trip.py +++ b/src/onebusaway/resources/trip.py @@ -4,20 +4,17 @@ import httpx +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property - -from ..types.trip_retrieve_response import TripRetrieveResponse - -from .._base_client import make_request_options - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +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.trip_retrieve_response import TripRetrieveResponse __all__ = ["TripResource", "AsyncTripResource"] diff --git a/src/onebusaway/resources/trip_details.py b/src/onebusaway/resources/trip_details.py index cbbb057..4c4fe91 100644 --- a/src/onebusaway/resources/trip_details.py +++ b/src/onebusaway/resources/trip_details.py @@ -4,23 +4,22 @@ import httpx +from ..types import trip_detail_retrieve_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) from .._compat import cached_property - -from ..types.trip_detail_retrieve_response import TripDetailRetrieveResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import trip_detail_retrieve_params +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.trip_detail_retrieve_response import TripDetailRetrieveResponse __all__ = ["TripDetailsResource", "AsyncTripDetailsResource"] diff --git a/src/onebusaway/resources/trip_for_vehicle.py b/src/onebusaway/resources/trip_for_vehicle.py index 4327fc7..1a993a1 100644 --- a/src/onebusaway/resources/trip_for_vehicle.py +++ b/src/onebusaway/resources/trip_for_vehicle.py @@ -4,23 +4,22 @@ import httpx +from ..types import trip_for_vehicle_retrieve_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) from .._compat import cached_property - -from ..types.trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import trip_for_vehicle_retrieve_params +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.trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse __all__ = ["TripForVehicleResource", "AsyncTripForVehicleResource"] diff --git a/src/onebusaway/resources/trips_for_location.py b/src/onebusaway/resources/trips_for_location.py index ab7ba23..f3decf4 100644 --- a/src/onebusaway/resources/trips_for_location.py +++ b/src/onebusaway/resources/trips_for_location.py @@ -4,23 +4,22 @@ import httpx +from ..types import trips_for_location_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 ..types.trips_for_location_list_response import TripsForLocationListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import trips_for_location_list_params +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.trips_for_location_list_response import TripsForLocationListResponse __all__ = ["TripsForLocationResource", "AsyncTripsForLocationResource"] diff --git a/src/onebusaway/resources/trips_for_route.py b/src/onebusaway/resources/trips_for_route.py index 690ea60..129ab33 100644 --- a/src/onebusaway/resources/trips_for_route.py +++ b/src/onebusaway/resources/trips_for_route.py @@ -4,23 +4,22 @@ import httpx +from ..types import trips_for_route_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 ..types.trips_for_route_list_response import TripsForRouteListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import trips_for_route_list_params +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.trips_for_route_list_response import TripsForRouteListResponse __all__ = ["TripsForRouteResource", "AsyncTripsForRouteResource"] diff --git a/src/onebusaway/resources/vehicles_for_agency.py b/src/onebusaway/resources/vehicles_for_agency.py index 4126bb6..2cd39db 100644 --- a/src/onebusaway/resources/vehicles_for_agency.py +++ b/src/onebusaway/resources/vehicles_for_agency.py @@ -4,23 +4,22 @@ 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 ..types.vehicles_for_agency_list_response import VehiclesForAgencyListResponse - -from .._base_client import make_request_options - -from .._utils import maybe_transform, async_maybe_transform - -from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper, to_streamed_response_wrapper, async_to_streamed_response_wrapper - -import warnings -from typing_extensions import Literal, overload -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import vehicles_for_agency_list_params +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"] diff --git a/src/onebusaway/types/__init__.py b/src/onebusaway/types/__init__.py index 634ab48..a4bb996 100644 --- a/src/onebusaway/types/__init__.py +++ b/src/onebusaway/types/__init__.py @@ -3,46 +3,54 @@ from __future__ import annotations from .shared import References as References, ResponseWrapper as ResponseWrapper -from .agencies_with_coverage_list_response import AgenciesWithCoverageListResponse as AgenciesWithCoverageListResponse +from .stop_retrieve_response import StopRetrieveResponse as StopRetrieveResponse +from .trip_retrieve_response import TripRetrieveResponse as TripRetrieveResponse +from .block_retrieve_response import BlockRetrieveResponse as BlockRetrieveResponse +from .route_retrieve_response import RouteRetrieveResponse as RouteRetrieveResponse +from .shape_retrieve_response import ShapeRetrieveResponse as ShapeRetrieveResponse from .agency_retrieve_response import AgencyRetrieveResponse as AgencyRetrieveResponse -from .vehicles_for_agency_list_response import VehiclesForAgencyListResponse as VehiclesForAgencyListResponse -from .vehicles_for_agency_list_params import VehiclesForAgencyListParams as VehiclesForAgencyListParams from .config_retrieve_response import ConfigRetrieveResponse as ConfigRetrieveResponse -from .current_time_retrieve_response import CurrentTimeRetrieveResponse as CurrentTimeRetrieveResponse -from .stops_for_location_list_response import StopsForLocationListResponse as StopsForLocationListResponse -from .stops_for_location_list_params import StopsForLocationListParams as StopsForLocationListParams -from .stops_for_route_list_response import StopsForRouteListResponse as StopsForRouteListResponse +from .search_for_stop_list_params import SearchForStopListParams as SearchForStopListParams from .stops_for_route_list_params import StopsForRouteListParams as StopsForRouteListParams +from .trip_detail_retrieve_params import TripDetailRetrieveParams as TripDetailRetrieveParams +from .trips_for_route_list_params import TripsForRouteListParams as TripsForRouteListParams +from .search_for_route_list_params import SearchForRouteListParams as SearchForRouteListParams +from .search_for_stop_list_response import SearchForStopListResponse as SearchForStopListResponse +from .stops_for_route_list_response import StopsForRouteListResponse as StopsForRouteListResponse +from .trip_detail_retrieve_response import TripDetailRetrieveResponse as TripDetailRetrieveResponse +from .trips_for_route_list_response import TripsForRouteListResponse as TripsForRouteListResponse +from .current_time_retrieve_response import CurrentTimeRetrieveResponse as CurrentTimeRetrieveResponse +from .search_for_route_list_response import SearchForRouteListResponse as SearchForRouteListResponse from .stops_for_agency_list_response import StopsForAgencyListResponse as StopsForAgencyListResponse -from .stop_retrieve_response import StopRetrieveResponse as StopRetrieveResponse -from .stop_ids_for_agency_list_response import StopIDsForAgencyListResponse as StopIDsForAgencyListResponse -from .schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse as ScheduleForStopRetrieveResponse +from .stops_for_location_list_params import StopsForLocationListParams as StopsForLocationListParams +from .trips_for_location_list_params import TripsForLocationListParams as TripsForLocationListParams +from .routes_for_agency_list_response import RoutesForAgencyListResponse as RoutesForAgencyListResponse +from .routes_for_location_list_params import RoutesForLocationListParams as RoutesForLocationListParams +from .vehicles_for_agency_list_params import VehiclesForAgencyListParams as VehiclesForAgencyListParams +from .stops_for_location_list_response import StopsForLocationListResponse as StopsForLocationListResponse +from .trip_for_vehicle_retrieve_params import TripForVehicleRetrieveParams as TripForVehicleRetrieveParams +from .trips_for_location_list_response import TripsForLocationListResponse as TripsForLocationListResponse +from .arrival_and_departure_list_params import ArrivalAndDepartureListParams as ArrivalAndDepartureListParams +from .routes_for_location_list_response import RoutesForLocationListResponse as RoutesForLocationListResponse from .schedule_for_stop_retrieve_params import ScheduleForStopRetrieveParams as ScheduleForStopRetrieveParams -from .route_retrieve_response import RouteRetrieveResponse as RouteRetrieveResponse +from .stop_ids_for_agency_list_response import StopIDsForAgencyListResponse as StopIDsForAgencyListResponse +from .vehicles_for_agency_list_response import VehiclesForAgencyListResponse as VehiclesForAgencyListResponse from .route_ids_for_agency_list_response import RouteIDsForAgencyListResponse as RouteIDsForAgencyListResponse -from .routes_for_location_list_response import RoutesForLocationListResponse as RoutesForLocationListResponse -from .routes_for_location_list_params import RoutesForLocationListParams as RoutesForLocationListParams -from .routes_for_agency_list_response import RoutesForAgencyListResponse as RoutesForAgencyListResponse -from .schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse as ScheduleForRouteRetrieveResponse from .schedule_for_route_retrieve_params import ScheduleForRouteRetrieveParams as ScheduleForRouteRetrieveParams -from .arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse as ArrivalAndDepartureRetrieveResponse -from .arrival_and_departure_list_response import ArrivalAndDepartureListResponse as ArrivalAndDepartureListResponse -from .arrival_and_departure_retrieve_params import ArrivalAndDepartureRetrieveParams as ArrivalAndDepartureRetrieveParams -from .arrival_and_departure_list_params import ArrivalAndDepartureListParams as ArrivalAndDepartureListParams -from .trip_retrieve_response import TripRetrieveResponse as TripRetrieveResponse -from .trips_for_location_list_response import TripsForLocationListResponse as TripsForLocationListResponse -from .trips_for_location_list_params import TripsForLocationListParams as TripsForLocationListParams -from .trip_detail_retrieve_response import TripDetailRetrieveResponse as TripDetailRetrieveResponse -from .trip_detail_retrieve_params import TripDetailRetrieveParams as TripDetailRetrieveParams from .trip_for_vehicle_retrieve_response import TripForVehicleRetrieveResponse as TripForVehicleRetrieveResponse -from .trip_for_vehicle_retrieve_params import TripForVehicleRetrieveParams as TripForVehicleRetrieveParams -from .trips_for_route_list_response import TripsForRouteListResponse as TripsForRouteListResponse -from .trips_for_route_list_params import TripsForRouteListParams as TripsForRouteListParams -from .report_problem_with_stop_retrieve_params import ReportProblemWithStopRetrieveParams as ReportProblemWithStopRetrieveParams -from .report_problem_with_trip_retrieve_params import ReportProblemWithTripRetrieveParams as ReportProblemWithTripRetrieveParams -from .search_for_stop_list_response import SearchForStopListResponse as SearchForStopListResponse -from .search_for_stop_list_params import SearchForStopListParams as SearchForStopListParams -from .search_for_route_list_response import SearchForRouteListResponse as SearchForRouteListResponse -from .search_for_route_list_params import SearchForRouteListParams as SearchForRouteListParams -from .block_retrieve_response import BlockRetrieveResponse as BlockRetrieveResponse -from .shape_retrieve_response import ShapeRetrieveResponse as ShapeRetrieveResponse \ No newline at end of file +from .arrival_and_departure_list_response import ArrivalAndDepartureListResponse as ArrivalAndDepartureListResponse +from .schedule_for_stop_retrieve_response import ScheduleForStopRetrieveResponse as ScheduleForStopRetrieveResponse +from .agencies_with_coverage_list_response import AgenciesWithCoverageListResponse as AgenciesWithCoverageListResponse +from .schedule_for_route_retrieve_response import ScheduleForRouteRetrieveResponse as ScheduleForRouteRetrieveResponse +from .arrival_and_departure_retrieve_params import ( + ArrivalAndDepartureRetrieveParams as ArrivalAndDepartureRetrieveParams, +) +from .arrival_and_departure_retrieve_response import ( + ArrivalAndDepartureRetrieveResponse as ArrivalAndDepartureRetrieveResponse, +) +from .report_problem_with_stop_retrieve_params import ( + ReportProblemWithStopRetrieveParams as ReportProblemWithStopRetrieveParams, +) +from .report_problem_with_trip_retrieve_params import ( + ReportProblemWithTripRetrieveParams as ReportProblemWithTripRetrieveParams, +) diff --git a/src/onebusaway/types/agencies_with_coverage_list_response.py b/src/onebusaway/types/agencies_with_coverage_list_response.py index 4a5b82d..d972228 100644 --- a/src/onebusaway/types/agencies_with_coverage_list_response.py +++ b/src/onebusaway/types/agencies_with_coverage_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["AgenciesWithCoverageListResponse", "AgenciesWithCoverageListResponseData", "AgenciesWithCoverageListResponseDataList"] class AgenciesWithCoverageListResponseDataList(BaseModel): diff --git a/src/onebusaway/types/agency_retrieve_response.py b/src/onebusaway/types/agency_retrieve_response.py index 037963c..a599b3c 100644 --- a/src/onebusaway/types/agency_retrieve_response.py +++ b/src/onebusaway/types/agency_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["AgencyRetrieveResponse", "AgencyRetrieveResponseData", "AgencyRetrieveResponseDataEntry"] class AgencyRetrieveResponseDataEntry(BaseModel): diff --git a/src/onebusaway/types/arrival_and_departure_list_params.py b/src/onebusaway/types/arrival_and_departure_list_params.py index 8205ce6..79b8ee0 100644 --- a/src/onebusaway/types/arrival_and_departure_list_params.py +++ b/src/onebusaway/types/arrival_and_departure_list_params.py @@ -2,16 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - -from .._utils import PropertyInfo - from typing import Union - from datetime import datetime +from typing_extensions import Annotated, TypedDict -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes from .._utils import PropertyInfo __all__ = ["ArrivalAndDepartureListParams"] diff --git a/src/onebusaway/types/arrival_and_departure_list_response.py b/src/onebusaway/types/arrival_and_departure_list_response.py index 87f8287..65e555a 100644 --- a/src/onebusaway/types/arrival_and_departure_list_response.py +++ b/src/onebusaway/types/arrival_and_departure_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["ArrivalAndDepartureListResponse", "ArrivalAndDepartureListResponseData", "ArrivalAndDepartureListResponseDataEntry", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDeparture", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatus", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation", "ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusPosition"] class ArrivalAndDepartureListResponseDataEntryArrivalsAndDepartureTripStatusLastKnownLocation(BaseModel): diff --git a/src/onebusaway/types/arrival_and_departure_retrieve_params.py b/src/onebusaway/types/arrival_and_departure_retrieve_params.py index 1bddc55..ea44970 100644 --- a/src/onebusaway/types/arrival_and_departure_retrieve_params.py +++ b/src/onebusaway/types/arrival_and_departure_retrieve_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Required +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["ArrivalAndDepartureRetrieveParams"] class ArrivalAndDepartureRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/arrival_and_departure_retrieve_response.py b/src/onebusaway/types/arrival_and_departure_retrieve_response.py index 78120ae..5b73f1f 100644 --- a/src/onebusaway/types/arrival_and_departure_retrieve_response.py +++ b/src/onebusaway/types/arrival_and_departure_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["ArrivalAndDepartureRetrieveResponse", "ArrivalAndDepartureRetrieveResponseData", "ArrivalAndDepartureRetrieveResponseDataEntry", "ArrivalAndDepartureRetrieveResponseDataEntryTripStatus", "ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation", "ArrivalAndDepartureRetrieveResponseDataEntryTripStatusPosition"] class ArrivalAndDepartureRetrieveResponseDataEntryTripStatusLastKnownLocation(BaseModel): diff --git a/src/onebusaway/types/block_retrieve_response.py b/src/onebusaway/types/block_retrieve_response.py index ceb636d..abd6b68 100644 --- a/src/onebusaway/types/block_retrieve_response.py +++ b/src/onebusaway/types/block_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["BlockRetrieveResponse", "BlockRetrieveResponseData", "BlockRetrieveResponseDataEntry", "BlockRetrieveResponseDataEntryConfiguration", "BlockRetrieveResponseDataEntryConfigurationTrip", "BlockRetrieveResponseDataEntryConfigurationTripBlockStopTime", "BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime"] class BlockRetrieveResponseDataEntryConfigurationTripBlockStopTimeStopTime(BaseModel): diff --git a/src/onebusaway/types/config_retrieve_response.py b/src/onebusaway/types/config_retrieve_response.py index ace5e26..c81ccf4 100644 --- a/src/onebusaway/types/config_retrieve_response.py +++ b/src/onebusaway/types/config_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["ConfigRetrieveResponse", "ConfigRetrieveResponseData", "ConfigRetrieveResponseDataEntry", "ConfigRetrieveResponseDataEntryGitProperties"] class ConfigRetrieveResponseDataEntryGitProperties(BaseModel): diff --git a/src/onebusaway/types/current_time_retrieve_response.py b/src/onebusaway/types/current_time_retrieve_response.py index 80fc92a..90377e3 100644 --- a/src/onebusaway/types/current_time_retrieve_response.py +++ b/src/onebusaway/types/current_time_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["CurrentTimeRetrieveResponse", "CurrentTimeRetrieveResponseData", "CurrentTimeRetrieveResponseDataEntry"] class CurrentTimeRetrieveResponseDataEntry(BaseModel): diff --git a/src/onebusaway/types/report_problem_with_stop_retrieve_params.py b/src/onebusaway/types/report_problem_with_stop_retrieve_params.py index 6889773..559f5b8 100644 --- a/src/onebusaway/types/report_problem_with_stop_retrieve_params.py +++ b/src/onebusaway/types/report_problem_with_stop_retrieve_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Annotated +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["ReportProblemWithStopRetrieveParams"] class ReportProblemWithStopRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/report_problem_with_trip_retrieve_params.py b/src/onebusaway/types/report_problem_with_trip_retrieve_params.py index 94dc84e..03bd538 100644 --- a/src/onebusaway/types/report_problem_with_trip_retrieve_params.py +++ b/src/onebusaway/types/report_problem_with_trip_retrieve_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Annotated +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["ReportProblemWithTripRetrieveParams"] class ReportProblemWithTripRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/route_ids_for_agency_list_response.py b/src/onebusaway/types/route_ids_for_agency_list_response.py index 33d3468..520e852 100644 --- a/src/onebusaway/types/route_ids_for_agency_list_response.py +++ b/src/onebusaway/types/route_ids_for_agency_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["RouteIDsForAgencyListResponse", "RouteIDsForAgencyListResponseData"] class RouteIDsForAgencyListResponseData(BaseModel): diff --git a/src/onebusaway/types/route_retrieve_response.py b/src/onebusaway/types/route_retrieve_response.py index f5ca95a..aaf73fd 100644 --- a/src/onebusaway/types/route_retrieve_response.py +++ b/src/onebusaway/types/route_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["RouteRetrieveResponse", "RouteRetrieveResponseData", "RouteRetrieveResponseDataEntry"] class RouteRetrieveResponseDataEntry(BaseModel): diff --git a/src/onebusaway/types/routes_for_agency_list_response.py b/src/onebusaway/types/routes_for_agency_list_response.py index 949b1ff..ccca9a8 100644 --- a/src/onebusaway/types/routes_for_agency_list_response.py +++ b/src/onebusaway/types/routes_for_agency_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["RoutesForAgencyListResponse", "RoutesForAgencyListResponseData", "RoutesForAgencyListResponseDataList"] class RoutesForAgencyListResponseDataList(BaseModel): diff --git a/src/onebusaway/types/routes_for_location_list_params.py b/src/onebusaway/types/routes_for_location_list_params.py index cfabb8c..0773789 100644 --- a/src/onebusaway/types/routes_for_location_list_params.py +++ b/src/onebusaway/types/routes_for_location_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["RoutesForLocationListParams"] class RoutesForLocationListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/routes_for_location_list_response.py b/src/onebusaway/types/routes_for_location_list_response.py index b91a72c..d053900 100644 --- a/src/onebusaway/types/routes_for_location_list_response.py +++ b/src/onebusaway/types/routes_for_location_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["RoutesForLocationListResponse", "RoutesForLocationListResponseData", "RoutesForLocationListResponseDataList"] class RoutesForLocationListResponseDataList(BaseModel): diff --git a/src/onebusaway/types/schedule_for_route_retrieve_params.py b/src/onebusaway/types/schedule_for_route_retrieve_params.py index 6b5fa6b..e763ac0 100644 --- a/src/onebusaway/types/schedule_for_route_retrieve_params.py +++ b/src/onebusaway/types/schedule_for_route_retrieve_params.py @@ -3,17 +3,11 @@ from __future__ import annotations import datetime - -from typing_extensions import TypedDict, Annotated - from typing import Union +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["ScheduleForRouteRetrieveParams"] class ScheduleForRouteRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/schedule_for_route_retrieve_response.py b/src/onebusaway/types/schedule_for_route_retrieve_response.py index 31d487b..4f02939 100644 --- a/src/onebusaway/types/schedule_for_route_retrieve_response.py +++ b/src/onebusaway/types/schedule_for_route_retrieve_response.py @@ -1,14 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Optional -from .shared.response_wrapper import ResponseWrapper - -from typing_extensions import Literal from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.response_wrapper import ResponseWrapper + __all__ = ["ScheduleForRouteRetrieveResponse", "ScheduleForRouteRetrieveResponseData", "ScheduleForRouteRetrieveResponseDataEntry", "ScheduleForRouteRetrieveResponseDataEntryStop", "ScheduleForRouteRetrieveResponseDataEntryStopTripGrouping", "ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTime", "ScheduleForRouteRetrieveResponseDataEntryStopTripGroupingTripsWithStopTimeStopTime", "ScheduleForRouteRetrieveResponseDataEntryTrip"] class ScheduleForRouteRetrieveResponseDataEntryStop(BaseModel): diff --git a/src/onebusaway/types/schedule_for_stop_retrieve_params.py b/src/onebusaway/types/schedule_for_stop_retrieve_params.py index 2fe81c7..fcfed09 100644 --- a/src/onebusaway/types/schedule_for_stop_retrieve_params.py +++ b/src/onebusaway/types/schedule_for_stop_retrieve_params.py @@ -3,17 +3,11 @@ from __future__ import annotations import datetime - -from typing_extensions import TypedDict, Annotated - from typing import Union +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["ScheduleForStopRetrieveParams"] class ScheduleForStopRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/schedule_for_stop_retrieve_response.py b/src/onebusaway/types/schedule_for_stop_retrieve_response.py index afc6eb7..619e319 100644 --- a/src/onebusaway/types/schedule_for_stop_retrieve_response.py +++ b/src/onebusaway/types/schedule_for_stop_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["ScheduleForStopRetrieveResponse", "ScheduleForStopRetrieveResponseData", "ScheduleForStopRetrieveResponseDataEntry", "ScheduleForStopRetrieveResponseDataEntryStopRouteSchedule", "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionSchedule", "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime", "ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleFrequency"] class ScheduleForStopRetrieveResponseDataEntryStopRouteScheduleStopRouteDirectionScheduleScheduleStopTime(BaseModel): diff --git a/src/onebusaway/types/search_for_route_list_params.py b/src/onebusaway/types/search_for_route_list_params.py index 979587c..885eb3e 100755 --- a/src/onebusaway/types/search_for_route_list_params.py +++ b/src/onebusaway/types/search_for_route_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SearchForRouteListParams"] class SearchForRouteListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/search_for_route_list_response.py b/src/onebusaway/types/search_for_route_list_response.py index 6c8e481..6d4b6d8 100755 --- a/src/onebusaway/types/search_for_route_list_response.py +++ b/src/onebusaway/types/search_for_route_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["SearchForRouteListResponse", "SearchForRouteListResponseData", "SearchForRouteListResponseDataList"] class SearchForRouteListResponseDataList(BaseModel): diff --git a/src/onebusaway/types/search_for_stop_list_params.py b/src/onebusaway/types/search_for_stop_list_params.py index 9cf8c67..42ba10a 100755 --- a/src/onebusaway/types/search_for_stop_list_params.py +++ b/src/onebusaway/types/search_for_stop_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SearchForStopListParams"] class SearchForStopListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/search_for_stop_list_response.py b/src/onebusaway/types/search_for_stop_list_response.py index 1b643cb..22d28a0 100755 --- a/src/onebusaway/types/search_for_stop_list_response.py +++ b/src/onebusaway/types/search_for_stop_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["SearchForStopListResponse", "SearchForStopListResponseData", "SearchForStopListResponseDataList"] class SearchForStopListResponseDataList(BaseModel): diff --git a/src/onebusaway/types/shape_retrieve_response.py b/src/onebusaway/types/shape_retrieve_response.py index d4e9b0d..e331899 100644 --- a/src/onebusaway/types/shape_retrieve_response.py +++ b/src/onebusaway/types/shape_retrieve_response.py @@ -1,16 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["ShapeRetrieveResponse", "ShapeRetrieveResponseData", "ShapeRetrieveResponseDataEntry"] class ShapeRetrieveResponseDataEntry(BaseModel): diff --git a/src/onebusaway/types/shared/references.py b/src/onebusaway/types/shared/references.py index bed6854..4eca75f 100644 --- a/src/onebusaway/types/shared/references.py +++ b/src/onebusaway/types/shared/references.py @@ -1,15 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from typing import Optional, List - -from typing_extensions import Literal - +from typing import List, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo +from ..._models import BaseModel + __all__ = ["References", "Agency", "Route", "Situation", "SituationActiveWindow", "SituationAllAffect", "SituationConsequence", "SituationConsequenceConditionDetails", "SituationConsequenceConditionDetailsDiversionPath", "SituationDescription", "SituationPublicationWindow", "SituationSummary", "SituationURL", "Stop", "StopTime", "Trip"] class Agency(BaseModel): diff --git a/src/onebusaway/types/shared/response_wrapper.py b/src/onebusaway/types/shared/response_wrapper.py index fcaf06c..77dae24 100644 --- a/src/onebusaway/types/shared/response_wrapper.py +++ b/src/onebusaway/types/shared/response_wrapper.py @@ -1,11 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from typing_extensions import Literal from pydantic import Field as FieldInfo +from ..._models import BaseModel + __all__ = ["ResponseWrapper"] class ResponseWrapper(BaseModel): diff --git a/src/onebusaway/types/stop_ids_for_agency_list_response.py b/src/onebusaway/types/stop_ids_for_agency_list_response.py index 48489cd..bd9c2fe 100644 --- a/src/onebusaway/types/stop_ids_for_agency_list_response.py +++ b/src/onebusaway/types/stop_ids_for_agency_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["StopIDsForAgencyListResponse", "StopIDsForAgencyListResponseData"] class StopIDsForAgencyListResponseData(BaseModel): diff --git a/src/onebusaway/types/stop_retrieve_response.py b/src/onebusaway/types/stop_retrieve_response.py index eb259c5..49c171b 100644 --- a/src/onebusaway/types/stop_retrieve_response.py +++ b/src/onebusaway/types/stop_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["StopRetrieveResponse", "StopRetrieveResponseData", "StopRetrieveResponseDataEntry"] class StopRetrieveResponseDataEntry(BaseModel): diff --git a/src/onebusaway/types/stops_for_agency_list_response.py b/src/onebusaway/types/stops_for_agency_list_response.py index bf131b5..467880b 100644 --- a/src/onebusaway/types/stops_for_agency_list_response.py +++ b/src/onebusaway/types/stops_for_agency_list_response.py @@ -1,15 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Optional -from .shared.response_wrapper import ResponseWrapper +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .shared.response_wrapper import ResponseWrapper __all__ = ["StopsForAgencyListResponse", "StopsForAgencyListResponseList"] diff --git a/src/onebusaway/types/stops_for_location_list_params.py b/src/onebusaway/types/stops_for_location_list_params.py index 6137ce8..4b672c6 100644 --- a/src/onebusaway/types/stops_for_location_list_params.py +++ b/src/onebusaway/types/stops_for_location_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["StopsForLocationListParams"] class StopsForLocationListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/stops_for_location_list_response.py b/src/onebusaway/types/stops_for_location_list_response.py index f9d4fca..c2404b9 100644 --- a/src/onebusaway/types/stops_for_location_list_response.py +++ b/src/onebusaway/types/stops_for_location_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["StopsForLocationListResponse", "StopsForLocationListResponseData", "StopsForLocationListResponseDataList"] class StopsForLocationListResponseDataList(BaseModel): diff --git a/src/onebusaway/types/stops_for_route_list_params.py b/src/onebusaway/types/stops_for_route_list_params.py index cad8058..c55ae9d 100644 --- a/src/onebusaway/types/stops_for_route_list_params.py +++ b/src/onebusaway/types/stops_for_route_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["StopsForRouteListParams"] class StopsForRouteListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/stops_for_route_list_response.py b/src/onebusaway/types/stops_for_route_list_response.py index cd346b6..4528bac 100644 --- a/src/onebusaway/types/stops_for_route_list_response.py +++ b/src/onebusaway/types/stops_for_route_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["StopsForRouteListResponse", "StopsForRouteListResponseData", "StopsForRouteListResponseDataEntry", "StopsForRouteListResponseDataEntryPolyline", "StopsForRouteListResponseDataEntryStopGrouping", "StopsForRouteListResponseDataEntryStopGroupingName", "StopsForRouteListResponseDataEntryStopGroupingPolyline"] class StopsForRouteListResponseDataEntryPolyline(BaseModel): diff --git a/src/onebusaway/types/trip_detail_retrieve_params.py b/src/onebusaway/types/trip_detail_retrieve_params.py index 658d0a6..42a37db 100644 --- a/src/onebusaway/types/trip_detail_retrieve_params.py +++ b/src/onebusaway/types/trip_detail_retrieve_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["TripDetailRetrieveParams"] class TripDetailRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/trip_detail_retrieve_response.py b/src/onebusaway/types/trip_detail_retrieve_response.py index 1846d1e..99d8166 100644 --- a/src/onebusaway/types/trip_detail_retrieve_response.py +++ b/src/onebusaway/types/trip_detail_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["TripDetailRetrieveResponse", "TripDetailRetrieveResponseData", "TripDetailRetrieveResponseDataEntry", "TripDetailRetrieveResponseDataEntrySchedule", "TripDetailRetrieveResponseDataEntryScheduleStopTime", "TripDetailRetrieveResponseDataEntryStatus", "TripDetailRetrieveResponseDataEntryStatusLastKnownLocation", "TripDetailRetrieveResponseDataEntryStatusPosition"] class TripDetailRetrieveResponseDataEntryScheduleStopTime(BaseModel): diff --git a/src/onebusaway/types/trip_for_vehicle_retrieve_params.py b/src/onebusaway/types/trip_for_vehicle_retrieve_params.py index 325521b..7cf1876 100644 --- a/src/onebusaway/types/trip_for_vehicle_retrieve_params.py +++ b/src/onebusaway/types/trip_for_vehicle_retrieve_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["TripForVehicleRetrieveParams"] class TripForVehicleRetrieveParams(TypedDict, total=False): diff --git a/src/onebusaway/types/trip_for_vehicle_retrieve_response.py b/src/onebusaway/types/trip_for_vehicle_retrieve_response.py index fab9984..cecc593 100644 --- a/src/onebusaway/types/trip_for_vehicle_retrieve_response.py +++ b/src/onebusaway/types/trip_for_vehicle_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["TripForVehicleRetrieveResponse", "TripForVehicleRetrieveResponseData", "TripForVehicleRetrieveResponseDataEntry", "TripForVehicleRetrieveResponseDataEntrySchedule", "TripForVehicleRetrieveResponseDataEntryScheduleStopTime", "TripForVehicleRetrieveResponseDataEntryStatus", "TripForVehicleRetrieveResponseDataEntryStatusLastKnownLocation", "TripForVehicleRetrieveResponseDataEntryStatusPosition"] class TripForVehicleRetrieveResponseDataEntryScheduleStopTime(BaseModel): diff --git a/src/onebusaway/types/trip_retrieve_response.py b/src/onebusaway/types/trip_retrieve_response.py index 37fbab7..7c3c1bc 100644 --- a/src/onebusaway/types/trip_retrieve_response.py +++ b/src/onebusaway/types/trip_retrieve_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional -from .shared.references import References +from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.references import References from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["TripRetrieveResponse", "TripRetrieveResponseData", "TripRetrieveResponseDataEntry"] class TripRetrieveResponseDataEntry(BaseModel): diff --git a/src/onebusaway/types/trips_for_location_list_params.py b/src/onebusaway/types/trips_for_location_list_params.py index 6962798..5c50ae9 100644 --- a/src/onebusaway/types/trips_for_location_list_params.py +++ b/src/onebusaway/types/trips_for_location_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["TripsForLocationListParams"] class TripsForLocationListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/trips_for_location_list_response.py b/src/onebusaway/types/trips_for_location_list_response.py index 5e3c087..01b2233 100644 --- a/src/onebusaway/types/trips_for_location_list_response.py +++ b/src/onebusaway/types/trips_for_location_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["TripsForLocationListResponse", "TripsForLocationListResponseData", "TripsForLocationListResponseDataList", "TripsForLocationListResponseDataListSchedule", "TripsForLocationListResponseDataListScheduleStopTime", "TripsForLocationListResponseDataListStatus", "TripsForLocationListResponseDataListStatusLastKnownLocation", "TripsForLocationListResponseDataListStatusPosition"] class TripsForLocationListResponseDataListScheduleStopTime(BaseModel): diff --git a/src/onebusaway/types/trips_for_route_list_params.py b/src/onebusaway/types/trips_for_route_list_params.py index d3bf43f..e1dbb72 100644 --- a/src/onebusaway/types/trips_for_route_list_params.py +++ b/src/onebusaway/types/trips_for_route_list_params.py @@ -2,14 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["TripsForRouteListParams"] class TripsForRouteListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/trips_for_route_list_response.py b/src/onebusaway/types/trips_for_route_list_response.py index efb7b6e..3e33f85 100644 --- a/src/onebusaway/types/trips_for_route_list_response.py +++ b/src/onebusaway/types/trips_for_route_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["TripsForRouteListResponse", "TripsForRouteListResponseData", "TripsForRouteListResponseDataList", "TripsForRouteListResponseDataListSchedule", "TripsForRouteListResponseDataListScheduleStopTime", "TripsForRouteListResponseDataListStatus", "TripsForRouteListResponseDataListStatusLastKnownLocation", "TripsForRouteListResponseDataListStatusPosition"] class TripsForRouteListResponseDataListScheduleStopTime(BaseModel): diff --git a/src/onebusaway/types/vehicles_for_agency_list_params.py b/src/onebusaway/types/vehicles_for_agency_list_params.py index 05937c8..808fd7a 100644 --- a/src/onebusaway/types/vehicles_for_agency_list_params.py +++ b/src/onebusaway/types/vehicles_for_agency_list_params.py @@ -4,10 +4,6 @@ from typing_extensions import TypedDict -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["VehiclesForAgencyListParams"] class VehiclesForAgencyListParams(TypedDict, total=False): diff --git a/src/onebusaway/types/vehicles_for_agency_list_response.py b/src/onebusaway/types/vehicles_for_agency_list_response.py index cd8ac35..05d11de 100644 --- a/src/onebusaway/types/vehicles_for_agency_list_response.py +++ b/src/onebusaway/types/vehicles_for_agency_list_response.py @@ -1,16 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel +from typing import List, Optional -from typing import Optional, List +from pydantic import Field as FieldInfo +from .._models import BaseModel from .shared.references import References - from .shared.response_wrapper import ResponseWrapper -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["VehiclesForAgencyListResponse", "VehiclesForAgencyListResponseData", "VehiclesForAgencyListResponseDataList", "VehiclesForAgencyListResponseDataListLocation", "VehiclesForAgencyListResponseDataListTripStatus", "VehiclesForAgencyListResponseDataListTripStatusLastKnownLocation", "VehiclesForAgencyListResponseDataListTripStatusPosition"] class VehiclesForAgencyListResponseDataListLocation(BaseModel): diff --git a/tests/api_resources/test_agencies_with_coverage.py b/tests/api_resources/test_agencies_with_coverage.py index 5b49882..31c169e 100644 --- a/tests/api_resources/test_agencies_with_coverage.py +++ b/tests/api_resources/test_agencies_with_coverage.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import AgenciesWithCoverageListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import AgenciesWithCoverageListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_agency.py b/tests/api_resources/test_agency.py index bdfd649..a991b01 100644 --- a/tests/api_resources/test_agency.py +++ b/tests/api_resources/test_agency.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import AgencyRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import AgencyRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_arrival_and_departure.py b/tests/api_resources/test_arrival_and_departure.py index f371046..6af856f 100644 --- a/tests/api_resources/test_arrival_and_departure.py +++ b/tests/api_resources/test_arrival_and_departure.py @@ -2,22 +2,17 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import ArrivalAndDepartureRetrieveResponse, ArrivalAndDepartureListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import arrival_and_departure_retrieve_params -from onebusaway.types import arrival_and_departure_list_params -from onebusaway._utils import parse_datetime +from onebusaway.types import ( + ArrivalAndDepartureListResponse, + ArrivalAndDepartureRetrieveResponse, +) from onebusaway._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_block.py b/tests/api_resources/test_block.py index 0adb879..51df2aa 100644 --- a/tests/api_resources/test_block.py +++ b/tests/api_resources/test_block.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import BlockRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import BlockRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_config.py b/tests/api_resources/test_config.py index 5692c29..c69064e 100644 --- a/tests/api_resources/test_config.py +++ b/tests/api_resources/test_config.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import ConfigRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import ConfigRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_current_time.py b/tests/api_resources/test_current_time.py index a43fb0c..ff80f9e 100644 --- a/tests/api_resources/test_current_time.py +++ b/tests/api_resources/test_current_time.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import CurrentTimeRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import CurrentTimeRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_report_problem_with_stop.py b/tests/api_resources/test_report_problem_with_stop.py index f7a4f54..4233004 100644 --- a/tests/api_resources/test_report_problem_with_stop.py +++ b/tests/api_resources/test_report_problem_with_stop.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types.shared import ResponseWrapper - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import report_problem_with_stop_retrieve_params +from onebusaway.types.shared import ResponseWrapper base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_report_problem_with_trip.py b/tests/api_resources/test_report_problem_with_trip.py index 8b23611..c92d0cf 100644 --- a/tests/api_resources/test_report_problem_with_trip.py +++ b/tests/api_resources/test_report_problem_with_trip.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types.shared import ResponseWrapper - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import report_problem_with_trip_retrieve_params +from onebusaway.types.shared import ResponseWrapper base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_route.py b/tests/api_resources/test_route.py index b27ce01..b046f5b 100644 --- a/tests/api_resources/test_route.py +++ b/tests/api_resources/test_route.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import RouteRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import RouteRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_route_ids_for_agency.py b/tests/api_resources/test_route_ids_for_agency.py index f8ded3c..586c885 100644 --- a/tests/api_resources/test_route_ids_for_agency.py +++ b/tests/api_resources/test_route_ids_for_agency.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import RouteIDsForAgencyListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import RouteIDsForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_routes_for_agency.py b/tests/api_resources/test_routes_for_agency.py index 225d1f2..3c5e3d1 100644 --- a/tests/api_resources/test_routes_for_agency.py +++ b/tests/api_resources/test_routes_for_agency.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import RoutesForAgencyListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import RoutesForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_routes_for_location.py b/tests/api_resources/test_routes_for_location.py index 35716ba..76683a4 100644 --- a/tests/api_resources/test_routes_for_location.py +++ b/tests/api_resources/test_routes_for_location.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import RoutesForLocationListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import routes_for_location_list_params +from onebusaway.types import RoutesForLocationListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_schedule_for_route.py b/tests/api_resources/test_schedule_for_route.py index 4dd1a1d..2fee578 100644 --- a/tests/api_resources/test_schedule_for_route.py +++ b/tests/api_resources/test_schedule_for_route.py @@ -2,21 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import ScheduleForRouteRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import schedule_for_route_retrieve_params -from onebusaway._utils import parse_date +from onebusaway.types import ScheduleForRouteRetrieveResponse from onebusaway._utils import parse_date base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_schedule_for_stop.py b/tests/api_resources/test_schedule_for_stop.py index ad705cf..beb7aea 100644 --- a/tests/api_resources/test_schedule_for_stop.py +++ b/tests/api_resources/test_schedule_for_stop.py @@ -2,21 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import ScheduleForStopRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import schedule_for_stop_retrieve_params -from onebusaway._utils import parse_date +from onebusaway.types import ScheduleForStopRetrieveResponse from onebusaway._utils import parse_date base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_search_for_route.py b/tests/api_resources/test_search_for_route.py index 220353c..0726471 100644 --- a/tests/api_resources/test_search_for_route.py +++ b/tests/api_resources/test_search_for_route.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import SearchForRouteListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import search_for_route_list_params +from onebusaway.types import SearchForRouteListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_search_for_stop.py b/tests/api_resources/test_search_for_stop.py index aa138a1..8ff8b57 100644 --- a/tests/api_resources/test_search_for_stop.py +++ b/tests/api_resources/test_search_for_stop.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import SearchForStopListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import search_for_stop_list_params +from onebusaway.types import SearchForStopListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_shape.py b/tests/api_resources/test_shape.py index 4ef8019..adfbf9f 100644 --- a/tests/api_resources/test_shape.py +++ b/tests/api_resources/test_shape.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import ShapeRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import ShapeRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_stop.py b/tests/api_resources/test_stop.py index eacc5ad..dc113e5 100644 --- a/tests/api_resources/test_stop.py +++ b/tests/api_resources/test_stop.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import StopRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import StopRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_stop_ids_for_agency.py b/tests/api_resources/test_stop_ids_for_agency.py index 56c9414..9a060b7 100644 --- a/tests/api_resources/test_stop_ids_for_agency.py +++ b/tests/api_resources/test_stop_ids_for_agency.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import StopIDsForAgencyListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import StopIDsForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_stops_for_agency.py b/tests/api_resources/test_stops_for_agency.py index 71230d1..ce3acaf 100644 --- a/tests/api_resources/test_stops_for_agency.py +++ b/tests/api_resources/test_stops_for_agency.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import StopsForAgencyListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import StopsForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_stops_for_location.py b/tests/api_resources/test_stops_for_location.py index 520184f..91440a5 100644 --- a/tests/api_resources/test_stops_for_location.py +++ b/tests/api_resources/test_stops_for_location.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import StopsForLocationListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import stops_for_location_list_params +from onebusaway.types import StopsForLocationListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_stops_for_route.py b/tests/api_resources/test_stops_for_route.py index 4e6787a..c2381e7 100644 --- a/tests/api_resources/test_stops_for_route.py +++ b/tests/api_resources/test_stops_for_route.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import StopsForRouteListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import stops_for_route_list_params +from onebusaway.types import StopsForRouteListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_trip.py b/tests/api_resources/test_trip.py index 7c39766..c7eeb0e 100644 --- a/tests/api_resources/test_trip.py +++ b/tests/api_resources/test_trip.py @@ -2,19 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import TripRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type +from onebusaway.types import TripRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_trip_details.py b/tests/api_resources/test_trip_details.py index 0db299e..41a8789 100644 --- a/tests/api_resources/test_trip_details.py +++ b/tests/api_resources/test_trip_details.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import TripDetailRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import trip_detail_retrieve_params +from onebusaway.types import TripDetailRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_trip_for_vehicle.py b/tests/api_resources/test_trip_for_vehicle.py index 0a2d84f..c574a5b 100644 --- a/tests/api_resources/test_trip_for_vehicle.py +++ b/tests/api_resources/test_trip_for_vehicle.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import TripForVehicleRetrieveResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import trip_for_vehicle_retrieve_params +from onebusaway.types import TripForVehicleRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_trips_for_location.py b/tests/api_resources/test_trips_for_location.py index c3dbfa3..75fc984 100644 --- a/tests/api_resources/test_trips_for_location.py +++ b/tests/api_resources/test_trips_for_location.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import TripsForLocationListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import trips_for_location_list_params +from onebusaway.types import TripsForLocationListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_trips_for_route.py b/tests/api_resources/test_trips_for_route.py index b301f38..ce2af07 100644 --- a/tests/api_resources/test_trips_for_route.py +++ b/tests/api_resources/test_trips_for_route.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import TripsForRouteListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import trips_for_route_list_params +from onebusaway.types import TripsForRouteListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_vehicles_for_agency.py b/tests/api_resources/test_vehicles_for_agency.py index 4d2e659..078450d 100644 --- a/tests/api_resources/test_vehicles_for_agency.py +++ b/tests/api_resources/test_vehicles_for_agency.py @@ -2,20 +2,14 @@ from __future__ import annotations -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway.types import VehiclesForAgencyListResponse - -from typing import cast, Any - import os +from typing import Any, cast + import pytest -import httpx -from typing_extensions import get_args -from respx import MockRouter + from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK from tests.utils import assert_matches_type -from onebusaway.types import vehicles_for_agency_list_params +from onebusaway.types import VehiclesForAgencyListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/conftest.py b/tests/conftest.py index 763d201..cdab733 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,14 +1,12 @@ from __future__ import annotations +import os import logging -from typing import Iterator +from typing import TYPE_CHECKING, Iterator, AsyncIterator import pytest from pytest_asyncio import is_async_test -import os -from typing import TYPE_CHECKING, AsyncIterator - from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK if TYPE_CHECKING: diff --git a/tests/test_client.py b/tests/test_client.py index 32505e6..0d603b3 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -2,47 +2,38 @@ from __future__ import annotations -import httpx - -import subprocess - +import gc +import os import sys - +import json import time - -from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK - -from onebusaway._exceptions import APITimeoutError, APIStatusError, APIResponseValidationError - -from typing import cast, Any, Union - -from pydantic import ValidationError - -from typing_extensions import Literal - -from textwrap import dedent - import asyncio -import gc import inspect -import json -import os +import subprocess import tracemalloc import urllib.parse +from typing import Any, Union, cast +from textwrap import dedent from unittest import mock +from typing_extensions import Literal import httpx import pytest from respx import MockRouter +from pydantic import ValidationError from onebusaway import OnebusawaySDK, AsyncOnebusawaySDK, APIResponseValidationError -from onebusaway._models import FinalRequestOptions, BaseModel -from onebusaway._types import NOT_GIVEN, Headers, NotGiven, Query, Body, Timeout, Omit -from onebusaway._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, RequestOptions, make_request_options -from onebusaway._streaming import Stream, AsyncStream -from onebusaway._constants import RAW_RESPONSE_HEADER -from onebusaway._response import APIResponse, AsyncAPIResponse from onebusaway._types import Omit +from onebusaway._models import BaseModel, FinalRequestOptions +from onebusaway._constants import RAW_RESPONSE_HEADER +from onebusaway._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError +from onebusaway._base_client import ( + DEFAULT_TIMEOUT, + HTTPX_DEFAULT_TIMEOUT, + BaseClient, + make_request_options, +) + from .utils import update_env base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")