77
88import httpx
99
10- from ..types import (
11- arrival_and_departure_search_for_stop_params ,
12- arrival_and_departure_search_all_for_stop_params ,
13- )
10+ from ..types import arrival_and_departure_list_params , arrival_and_departure_retrieve_params
1411from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
1512from .._utils import (
1613 maybe_transform ,
2724from .._base_client import (
2825 make_request_options ,
2926)
30- from ..types .arrival_and_departure_search_for_stop_response import ArrivalAndDepartureSearchForStopResponse
31- from ..types .arrival_and_departure_search_all_for_stop_response import ArrivalAndDepartureSearchAllForStopResponse
27+ from ..types .arrival_and_departure_list_response import ArrivalAndDepartureListResponse
28+ from ..types .arrival_and_departure_retrieve_response import ArrivalAndDepartureRetrieveResponse
3229
3330__all__ = ["ArrivalAndDepartureResource" , "AsyncArrivalAndDepartureResource" ]
3431
@@ -42,30 +39,26 @@ def with_raw_response(self) -> ArrivalAndDepartureResourceWithRawResponse:
4239 def with_streaming_response (self ) -> ArrivalAndDepartureResourceWithStreamingResponse :
4340 return ArrivalAndDepartureResourceWithStreamingResponse (self )
4441
45- def search_all_for_stop (
42+ def retrieve (
4643 self ,
4744 stop_id : str ,
4845 * ,
49- minutes_after : int | NotGiven = NOT_GIVEN ,
50- minutes_before : int | NotGiven = NOT_GIVEN ,
51- time : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
46+ service_date : int ,
47+ trip_id : str ,
48+ stop_sequence : int | NotGiven = NOT_GIVEN ,
49+ time : int | NotGiven = NOT_GIVEN ,
50+ vehicle_id : str | NotGiven = NOT_GIVEN ,
5251 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5352 # The extra values given here take precedence over values defined on the client or passed to this method.
5453 extra_headers : Headers | None = None ,
5554 extra_query : Query | None = None ,
5655 extra_body : Body | None = None ,
5756 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
58- ) -> ArrivalAndDepartureSearchAllForStopResponse :
57+ ) -> ArrivalAndDepartureRetrieveResponse :
5958 """
60- arrivals -and-departures -for-stop
59+ arrival -and-departure -for-stop
6160
6261 Args:
63- minutes_after: Include vehicles arriving or departing in the next n minutes.
64-
65- minutes_before: Include vehicles having arrived or departed in the previous n minutes.
66-
67- time: The specific time for querying the system status.
68-
6962 extra_headers: Send extra headers
7063
7164 extra_query: Add additional query parameters to the request
@@ -77,44 +70,50 @@ def search_all_for_stop(
7770 if not stop_id :
7871 raise ValueError (f"Expected a non-empty value for `stop_id` but received { stop_id !r} " )
7972 return self ._get (
80- f"/api/where/arrivals -and-departures -for-stop/stopID.json" ,
73+ f"/api/where/arrival -and-departure -for-stop/stopID.json" ,
8174 options = make_request_options (
8275 extra_headers = extra_headers ,
8376 extra_query = extra_query ,
8477 extra_body = extra_body ,
8578 timeout = timeout ,
8679 query = maybe_transform (
8780 {
88- "minutes_after" : minutes_after ,
89- "minutes_before" : minutes_before ,
81+ "service_date" : service_date ,
82+ "trip_id" : trip_id ,
83+ "stop_sequence" : stop_sequence ,
9084 "time" : time ,
85+ "vehicle_id" : vehicle_id ,
9186 },
92- arrival_and_departure_search_all_for_stop_params . ArrivalAndDepartureSearchAllForStopParams ,
87+ arrival_and_departure_retrieve_params . ArrivalAndDepartureRetrieveParams ,
9388 ),
9489 ),
95- cast_to = ArrivalAndDepartureSearchAllForStopResponse ,
90+ cast_to = ArrivalAndDepartureRetrieveResponse ,
9691 )
9792
98- def search_for_stop (
93+ def list (
9994 self ,
10095 stop_id : str ,
10196 * ,
102- service_date : int ,
103- trip_id : str ,
104- stop_sequence : int | NotGiven = NOT_GIVEN ,
105- time : int | NotGiven = NOT_GIVEN ,
106- vehicle_id : str | NotGiven = NOT_GIVEN ,
97+ minutes_after : int | NotGiven = NOT_GIVEN ,
98+ minutes_before : int | NotGiven = NOT_GIVEN ,
99+ time : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
107100 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
108101 # The extra values given here take precedence over values defined on the client or passed to this method.
109102 extra_headers : Headers | None = None ,
110103 extra_query : Query | None = None ,
111104 extra_body : Body | None = None ,
112105 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
113- ) -> ArrivalAndDepartureSearchForStopResponse :
106+ ) -> ArrivalAndDepartureListResponse :
114107 """
115- arrival -and-departure -for-stop
108+ arrivals -and-departures -for-stop
116109
117110 Args:
111+ minutes_after: Include vehicles arriving or departing in the next n minutes.
112+
113+ minutes_before: Include vehicles having arrived or departed in the previous n minutes.
114+
115+ time: The specific time for querying the system status.
116+
118117 extra_headers: Send extra headers
119118
120119 extra_query: Add additional query parameters to the request
@@ -126,24 +125,22 @@ def search_for_stop(
126125 if not stop_id :
127126 raise ValueError (f"Expected a non-empty value for `stop_id` but received { stop_id !r} " )
128127 return self ._get (
129- f"/api/where/arrival -and-departure -for-stop/stopID.json" ,
128+ f"/api/where/arrivals -and-departures -for-stop/stopID.json" ,
130129 options = make_request_options (
131130 extra_headers = extra_headers ,
132131 extra_query = extra_query ,
133132 extra_body = extra_body ,
134133 timeout = timeout ,
135134 query = maybe_transform (
136135 {
137- "service_date" : service_date ,
138- "trip_id" : trip_id ,
139- "stop_sequence" : stop_sequence ,
136+ "minutes_after" : minutes_after ,
137+ "minutes_before" : minutes_before ,
140138 "time" : time ,
141- "vehicle_id" : vehicle_id ,
142139 },
143- arrival_and_departure_search_for_stop_params . ArrivalAndDepartureSearchForStopParams ,
140+ arrival_and_departure_list_params . ArrivalAndDepartureListParams ,
144141 ),
145142 ),
146- cast_to = ArrivalAndDepartureSearchForStopResponse ,
143+ cast_to = ArrivalAndDepartureListResponse ,
147144 )
148145
149146
@@ -156,30 +153,26 @@ def with_raw_response(self) -> AsyncArrivalAndDepartureResourceWithRawResponse:
156153 def with_streaming_response (self ) -> AsyncArrivalAndDepartureResourceWithStreamingResponse :
157154 return AsyncArrivalAndDepartureResourceWithStreamingResponse (self )
158155
159- async def search_all_for_stop (
156+ async def retrieve (
160157 self ,
161158 stop_id : str ,
162159 * ,
163- minutes_after : int | NotGiven = NOT_GIVEN ,
164- minutes_before : int | NotGiven = NOT_GIVEN ,
165- time : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
160+ service_date : int ,
161+ trip_id : str ,
162+ stop_sequence : int | NotGiven = NOT_GIVEN ,
163+ time : int | NotGiven = NOT_GIVEN ,
164+ vehicle_id : str | NotGiven = NOT_GIVEN ,
166165 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
167166 # The extra values given here take precedence over values defined on the client or passed to this method.
168167 extra_headers : Headers | None = None ,
169168 extra_query : Query | None = None ,
170169 extra_body : Body | None = None ,
171170 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
172- ) -> ArrivalAndDepartureSearchAllForStopResponse :
171+ ) -> ArrivalAndDepartureRetrieveResponse :
173172 """
174- arrivals -and-departures -for-stop
173+ arrival -and-departure -for-stop
175174
176175 Args:
177- minutes_after: Include vehicles arriving or departing in the next n minutes.
178-
179- minutes_before: Include vehicles having arrived or departed in the previous n minutes.
180-
181- time: The specific time for querying the system status.
182-
183176 extra_headers: Send extra headers
184177
185178 extra_query: Add additional query parameters to the request
@@ -191,44 +184,50 @@ async def search_all_for_stop(
191184 if not stop_id :
192185 raise ValueError (f"Expected a non-empty value for `stop_id` but received { stop_id !r} " )
193186 return await self ._get (
194- f"/api/where/arrivals -and-departures -for-stop/stopID.json" ,
187+ f"/api/where/arrival -and-departure -for-stop/stopID.json" ,
195188 options = make_request_options (
196189 extra_headers = extra_headers ,
197190 extra_query = extra_query ,
198191 extra_body = extra_body ,
199192 timeout = timeout ,
200193 query = await async_maybe_transform (
201194 {
202- "minutes_after" : minutes_after ,
203- "minutes_before" : minutes_before ,
195+ "service_date" : service_date ,
196+ "trip_id" : trip_id ,
197+ "stop_sequence" : stop_sequence ,
204198 "time" : time ,
199+ "vehicle_id" : vehicle_id ,
205200 },
206- arrival_and_departure_search_all_for_stop_params . ArrivalAndDepartureSearchAllForStopParams ,
201+ arrival_and_departure_retrieve_params . ArrivalAndDepartureRetrieveParams ,
207202 ),
208203 ),
209- cast_to = ArrivalAndDepartureSearchAllForStopResponse ,
204+ cast_to = ArrivalAndDepartureRetrieveResponse ,
210205 )
211206
212- async def search_for_stop (
207+ async def list (
213208 self ,
214209 stop_id : str ,
215210 * ,
216- service_date : int ,
217- trip_id : str ,
218- stop_sequence : int | NotGiven = NOT_GIVEN ,
219- time : int | NotGiven = NOT_GIVEN ,
220- vehicle_id : str | NotGiven = NOT_GIVEN ,
211+ minutes_after : int | NotGiven = NOT_GIVEN ,
212+ minutes_before : int | NotGiven = NOT_GIVEN ,
213+ time : Union [str , datetime ] | NotGiven = NOT_GIVEN ,
221214 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
222215 # The extra values given here take precedence over values defined on the client or passed to this method.
223216 extra_headers : Headers | None = None ,
224217 extra_query : Query | None = None ,
225218 extra_body : Body | None = None ,
226219 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
227- ) -> ArrivalAndDepartureSearchForStopResponse :
220+ ) -> ArrivalAndDepartureListResponse :
228221 """
229- arrival -and-departure -for-stop
222+ arrivals -and-departures -for-stop
230223
231224 Args:
225+ minutes_after: Include vehicles arriving or departing in the next n minutes.
226+
227+ minutes_before: Include vehicles having arrived or departed in the previous n minutes.
228+
229+ time: The specific time for querying the system status.
230+
232231 extra_headers: Send extra headers
233232
234233 extra_query: Add additional query parameters to the request
@@ -240,70 +239,68 @@ async def search_for_stop(
240239 if not stop_id :
241240 raise ValueError (f"Expected a non-empty value for `stop_id` but received { stop_id !r} " )
242241 return await self ._get (
243- f"/api/where/arrival -and-departure -for-stop/stopID.json" ,
242+ f"/api/where/arrivals -and-departures -for-stop/stopID.json" ,
244243 options = make_request_options (
245244 extra_headers = extra_headers ,
246245 extra_query = extra_query ,
247246 extra_body = extra_body ,
248247 timeout = timeout ,
249248 query = await async_maybe_transform (
250249 {
251- "service_date" : service_date ,
252- "trip_id" : trip_id ,
253- "stop_sequence" : stop_sequence ,
250+ "minutes_after" : minutes_after ,
251+ "minutes_before" : minutes_before ,
254252 "time" : time ,
255- "vehicle_id" : vehicle_id ,
256253 },
257- arrival_and_departure_search_for_stop_params . ArrivalAndDepartureSearchForStopParams ,
254+ arrival_and_departure_list_params . ArrivalAndDepartureListParams ,
258255 ),
259256 ),
260- cast_to = ArrivalAndDepartureSearchForStopResponse ,
257+ cast_to = ArrivalAndDepartureListResponse ,
261258 )
262259
263260
264261class ArrivalAndDepartureResourceWithRawResponse :
265262 def __init__ (self , arrival_and_departure : ArrivalAndDepartureResource ) -> None :
266263 self ._arrival_and_departure = arrival_and_departure
267264
268- self .search_all_for_stop = to_raw_response_wrapper (
269- arrival_and_departure .search_all_for_stop ,
265+ self .retrieve = to_raw_response_wrapper (
266+ arrival_and_departure .retrieve ,
270267 )
271- self .search_for_stop = to_raw_response_wrapper (
272- arrival_and_departure .search_for_stop ,
268+ self .list = to_raw_response_wrapper (
269+ arrival_and_departure .list ,
273270 )
274271
275272
276273class AsyncArrivalAndDepartureResourceWithRawResponse :
277274 def __init__ (self , arrival_and_departure : AsyncArrivalAndDepartureResource ) -> None :
278275 self ._arrival_and_departure = arrival_and_departure
279276
280- self .search_all_for_stop = async_to_raw_response_wrapper (
281- arrival_and_departure .search_all_for_stop ,
277+ self .retrieve = async_to_raw_response_wrapper (
278+ arrival_and_departure .retrieve ,
282279 )
283- self .search_for_stop = async_to_raw_response_wrapper (
284- arrival_and_departure .search_for_stop ,
280+ self .list = async_to_raw_response_wrapper (
281+ arrival_and_departure .list ,
285282 )
286283
287284
288285class ArrivalAndDepartureResourceWithStreamingResponse :
289286 def __init__ (self , arrival_and_departure : ArrivalAndDepartureResource ) -> None :
290287 self ._arrival_and_departure = arrival_and_departure
291288
292- self .search_all_for_stop = to_streamed_response_wrapper (
293- arrival_and_departure .search_all_for_stop ,
289+ self .retrieve = to_streamed_response_wrapper (
290+ arrival_and_departure .retrieve ,
294291 )
295- self .search_for_stop = to_streamed_response_wrapper (
296- arrival_and_departure .search_for_stop ,
292+ self .list = to_streamed_response_wrapper (
293+ arrival_and_departure .list ,
297294 )
298295
299296
300297class AsyncArrivalAndDepartureResourceWithStreamingResponse :
301298 def __init__ (self , arrival_and_departure : AsyncArrivalAndDepartureResource ) -> None :
302299 self ._arrival_and_departure = arrival_and_departure
303300
304- self .search_all_for_stop = async_to_streamed_response_wrapper (
305- arrival_and_departure .search_all_for_stop ,
301+ self .retrieve = async_to_streamed_response_wrapper (
302+ arrival_and_departure .retrieve ,
306303 )
307- self .search_for_stop = async_to_streamed_response_wrapper (
308- arrival_and_departure .search_for_stop ,
304+ self .list = async_to_streamed_response_wrapper (
305+ arrival_and_departure .list ,
309306 )
0 commit comments