-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): OpenAPI spec update via Stainless API (#56)
- Loading branch information
1 parent
9adae4d
commit 1882cdc
Showing
8 changed files
with
321 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 18 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-6579f942268e5d39432a6348fbf1eb5850e71235e72797ed78894a3329fbb25e.yml | ||
configured_endpoints: 19 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-321de3032fb9e1dd70c112bc3f172d12a36692f8fcfa2e8aec47ab6a85ca37e2.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from __future__ import annotations | ||
|
||
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"] | ||
|
||
|
||
class RoutesForAgencyResource(SyncAPIResource): | ||
@cached_property | ||
def with_raw_response(self) -> RoutesForAgencyResourceWithRawResponse: | ||
return RoutesForAgencyResourceWithRawResponse(self) | ||
|
||
@cached_property | ||
def with_streaming_response(self) -> RoutesForAgencyResourceWithStreamingResponse: | ||
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: | ||
""" | ||
Retrieve the list of all routes for a particular agency by id | ||
Args: | ||
extra_headers: Send extra headers | ||
extra_query: Add additional query parameters to the request | ||
extra_body: Add additional JSON properties to the request | ||
timeout: Override the client-level default timeout for this request, in seconds | ||
""" | ||
if not agency_id: | ||
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}") | ||
return self._get( | ||
f"/api/where/routes-for-agency/agencyID.json", | ||
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: | ||
return AsyncRoutesForAgencyResourceWithRawResponse(self) | ||
|
||
@cached_property | ||
def with_streaming_response(self) -> AsyncRoutesForAgencyResourceWithStreamingResponse: | ||
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: | ||
""" | ||
Retrieve the list of all routes for a particular agency by id | ||
Args: | ||
extra_headers: Send extra headers | ||
extra_query: Add additional query parameters to the request | ||
extra_body: Add additional JSON properties to the request | ||
timeout: Override the client-level default timeout for this request, in seconds | ||
""" | ||
if not agency_id: | ||
raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}") | ||
return await self._get( | ||
f"/api/where/routes-for-agency/agencyID.json", | ||
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 | ||
|
||
self.list = to_raw_response_wrapper( | ||
routes_for_agency.list, | ||
) | ||
|
||
|
||
class AsyncRoutesForAgencyResourceWithRawResponse: | ||
def __init__(self, routes_for_agency: AsyncRoutesForAgencyResource) -> None: | ||
self._routes_for_agency = routes_for_agency | ||
|
||
self.list = async_to_raw_response_wrapper( | ||
routes_for_agency.list, | ||
) | ||
|
||
|
||
class RoutesForAgencyResourceWithStreamingResponse: | ||
def __init__(self, routes_for_agency: RoutesForAgencyResource) -> None: | ||
self._routes_for_agency = routes_for_agency | ||
|
||
self.list = to_streamed_response_wrapper( | ||
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from typing import List, Optional | ||
|
||
from pydantic import Field as FieldInfo | ||
|
||
from .._models import BaseModel | ||
from .shared.references import References | ||
from .shared.response_wrapper import ResponseWrapper | ||
|
||
__all__ = ["RoutesForAgencyListResponse", "RoutesForAgencyListResponseData", "RoutesForAgencyListResponseDataList"] | ||
|
||
|
||
class RoutesForAgencyListResponseDataList(BaseModel): | ||
id: Optional[str] = None | ||
|
||
agency_id: Optional[str] = FieldInfo(alias="agencyId", default=None) | ||
|
||
color: Optional[str] = None | ||
|
||
description: Optional[str] = None | ||
|
||
long_name: Optional[str] = FieldInfo(alias="longName", default=None) | ||
|
||
null_safe_short_name: Optional[str] = FieldInfo(alias="nullSafeShortName", default=None) | ||
|
||
short_name: Optional[str] = FieldInfo(alias="shortName", default=None) | ||
|
||
text_color: Optional[str] = FieldInfo(alias="textColor", default=None) | ||
|
||
type: Optional[int] = None | ||
|
||
url: Optional[str] = None | ||
|
||
|
||
class RoutesForAgencyListResponseData(BaseModel): | ||
limit_exceeded: bool = FieldInfo(alias="limitExceeded") | ||
|
||
list: List[RoutesForAgencyListResponseDataList] | ||
|
||
references: References | ||
|
||
|
||
class RoutesForAgencyListResponse(ResponseWrapper): | ||
data: RoutesForAgencyListResponseData |
Oops, something went wrong.