From 8d2cacf3956f66370ac347dde23faa7b8e97f2ad Mon Sep 17 00:00:00 2001 From: "hotdata-automation[bot]" <267177015+hotdata-automation[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 04:38:27 +0000 Subject: [PATCH] chore: regenerate client from OpenAPI spec --- .openapi-generator/FILES | 3 - docs/CreateIndexRequest.md | 2 +- docs/IndexesApi.md | 286 +++++++ docs/JobType.md | 2 + docs/UploadsApi.md | 8 +- docs/WorkspaceContextApi.md | 85 ++ hotdata/api/indexes_api.py | 1035 +++++++++++++++++++++--- hotdata/api/uploads_api.py | 25 +- hotdata/api/workspace_context_api.py | 268 ++++++ hotdata/models/create_index_request.py | 2 +- hotdata/models/job_type.py | 1 + 11 files changed, 1592 insertions(+), 125 deletions(-) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 58067ca..33bbea0 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -287,7 +287,4 @@ requirements.txt setup.cfg test-requirements.txt test/__init__.py -test/test_dataset_source_one_of2.py -test/test_dataset_source_one_of3.py -test/test_dataset_source_one_of4.py tox.ini diff --git a/docs/CreateIndexRequest.md b/docs/CreateIndexRequest.md index 4fb1a4f..baa0276 100644 --- a/docs/CreateIndexRequest.md +++ b/docs/CreateIndexRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **var_async** | **bool** | When true, create the index as a background job and return a job ID for polling. | [optional] **columns** | **List[str]** | Columns to index. Required for all index types. | **description** | **str** | User-facing description of the embedding (e.g., \"product descriptions\"). | [optional] -**dimensions** | **int** | Output vector dimensions. Some models support multiple dimension sizes (e.g., OpenAI text-embedding-3-small supports 512 or 1536). If omitted, the model's default dimensions are used. | [optional] +**dimensions** | **int** | Output vector dimensions. Some models support multiple dimension sizes (e.g., OpenAI text-embedding-3-small supports 512 or 1536). If omitted, the model's default dimensions are used | [optional] **embedding_provider_id** | **str** | Embedding provider ID. When set for a vector index, the source column is treated as text and embeddings are generated automatically. The vector index is then built on the generated embedding column (`{column}_embedding` by default). | [optional] **index_name** | **str** | | **index_type** | **str** | Index type: \"sorted\" (default), \"bm25\", or \"vector\" | [optional] diff --git a/docs/IndexesApi.md b/docs/IndexesApi.md index 8adb1f6..061a530 100644 --- a/docs/IndexesApi.md +++ b/docs/IndexesApi.md @@ -4,11 +4,112 @@ All URIs are relative to *https://api.hotdata.dev* Method | HTTP request | Description ------------- | ------------- | ------------- +[**create_dataset_index**](IndexesApi.md#create_dataset_index) | **POST** /v1/datasets/{dataset_id}/indexes | Create an index on a dataset [**create_index**](IndexesApi.md#create_index) | **POST** /v1/connections/{connection_id}/tables/{schema}/{table}/indexes | Create an index on a table +[**delete_dataset_index**](IndexesApi.md#delete_dataset_index) | **DELETE** /v1/datasets/{dataset_id}/indexes/{index_name} | Delete a dataset index [**delete_index**](IndexesApi.md#delete_index) | **DELETE** /v1/connections/{connection_id}/tables/{schema}/{table}/indexes/{index_name} | Delete an index +[**list_dataset_indexes**](IndexesApi.md#list_dataset_indexes) | **GET** /v1/datasets/{dataset_id}/indexes | List indexes on a dataset [**list_indexes**](IndexesApi.md#list_indexes) | **GET** /v1/connections/{connection_id}/tables/{schema}/{table}/indexes | List indexes on a table +# **create_dataset_index** +> IndexInfoResponse create_dataset_index(dataset_id, create_index_request) + +Create an index on a dataset + +Create a sorted, BM25, or vector index on a dataset. + +### Example + +* Api Key Authentication (WorkspaceId): +* Api Key Authentication (SessionId): +* Bearer Authentication (BearerAuth): + +```python +import hotdata +from hotdata.models.create_index_request import CreateIndexRequest +from hotdata.models.index_info_response import IndexInfoResponse +from hotdata.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.hotdata.dev +# See configuration.py for a list of all supported configuration parameters. +configuration = hotdata.Configuration( + host = "https://api.hotdata.dev" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: WorkspaceId +configuration.api_key['WorkspaceId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['WorkspaceId'] = 'Bearer' + +# Configure API key authorization: SessionId +configuration.api_key['SessionId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['SessionId'] = 'Bearer' + +# Configure Bearer authorization: BearerAuth +configuration = hotdata.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with hotdata.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = hotdata.IndexesApi(api_client) + dataset_id = 'dataset_id_example' # str | Dataset identifier + create_index_request = hotdata.CreateIndexRequest() # CreateIndexRequest | + + try: + # Create an index on a dataset + api_response = api_instance.create_dataset_index(dataset_id, create_index_request) + print("The response of IndexesApi->create_dataset_index:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IndexesApi->create_dataset_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dataset_id** | **str**| Dataset identifier | + **create_index_request** | [**CreateIndexRequest**](CreateIndexRequest.md)| | + +### Return type + +[**IndexInfoResponse**](IndexInfoResponse.md) + +### Authorization + +[WorkspaceId](../README.md#WorkspaceId), [SessionId](../README.md#SessionId), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Index created | - | +**400** | Invalid request | - | +**404** | Dataset not found | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_index** > IndexInfoResponse create_index(connection_id, var_schema, table, create_index_request) @@ -104,6 +205,98 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_dataset_index** +> delete_dataset_index(dataset_id, index_name) + +Delete a dataset index + +Delete a specific index from a dataset. + +### Example + +* Api Key Authentication (WorkspaceId): +* Api Key Authentication (SessionId): +* Bearer Authentication (BearerAuth): + +```python +import hotdata +from hotdata.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.hotdata.dev +# See configuration.py for a list of all supported configuration parameters. +configuration = hotdata.Configuration( + host = "https://api.hotdata.dev" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: WorkspaceId +configuration.api_key['WorkspaceId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['WorkspaceId'] = 'Bearer' + +# Configure API key authorization: SessionId +configuration.api_key['SessionId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['SessionId'] = 'Bearer' + +# Configure Bearer authorization: BearerAuth +configuration = hotdata.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with hotdata.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = hotdata.IndexesApi(api_client) + dataset_id = 'dataset_id_example' # str | Dataset identifier + index_name = 'index_name_example' # str | Index name + + try: + # Delete a dataset index + api_instance.delete_dataset_index(dataset_id, index_name) + except Exception as e: + print("Exception when calling IndexesApi->delete_dataset_index: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dataset_id** | **str**| Dataset identifier | + **index_name** | **str**| Index name | + +### Return type + +void (empty response body) + +### Authorization + +[WorkspaceId](../README.md#WorkspaceId), [SessionId](../README.md#SessionId), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Index deleted | - | +**404** | Index or dataset not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_index** > delete_index(connection_id, var_schema, table, index_name) @@ -194,6 +387,99 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_dataset_indexes** +> ListIndexesResponse list_dataset_indexes(dataset_id) + +List indexes on a dataset + +List all indexes created on a dataset. + +### Example + +* Api Key Authentication (WorkspaceId): +* Api Key Authentication (SessionId): +* Bearer Authentication (BearerAuth): + +```python +import hotdata +from hotdata.models.list_indexes_response import ListIndexesResponse +from hotdata.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.hotdata.dev +# See configuration.py for a list of all supported configuration parameters. +configuration = hotdata.Configuration( + host = "https://api.hotdata.dev" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: WorkspaceId +configuration.api_key['WorkspaceId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['WorkspaceId'] = 'Bearer' + +# Configure API key authorization: SessionId +configuration.api_key['SessionId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['SessionId'] = 'Bearer' + +# Configure Bearer authorization: BearerAuth +configuration = hotdata.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with hotdata.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = hotdata.IndexesApi(api_client) + dataset_id = 'dataset_id_example' # str | Dataset identifier + + try: + # List indexes on a dataset + api_response = api_instance.list_dataset_indexes(dataset_id) + print("The response of IndexesApi->list_dataset_indexes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IndexesApi->list_dataset_indexes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dataset_id** | **str**| Dataset identifier | + +### Return type + +[**ListIndexesResponse**](ListIndexesResponse.md) + +### Authorization + +[WorkspaceId](../README.md#WorkspaceId), [SessionId](../README.md#SessionId), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Indexes listed | - | +**404** | Dataset not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **list_indexes** > ListIndexesResponse list_indexes(connection_id, var_schema, table) diff --git a/docs/JobType.md b/docs/JobType.md index 012b04b..a3c9d43 100644 --- a/docs/JobType.md +++ b/docs/JobType.md @@ -14,6 +14,8 @@ Background job types returned by the API. * `CREATE_INDEX` (value: `'create_index'`) +* `CREATE_DATASET_INDEX` (value: `'create_dataset_index'`) + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UploadsApi.md b/docs/UploadsApi.md index 1d8809d..bfb77fc 100644 --- a/docs/UploadsApi.md +++ b/docs/UploadsApi.md @@ -92,11 +92,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file** -> UploadResponse upload_file(body, streaming=streaming) +> UploadResponse upload_file(body) Upload file -Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The returned upload ID can be passed to POST /v1/datasets to create a queryable table. Add `?streaming=true` for large files (up to 20GB) — streams to disk instead of loading into memory. +Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to POST /v1/datasets to create a queryable table. ### Example @@ -136,11 +136,10 @@ with hotdata.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = hotdata.UploadsApi(api_client) body = None # bytearray | - streaming = True # bool | Stream upload to disk for large files (up to 20GB) (optional) try: # Upload file - api_response = api_instance.upload_file(body, streaming=streaming) + api_response = api_instance.upload_file(body) print("The response of UploadsApi->upload_file:\n") pprint(api_response) except Exception as e: @@ -155,7 +154,6 @@ with hotdata.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **bytearray**| | - **streaming** | **bool**| Stream upload to disk for large files (up to 20GB) | [optional] ### Return type diff --git a/docs/WorkspaceContextApi.md b/docs/WorkspaceContextApi.md index bb09d06..66f7235 100644 --- a/docs/WorkspaceContextApi.md +++ b/docs/WorkspaceContextApi.md @@ -4,11 +4,96 @@ All URIs are relative to *https://api.hotdata.dev* Method | HTTP request | Description ------------- | ------------- | ------------- +[**delete_workspace_context**](WorkspaceContextApi.md#delete_workspace_context) | **DELETE** /v1/context/{name} | Delete workspace context [**get_workspace_context**](WorkspaceContextApi.md#get_workspace_context) | **GET** /v1/context/{name} | Get one workspace context [**list_workspace_contexts**](WorkspaceContextApi.md#list_workspace_contexts) | **GET** /v1/context | List workspace contexts [**upsert_workspace_context**](WorkspaceContextApi.md#upsert_workspace_context) | **POST** /v1/context | Create or update workspace context +# **delete_workspace_context** +> delete_workspace_context(name) + +Delete workspace context + +Removes a named context document from the catalog. + +### Example + +* Api Key Authentication (WorkspaceId): +* Bearer Authentication (BearerAuth): + +```python +import hotdata +from hotdata.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.hotdata.dev +# See configuration.py for a list of all supported configuration parameters. +configuration = hotdata.Configuration( + host = "https://api.hotdata.dev" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: WorkspaceId +configuration.api_key['WorkspaceId'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['WorkspaceId'] = 'Bearer' + +# Configure Bearer authorization: BearerAuth +configuration = hotdata.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with hotdata.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = hotdata.WorkspaceContextApi(api_client) + name = 'name_example' # str | Context key: same character rules as a dataset table name (letter or underscore first; no hyphens) + + try: + # Delete workspace context + api_instance.delete_workspace_context(name) + except Exception as e: + print("Exception when calling WorkspaceContextApi->delete_workspace_context: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Context key: same character rules as a dataset table name (letter or underscore first; no hyphens) | + +### Return type + +void (empty response body) + +### Authorization + +[WorkspaceId](../README.md#WorkspaceId), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Context deleted | - | +**400** | Invalid request | - | +**404** | Context not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_workspace_context** > GetWorkspaceContextResponse get_workspace_context(name) diff --git a/hotdata/api/indexes_api.py b/hotdata/api/indexes_api.py index a291fec..cada327 100644 --- a/hotdata/api/indexes_api.py +++ b/hotdata/api/indexes_api.py @@ -41,11 +41,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def create_index( + def create_dataset_index( self, - connection_id: Annotated[StrictStr, Field(description="Connection identifier")], - var_schema: Annotated[StrictStr, Field(description="Schema name")], - table: Annotated[StrictStr, Field(description="Table name")], + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], create_index_request: CreateIndexRequest, _request_timeout: Union[ None, @@ -60,16 +58,12 @@ def create_index( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> IndexInfoResponse: - """Create an index on a table + """Create an index on a dataset - Create a sorted or BM25 full-text index on a cached table. + Create a sorted, BM25, or vector index on a dataset. - :param connection_id: Connection identifier (required) - :type connection_id: str - :param var_schema: Schema name (required) - :type var_schema: str - :param table: Table name (required) - :type table: str + :param dataset_id: Dataset identifier (required) + :type dataset_id: str :param create_index_request: (required) :type create_index_request: CreateIndexRequest :param _request_timeout: timeout setting for this request. If one @@ -94,10 +88,8 @@ def create_index( :return: Returns the result object. """ # noqa: E501 - _param = self._create_index_serialize( - connection_id=connection_id, - var_schema=var_schema, - table=table, + _param = self._create_dataset_index_serialize( + dataset_id=dataset_id, create_index_request=create_index_request, _request_auth=_request_auth, _content_type=_content_type, @@ -123,11 +115,9 @@ def create_index( @validate_call - def create_index_with_http_info( + def create_dataset_index_with_http_info( self, - connection_id: Annotated[StrictStr, Field(description="Connection identifier")], - var_schema: Annotated[StrictStr, Field(description="Schema name")], - table: Annotated[StrictStr, Field(description="Table name")], + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], create_index_request: CreateIndexRequest, _request_timeout: Union[ None, @@ -142,16 +132,12 @@ def create_index_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[IndexInfoResponse]: - """Create an index on a table + """Create an index on a dataset - Create a sorted or BM25 full-text index on a cached table. + Create a sorted, BM25, or vector index on a dataset. - :param connection_id: Connection identifier (required) - :type connection_id: str - :param var_schema: Schema name (required) - :type var_schema: str - :param table: Table name (required) - :type table: str + :param dataset_id: Dataset identifier (required) + :type dataset_id: str :param create_index_request: (required) :type create_index_request: CreateIndexRequest :param _request_timeout: timeout setting for this request. If one @@ -176,10 +162,8 @@ def create_index_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_index_serialize( - connection_id=connection_id, - var_schema=var_schema, - table=table, + _param = self._create_dataset_index_serialize( + dataset_id=dataset_id, create_index_request=create_index_request, _request_auth=_request_auth, _content_type=_content_type, @@ -205,11 +189,9 @@ def create_index_with_http_info( @validate_call - def create_index_without_preload_content( + def create_dataset_index_without_preload_content( self, - connection_id: Annotated[StrictStr, Field(description="Connection identifier")], - var_schema: Annotated[StrictStr, Field(description="Schema name")], - table: Annotated[StrictStr, Field(description="Table name")], + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], create_index_request: CreateIndexRequest, _request_timeout: Union[ None, @@ -224,16 +206,12 @@ def create_index_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create an index on a table + """Create an index on a dataset - Create a sorted or BM25 full-text index on a cached table. + Create a sorted, BM25, or vector index on a dataset. - :param connection_id: Connection identifier (required) - :type connection_id: str - :param var_schema: Schema name (required) - :type var_schema: str - :param table: Table name (required) - :type table: str + :param dataset_id: Dataset identifier (required) + :type dataset_id: str :param create_index_request: (required) :type create_index_request: CreateIndexRequest :param _request_timeout: timeout setting for this request. If one @@ -258,10 +236,8 @@ def create_index_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_index_serialize( - connection_id=connection_id, - var_schema=var_schema, - table=table, + _param = self._create_dataset_index_serialize( + dataset_id=dataset_id, create_index_request=create_index_request, _request_auth=_request_auth, _content_type=_content_type, @@ -282,11 +258,9 @@ def create_index_without_preload_content( return response_data.response - def _create_index_serialize( + def _create_dataset_index_serialize( self, - connection_id, - var_schema, - table, + dataset_id, create_index_request, _request_auth, _content_type, @@ -309,12 +283,8 @@ def _create_index_serialize( _body_params: Optional[bytes] = None # process the path parameters - if connection_id is not None: - _path_params['connection_id'] = connection_id - if var_schema is not None: - _path_params['schema'] = var_schema - if table is not None: - _path_params['table'] = table + if dataset_id is not None: + _path_params['dataset_id'] = dataset_id # process the query parameters # process the header parameters # process the form parameters @@ -348,12 +318,13 @@ def _create_index_serialize( # authentication setting _auth_settings: List[str] = [ 'WorkspaceId', + 'SessionId', 'BearerAuth' ] return self.api_client.param_serialize( method='POST', - resource_path='/v1/connections/{connection_id}/tables/{schema}/{table}/indexes', + resource_path='/v1/datasets/{dataset_id}/indexes', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -370,12 +341,12 @@ def _create_index_serialize( @validate_call - def delete_index( + def create_index( self, connection_id: Annotated[StrictStr, Field(description="Connection identifier")], var_schema: Annotated[StrictStr, Field(description="Schema name")], table: Annotated[StrictStr, Field(description="Table name")], - index_name: Annotated[StrictStr, Field(description="Index name")], + create_index_request: CreateIndexRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -388,10 +359,10 @@ def delete_index( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete an index + ) -> IndexInfoResponse: + """Create an index on a table - Delete a specific index from a cached table. + Create a sorted or BM25 full-text index on a cached table. :param connection_id: Connection identifier (required) :type connection_id: str @@ -399,8 +370,8 @@ def delete_index( :type var_schema: str :param table: Table name (required) :type table: str - :param index_name: Index name (required) - :type index_name: str + :param create_index_request: (required) + :type create_index_request: CreateIndexRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -423,11 +394,11 @@ def delete_index( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_index_serialize( + _param = self._create_index_serialize( connection_id=connection_id, var_schema=var_schema, table=table, - index_name=index_name, + create_index_request=create_index_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -435,7 +406,8 @@ def delete_index( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '201': "IndexInfoResponse", + '400': "ApiErrorResponse", '404': "ApiErrorResponse", '500': "ApiErrorResponse", } @@ -451,12 +423,12 @@ def delete_index( @validate_call - def delete_index_with_http_info( + def create_index_with_http_info( self, connection_id: Annotated[StrictStr, Field(description="Connection identifier")], var_schema: Annotated[StrictStr, Field(description="Schema name")], table: Annotated[StrictStr, Field(description="Table name")], - index_name: Annotated[StrictStr, Field(description="Index name")], + create_index_request: CreateIndexRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -469,10 +441,10 @@ def delete_index_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete an index + ) -> ApiResponse[IndexInfoResponse]: + """Create an index on a table - Delete a specific index from a cached table. + Create a sorted or BM25 full-text index on a cached table. :param connection_id: Connection identifier (required) :type connection_id: str @@ -480,8 +452,8 @@ def delete_index_with_http_info( :type var_schema: str :param table: Table name (required) :type table: str - :param index_name: Index name (required) - :type index_name: str + :param create_index_request: (required) + :type create_index_request: CreateIndexRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -504,11 +476,11 @@ def delete_index_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_index_serialize( + _param = self._create_index_serialize( connection_id=connection_id, var_schema=var_schema, table=table, - index_name=index_name, + create_index_request=create_index_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -516,7 +488,8 @@ def delete_index_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '201': "IndexInfoResponse", + '400': "ApiErrorResponse", '404': "ApiErrorResponse", '500': "ApiErrorResponse", } @@ -532,12 +505,12 @@ def delete_index_with_http_info( @validate_call - def delete_index_without_preload_content( + def create_index_without_preload_content( self, connection_id: Annotated[StrictStr, Field(description="Connection identifier")], var_schema: Annotated[StrictStr, Field(description="Schema name")], table: Annotated[StrictStr, Field(description="Table name")], - index_name: Annotated[StrictStr, Field(description="Index name")], + create_index_request: CreateIndexRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -551,9 +524,9 @@ def delete_index_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete an index + """Create an index on a table - Delete a specific index from a cached table. + Create a sorted or BM25 full-text index on a cached table. :param connection_id: Connection identifier (required) :type connection_id: str @@ -561,8 +534,8 @@ def delete_index_without_preload_content( :type var_schema: str :param table: Table name (required) :type table: str - :param index_name: Index name (required) - :type index_name: str + :param create_index_request: (required) + :type create_index_request: CreateIndexRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -585,11 +558,11 @@ def delete_index_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_index_serialize( + _param = self._create_index_serialize( connection_id=connection_id, var_schema=var_schema, table=table, - index_name=index_name, + create_index_request=create_index_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -597,7 +570,8 @@ def delete_index_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '201': "IndexInfoResponse", + '400': "ApiErrorResponse", '404': "ApiErrorResponse", '500': "ApiErrorResponse", } @@ -608,12 +582,12 @@ def delete_index_without_preload_content( return response_data.response - def _delete_index_serialize( + def _create_index_serialize( self, connection_id, var_schema, table, - index_name, + create_index_request, _request_auth, _content_type, _headers, @@ -641,12 +615,12 @@ def _delete_index_serialize( _path_params['schema'] = var_schema if table is not None: _path_params['table'] = table - if index_name is not None: - _path_params['index_name'] = index_name # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_index_request is not None: + _body_params = create_index_request # set the HTTP header `Accept` @@ -657,6 +631,19 @@ def _delete_index_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -665,8 +652,868 @@ def _delete_index_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/connections/{connection_id}/tables/{schema}/{table}/indexes/{index_name}', + method='POST', + resource_path='/v1/connections/{connection_id}/tables/{schema}/{table}/indexes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_dataset_index( + self, + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], + index_name: Annotated[StrictStr, Field(description="Index name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a dataset index + + Delete a specific index from a dataset. + + :param dataset_id: Dataset identifier (required) + :type dataset_id: str + :param index_name: Index name (required) + :type index_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dataset_index_serialize( + dataset_id=dataset_id, + index_name=index_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_dataset_index_with_http_info( + self, + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], + index_name: Annotated[StrictStr, Field(description="Index name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a dataset index + + Delete a specific index from a dataset. + + :param dataset_id: Dataset identifier (required) + :type dataset_id: str + :param index_name: Index name (required) + :type index_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dataset_index_serialize( + dataset_id=dataset_id, + index_name=index_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_dataset_index_without_preload_content( + self, + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], + index_name: Annotated[StrictStr, Field(description="Index name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a dataset index + + Delete a specific index from a dataset. + + :param dataset_id: Dataset identifier (required) + :type dataset_id: str + :param index_name: Index name (required) + :type index_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dataset_index_serialize( + dataset_id=dataset_id, + index_name=index_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_dataset_index_serialize( + self, + dataset_id, + index_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset_id is not None: + _path_params['dataset_id'] = dataset_id + if index_name is not None: + _path_params['index_name'] = index_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'WorkspaceId', + 'SessionId', + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/datasets/{dataset_id}/indexes/{index_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_index( + self, + connection_id: Annotated[StrictStr, Field(description="Connection identifier")], + var_schema: Annotated[StrictStr, Field(description="Schema name")], + table: Annotated[StrictStr, Field(description="Table name")], + index_name: Annotated[StrictStr, Field(description="Index name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an index + + Delete a specific index from a cached table. + + :param connection_id: Connection identifier (required) + :type connection_id: str + :param var_schema: Schema name (required) + :type var_schema: str + :param table: Table name (required) + :type table: str + :param index_name: Index name (required) + :type index_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_index_serialize( + connection_id=connection_id, + var_schema=var_schema, + table=table, + index_name=index_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "ApiErrorResponse", + '500': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_index_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="Connection identifier")], + var_schema: Annotated[StrictStr, Field(description="Schema name")], + table: Annotated[StrictStr, Field(description="Table name")], + index_name: Annotated[StrictStr, Field(description="Index name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an index + + Delete a specific index from a cached table. + + :param connection_id: Connection identifier (required) + :type connection_id: str + :param var_schema: Schema name (required) + :type var_schema: str + :param table: Table name (required) + :type table: str + :param index_name: Index name (required) + :type index_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_index_serialize( + connection_id=connection_id, + var_schema=var_schema, + table=table, + index_name=index_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "ApiErrorResponse", + '500': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_index_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="Connection identifier")], + var_schema: Annotated[StrictStr, Field(description="Schema name")], + table: Annotated[StrictStr, Field(description="Table name")], + index_name: Annotated[StrictStr, Field(description="Index name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an index + + Delete a specific index from a cached table. + + :param connection_id: Connection identifier (required) + :type connection_id: str + :param var_schema: Schema name (required) + :type var_schema: str + :param table: Table name (required) + :type table: str + :param index_name: Index name (required) + :type index_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_index_serialize( + connection_id=connection_id, + var_schema=var_schema, + table=table, + index_name=index_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "ApiErrorResponse", + '500': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_index_serialize( + self, + connection_id, + var_schema, + table, + index_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + if var_schema is not None: + _path_params['schema'] = var_schema + if table is not None: + _path_params['table'] = table + if index_name is not None: + _path_params['index_name'] = index_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'WorkspaceId', + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/connections/{connection_id}/tables/{schema}/{table}/indexes/{index_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_dataset_indexes( + self, + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListIndexesResponse: + """List indexes on a dataset + + List all indexes created on a dataset. + + :param dataset_id: Dataset identifier (required) + :type dataset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_dataset_indexes_serialize( + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListIndexesResponse", + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_dataset_indexes_with_http_info( + self, + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListIndexesResponse]: + """List indexes on a dataset + + List all indexes created on a dataset. + + :param dataset_id: Dataset identifier (required) + :type dataset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_dataset_indexes_serialize( + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListIndexesResponse", + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_dataset_indexes_without_preload_content( + self, + dataset_id: Annotated[StrictStr, Field(description="Dataset identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List indexes on a dataset + + List all indexes created on a dataset. + + :param dataset_id: Dataset identifier (required) + :type dataset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_dataset_indexes_serialize( + dataset_id=dataset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListIndexesResponse", + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_dataset_indexes_serialize( + self, + dataset_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset_id is not None: + _path_params['dataset_id'] = dataset_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'WorkspaceId', + 'SessionId', + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/datasets/{dataset_id}/indexes', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/hotdata/api/uploads_api.py b/hotdata/api/uploads_api.py index 8294d78..60304d4 100644 --- a/hotdata/api/uploads_api.py +++ b/hotdata/api/uploads_api.py @@ -16,7 +16,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictBytes, StrictStr +from pydantic import Field, StrictBytes, StrictStr from typing import Optional, Tuple, Union from typing_extensions import Annotated from hotdata.models.list_uploads_response import ListUploadsResponse @@ -305,7 +305,6 @@ def _list_uploads_serialize( def upload_file( self, body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], - streaming: Annotated[Optional[StrictBool], Field(description="Stream upload to disk for large files (up to 20GB)")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -321,12 +320,10 @@ def upload_file( ) -> UploadResponse: """Upload file - Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The returned upload ID can be passed to POST /v1/datasets to create a queryable table. Add `?streaming=true` for large files (up to 20GB) — streams to disk instead of loading into memory. + Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to POST /v1/datasets to create a queryable table. :param body: (required) :type body: bytearray - :param streaming: Stream upload to disk for large files (up to 20GB) - :type streaming: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -351,7 +348,6 @@ def upload_file( _param = self._upload_file_serialize( body=body, - streaming=streaming, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -377,7 +373,6 @@ def upload_file( def upload_file_with_http_info( self, body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], - streaming: Annotated[Optional[StrictBool], Field(description="Stream upload to disk for large files (up to 20GB)")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -393,12 +388,10 @@ def upload_file_with_http_info( ) -> ApiResponse[UploadResponse]: """Upload file - Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The returned upload ID can be passed to POST /v1/datasets to create a queryable table. Add `?streaming=true` for large files (up to 20GB) — streams to disk instead of loading into memory. + Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to POST /v1/datasets to create a queryable table. :param body: (required) :type body: bytearray - :param streaming: Stream upload to disk for large files (up to 20GB) - :type streaming: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -423,7 +416,6 @@ def upload_file_with_http_info( _param = self._upload_file_serialize( body=body, - streaming=streaming, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -449,7 +441,6 @@ def upload_file_with_http_info( def upload_file_without_preload_content( self, body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], - streaming: Annotated[Optional[StrictBool], Field(description="Stream upload to disk for large files (up to 20GB)")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -465,12 +456,10 @@ def upload_file_without_preload_content( ) -> RESTResponseType: """Upload file - Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The returned upload ID can be passed to POST /v1/datasets to create a queryable table. Add `?streaming=true` for large files (up to 20GB) — streams to disk instead of loading into memory. + Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to POST /v1/datasets to create a queryable table. :param body: (required) :type body: bytearray - :param streaming: Stream upload to disk for large files (up to 20GB) - :type streaming: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -495,7 +484,6 @@ def upload_file_without_preload_content( _param = self._upload_file_serialize( body=body, - streaming=streaming, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -516,7 +504,6 @@ def upload_file_without_preload_content( def _upload_file_serialize( self, body, - streaming, _request_auth, _content_type, _headers, @@ -539,10 +526,6 @@ def _upload_file_serialize( # process the path parameters # process the query parameters - if streaming is not None: - - _query_params.append(('streaming', streaming)) - # process the header parameters # process the form parameters # process the body parameter diff --git a/hotdata/api/workspace_context_api.py b/hotdata/api/workspace_context_api.py index 59a6637..fa7499c 100644 --- a/hotdata/api/workspace_context_api.py +++ b/hotdata/api/workspace_context_api.py @@ -41,6 +41,274 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def delete_workspace_context( + self, + name: Annotated[StrictStr, Field(description="Context key: same character rules as a dataset table name (letter or underscore first; no hyphens)")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete workspace context + + Removes a named context document from the catalog. + + :param name: Context key: same character rules as a dataset table name (letter or underscore first; no hyphens) (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_workspace_context_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ApiErrorResponse", + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_workspace_context_with_http_info( + self, + name: Annotated[StrictStr, Field(description="Context key: same character rules as a dataset table name (letter or underscore first; no hyphens)")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete workspace context + + Removes a named context document from the catalog. + + :param name: Context key: same character rules as a dataset table name (letter or underscore first; no hyphens) (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_workspace_context_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ApiErrorResponse", + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_workspace_context_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="Context key: same character rules as a dataset table name (letter or underscore first; no hyphens)")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete workspace context + + Removes a named context document from the catalog. + + :param name: Context key: same character rules as a dataset table name (letter or underscore first; no hyphens) (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_workspace_context_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ApiErrorResponse", + '404': "ApiErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_workspace_context_serialize( + self, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'WorkspaceId', + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/context/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_workspace_context( self, diff --git a/hotdata/models/create_index_request.py b/hotdata/models/create_index_request.py index ecb2d2c..faebe33 100644 --- a/hotdata/models/create_index_request.py +++ b/hotdata/models/create_index_request.py @@ -31,7 +31,7 @@ class CreateIndexRequest(BaseModel): var_async: Optional[StrictBool] = Field(default=None, description="When true, create the index as a background job and return a job ID for polling.", alias="async") columns: List[StrictStr] = Field(description="Columns to index. Required for all index types.") description: Optional[StrictStr] = Field(default=None, description="User-facing description of the embedding (e.g., \"product descriptions\").") - dimensions: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Output vector dimensions. Some models support multiple dimension sizes (e.g., OpenAI text-embedding-3-small supports 512 or 1536). If omitted, the model's default dimensions are used.") + dimensions: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Output vector dimensions. Some models support multiple dimension sizes (e.g., OpenAI text-embedding-3-small supports 512 or 1536). If omitted, the model's default dimensions are used") embedding_provider_id: Optional[StrictStr] = Field(default=None, description="Embedding provider ID. When set for a vector index, the source column is treated as text and embeddings are generated automatically. The vector index is then built on the generated embedding column (`{column}_embedding` by default).") index_name: StrictStr index_type: Optional[StrictStr] = Field(default=None, description="Index type: \"sorted\" (default), \"bm25\", or \"vector\"") diff --git a/hotdata/models/job_type.py b/hotdata/models/job_type.py index 6ae7faa..3db4324 100644 --- a/hotdata/models/job_type.py +++ b/hotdata/models/job_type.py @@ -32,6 +32,7 @@ class JobType(str, Enum): DATA_REFRESH_CONNECTION = 'data_refresh_connection' DATASET_REFRESH = 'dataset_refresh' CREATE_INDEX = 'create_index' + CREATE_DATASET_INDEX = 'create_dataset_index' @classmethod def from_json(cls, json_str: str) -> Self: