diff --git a/src/dataherald/resources/table_descriptions.py b/src/dataherald/resources/table_descriptions.py index 82b09c2..d7d015e 100644 --- a/src/dataherald/resources/table_descriptions.py +++ b/src/dataherald/resources/table_descriptions.py @@ -164,8 +164,7 @@ def list( def sync_schemas( self, *, - db_connection_id: str, - table_names: List[str] | NotGiven = NOT_GIVEN, + body: List[table_description_sync_schemas_params.Body], # 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, @@ -187,13 +186,7 @@ def sync_schemas( """ return self._post( "/api/table-descriptions/sync-schemas", - body=maybe_transform( - { - "db_connection_id": db_connection_id, - "table_names": table_names, - }, - table_description_sync_schemas_params.TableDescriptionSyncSchemasParams, - ), + body=maybe_transform(body, table_description_sync_schemas_params.TableDescriptionSyncSchemasParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -334,8 +327,7 @@ async def list( async def sync_schemas( self, *, - db_connection_id: str, - table_names: List[str] | NotGiven = NOT_GIVEN, + body: List[table_description_sync_schemas_params.Body], # 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, @@ -357,13 +349,7 @@ async def sync_schemas( """ return await self._post( "/api/table-descriptions/sync-schemas", - body=maybe_transform( - { - "db_connection_id": db_connection_id, - "table_names": table_names, - }, - table_description_sync_schemas_params.TableDescriptionSyncSchemasParams, - ), + body=maybe_transform(body, table_description_sync_schemas_params.TableDescriptionSyncSchemasParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/dataherald/types/table_description_sync_schemas_params.py b/src/dataherald/types/table_description_sync_schemas_params.py index d968da4..880570c 100644 --- a/src/dataherald/types/table_description_sync_schemas_params.py +++ b/src/dataherald/types/table_description_sync_schemas_params.py @@ -5,10 +5,14 @@ from typing import List from typing_extensions import Required, TypedDict -__all__ = ["TableDescriptionSyncSchemasParams"] +__all__ = ["TableDescriptionSyncSchemasParams", "Body"] class TableDescriptionSyncSchemasParams(TypedDict, total=False): + body: Required[List[Body]] + + +class Body(TypedDict, total=False): db_connection_id: Required[str] table_names: List[str] diff --git a/tests/api_resources/test_table_descriptions.py b/tests/api_resources/test_table_descriptions.py index a1c00e1..f3b9daa 100644 --- a/tests/api_resources/test_table_descriptions.py +++ b/tests/api_resources/test_table_descriptions.py @@ -178,22 +178,14 @@ def test_streaming_response_list(self, client: Dataherald) -> None: @parametrize def test_method_sync_schemas(self, client: Dataherald) -> None: table_description = client.table_descriptions.sync_schemas( - db_connection_id="string", - ) - 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"], + body=[{"db_connection_id": "string"}, {"db_connection_id": "string"}, {"db_connection_id": "string"}], ) assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"]) @parametrize def test_raw_response_sync_schemas(self, client: Dataherald) -> None: response = client.table_descriptions.with_raw_response.sync_schemas( - db_connection_id="string", + body=[{"db_connection_id": "string"}, {"db_connection_id": "string"}, {"db_connection_id": "string"}], ) assert response.is_closed is True @@ -204,7 +196,7 @@ def test_raw_response_sync_schemas(self, client: Dataherald) -> None: @parametrize def test_streaming_response_sync_schemas(self, client: Dataherald) -> None: with client.table_descriptions.with_streaming_response.sync_schemas( - db_connection_id="string", + body=[{"db_connection_id": "string"}, {"db_connection_id": "string"}, {"db_connection_id": "string"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -375,22 +367,14 @@ async def test_streaming_response_list(self, async_client: AsyncDataherald) -> N @parametrize async def test_method_sync_schemas(self, async_client: AsyncDataherald) -> None: table_description = await async_client.table_descriptions.sync_schemas( - db_connection_id="string", - ) - assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"]) - - @parametrize - async def test_method_sync_schemas_with_all_params(self, async_client: AsyncDataherald) -> None: - table_description = await async_client.table_descriptions.sync_schemas( - db_connection_id="string", - table_names=["string", "string", "string"], + body=[{"db_connection_id": "string"}, {"db_connection_id": "string"}, {"db_connection_id": "string"}], ) assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"]) @parametrize async def test_raw_response_sync_schemas(self, async_client: AsyncDataherald) -> None: response = await async_client.table_descriptions.with_raw_response.sync_schemas( - db_connection_id="string", + body=[{"db_connection_id": "string"}, {"db_connection_id": "string"}, {"db_connection_id": "string"}], ) assert response.is_closed is True @@ -401,7 +385,7 @@ async def test_raw_response_sync_schemas(self, async_client: AsyncDataherald) -> @parametrize async def test_streaming_response_sync_schemas(self, async_client: AsyncDataherald) -> None: async with async_client.table_descriptions.with_streaming_response.sync_schemas( - db_connection_id="string", + body=[{"db_connection_id": "string"}, {"db_connection_id": "string"}, {"db_connection_id": "string"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"