From a54722eeda6c71c50c558a9f1d68925f94cede19 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 10:14:08 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 2 +- api.md | 4 ++-- .../resources/securetunnels/securetunnels.py | 8 ++++---- .../types/securetunnels/secure_tunnel_link.py | 4 ++-- tests/api_resources/test_securetunnels.py | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index be176ea..ea7faa4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 70 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-eacc19681b584d12739c5775cf012c0a50792f7cf1e12d80d28d2ac0786a896f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-55b1b1224cfcd2083a3df4a1752689ebf1b16821d0baeef75030854010fd6cd4.yml diff --git a/api.md b/api.md index c81247f..40e21aa 100644 --- a/api.md +++ b/api.md @@ -9,14 +9,14 @@ from asktable.types import AnswerModel, Message, Policy Types: ```python -from asktable.types import SecureTunnel, SecuretunnelUpdateResponse, SecuretunnelListResponse +from asktable.types import SecureTunnel, SecuretunnelListResponse ``` Methods: - client.securetunnels.create(\*\*params) -> SecureTunnel - client.securetunnels.retrieve(securetunnel_id) -> SecureTunnel -- client.securetunnels.update(securetunnel_id, \*\*params) -> object +- client.securetunnels.update(securetunnel_id, \*\*params) -> SecureTunnel - client.securetunnels.list(\*\*params) -> SecuretunnelListResponse - client.securetunnels.delete(securetunnel_id) -> None diff --git a/src/asktable/resources/securetunnels/securetunnels.py b/src/asktable/resources/securetunnels/securetunnels.py index d7da912..57153c7 100644 --- a/src/asktable/resources/securetunnels/securetunnels.py +++ b/src/asktable/resources/securetunnels/securetunnels.py @@ -139,7 +139,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> SecureTunnel: """ 更新某个 ATST @@ -173,7 +173,7 @@ def update( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=object, + cast_to=SecureTunnel, ) def list( @@ -361,7 +361,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> SecureTunnel: """ 更新某个 ATST @@ -395,7 +395,7 @@ async def update( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=object, + cast_to=SecureTunnel, ) async def list( diff --git a/src/asktable/types/securetunnels/secure_tunnel_link.py b/src/asktable/types/securetunnels/secure_tunnel_link.py index 2329788..8c69a5b 100644 --- a/src/asktable/types/securetunnels/secure_tunnel_link.py +++ b/src/asktable/types/securetunnels/secure_tunnel_link.py @@ -11,6 +11,8 @@ class Item(BaseModel): id: str + atst_id: str + created_at: datetime datasource_ids: List[str] @@ -19,8 +21,6 @@ class Item(BaseModel): proxy_port: int - securetunnel_id: str - status: str target_host: str diff --git a/tests/api_resources/test_securetunnels.py b/tests/api_resources/test_securetunnels.py index e16aaf1..a088d11 100644 --- a/tests/api_resources/test_securetunnels.py +++ b/tests/api_resources/test_securetunnels.py @@ -95,7 +95,7 @@ def test_method_update(self, client: Asktable) -> None: securetunnel = client.securetunnels.update( securetunnel_id="securetunnel_id", ) - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Asktable) -> None: @@ -105,7 +105,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None: name="我的测试机", unique_key="unique_key", ) - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) @parametrize def test_raw_response_update(self, client: Asktable) -> None: @@ -116,7 +116,7 @@ def test_raw_response_update(self, client: Asktable) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" securetunnel = response.parse() - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) @parametrize def test_streaming_response_update(self, client: Asktable) -> None: @@ -127,7 +127,7 @@ def test_streaming_response_update(self, client: Asktable) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" securetunnel = response.parse() - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) assert cast(Any, response.is_closed) is True @@ -288,7 +288,7 @@ async def test_method_update(self, async_client: AsyncAsktable) -> None: securetunnel = await async_client.securetunnels.update( securetunnel_id="securetunnel_id", ) - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncAsktable) -> None: @@ -298,7 +298,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable) name="我的测试机", unique_key="unique_key", ) - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncAsktable) -> None: @@ -309,7 +309,7 @@ async def test_raw_response_update(self, async_client: AsyncAsktable) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" securetunnel = await response.parse() - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncAsktable) -> None: @@ -320,7 +320,7 @@ async def test_streaming_response_update(self, async_client: AsyncAsktable) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" securetunnel = await response.parse() - assert_matches_type(object, securetunnel, path=["response"]) + assert_matches_type(SecureTunnel, securetunnel, path=["response"]) assert cast(Any, response.is_closed) is True