Skip to content

Commit d93e82a

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#65)
1 parent d472196 commit d93e82a

File tree

8 files changed

+395
-2
lines changed

8 files changed

+395
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-681949f64ed7ba8d43a08daba3e5dfcee447cecc48a0a03fcf2aedef3b656641.yml
1+
configured_endpoints: 22
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-5140605804e4ff2f23c4401b0747441e07daeefb864695a4389e734b83eb07e8.yml

api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,9 @@ from onebusaway.types import TripForVehicleRetrieveResponse
244244
Methods:
245245

246246
- <code title="get /api/where/trip-for-vehicle/{vehicleID}.json">client.trip_for_vehicle.<a href="./src/onebusaway/resources/trip_for_vehicle.py">retrieve</a>(vehicle_id, \*\*<a href="src/onebusaway/types/trip_for_vehicle_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/trip_for_vehicle_retrieve_response.py">TripForVehicleRetrieveResponse</a></code>
247+
248+
# ReportProblemWithStop
249+
250+
Methods:
251+
252+
- <code title="get /api/where/report-problem-with-stop/{stopID}.json">client.report_problem_with_stop.<a href="./src/onebusaway/resources/report_problem_with_stop.py">retrieve</a>(stop_id, \*\*<a href="src/onebusaway/types/report_problem_with_stop_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/shared/response_wrapper.py">ResponseWrapper</a></code>

src/onebusaway/_client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class OnebusawaySDK(SyncAPIClient):
6666
trips_for_location: resources.TripsForLocationResource
6767
trip_details: resources.TripDetailsResource
6868
trip_for_vehicle: resources.TripForVehicleResource
69+
report_problem_with_stop: resources.ReportProblemWithStopResource
6970
with_raw_response: OnebusawaySDKWithRawResponse
7071
with_streaming_response: OnebusawaySDKWithStreamedResponse
7172

@@ -143,6 +144,7 @@ def __init__(
143144
self.trips_for_location = resources.TripsForLocationResource(self)
144145
self.trip_details = resources.TripDetailsResource(self)
145146
self.trip_for_vehicle = resources.TripForVehicleResource(self)
147+
self.report_problem_with_stop = resources.ReportProblemWithStopResource(self)
146148
self.with_raw_response = OnebusawaySDKWithRawResponse(self)
147149
self.with_streaming_response = OnebusawaySDKWithStreamedResponse(self)
148150

@@ -280,6 +282,7 @@ class AsyncOnebusawaySDK(AsyncAPIClient):
280282
trips_for_location: resources.AsyncTripsForLocationResource
281283
trip_details: resources.AsyncTripDetailsResource
282284
trip_for_vehicle: resources.AsyncTripForVehicleResource
285+
report_problem_with_stop: resources.AsyncReportProblemWithStopResource
283286
with_raw_response: AsyncOnebusawaySDKWithRawResponse
284287
with_streaming_response: AsyncOnebusawaySDKWithStreamedResponse
285288

@@ -357,6 +360,7 @@ def __init__(
357360
self.trips_for_location = resources.AsyncTripsForLocationResource(self)
358361
self.trip_details = resources.AsyncTripDetailsResource(self)
359362
self.trip_for_vehicle = resources.AsyncTripForVehicleResource(self)
363+
self.report_problem_with_stop = resources.AsyncReportProblemWithStopResource(self)
360364
self.with_raw_response = AsyncOnebusawaySDKWithRawResponse(self)
361365
self.with_streaming_response = AsyncOnebusawaySDKWithStreamedResponse(self)
362366

@@ -497,6 +501,9 @@ def __init__(self, client: OnebusawaySDK) -> None:
497501
self.trips_for_location = resources.TripsForLocationResourceWithRawResponse(client.trips_for_location)
498502
self.trip_details = resources.TripDetailsResourceWithRawResponse(client.trip_details)
499503
self.trip_for_vehicle = resources.TripForVehicleResourceWithRawResponse(client.trip_for_vehicle)
504+
self.report_problem_with_stop = resources.ReportProblemWithStopResourceWithRawResponse(
505+
client.report_problem_with_stop
506+
)
500507

501508

502509
class AsyncOnebusawaySDKWithRawResponse:
@@ -525,6 +532,9 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
525532
self.trips_for_location = resources.AsyncTripsForLocationResourceWithRawResponse(client.trips_for_location)
526533
self.trip_details = resources.AsyncTripDetailsResourceWithRawResponse(client.trip_details)
527534
self.trip_for_vehicle = resources.AsyncTripForVehicleResourceWithRawResponse(client.trip_for_vehicle)
535+
self.report_problem_with_stop = resources.AsyncReportProblemWithStopResourceWithRawResponse(
536+
client.report_problem_with_stop
537+
)
528538

529539

530540
class OnebusawaySDKWithStreamedResponse:
@@ -555,6 +565,9 @@ def __init__(self, client: OnebusawaySDK) -> None:
555565
self.trips_for_location = resources.TripsForLocationResourceWithStreamingResponse(client.trips_for_location)
556566
self.trip_details = resources.TripDetailsResourceWithStreamingResponse(client.trip_details)
557567
self.trip_for_vehicle = resources.TripForVehicleResourceWithStreamingResponse(client.trip_for_vehicle)
568+
self.report_problem_with_stop = resources.ReportProblemWithStopResourceWithStreamingResponse(
569+
client.report_problem_with_stop
570+
)
558571

559572

560573
class AsyncOnebusawaySDKWithStreamedResponse:
@@ -597,6 +610,9 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
597610
)
598611
self.trip_details = resources.AsyncTripDetailsResourceWithStreamingResponse(client.trip_details)
599612
self.trip_for_vehicle = resources.AsyncTripForVehicleResourceWithStreamingResponse(client.trip_for_vehicle)
613+
self.report_problem_with_stop = resources.AsyncReportProblemWithStopResourceWithStreamingResponse(
614+
client.report_problem_with_stop
615+
)
600616

601617

602618
Client = OnebusawaySDK

src/onebusaway/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@
160160
AgenciesWithCoverageResourceWithStreamingResponse,
161161
AsyncAgenciesWithCoverageResourceWithStreamingResponse,
162162
)
163+
from .report_problem_with_stop import (
164+
ReportProblemWithStopResource,
165+
AsyncReportProblemWithStopResource,
166+
ReportProblemWithStopResourceWithRawResponse,
167+
AsyncReportProblemWithStopResourceWithRawResponse,
168+
ReportProblemWithStopResourceWithStreamingResponse,
169+
AsyncReportProblemWithStopResourceWithStreamingResponse,
170+
)
163171

164172
__all__ = [
165173
"AgenciesWithCoverageResource",
@@ -282,4 +290,10 @@
282290
"AsyncTripForVehicleResourceWithRawResponse",
283291
"TripForVehicleResourceWithStreamingResponse",
284292
"AsyncTripForVehicleResourceWithStreamingResponse",
293+
"ReportProblemWithStopResource",
294+
"AsyncReportProblemWithStopResource",
295+
"ReportProblemWithStopResourceWithRawResponse",
296+
"AsyncReportProblemWithStopResourceWithRawResponse",
297+
"ReportProblemWithStopResourceWithStreamingResponse",
298+
"AsyncReportProblemWithStopResourceWithStreamingResponse",
285299
]
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal
6+
7+
import httpx
8+
9+
from ..types import report_problem_with_stop_retrieve_params
10+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11+
from .._utils import (
12+
maybe_transform,
13+
async_maybe_transform,
14+
)
15+
from .._compat import cached_property
16+
from .._resource import SyncAPIResource, AsyncAPIResource
17+
from .._response import (
18+
to_raw_response_wrapper,
19+
to_streamed_response_wrapper,
20+
async_to_raw_response_wrapper,
21+
async_to_streamed_response_wrapper,
22+
)
23+
from .._base_client import make_request_options
24+
from ..types.shared.response_wrapper import ResponseWrapper
25+
26+
__all__ = ["ReportProblemWithStopResource", "AsyncReportProblemWithStopResource"]
27+
28+
29+
class ReportProblemWithStopResource(SyncAPIResource):
30+
@cached_property
31+
def with_raw_response(self) -> ReportProblemWithStopResourceWithRawResponse:
32+
return ReportProblemWithStopResourceWithRawResponse(self)
33+
34+
@cached_property
35+
def with_streaming_response(self) -> ReportProblemWithStopResourceWithStreamingResponse:
36+
return ReportProblemWithStopResourceWithStreamingResponse(self)
37+
38+
def retrieve(
39+
self,
40+
stop_id: str,
41+
*,
42+
code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"]
43+
| NotGiven = NOT_GIVEN,
44+
user_comment: str | NotGiven = NOT_GIVEN,
45+
user_lat: float | NotGiven = NOT_GIVEN,
46+
user_location_accuracy: float | NotGiven = NOT_GIVEN,
47+
user_lon: float | NotGiven = NOT_GIVEN,
48+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
49+
# The extra values given here take precedence over values defined on the client or passed to this method.
50+
extra_headers: Headers | None = None,
51+
extra_query: Query | None = None,
52+
extra_body: Body | None = None,
53+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
54+
) -> ResponseWrapper:
55+
"""
56+
Submit a user-generated problem report for a stop
57+
58+
Args:
59+
code: A string code identifying the nature of the problem
60+
61+
user_comment: Additional comment text supplied by the user describing the problem
62+
63+
user_lat: The reporting user’s current latitude
64+
65+
user_location_accuracy: The reporting user’s location accuracy, in meters
66+
67+
user_lon: The reporting user’s current longitude
68+
69+
extra_headers: Send extra headers
70+
71+
extra_query: Add additional query parameters to the request
72+
73+
extra_body: Add additional JSON properties to the request
74+
75+
timeout: Override the client-level default timeout for this request, in seconds
76+
"""
77+
if not stop_id:
78+
raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}")
79+
return self._get(
80+
f"/api/where/report-problem-with-stop/{stop_id}.json",
81+
options=make_request_options(
82+
extra_headers=extra_headers,
83+
extra_query=extra_query,
84+
extra_body=extra_body,
85+
timeout=timeout,
86+
query=maybe_transform(
87+
{
88+
"code": code,
89+
"user_comment": user_comment,
90+
"user_lat": user_lat,
91+
"user_location_accuracy": user_location_accuracy,
92+
"user_lon": user_lon,
93+
},
94+
report_problem_with_stop_retrieve_params.ReportProblemWithStopRetrieveParams,
95+
),
96+
),
97+
cast_to=ResponseWrapper,
98+
)
99+
100+
101+
class AsyncReportProblemWithStopResource(AsyncAPIResource):
102+
@cached_property
103+
def with_raw_response(self) -> AsyncReportProblemWithStopResourceWithRawResponse:
104+
return AsyncReportProblemWithStopResourceWithRawResponse(self)
105+
106+
@cached_property
107+
def with_streaming_response(self) -> AsyncReportProblemWithStopResourceWithStreamingResponse:
108+
return AsyncReportProblemWithStopResourceWithStreamingResponse(self)
109+
110+
async def retrieve(
111+
self,
112+
stop_id: str,
113+
*,
114+
code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"]
115+
| NotGiven = NOT_GIVEN,
116+
user_comment: str | NotGiven = NOT_GIVEN,
117+
user_lat: float | NotGiven = NOT_GIVEN,
118+
user_location_accuracy: float | NotGiven = NOT_GIVEN,
119+
user_lon: float | NotGiven = NOT_GIVEN,
120+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
121+
# The extra values given here take precedence over values defined on the client or passed to this method.
122+
extra_headers: Headers | None = None,
123+
extra_query: Query | None = None,
124+
extra_body: Body | None = None,
125+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
126+
) -> ResponseWrapper:
127+
"""
128+
Submit a user-generated problem report for a stop
129+
130+
Args:
131+
code: A string code identifying the nature of the problem
132+
133+
user_comment: Additional comment text supplied by the user describing the problem
134+
135+
user_lat: The reporting user’s current latitude
136+
137+
user_location_accuracy: The reporting user’s location accuracy, in meters
138+
139+
user_lon: The reporting user’s current longitude
140+
141+
extra_headers: Send extra headers
142+
143+
extra_query: Add additional query parameters to the request
144+
145+
extra_body: Add additional JSON properties to the request
146+
147+
timeout: Override the client-level default timeout for this request, in seconds
148+
"""
149+
if not stop_id:
150+
raise ValueError(f"Expected a non-empty value for `stop_id` but received {stop_id!r}")
151+
return await self._get(
152+
f"/api/where/report-problem-with-stop/{stop_id}.json",
153+
options=make_request_options(
154+
extra_headers=extra_headers,
155+
extra_query=extra_query,
156+
extra_body=extra_body,
157+
timeout=timeout,
158+
query=await async_maybe_transform(
159+
{
160+
"code": code,
161+
"user_comment": user_comment,
162+
"user_lat": user_lat,
163+
"user_location_accuracy": user_location_accuracy,
164+
"user_lon": user_lon,
165+
},
166+
report_problem_with_stop_retrieve_params.ReportProblemWithStopRetrieveParams,
167+
),
168+
),
169+
cast_to=ResponseWrapper,
170+
)
171+
172+
173+
class ReportProblemWithStopResourceWithRawResponse:
174+
def __init__(self, report_problem_with_stop: ReportProblemWithStopResource) -> None:
175+
self._report_problem_with_stop = report_problem_with_stop
176+
177+
self.retrieve = to_raw_response_wrapper(
178+
report_problem_with_stop.retrieve,
179+
)
180+
181+
182+
class AsyncReportProblemWithStopResourceWithRawResponse:
183+
def __init__(self, report_problem_with_stop: AsyncReportProblemWithStopResource) -> None:
184+
self._report_problem_with_stop = report_problem_with_stop
185+
186+
self.retrieve = async_to_raw_response_wrapper(
187+
report_problem_with_stop.retrieve,
188+
)
189+
190+
191+
class ReportProblemWithStopResourceWithStreamingResponse:
192+
def __init__(self, report_problem_with_stop: ReportProblemWithStopResource) -> None:
193+
self._report_problem_with_stop = report_problem_with_stop
194+
195+
self.retrieve = to_streamed_response_wrapper(
196+
report_problem_with_stop.retrieve,
197+
)
198+
199+
200+
class AsyncReportProblemWithStopResourceWithStreamingResponse:
201+
def __init__(self, report_problem_with_stop: AsyncReportProblemWithStopResource) -> None:
202+
self._report_problem_with_stop = report_problem_with_stop
203+
204+
self.retrieve = async_to_streamed_response_wrapper(
205+
report_problem_with_stop.retrieve,
206+
)

src/onebusaway/types/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@
4343
from .agencies_with_coverage_retrieve_response import (
4444
AgenciesWithCoverageRetrieveResponse as AgenciesWithCoverageRetrieveResponse,
4545
)
46+
from .report_problem_with_stop_retrieve_params import (
47+
ReportProblemWithStopRetrieveParams as ReportProblemWithStopRetrieveParams,
48+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Annotated, TypedDict
6+
7+
from .._utils import PropertyInfo
8+
9+
__all__ = ["ReportProblemWithStopRetrieveParams"]
10+
11+
12+
class ReportProblemWithStopRetrieveParams(TypedDict, total=False):
13+
code: Literal["stop_name_wrong", "stop_number_wrong", "stop_location_wrong", "route_or_trip_missing", "other"]
14+
"""A string code identifying the nature of the problem"""
15+
16+
user_comment: Annotated[str, PropertyInfo(alias="userComment")]
17+
"""Additional comment text supplied by the user describing the problem"""
18+
19+
user_lat: Annotated[float, PropertyInfo(alias="userLat")]
20+
"""The reporting user’s current latitude"""
21+
22+
user_location_accuracy: Annotated[float, PropertyInfo(alias="userLocationAccuracy")]
23+
"""The reporting user’s location accuracy, in meters"""
24+
25+
user_lon: Annotated[float, PropertyInfo(alias="userLon")]
26+
"""The reporting user’s current longitude"""

0 commit comments

Comments
 (0)