From 2359b78a90efd7c577df61a5e693a1ec5944d35a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:52:27 +0000 Subject: [PATCH] feat(api): OpenAPI spec update (#26) --- README.md | 2 +- api.md | 2 +- src/dataherald/resources/table_descriptions.py | 13 +++++++------ src/dataherald/types/__init__.py | 3 +++ .../table_description_sync_schemas_response.py | 9 +++++++++ tests/api_resources/test_table_descriptions.py | 13 +++++++------ 6 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 src/dataherald/types/table_description_sync_schemas_response.py diff --git a/README.md b/README.md index c03892d..28521a2 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/api.md b/api.md index fc235e5..0f35e86 100644 --- a/api.md +++ b/api.md @@ -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 diff --git a/src/dataherald/resources/table_descriptions.py b/src/dataherald/resources/table_descriptions.py index 968fb37..fc7ce7f 100644 --- a/src/dataherald/resources/table_descriptions.py +++ b/src/dataherald/resources/table_descriptions.py @@ -9,6 +9,7 @@ from ..types import ( TableDescriptionResponse, TableDescriptionListResponse, + TableDescriptionSyncSchemasResponse, table_description_list_params, table_description_update_params, table_description_sync_schemas_params, @@ -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 @@ -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, ) @@ -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 @@ -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, ) diff --git a/src/dataherald/types/__init__.py b/src/dataherald/types/__init__.py index 9b59f05..92b5e30 100644 --- a/src/dataherald/types/__init__.py +++ b/src/dataherald/types/__init__.py @@ -49,3 +49,6 @@ from .table_description_sync_schemas_params import ( TableDescriptionSyncSchemasParams as TableDescriptionSyncSchemasParams, ) +from .table_description_sync_schemas_response import ( + TableDescriptionSyncSchemasResponse as TableDescriptionSyncSchemasResponse, +) diff --git a/src/dataherald/types/table_description_sync_schemas_response.py b/src/dataherald/types/table_description_sync_schemas_response.py new file mode 100644 index 0000000..ec2f83e --- /dev/null +++ b/src/dataherald/types/table_description_sync_schemas_response.py @@ -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] diff --git a/tests/api_resources/test_table_descriptions.py b/tests/api_resources/test_table_descriptions.py index 65ae2c9..d260e2f 100644 --- a/tests/api_resources/test_table_descriptions.py +++ b/tests/api_resources/test_table_descriptions.py @@ -11,6 +11,7 @@ from dataherald.types import ( TableDescriptionResponse, TableDescriptionListResponse, + TableDescriptionSyncSchemasResponse, ) from dataherald._client import Dataherald, AsyncDataherald @@ -123,7 +124,7 @@ 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: @@ -131,7 +132,7 @@ def test_method_sync_schemas_with_all_params(self, client: Dataherald) -> None: 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: @@ -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: @@ -248,7 +249,7 @@ 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: @@ -256,7 +257,7 @@ async def test_method_sync_schemas_with_all_params(self, client: AsyncDataherald 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: @@ -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"])