Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 96
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-89441bb57f08015241a214ce4e51c76bac21e202f1f9cdc0a90e91c4ccbe4ff0.yml
openapi_spec_hash: 2642d0ba1cbd7daa3dd69af0d3076a26
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-9c2cc4835126cc880e27db1bda2225bd20ca2d6e766000ce4cdcb52a44b24624.yml
openapi_spec_hash: 9c022d30348c22d12c883cf4db075771
config_hash: 575ddfb316392e5f7f3c7b7999796a03
8 changes: 8 additions & 0 deletions src/asktable/resources/bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def update(
def list(
self,
*,
bot_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
size: int | NotGiven = NOT_GIVEN,
Expand All @@ -262,6 +263,8 @@ def list(
查询所有 Bot

Args:
bot_ids: Bot ID

name: 名称

page: Page number
Expand All @@ -286,6 +289,7 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"bot_ids": bot_ids,
"name": name,
"page": page,
"size": size,
Expand Down Expand Up @@ -589,6 +593,7 @@ async def update(
def list(
self,
*,
bot_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
size: int | NotGiven = NOT_GIVEN,
Expand All @@ -603,6 +608,8 @@ def list(
查询所有 Bot

Args:
bot_ids: Bot ID

name: 名称

page: Page number
Expand All @@ -627,6 +634,7 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"bot_ids": bot_ids,
"name": name,
"page": page,
"size": size,
Expand Down
24 changes: 22 additions & 2 deletions src/asktable/resources/datasources/datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ def update_field(
field_name: str,
schema_name: str,
table_name: str,
identifiable_type: Optional[
Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
]
| NotGiven = NOT_GIVEN,
visibility: Optional[bool] | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -499,6 +503,8 @@ def update_field(
更新数据源的某个字段的描述

Args:
identifiable_type: identifiable type

visibility: field visibility

extra_headers: Send extra headers
Expand All @@ -514,7 +520,11 @@ def update_field(
return self._patch(
f"/v1/datasources/{datasource_id}/field",
body=maybe_transform(
{"visibility": visibility}, datasource_update_field_params.DatasourceUpdateFieldParams
{
"identifiable_type": identifiable_type,
"visibility": visibility,
},
datasource_update_field_params.DatasourceUpdateFieldParams,
),
options=make_request_options(
extra_headers=extra_headers,
Expand Down Expand Up @@ -959,6 +969,10 @@ async def update_field(
field_name: str,
schema_name: str,
table_name: str,
identifiable_type: Optional[
Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
]
| NotGiven = NOT_GIVEN,
visibility: Optional[bool] | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -971,6 +985,8 @@ async def update_field(
更新数据源的某个字段的描述

Args:
identifiable_type: identifiable type

visibility: field visibility

extra_headers: Send extra headers
Expand All @@ -986,7 +1002,11 @@ async def update_field(
return await self._patch(
f"/v1/datasources/{datasource_id}/field",
body=await async_maybe_transform(
{"visibility": visibility}, datasource_update_field_params.DatasourceUpdateFieldParams
{
"identifiable_type": identifiable_type,
"visibility": visibility,
},
datasource_update_field_params.DatasourceUpdateFieldParams,
),
options=make_request_options(
extra_headers=extra_headers,
Expand Down
5 changes: 4 additions & 1 deletion src/asktable/types/bot_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

from __future__ import annotations

from typing import Optional
from typing import List, Optional
from typing_extensions import TypedDict

__all__ = ["BotListParams"]


class BotListParams(TypedDict, total=False):
bot_ids: Optional[List[str]]
"""Bot ID"""

name: Optional[str]
"""名称"""

Expand Down
5 changes: 4 additions & 1 deletion src/asktable/types/datasource_update_field_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from typing import Optional
from typing_extensions import Required, TypedDict
from typing_extensions import Literal, Required, TypedDict

__all__ = ["DatasourceUpdateFieldParams"]

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

table_name: Required[str]

identifiable_type: Optional[Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]]
"""identifiable type"""

visibility: Optional[bool]
"""field visibility"""
3 changes: 3 additions & 0 deletions src/asktable/types/datasources/meta_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class MetaSchemasTablesFields(TypedDict, total=False):
data_type: Optional[str]
"""field data type"""

identifiable_type: Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
"""identifiable type"""

sample_data: Optional[str]
"""field sample data"""

Expand Down
3 changes: 3 additions & 0 deletions src/asktable/types/datasources/meta_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class MetaSchemasTablesFields(TypedDict, total=False):
data_type: Optional[str]
"""field data type"""

identifiable_type: Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
"""identifiable type"""

sample_data: Optional[str]
"""field sample data"""

Expand Down
5 changes: 5 additions & 0 deletions src/asktable/types/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class SchemasTablesFields(BaseModel):
data_type: Optional[str] = None
"""field data type"""

identifiable_type: Optional[
Literal["plain", "person_name", "email", "ssn", "id", "phone", "address", "company"]
] = None
"""identifiable type"""

sample_data: Optional[str] = None
"""field sample data"""

Expand Down
4 changes: 4 additions & 0 deletions tests/api_resources/datasources/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
"name": "name",
"origin_desc": "origin_desc",
"data_type": "data_type",
"identifiable_type": "plain",
"sample_data": "sample_data",
"visibility": True,
}
Expand Down Expand Up @@ -155,6 +156,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
"name": "name",
"origin_desc": "origin_desc",
"data_type": "data_type",
"identifiable_type": "plain",
"sample_data": "sample_data",
"visibility": True,
}
Expand Down Expand Up @@ -274,6 +276,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
"name": "name",
"origin_desc": "origin_desc",
"data_type": "data_type",
"identifiable_type": "plain",
"sample_data": "sample_data",
"visibility": True,
}
Expand Down Expand Up @@ -384,6 +387,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
"name": "name",
"origin_desc": "origin_desc",
"data_type": "data_type",
"identifiable_type": "plain",
"sample_data": "sample_data",
"visibility": True,
}
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def test_method_list(self, client: Asktable) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Asktable) -> None:
bot = client.bots.list(
bot_ids=["string"],
name="name",
page=1,
size=1,
Expand Down Expand Up @@ -436,6 +437,7 @@ async def test_method_list(self, async_client: AsyncAsktable) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncAsktable) -> None:
bot = await async_client.bots.list(
bot_ids=["string"],
name="name",
page=1,
size=1,
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def test_method_update_field_with_all_params(self, client: Asktable) -> None:
field_name="field_name",
schema_name="schema_name",
table_name="table_name",
identifiable_type="plain",
visibility=True,
)
assert_matches_type(object, datasource, path=["response"])
Expand Down Expand Up @@ -806,6 +807,7 @@ async def test_method_update_field_with_all_params(self, async_client: AsyncAskt
field_name="field_name",
schema_name="schema_name",
table_name="table_name",
identifiable_type="plain",
visibility=True,
)
assert_matches_type(object, datasource, path=["response"])
Expand Down