-
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.
Merge pull request #78 from OneBusAway/release-please--branches--main…
…--changes--next release: 0.1.0-alpha.17
- Loading branch information
Showing
17 changed files
with
709 additions
and
5 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,3 +1,3 @@ | ||
{ | ||
".": "0.1.0-alpha.16" | ||
".": "0.1.0-alpha.17" | ||
} |
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: 25 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-f0a1f65a327091207db6d5ecc22149149967274b0c54c192cc442f93cc819c64.yml | ||
configured_endpoints: 27 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-e4779565160778ba4193bbe8b27556a49f0f8c31ef15ac72c9ee1eb791f92d33.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from helpers.load_env import load_settings | ||
|
||
from onebusaway import OnebusawaySDK | ||
|
||
# Load settings from .env file, if it exists. If not, we'll use the | ||
# Puget Sound server URL (which is also the default in the SDK) and | ||
# the 'TEST' API key. | ||
settings = load_settings( | ||
{ | ||
"api_key": "TEST", | ||
"base_url": "https://api.pugetsound.onebusaway.org/", | ||
} | ||
) | ||
|
||
# Create a new instance of the OneBusAway SDK with the settings we loaded. | ||
oba = OnebusawaySDK(**settings) | ||
|
||
block_id = '1_7310845' | ||
response = oba.block.retrieve(block_id) | ||
if response and response.data: | ||
print(response.data.entry) |
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,21 @@ | ||
from helpers.load_env import load_settings | ||
|
||
from onebusaway import OnebusawaySDK | ||
|
||
# Load settings from .env file, if it exists. If not, we'll use the | ||
# Puget Sound server URL (which is also the default in the SDK) and | ||
# the 'TEST' API key. | ||
settings = load_settings( | ||
{ | ||
"api_key": "TEST", | ||
"base_url": "https://api.pugetsound.onebusaway.org/", | ||
} | ||
) | ||
|
||
# Create a new instance of the OneBusAway SDK with the settings we loaded. | ||
oba = OnebusawaySDK(**settings) | ||
|
||
shape_id = '1_10002005' | ||
response = oba.shape.retrieve(shape_id) | ||
if response and response.data: | ||
print(response.data.entry) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
__title__ = "onebusaway" | ||
__version__ = "0.1.0-alpha.16" # x-release-please-version | ||
__version__ = "0.1.0-alpha.17" # x-release-please-version |
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.block_retrieve_response import BlockRetrieveResponse | ||
|
||
__all__ = ["BlockResource", "AsyncBlockResource"] | ||
|
||
|
||
class BlockResource(SyncAPIResource): | ||
@cached_property | ||
def with_raw_response(self) -> BlockResourceWithRawResponse: | ||
return BlockResourceWithRawResponse(self) | ||
|
||
@cached_property | ||
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: | ||
""" | ||
Get details of a specific block 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 block_id: | ||
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 | ||
), | ||
cast_to=BlockRetrieveResponse, | ||
) | ||
|
||
|
||
class AsyncBlockResource(AsyncAPIResource): | ||
@cached_property | ||
def with_raw_response(self) -> AsyncBlockResourceWithRawResponse: | ||
return AsyncBlockResourceWithRawResponse(self) | ||
|
||
@cached_property | ||
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: | ||
""" | ||
Get details of a specific block 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 block_id: | ||
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 | ||
), | ||
cast_to=BlockRetrieveResponse, | ||
) | ||
|
||
|
||
class BlockResourceWithRawResponse: | ||
def __init__(self, block: BlockResource) -> None: | ||
self._block = block | ||
|
||
self.retrieve = to_raw_response_wrapper( | ||
block.retrieve, | ||
) | ||
|
||
|
||
class AsyncBlockResourceWithRawResponse: | ||
def __init__(self, block: AsyncBlockResource) -> None: | ||
self._block = block | ||
|
||
self.retrieve = async_to_raw_response_wrapper( | ||
block.retrieve, | ||
) | ||
|
||
|
||
class BlockResourceWithStreamingResponse: | ||
def __init__(self, block: BlockResource) -> None: | ||
self._block = block | ||
|
||
self.retrieve = to_streamed_response_wrapper( | ||
block.retrieve, | ||
) | ||
|
||
|
||
class AsyncBlockResourceWithStreamingResponse: | ||
def __init__(self, block: AsyncBlockResource) -> None: | ||
self._block = block | ||
|
||
self.retrieve = async_to_streamed_response_wrapper( | ||
block.retrieve, | ||
) |
Oops, something went wrong.