Skip to content

Commit

Permalink
feat(api): OpenAPI spec update (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 12, 2024
1 parent 3eaecf3 commit 2359b78
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and offers both synchronous and asynchronous clients powered by [httpx](https://

## Documentation

The API documentation can be found [here](https://dataherald.readthedocs.io/en/latest/).
The REST API documentation can be found [on dataherald.readthedocs.io](https://dataherald.readthedocs.io/en/latest/). The full API of this library can be found in [api.md](https://www.github.com/Dataherald/dataherald-python/blob/main/api.md).

## Installation

Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Methods:
- <code title="get /api/table-descriptions/{id}">client.table_descriptions.<a href="./src/dataherald/resources/table_descriptions.py">retrieve</a>(id) -> <a href="./src/dataherald/types/table_description_response.py">TableDescriptionResponse</a></code>
- <code title="put /api/table-descriptions/{id}">client.table_descriptions.<a href="./src/dataherald/resources/table_descriptions.py">update</a>(id, \*\*<a href="src/dataherald/types/table_description_update_params.py">params</a>) -> <a href="./src/dataherald/types/table_description_response.py">TableDescriptionResponse</a></code>
- <code title="get /api/table-descriptions">client.table_descriptions.<a href="./src/dataherald/resources/table_descriptions.py">list</a>(\*\*<a href="src/dataherald/types/table_description_list_params.py">params</a>) -> <a href="./src/dataherald/types/table_description_list_response.py">TableDescriptionListResponse</a></code>
- <code title="post /api/table-descriptions/sync-schemas">client.table_descriptions.<a href="./src/dataherald/resources/table_descriptions.py">sync_schemas</a>(\*\*<a href="src/dataherald/types/table_description_sync_schemas_params.py">params</a>) -> <a href="./src/dataherald/types/table_description_sync_schemas_response.py">object</a></code>
- <code title="post /api/table-descriptions/sync-schemas">client.table_descriptions.<a href="./src/dataherald/resources/table_descriptions.py">sync_schemas</a>(\*\*<a href="src/dataherald/types/table_description_sync_schemas_params.py">params</a>) -> <a href="./src/dataherald/types/table_description_sync_schemas_response.py">TableDescriptionSyncSchemasResponse</a></code>

# Heartbeat

Expand Down
13 changes: 7 additions & 6 deletions src/dataherald/resources/table_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ..types import (
TableDescriptionResponse,
TableDescriptionListResponse,
TableDescriptionSyncSchemasResponse,
table_description_list_params,
table_description_update_params,
table_description_sync_schemas_params,
Expand Down Expand Up @@ -158,9 +159,9 @@ def sync_schemas(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> TableDescriptionSyncSchemasResponse:
"""
Api Sync Table Descriptions Schemas
Sync Table Descriptions Schemas
Args:
extra_headers: Send extra headers
Expand All @@ -183,7 +184,7 @@ def sync_schemas(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
cast_to=TableDescriptionSyncSchemasResponse,
)


Expand Down Expand Up @@ -320,9 +321,9 @@ async def sync_schemas(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> TableDescriptionSyncSchemasResponse:
"""
Api Sync Table Descriptions Schemas
Sync Table Descriptions Schemas
Args:
extra_headers: Send extra headers
Expand All @@ -345,7 +346,7 @@ async def sync_schemas(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
cast_to=TableDescriptionSyncSchemasResponse,
)


Expand Down
3 changes: 3 additions & 0 deletions src/dataherald/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
from .table_description_sync_schemas_params import (
TableDescriptionSyncSchemasParams as TableDescriptionSyncSchemasParams,
)
from .table_description_sync_schemas_response import (
TableDescriptionSyncSchemasResponse as TableDescriptionSyncSchemasResponse,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File generated from our OpenAPI spec by Stainless.

from typing import List

from .table_description_response import TableDescriptionResponse

__all__ = ["TableDescriptionSyncSchemasResponse"]

TableDescriptionSyncSchemasResponse = List[TableDescriptionResponse]
13 changes: 7 additions & 6 deletions tests/api_resources/test_table_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from dataherald.types import (
TableDescriptionResponse,
TableDescriptionListResponse,
TableDescriptionSyncSchemasResponse,
)
from dataherald._client import Dataherald, AsyncDataherald

Expand Down Expand Up @@ -123,15 +124,15 @@ def test_method_sync_schemas(self, client: Dataherald) -> None:
table_description = client.table_descriptions.sync_schemas(
db_connection_id="string",
)
assert_matches_type(object, table_description, path=["response"])
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

@parametrize
def test_method_sync_schemas_with_all_params(self, client: Dataherald) -> None:
table_description = client.table_descriptions.sync_schemas(
db_connection_id="string",
table_names=["string", "string", "string"],
)
assert_matches_type(object, table_description, path=["response"])
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

@parametrize
def test_raw_response_sync_schemas(self, client: Dataherald) -> None:
Expand All @@ -140,7 +141,7 @@ def test_raw_response_sync_schemas(self, client: Dataherald) -> None:
)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
table_description = response.parse()
assert_matches_type(object, table_description, path=["response"])
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])


class TestAsyncTableDescriptions:
Expand Down Expand Up @@ -248,15 +249,15 @@ async def test_method_sync_schemas(self, client: AsyncDataherald) -> None:
table_description = await client.table_descriptions.sync_schemas(
db_connection_id="string",
)
assert_matches_type(object, table_description, path=["response"])
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

@parametrize
async def test_method_sync_schemas_with_all_params(self, client: AsyncDataherald) -> None:
table_description = await client.table_descriptions.sync_schemas(
db_connection_id="string",
table_names=["string", "string", "string"],
)
assert_matches_type(object, table_description, path=["response"])
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

@parametrize
async def test_raw_response_sync_schemas(self, client: AsyncDataherald) -> None:
Expand All @@ -265,4 +266,4 @@ async def test_raw_response_sync_schemas(self, client: AsyncDataherald) -> None:
)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
table_description = response.parse()
assert_matches_type(object, table_description, path=["response"])
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

0 comments on commit 2359b78

Please sign in to comment.