Skip to content

Commit e70fbf4

Browse files
chore(internal): codegen related update (#138)
1 parent e4c4ede commit e70fbf4

File tree

4 files changed

+36
-38
lines changed

4 files changed

+36
-38
lines changed

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ from asktable.types.extapis import ExtapiRoute, RouteListResponse
237237

238238
Methods:
239239

240-
- <code title="post /extapis/{extapi_id}/routes">client.extapis.routes.<a href="./src/asktable/resources/extapis/routes.py">create</a>(\*, path_extapi_id, \*\*<a href="src/asktable/types/extapis/route_create_params.py">params</a>) -> <a href="./src/asktable/types/extapis/extapi_route.py">ExtapiRoute</a></code>
240+
- <code title="post /extapis/{extapi_id}/routes">client.extapis.routes.<a href="./src/asktable/resources/extapis/routes.py">create</a>(extapi_id_1, \*\*<a href="src/asktable/types/extapis/route_create_params.py">params</a>) -> <a href="./src/asktable/types/extapis/extapi_route.py">ExtapiRoute</a></code>
241241
- <code title="get /extapis/{extapi_id}/routes/{route_id}">client.extapis.routes.<a href="./src/asktable/resources/extapis/routes.py">retrieve</a>(route_id, \*, extapi_id) -> <a href="./src/asktable/types/extapis/extapi_route.py">ExtapiRoute</a></code>
242242
- <code title="post /extapis/{extapi_id}/routes/{route_id}">client.extapis.routes.<a href="./src/asktable/resources/extapis/routes.py">update</a>(route_id, \*, extapi_id, \*\*<a href="src/asktable/types/extapis/route_update_params.py">params</a>) -> <a href="./src/asktable/types/extapis/extapi_route.py">ExtapiRoute</a></code>
243243
- <code title="get /extapis/{extapi_id}/routes">client.extapis.routes.<a href="./src/asktable/resources/extapis/routes.py">list</a>(extapi_id) -> <a href="./src/asktable/types/extapis/route_list_response.py">RouteListResponse</a></code>

src/asktable/resources/extapis/routes.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ def with_streaming_response(self) -> RoutesResourceWithStreamingResponse:
5151

5252
def create(
5353
self,
54+
extapi_id_1: str,
5455
*,
55-
path_extapi_id: str,
5656
id: str,
5757
created_at: Union[str, datetime],
58-
body_extapi_id: str,
58+
extapi_id_2: str,
5959
method: Literal["GET", "POST", "PUT", "DELETE"],
6060
name: str,
6161
path: str,
@@ -95,15 +95,15 @@ def create(
9595
9696
timeout: Override the client-level default timeout for this request, in seconds
9797
"""
98-
if not path_extapi_id:
99-
raise ValueError(f"Expected a non-empty value for `path_extapi_id` but received {path_extapi_id!r}")
98+
if not extapi_id_1:
99+
raise ValueError(f"Expected a non-empty value for `extapi_id_1` but received {extapi_id_1!r}")
100100
return self._post(
101-
f"/extapis/{path_extapi_id}/routes",
101+
f"/extapis/{extapi_id_1}/routes",
102102
body=maybe_transform(
103103
{
104104
"id": id,
105105
"created_at": created_at,
106-
"body_extapi_id": body_extapi_id,
106+
"extapi_id_2": extapi_id_2,
107107
"method": method,
108108
"name": name,
109109
"path": path,
@@ -315,11 +315,11 @@ def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse:
315315

316316
async def create(
317317
self,
318+
extapi_id_1: str,
318319
*,
319-
path_extapi_id: str,
320320
id: str,
321321
created_at: Union[str, datetime],
322-
body_extapi_id: str,
322+
extapi_id_2: str,
323323
method: Literal["GET", "POST", "PUT", "DELETE"],
324324
name: str,
325325
path: str,
@@ -359,15 +359,15 @@ async def create(
359359
360360
timeout: Override the client-level default timeout for this request, in seconds
361361
"""
362-
if not path_extapi_id:
363-
raise ValueError(f"Expected a non-empty value for `path_extapi_id` but received {path_extapi_id!r}")
362+
if not extapi_id_1:
363+
raise ValueError(f"Expected a non-empty value for `extapi_id_1` but received {extapi_id_1!r}")
364364
return await self._post(
365-
f"/extapis/{path_extapi_id}/routes",
365+
f"/extapis/{extapi_id_1}/routes",
366366
body=await async_maybe_transform(
367367
{
368368
"id": id,
369369
"created_at": created_at,
370-
"body_extapi_id": body_extapi_id,
370+
"extapi_id_2": extapi_id_2,
371371
"method": method,
372372
"name": name,
373373
"path": path,

src/asktable/types/extapis/route_create_params.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212

1313

1414
class RouteCreateParams(TypedDict, total=False):
15-
path_extapi_id: Required[Annotated[str, PropertyInfo(alias="extapi_id")]]
16-
1715
id: Required[str]
1816

1917
created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
2018

21-
body_extapi_id: Required[Annotated[str, PropertyInfo(alias="extapi_id")]]
19+
extapi_id_2: Required[Annotated[str, PropertyInfo(alias="extapi_id")]]
2220

2321
method: Required[Literal["GET", "POST", "PUT", "DELETE"]]
2422
"""HTTP 方法"""

tests/api_resources/extapis/test_routes.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class TestRoutes:
2121
@parametrize
2222
def test_method_create(self, client: Asktable) -> None:
2323
route = client.extapis.routes.create(
24-
path_extapi_id="extapi_id",
24+
extapi_id_1="extapi_id",
2525
id="id",
2626
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
27-
body_extapi_id="extapi_id",
27+
extapi_id_2="extapi_id",
2828
method="GET",
2929
name="name",
3030
path="/resource",
@@ -35,10 +35,10 @@ def test_method_create(self, client: Asktable) -> None:
3535
@parametrize
3636
def test_method_create_with_all_params(self, client: Asktable) -> None:
3737
route = client.extapis.routes.create(
38-
path_extapi_id="extapi_id",
38+
extapi_id_1="extapi_id",
3939
id="id",
4040
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
41-
body_extapi_id="extapi_id",
41+
extapi_id_2="extapi_id",
4242
method="GET",
4343
name="name",
4444
path="/resource",
@@ -53,10 +53,10 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
5353
@parametrize
5454
def test_raw_response_create(self, client: Asktable) -> None:
5555
response = client.extapis.routes.with_raw_response.create(
56-
path_extapi_id="extapi_id",
56+
extapi_id_1="extapi_id",
5757
id="id",
5858
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
59-
body_extapi_id="extapi_id",
59+
extapi_id_2="extapi_id",
6060
method="GET",
6161
name="name",
6262
path="/resource",
@@ -71,10 +71,10 @@ def test_raw_response_create(self, client: Asktable) -> None:
7171
@parametrize
7272
def test_streaming_response_create(self, client: Asktable) -> None:
7373
with client.extapis.routes.with_streaming_response.create(
74-
path_extapi_id="extapi_id",
74+
extapi_id_1="extapi_id",
7575
id="id",
7676
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
77-
body_extapi_id="extapi_id",
77+
extapi_id_2="extapi_id",
7878
method="GET",
7979
name="name",
8080
path="/resource",
@@ -90,12 +90,12 @@ def test_streaming_response_create(self, client: Asktable) -> None:
9090

9191
@parametrize
9292
def test_path_params_create(self, client: Asktable) -> None:
93-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_extapi_id` but received ''"):
93+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `extapi_id_1` but received ''"):
9494
client.extapis.routes.with_raw_response.create(
95-
path_extapi_id="",
95+
extapi_id_1="",
9696
id="id",
9797
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
98-
body_extapi_id="",
98+
extapi_id_2="",
9999
method="GET",
100100
name="name",
101101
path="/resource",
@@ -305,10 +305,10 @@ class TestAsyncRoutes:
305305
@parametrize
306306
async def test_method_create(self, async_client: AsyncAsktable) -> None:
307307
route = await async_client.extapis.routes.create(
308-
path_extapi_id="extapi_id",
308+
extapi_id_1="extapi_id",
309309
id="id",
310310
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
311-
body_extapi_id="extapi_id",
311+
extapi_id_2="extapi_id",
312312
method="GET",
313313
name="name",
314314
path="/resource",
@@ -319,10 +319,10 @@ async def test_method_create(self, async_client: AsyncAsktable) -> None:
319319
@parametrize
320320
async def test_method_create_with_all_params(self, async_client: AsyncAsktable) -> None:
321321
route = await async_client.extapis.routes.create(
322-
path_extapi_id="extapi_id",
322+
extapi_id_1="extapi_id",
323323
id="id",
324324
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
325-
body_extapi_id="extapi_id",
325+
extapi_id_2="extapi_id",
326326
method="GET",
327327
name="name",
328328
path="/resource",
@@ -337,10 +337,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
337337
@parametrize
338338
async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
339339
response = await async_client.extapis.routes.with_raw_response.create(
340-
path_extapi_id="extapi_id",
340+
extapi_id_1="extapi_id",
341341
id="id",
342342
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
343-
body_extapi_id="extapi_id",
343+
extapi_id_2="extapi_id",
344344
method="GET",
345345
name="name",
346346
path="/resource",
@@ -355,10 +355,10 @@ async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
355355
@parametrize
356356
async def test_streaming_response_create(self, async_client: AsyncAsktable) -> None:
357357
async with async_client.extapis.routes.with_streaming_response.create(
358-
path_extapi_id="extapi_id",
358+
extapi_id_1="extapi_id",
359359
id="id",
360360
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
361-
body_extapi_id="extapi_id",
361+
extapi_id_2="extapi_id",
362362
method="GET",
363363
name="name",
364364
path="/resource",
@@ -374,12 +374,12 @@ async def test_streaming_response_create(self, async_client: AsyncAsktable) -> N
374374

375375
@parametrize
376376
async def test_path_params_create(self, async_client: AsyncAsktable) -> None:
377-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_extapi_id` but received ''"):
377+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `extapi_id_1` but received ''"):
378378
await async_client.extapis.routes.with_raw_response.create(
379-
path_extapi_id="",
379+
extapi_id_1="",
380380
id="id",
381381
created_at=parse_datetime("2019-12-27T18:11:19.117Z"),
382-
body_extapi_id="",
382+
extapi_id_2="",
383383
method="GET",
384384
name="name",
385385
path="/resource",

0 commit comments

Comments
 (0)