Skip to content

Commit 6fceb3a

Browse files
feat(api): manual updates (#28)
1 parent d72ad66 commit 6fceb3a

File tree

23 files changed

+1504
-27
lines changed

23 files changed

+1504
-27
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 68
1+
configured_endpoints: 74
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-2501e64cd24ad589fc833556bbecd5f54321add8f57b18c6af3503a75be0101f.yml

api.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,20 @@ Methods:
139139
Types:
140140

141141
```python
142-
from asktable.types.datasources import MetaCreateResponse, MetaRetrieveResponse, MetaUpdateResponse
142+
from asktable.types.datasources import (
143+
Meta,
144+
MetaCreateResponse,
145+
MetaUpdateResponse,
146+
MetaDeleteResponse,
147+
)
143148
```
144149

145150
Methods:
146151

147152
- <code title="post /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">create</a>(datasource_id, \*\*<a href="src/asktable/types/datasources/meta_create_params.py">params</a>) -> <a href="./src/asktable/types/datasources/meta_create_response.py">object</a></code>
148-
- <code title="get /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">retrieve</a>(datasource_id) -> <a href="./src/asktable/types/datasources/meta_retrieve_response.py">MetaRetrieveResponse</a></code>
153+
- <code title="get /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">retrieve</a>(datasource_id) -> <a href="./src/asktable/types/datasources/meta.py">Meta</a></code>
149154
- <code title="put /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">update</a>(datasource_id, \*\*<a href="src/asktable/types/datasources/meta_update_params.py">params</a>) -> <a href="./src/asktable/types/datasources/meta_update_response.py">object</a></code>
155+
- <code title="delete /datasources/{datasource_id}/meta">client.datasources.meta.<a href="./src/asktable/resources/datasources/meta.py">delete</a>(datasource_id) -> <a href="./src/asktable/types/datasources/meta_delete_response.py">object</a></code>
150156

151157
## UploadParams
152158

@@ -279,7 +285,19 @@ from asktable.types import AnswerDataSourceOut
279285

280286
Methods:
281287

282-
- <code title="post /integration/excel_csv_ask">client.integration.<a href="./src/asktable/resources/integration.py">excel_csv_ask</a>(\*\*<a href="src/asktable/types/integration_excel_csv_ask_params.py">params</a>) -> <a href="./src/asktable/types/answer_data_source_out.py">AnswerDataSourceOut</a></code>
288+
- <code title="post /integration/excel_csv_ask">client.integration.<a href="./src/asktable/resources/integration/integration.py">excel_csv_ask</a>(\*\*<a href="src/asktable/types/integration_excel_csv_ask_params.py">params</a>) -> <a href="./src/asktable/types/answer_data_source_out.py">AnswerDataSourceOut</a></code>
289+
290+
## ExcelCsv
291+
292+
Types:
293+
294+
```python
295+
from asktable.types.integration import DatasourceOut
296+
```
297+
298+
Methods:
299+
300+
- <code title="post /integration/create_excel_ds">client.integration.excel_csv.<a href="./src/asktable/resources/integration/excel_csv.py">create</a>(\*\*<a href="src/asktable/types/integration/excel_csv_create_params.py">params</a>) -> <a href="./src/asktable/types/data_source.py">DataSource</a></code>
283301

284302
# Sys
285303

@@ -324,3 +342,18 @@ from asktable.types.sys.projects import TokenCreateResponse
324342
Methods:
325343

326344
- <code title="post /sys/projects/{project_id}/tokens">client.sys.projects.tokens.<a href="./src/asktable/resources/sys/projects/tokens.py">create</a>(project_id, \*\*<a href="src/asktable/types/sys/projects/token_create_params.py">params</a>) -> <a href="./src/asktable/types/sys/projects/token_create_response.py">object</a></code>
345+
346+
# KB
347+
348+
Types:
349+
350+
```python
351+
from asktable.types import Document, PageDocument, KBCreateResponse, KBDeleteResponse
352+
```
353+
354+
Methods:
355+
356+
- <code title="post /kb">client.kb.<a href="./src/asktable/resources/kb.py">create</a>(\*\*<a href="src/asktable/types/kb_create_params.py">params</a>) -> <a href="./src/asktable/types/kb_create_response.py">KBCreateResponse</a></code>
357+
- <code title="get /kb/{doc_id}">client.kb.<a href="./src/asktable/resources/kb.py">retrieve</a>(doc_id) -> <a href="./src/asktable/types/document.py">Document</a></code>
358+
- <code title="get /kb">client.kb.<a href="./src/asktable/resources/kb.py">list</a>(\*\*<a href="src/asktable/types/kb_list_params.py">params</a>) -> <a href="./src/asktable/types/page_document.py">PageDocument</a></code>
359+
- <code title="delete /kb/{doc_id}">client.kb.<a href="./src/asktable/resources/kb.py">delete</a>(doc_id) -> <a href="./src/asktable/types/kb_delete_response.py">object</a></code>

src/asktable/_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Asktable(SyncAPIClient):
5858
caches: resources.CachesResource
5959
integration: resources.IntegrationResource
6060
sys: resources.SysResource
61+
kb: resources.KBResource
6162
with_raw_response: AsktableWithRawResponse
6263
with_streaming_response: AsktableWithStreamedResponse
6364

@@ -127,6 +128,7 @@ def __init__(
127128
self.caches = resources.CachesResource(self)
128129
self.integration = resources.IntegrationResource(self)
129130
self.sys = resources.SysResource(self)
131+
self.kb = resources.KBResource(self)
130132
self.with_raw_response = AsktableWithRawResponse(self)
131133
self.with_streaming_response = AsktableWithStreamedResponse(self)
132134

@@ -248,6 +250,7 @@ class AsyncAsktable(AsyncAPIClient):
248250
caches: resources.AsyncCachesResource
249251
integration: resources.AsyncIntegrationResource
250252
sys: resources.AsyncSysResource
253+
kb: resources.AsyncKBResource
251254
with_raw_response: AsyncAsktableWithRawResponse
252255
with_streaming_response: AsyncAsktableWithStreamedResponse
253256

@@ -317,6 +320,7 @@ def __init__(
317320
self.caches = resources.AsyncCachesResource(self)
318321
self.integration = resources.AsyncIntegrationResource(self)
319322
self.sys = resources.AsyncSysResource(self)
323+
self.kb = resources.AsyncKBResource(self)
320324
self.with_raw_response = AsyncAsktableWithRawResponse(self)
321325
self.with_streaming_response = AsyncAsktableWithStreamedResponse(self)
322326

@@ -439,6 +443,7 @@ def __init__(self, client: Asktable) -> None:
439443
self.caches = resources.CachesResourceWithRawResponse(client.caches)
440444
self.integration = resources.IntegrationResourceWithRawResponse(client.integration)
441445
self.sys = resources.SysResourceWithRawResponse(client.sys)
446+
self.kb = resources.KBResourceWithRawResponse(client.kb)
442447

443448

444449
class AsyncAsktableWithRawResponse:
@@ -455,6 +460,7 @@ def __init__(self, client: AsyncAsktable) -> None:
455460
self.caches = resources.AsyncCachesResourceWithRawResponse(client.caches)
456461
self.integration = resources.AsyncIntegrationResourceWithRawResponse(client.integration)
457462
self.sys = resources.AsyncSysResourceWithRawResponse(client.sys)
463+
self.kb = resources.AsyncKBResourceWithRawResponse(client.kb)
458464

459465

460466
class AsktableWithStreamedResponse:
@@ -471,6 +477,7 @@ def __init__(self, client: Asktable) -> None:
471477
self.caches = resources.CachesResourceWithStreamingResponse(client.caches)
472478
self.integration = resources.IntegrationResourceWithStreamingResponse(client.integration)
473479
self.sys = resources.SysResourceWithStreamingResponse(client.sys)
480+
self.kb = resources.KBResourceWithStreamingResponse(client.kb)
474481

475482

476483
class AsyncAsktableWithStreamedResponse:
@@ -487,6 +494,7 @@ def __init__(self, client: AsyncAsktable) -> None:
487494
self.caches = resources.AsyncCachesResourceWithStreamingResponse(client.caches)
488495
self.integration = resources.AsyncIntegrationResourceWithStreamingResponse(client.integration)
489496
self.sys = resources.AsyncSysResourceWithStreamingResponse(client.sys)
497+
self.kb = resources.AsyncKBResourceWithStreamingResponse(client.kb)
490498

491499

492500
Client = Asktable

src/asktable/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .kb import (
4+
KBResource,
5+
AsyncKBResource,
6+
KBResourceWithRawResponse,
7+
AsyncKBResourceWithRawResponse,
8+
KBResourceWithStreamingResponse,
9+
AsyncKBResourceWithStreamingResponse,
10+
)
311
from .sys import (
412
SysResource,
513
AsyncSysResource,
@@ -170,4 +178,10 @@
170178
"AsyncSysResourceWithRawResponse",
171179
"SysResourceWithStreamingResponse",
172180
"AsyncSysResourceWithStreamingResponse",
181+
"KBResource",
182+
"AsyncKBResource",
183+
"KBResourceWithRawResponse",
184+
"AsyncKBResourceWithRawResponse",
185+
"KBResourceWithStreamingResponse",
186+
"AsyncKBResourceWithStreamingResponse",
173187
]

src/asktable/resources/datasources/meta.py

Lines changed: 83 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
)
2424
from ..._base_client import make_request_options
2525
from ...types.datasources import meta_create_params, meta_update_params
26-
from ...types.datasources.meta_retrieve_response import MetaRetrieveResponse
26+
from ...types.datasources.meta import Meta
2727

2828
__all__ = ["MetaResource", "AsyncMetaResource"]
2929

@@ -156,7 +156,7 @@ def retrieve(
156156
extra_query: Query | None = None,
157157
extra_body: Body | None = None,
158158
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
159-
) -> MetaRetrieveResponse:
159+
) -> Meta:
160160
"""
161161
从数据源中获取最新的元数据
162162
@@ -176,7 +176,7 @@ def retrieve(
176176
options=make_request_options(
177177
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
178178
),
179-
cast_to=MetaRetrieveResponse,
179+
cast_to=Meta,
180180
)
181181

182182
@overload
@@ -269,6 +269,39 @@ def update(
269269
cast_to=object,
270270
)
271271

272+
def delete(
273+
self,
274+
datasource_id: str,
275+
*,
276+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
277+
# The extra values given here take precedence over values defined on the client or passed to this method.
278+
extra_headers: Headers | None = None,
279+
extra_query: Query | None = None,
280+
extra_body: Body | None = None,
281+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
282+
) -> object:
283+
"""
284+
Delete Datasource Metadata
285+
286+
Args:
287+
extra_headers: Send extra headers
288+
289+
extra_query: Add additional query parameters to the request
290+
291+
extra_body: Add additional JSON properties to the request
292+
293+
timeout: Override the client-level default timeout for this request, in seconds
294+
"""
295+
if not datasource_id:
296+
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
297+
return self._delete(
298+
f"/datasources/{datasource_id}/meta",
299+
options=make_request_options(
300+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
301+
),
302+
cast_to=object,
303+
)
304+
272305

273306
class AsyncMetaResource(AsyncAPIResource):
274307
@cached_property
@@ -398,7 +431,7 @@ async def retrieve(
398431
extra_query: Query | None = None,
399432
extra_body: Body | None = None,
400433
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
401-
) -> MetaRetrieveResponse:
434+
) -> Meta:
402435
"""
403436
从数据源中获取最新的元数据
404437
@@ -418,7 +451,7 @@ async def retrieve(
418451
options=make_request_options(
419452
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
420453
),
421-
cast_to=MetaRetrieveResponse,
454+
cast_to=Meta,
422455
)
423456

424457
@overload
@@ -511,6 +544,39 @@ async def update(
511544
cast_to=object,
512545
)
513546

547+
async def delete(
548+
self,
549+
datasource_id: str,
550+
*,
551+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
552+
# The extra values given here take precedence over values defined on the client or passed to this method.
553+
extra_headers: Headers | None = None,
554+
extra_query: Query | None = None,
555+
extra_body: Body | None = None,
556+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
557+
) -> object:
558+
"""
559+
Delete Datasource Metadata
560+
561+
Args:
562+
extra_headers: Send extra headers
563+
564+
extra_query: Add additional query parameters to the request
565+
566+
extra_body: Add additional JSON properties to the request
567+
568+
timeout: Override the client-level default timeout for this request, in seconds
569+
"""
570+
if not datasource_id:
571+
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
572+
return await self._delete(
573+
f"/datasources/{datasource_id}/meta",
574+
options=make_request_options(
575+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
576+
),
577+
cast_to=object,
578+
)
579+
514580

515581
class MetaResourceWithRawResponse:
516582
def __init__(self, meta: MetaResource) -> None:
@@ -525,6 +591,9 @@ def __init__(self, meta: MetaResource) -> None:
525591
self.update = to_raw_response_wrapper(
526592
meta.update,
527593
)
594+
self.delete = to_raw_response_wrapper(
595+
meta.delete,
596+
)
528597

529598

530599
class AsyncMetaResourceWithRawResponse:
@@ -540,6 +609,9 @@ def __init__(self, meta: AsyncMetaResource) -> None:
540609
self.update = async_to_raw_response_wrapper(
541610
meta.update,
542611
)
612+
self.delete = async_to_raw_response_wrapper(
613+
meta.delete,
614+
)
543615

544616

545617
class MetaResourceWithStreamingResponse:
@@ -555,6 +627,9 @@ def __init__(self, meta: MetaResource) -> None:
555627
self.update = to_streamed_response_wrapper(
556628
meta.update,
557629
)
630+
self.delete = to_streamed_response_wrapper(
631+
meta.delete,
632+
)
558633

559634

560635
class AsyncMetaResourceWithStreamingResponse:
@@ -570,3 +645,6 @@ def __init__(self, meta: AsyncMetaResource) -> None:
570645
self.update = async_to_streamed_response_wrapper(
571646
meta.update,
572647
)
648+
self.delete = async_to_streamed_response_wrapper(
649+
meta.delete,
650+
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .excel_csv import (
4+
ExcelCsvResource,
5+
AsyncExcelCsvResource,
6+
ExcelCsvResourceWithRawResponse,
7+
AsyncExcelCsvResourceWithRawResponse,
8+
ExcelCsvResourceWithStreamingResponse,
9+
AsyncExcelCsvResourceWithStreamingResponse,
10+
)
11+
from .integration import (
12+
IntegrationResource,
13+
AsyncIntegrationResource,
14+
IntegrationResourceWithRawResponse,
15+
AsyncIntegrationResourceWithRawResponse,
16+
IntegrationResourceWithStreamingResponse,
17+
AsyncIntegrationResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"ExcelCsvResource",
22+
"AsyncExcelCsvResource",
23+
"ExcelCsvResourceWithRawResponse",
24+
"AsyncExcelCsvResourceWithRawResponse",
25+
"ExcelCsvResourceWithStreamingResponse",
26+
"AsyncExcelCsvResourceWithStreamingResponse",
27+
"IntegrationResource",
28+
"AsyncIntegrationResource",
29+
"IntegrationResourceWithRawResponse",
30+
"AsyncIntegrationResourceWithRawResponse",
31+
"IntegrationResourceWithStreamingResponse",
32+
"AsyncIntegrationResourceWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)