-
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 (#4)
- Loading branch information
1 parent
589201b
commit fc1679d
Showing
13 changed files
with
597 additions
and
12 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,6 +1,8 @@ | ||
name: Release Doctor | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
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: 12 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-d7feb31fedeae9f0af2581bf85d95d374eb2eee635e6823975bc4f419bd8e492.yml | ||
configured_endpoints: 13 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-6c051801071707e025c582891048beeb3c06d10d13c852f8401a71604b81ac5d.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
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,200 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from __future__ import annotations | ||
|
||
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"] | ||
|
||
|
||
class TripForVehicleResource(SyncAPIResource): | ||
@cached_property | ||
def with_raw_response(self) -> TripForVehicleResourceWithRawResponse: | ||
return TripForVehicleResourceWithRawResponse(self) | ||
|
||
@cached_property | ||
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: | ||
""" | ||
Retrieve trip for a specific vehicle | ||
Args: | ||
include_schedule: Determines whether full <schedule/> element is included in the <tripDetails/> | ||
section. Defaults to false. | ||
include_status: Determines whether the full <status/> element is included in the <tripDetails/> | ||
section. Defaults to true. | ||
include_trip: Determines whether full <trip/> element is included in the <references/> | ||
section. Defaults to false. | ||
time: Time parameter to query the system at a specific time (optional). | ||
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 vehicle_id: | ||
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/vehicleID.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, | ||
), | ||
), | ||
cast_to=TripForVehicleRetrieveResponse, | ||
) | ||
|
||
|
||
class AsyncTripForVehicleResource(AsyncAPIResource): | ||
@cached_property | ||
def with_raw_response(self) -> AsyncTripForVehicleResourceWithRawResponse: | ||
return AsyncTripForVehicleResourceWithRawResponse(self) | ||
|
||
@cached_property | ||
def with_streaming_response(self) -> AsyncTripForVehicleResourceWithStreamingResponse: | ||
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: | ||
""" | ||
Retrieve trip for a specific vehicle | ||
Args: | ||
include_schedule: Determines whether full <schedule/> element is included in the <tripDetails/> | ||
section. Defaults to false. | ||
include_status: Determines whether the full <status/> element is included in the <tripDetails/> | ||
section. Defaults to true. | ||
include_trip: Determines whether full <trip/> element is included in the <references/> | ||
section. Defaults to false. | ||
time: Time parameter to query the system at a specific time (optional). | ||
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 vehicle_id: | ||
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/vehicleID.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, | ||
), | ||
), | ||
cast_to=TripForVehicleRetrieveResponse, | ||
) | ||
|
||
|
||
class TripForVehicleResourceWithRawResponse: | ||
def __init__(self, trip_for_vehicle: TripForVehicleResource) -> None: | ||
self._trip_for_vehicle = trip_for_vehicle | ||
|
||
self.retrieve = to_raw_response_wrapper( | ||
trip_for_vehicle.retrieve, | ||
) | ||
|
||
|
||
class AsyncTripForVehicleResourceWithRawResponse: | ||
def __init__(self, trip_for_vehicle: AsyncTripForVehicleResource) -> None: | ||
self._trip_for_vehicle = trip_for_vehicle | ||
|
||
self.retrieve = async_to_raw_response_wrapper( | ||
trip_for_vehicle.retrieve, | ||
) | ||
|
||
|
||
class TripForVehicleResourceWithStreamingResponse: | ||
def __init__(self, trip_for_vehicle: TripForVehicleResource) -> None: | ||
self._trip_for_vehicle = trip_for_vehicle | ||
|
||
self.retrieve = to_streamed_response_wrapper( | ||
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, | ||
) |
Oops, something went wrong.