From 2df26a34f60a8fec4fe125329e4e5638d39a64e7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 21 Jan 2025 04:02:43 +0000
Subject: [PATCH] chore(internal): codegen related update
---
api.md | 2 +-
src/asktable/resources/extapis/routes.py | 24 +++++-----
.../types/extapis/route_create_params.py | 4 +-
tests/api_resources/extapis/test_routes.py | 44 +++++++++----------
4 files changed, 36 insertions(+), 38 deletions(-)
diff --git a/api.md b/api.md
index bfeed1ba..bd1402c7 100644
--- a/api.md
+++ b/api.md
@@ -237,7 +237,7 @@ from asktable.types.extapis import ExtapiRoute, RouteListResponse
Methods:
-- client.extapis.routes.create(\*, path_extapi_id, \*\*params) -> ExtapiRoute
+- client.extapis.routes.create(extapi_id_1, \*\*params) -> ExtapiRoute
- client.extapis.routes.retrieve(route_id, \*, extapi_id) -> ExtapiRoute
- client.extapis.routes.update(route_id, \*, extapi_id, \*\*params) -> ExtapiRoute
- client.extapis.routes.list(extapi_id) -> RouteListResponse
diff --git a/src/asktable/resources/extapis/routes.py b/src/asktable/resources/extapis/routes.py
index 994f1cb4..243a26f6 100644
--- a/src/asktable/resources/extapis/routes.py
+++ b/src/asktable/resources/extapis/routes.py
@@ -51,11 +51,11 @@ def with_streaming_response(self) -> RoutesResourceWithStreamingResponse:
def create(
self,
+ extapi_id_1: str,
*,
- path_extapi_id: str,
id: str,
created_at: Union[str, datetime],
- body_extapi_id: str,
+ extapi_id_2: str,
method: Literal["GET", "POST", "PUT", "DELETE"],
name: str,
path: str,
@@ -95,15 +95,15 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not path_extapi_id:
- raise ValueError(f"Expected a non-empty value for `path_extapi_id` but received {path_extapi_id!r}")
+ if not extapi_id_1:
+ raise ValueError(f"Expected a non-empty value for `extapi_id_1` but received {extapi_id_1!r}")
return self._post(
- f"/extapis/{path_extapi_id}/routes",
+ f"/extapis/{extapi_id_1}/routes",
body=maybe_transform(
{
"id": id,
"created_at": created_at,
- "body_extapi_id": body_extapi_id,
+ "extapi_id_2": extapi_id_2,
"method": method,
"name": name,
"path": path,
@@ -315,11 +315,11 @@ def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse:
async def create(
self,
+ extapi_id_1: str,
*,
- path_extapi_id: str,
id: str,
created_at: Union[str, datetime],
- body_extapi_id: str,
+ extapi_id_2: str,
method: Literal["GET", "POST", "PUT", "DELETE"],
name: str,
path: str,
@@ -359,15 +359,15 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not path_extapi_id:
- raise ValueError(f"Expected a non-empty value for `path_extapi_id` but received {path_extapi_id!r}")
+ if not extapi_id_1:
+ raise ValueError(f"Expected a non-empty value for `extapi_id_1` but received {extapi_id_1!r}")
return await self._post(
- f"/extapis/{path_extapi_id}/routes",
+ f"/extapis/{extapi_id_1}/routes",
body=await async_maybe_transform(
{
"id": id,
"created_at": created_at,
- "body_extapi_id": body_extapi_id,
+ "extapi_id_2": extapi_id_2,
"method": method,
"name": name,
"path": path,
diff --git a/src/asktable/types/extapis/route_create_params.py b/src/asktable/types/extapis/route_create_params.py
index cfaafef7..7528ec33 100644
--- a/src/asktable/types/extapis/route_create_params.py
+++ b/src/asktable/types/extapis/route_create_params.py
@@ -12,13 +12,11 @@
class RouteCreateParams(TypedDict, total=False):
- path_extapi_id: Required[Annotated[str, PropertyInfo(alias="extapi_id")]]
-
id: Required[str]
created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- body_extapi_id: Required[Annotated[str, PropertyInfo(alias="extapi_id")]]
+ extapi_id_2: Required[Annotated[str, PropertyInfo(alias="extapi_id")]]
method: Required[Literal["GET", "POST", "PUT", "DELETE"]]
"""HTTP 方法"""
diff --git a/tests/api_resources/extapis/test_routes.py b/tests/api_resources/extapis/test_routes.py
index 5fa13718..4e02e0d9 100644
--- a/tests/api_resources/extapis/test_routes.py
+++ b/tests/api_resources/extapis/test_routes.py
@@ -21,10 +21,10 @@ class TestRoutes:
@parametrize
def test_method_create(self, client: Asktable) -> None:
route = client.extapis.routes.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -35,10 +35,10 @@ def test_method_create(self, client: Asktable) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Asktable) -> None:
route = client.extapis.routes.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -53,10 +53,10 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
@parametrize
def test_raw_response_create(self, client: Asktable) -> None:
response = client.extapis.routes.with_raw_response.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -71,10 +71,10 @@ def test_raw_response_create(self, client: Asktable) -> None:
@parametrize
def test_streaming_response_create(self, client: Asktable) -> None:
with client.extapis.routes.with_streaming_response.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -90,12 +90,12 @@ def test_streaming_response_create(self, client: Asktable) -> None:
@parametrize
def test_path_params_create(self, client: Asktable) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_extapi_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `extapi_id_1` but received ''"):
client.extapis.routes.with_raw_response.create(
- path_extapi_id="",
+ extapi_id_1="",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="",
+ extapi_id_2="",
method="GET",
name="name",
path="/resource",
@@ -305,10 +305,10 @@ class TestAsyncRoutes:
@parametrize
async def test_method_create(self, async_client: AsyncAsktable) -> None:
route = await async_client.extapis.routes.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -319,10 +319,10 @@ async def test_method_create(self, async_client: AsyncAsktable) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncAsktable) -> None:
route = await async_client.extapis.routes.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -337,10 +337,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
@parametrize
async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
response = await async_client.extapis.routes.with_raw_response.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -355,10 +355,10 @@ async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncAsktable) -> None:
async with async_client.extapis.routes.with_streaming_response.create(
- path_extapi_id="extapi_id",
+ extapi_id_1="extapi_id",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="extapi_id",
+ extapi_id_2="extapi_id",
method="GET",
name="name",
path="/resource",
@@ -374,12 +374,12 @@ async def test_streaming_response_create(self, async_client: AsyncAsktable) -> N
@parametrize
async def test_path_params_create(self, async_client: AsyncAsktable) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_extapi_id` but received ''"):
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `extapi_id_1` but received ''"):
await async_client.extapis.routes.with_raw_response.create(
- path_extapi_id="",
+ extapi_id_1="",
id="id",
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
- body_extapi_id="",
+ extapi_id_2="",
method="GET",
name="name",
path="/resource",