Skip to content

Commit 0270755

Browse files
feat(api): api update (#191)
1 parent fabff6d commit 0270755

File tree

11 files changed

+59
-6
lines changed

11 files changed

+59
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 96
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-89441bb57f08015241a214ce4e51c76bac21e202f1f9cdc0a90e91c4ccbe4ff0.yml
3-
openapi_spec_hash: 2642d0ba1cbd7daa3dd69af0d3076a26
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-9c2cc4835126cc880e27db1bda2225bd20ca2d6e766000ce4cdcb52a44b24624.yml
3+
openapi_spec_hash: 9c022d30348c22d12c883cf4db075771
44
config_hash: 575ddfb316392e5f7f3c7b7999796a03

src/asktable/resources/bots.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def update(
248248
def list(
249249
self,
250250
*,
251+
bot_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
251252
name: Optional[str] | NotGiven = NOT_GIVEN,
252253
page: int | NotGiven = NOT_GIVEN,
253254
size: int | NotGiven = NOT_GIVEN,
@@ -262,6 +263,8 @@ def list(
262263
查询所有 Bot
263264
264265
Args:
266+
bot_ids: Bot ID
267+
265268
name: 名称
266269
267270
page: Page number
@@ -286,6 +289,7 @@ def list(
286289
timeout=timeout,
287290
query=maybe_transform(
288291
{
292+
"bot_ids": bot_ids,
289293
"name": name,
290294
"page": page,
291295
"size": size,
@@ -589,6 +593,7 @@ async def update(
589593
def list(
590594
self,
591595
*,
596+
bot_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
592597
name: Optional[str] | NotGiven = NOT_GIVEN,
593598
page: int | NotGiven = NOT_GIVEN,
594599
size: int | NotGiven = NOT_GIVEN,
@@ -603,6 +608,8 @@ def list(
603608
查询所有 Bot
604609
605610
Args:
611+
bot_ids: Bot ID
612+
606613
name: 名称
607614
608615
page: Page number
@@ -627,6 +634,7 @@ def list(
627634
timeout=timeout,
628635
query=maybe_transform(
629636
{
637+
"bot_ids": bot_ids,
630638
"name": name,
631639
"page": page,
632640
"size": size,

src/asktable/resources/datasources/datasources.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ def update_field(
487487
field_name: str,
488488
schema_name: str,
489489
table_name: str,
490+
identifiable_type: Optional[
491+
Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
492+
]
493+
| NotGiven = NOT_GIVEN,
490494
visibility: Optional[bool] | NotGiven = NOT_GIVEN,
491495
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
492496
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -499,6 +503,8 @@ def update_field(
499503
更新数据源的某个字段的描述
500504
501505
Args:
506+
identifiable_type: identifiable type
507+
502508
visibility: field visibility
503509
504510
extra_headers: Send extra headers
@@ -514,7 +520,11 @@ def update_field(
514520
return self._patch(
515521
f"/v1/datasources/{datasource_id}/field",
516522
body=maybe_transform(
517-
{"visibility": visibility}, datasource_update_field_params.DatasourceUpdateFieldParams
523+
{
524+
"identifiable_type": identifiable_type,
525+
"visibility": visibility,
526+
},
527+
datasource_update_field_params.DatasourceUpdateFieldParams,
518528
),
519529
options=make_request_options(
520530
extra_headers=extra_headers,
@@ -959,6 +969,10 @@ async def update_field(
959969
field_name: str,
960970
schema_name: str,
961971
table_name: str,
972+
identifiable_type: Optional[
973+
Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
974+
]
975+
| NotGiven = NOT_GIVEN,
962976
visibility: Optional[bool] | NotGiven = NOT_GIVEN,
963977
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
964978
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -971,6 +985,8 @@ async def update_field(
971985
更新数据源的某个字段的描述
972986
973987
Args:
988+
identifiable_type: identifiable type
989+
974990
visibility: field visibility
975991
976992
extra_headers: Send extra headers
@@ -986,7 +1002,11 @@ async def update_field(
9861002
return await self._patch(
9871003
f"/v1/datasources/{datasource_id}/field",
9881004
body=await async_maybe_transform(
989-
{"visibility": visibility}, datasource_update_field_params.DatasourceUpdateFieldParams
1005+
{
1006+
"identifiable_type": identifiable_type,
1007+
"visibility": visibility,
1008+
},
1009+
datasource_update_field_params.DatasourceUpdateFieldParams,
9901010
),
9911011
options=make_request_options(
9921012
extra_headers=extra_headers,

src/asktable/types/bot_list_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import List, Optional
66
from typing_extensions import TypedDict
77

88
__all__ = ["BotListParams"]
99

1010

1111
class BotListParams(TypedDict, total=False):
12+
bot_ids: Optional[List[str]]
13+
"""Bot ID"""
14+
1215
name: Optional[str]
1316
"""名称"""
1417

src/asktable/types/datasource_update_field_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["DatasourceUpdateFieldParams"]
99

@@ -15,5 +15,8 @@ class DatasourceUpdateFieldParams(TypedDict, total=False):
1515

1616
table_name: Required[str]
1717

18+
identifiable_type: Optional[Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]]
19+
"""identifiable type"""
20+
1821
visibility: Optional[bool]
1922
"""field visibility"""

src/asktable/types/datasources/meta_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class MetaSchemasTablesFields(TypedDict, total=False):
2828
data_type: Optional[str]
2929
"""field data type"""
3030

31+
identifiable_type: Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
32+
"""identifiable type"""
33+
3134
sample_data: Optional[str]
3235
"""field sample data"""
3336

src/asktable/types/datasources/meta_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class MetaSchemasTablesFields(TypedDict, total=False):
2626
data_type: Optional[str]
2727
"""field data type"""
2828

29+
identifiable_type: Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
30+
"""identifiable type"""
31+
2932
sample_data: Optional[str]
3033
"""field sample data"""
3134

src/asktable/types/meta.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ class SchemasTablesFields(BaseModel):
3434
data_type: Optional[str] = None
3535
"""field data type"""
3636

37+
identifiable_type: Optional[
38+
Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
39+
] = None
40+
"""identifiable type"""
41+
3742
sample_data: Optional[str] = None
3843
"""field sample data"""
3944

tests/api_resources/datasources/test_meta.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
4545
"name": "name",
4646
"origin_desc": "origin_desc",
4747
"data_type": "data_type",
48+
"identifiable_type": "plain",
4849
"sample_data": "sample_data",
4950
"visibility": True,
5051
}
@@ -155,6 +156,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
155156
"name": "name",
156157
"origin_desc": "origin_desc",
157158
"data_type": "data_type",
159+
"identifiable_type": "plain",
158160
"sample_data": "sample_data",
159161
"visibility": True,
160162
}
@@ -274,6 +276,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
274276
"name": "name",
275277
"origin_desc": "origin_desc",
276278
"data_type": "data_type",
279+
"identifiable_type": "plain",
277280
"sample_data": "sample_data",
278281
"visibility": True,
279282
}
@@ -384,6 +387,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
384387
"name": "name",
385388
"origin_desc": "origin_desc",
386389
"data_type": "data_type",
390+
"identifiable_type": "plain",
387391
"sample_data": "sample_data",
388392
"visibility": True,
389393
}

tests/api_resources/test_bots.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def test_method_list(self, client: Asktable) -> None:
172172
@parametrize
173173
def test_method_list_with_all_params(self, client: Asktable) -> None:
174174
bot = client.bots.list(
175+
bot_ids=["string"],
175176
name="name",
176177
page=1,
177178
size=1,
@@ -436,6 +437,7 @@ async def test_method_list(self, async_client: AsyncAsktable) -> None:
436437
@parametrize
437438
async def test_method_list_with_all_params(self, async_client: AsyncAsktable) -> None:
438439
bot = await async_client.bots.list(
440+
bot_ids=["string"],
439441
name="name",
440442
page=1,
441443
size=1,

0 commit comments

Comments
 (0)