From 8aa1c2c37655f90affd804eda2aeccc4f229ecdb Mon Sep 17 00:00:00 2001 From: "hotdata-automation[bot]" <267177015+hotdata-automation[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 22:45:45 +0000 Subject: [PATCH 1/2] chore: remove datasets API and related job types --- .openapi-generator/FILES | 52 +- CHANGELOG.md | 4 + docs/ColumnTypeSpec.md | 15 - docs/CreateDatabaseRequest.md | 2 +- docs/CreateDatasetRequest.md | 13 - docs/CreateDatasetResponse.md | 16 - docs/DatabaseContextApi.md | 4 +- docs/DatabasesApi.md | 2 +- docs/DatasetSource.md | 15 - docs/DatasetSourceOneOf.md | 14 - docs/DatasetSourceOneOf1.md | 13 - docs/DatasetSourceOneOf2.md | 14 - docs/DatasetSourceOneOf3.md | 14 - docs/DatasetSourceOneOf4.md | 12 - docs/DatasetSummary.md | 18 - docs/DatasetVersionSummary.md | 14 - docs/DatasetsApi.md | 189 ------- docs/GetDatasetResponse.md | 20 - docs/IndexesApi.md | 95 ---- docs/InlineData.md | 13 - docs/InlineDatasetSource.md | 11 - docs/JobResult.md | 1 - docs/JobType.md | 2 - docs/ListDatasetVersionsResponse.md | 16 - docs/ListDatasetsResponse.md | 15 - docs/RefreshApi.md | 2 +- docs/RefreshDatasetResponse.md | 14 - docs/RefreshRequest.md | 1 - docs/RefreshResponse.md | 1 - docs/SavedQueryDatasetSource.md | 12 - docs/SqlQueryDatasetSource.md | 13 - docs/UpdateDatasetRequest.md | 13 - docs/UpdateDatasetResponse.md | 16 - docs/UploadDatasetSource.md | 13 - docs/UploadsApi.md | 2 +- docs/UpsertDatabaseContextRequest.md | 2 +- docs/UrlDatasetSource.md | 13 - docs/UsageApi.md | 39 ++ docs/WorkspaceUsageResponse.md | 15 + src/apis/databases_api.rs | 2 +- src/apis/datasets_api.rs | 504 ------------------ src/apis/indexes_api.rs | 249 --------- src/apis/mod.rs | 2 +- src/apis/refresh_api.rs | 2 +- src/apis/uploads_api.rs | 2 +- src/apis/usage_api.rs | 87 +++ src/models/column_type_spec.rs | 65 --- src/models/create_database_request.rs | 2 +- src/models/create_dataset_request.rs | 40 -- src/models/create_dataset_response.rs | 50 -- src/models/dataset_source.rs | 50 -- src/models/dataset_source_one_of.rs | 48 -- src/models/dataset_source_one_of_1.rs | 44 -- src/models/dataset_source_one_of_2.rs | 49 -- src/models/dataset_source_one_of_3.rs | 48 -- src/models/dataset_source_one_of_4.rs | 41 -- src/models/dataset_summary.rs | 62 --- src/models/dataset_version_summary.rs | 42 -- src/models/get_dataset_response.rs | 70 --- src/models/inline_data.rs | 35 -- src/models/inline_dataset_source.rs | 28 - src/models/job_result.rs | 1 - src/models/job_type.rs | 6 - src/models/list_dataset_versions_response.rs | 50 -- src/models/list_datasets_response.rs | 50 -- src/models/mod.rs | 48 +- src/models/refresh_dataset_response.rs | 42 -- src/models/refresh_request.rs | 8 - src/models/refresh_response.rs | 1 - src/models/saved_query_dataset_source.rs | 36 -- src/models/sql_query_dataset_source.rs | 46 -- src/models/update_dataset_request.rs | 50 -- src/models/update_dataset_response.rs | 54 -- src/models/upload_dataset_source.rs | 40 -- src/models/upsert_database_context_request.rs | 2 +- src/models/url_dataset_source.rs | 40 -- src/models/workspace_usage_response.rs | 55 ++ 77 files changed, 219 insertions(+), 2572 deletions(-) delete mode 100644 docs/ColumnTypeSpec.md delete mode 100644 docs/CreateDatasetRequest.md delete mode 100644 docs/CreateDatasetResponse.md delete mode 100644 docs/DatasetSource.md delete mode 100644 docs/DatasetSourceOneOf.md delete mode 100644 docs/DatasetSourceOneOf1.md delete mode 100644 docs/DatasetSourceOneOf2.md delete mode 100644 docs/DatasetSourceOneOf3.md delete mode 100644 docs/DatasetSourceOneOf4.md delete mode 100644 docs/DatasetSummary.md delete mode 100644 docs/DatasetVersionSummary.md delete mode 100644 docs/DatasetsApi.md delete mode 100644 docs/GetDatasetResponse.md delete mode 100644 docs/InlineData.md delete mode 100644 docs/InlineDatasetSource.md delete mode 100644 docs/ListDatasetVersionsResponse.md delete mode 100644 docs/ListDatasetsResponse.md delete mode 100644 docs/RefreshDatasetResponse.md delete mode 100644 docs/SavedQueryDatasetSource.md delete mode 100644 docs/SqlQueryDatasetSource.md delete mode 100644 docs/UpdateDatasetRequest.md delete mode 100644 docs/UpdateDatasetResponse.md delete mode 100644 docs/UploadDatasetSource.md delete mode 100644 docs/UrlDatasetSource.md create mode 100644 docs/UsageApi.md create mode 100644 docs/WorkspaceUsageResponse.md delete mode 100644 src/apis/datasets_api.rs create mode 100644 src/apis/usage_api.rs delete mode 100644 src/models/column_type_spec.rs delete mode 100644 src/models/create_dataset_request.rs delete mode 100644 src/models/create_dataset_response.rs delete mode 100644 src/models/dataset_source.rs delete mode 100644 src/models/dataset_source_one_of.rs delete mode 100644 src/models/dataset_source_one_of_1.rs delete mode 100644 src/models/dataset_source_one_of_2.rs delete mode 100644 src/models/dataset_source_one_of_3.rs delete mode 100644 src/models/dataset_source_one_of_4.rs delete mode 100644 src/models/dataset_summary.rs delete mode 100644 src/models/dataset_version_summary.rs delete mode 100644 src/models/get_dataset_response.rs delete mode 100644 src/models/inline_data.rs delete mode 100644 src/models/inline_dataset_source.rs delete mode 100644 src/models/list_dataset_versions_response.rs delete mode 100644 src/models/list_datasets_response.rs delete mode 100644 src/models/refresh_dataset_response.rs delete mode 100644 src/models/saved_query_dataset_source.rs delete mode 100644 src/models/sql_query_dataset_source.rs delete mode 100644 src/models/update_dataset_request.rs delete mode 100644 src/models/update_dataset_response.rs delete mode 100644 src/models/upload_dataset_source.rs delete mode 100644 src/models/url_dataset_source.rs create mode 100644 src/models/workspace_usage_response.rs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 58763a2..78d4d46 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -17,7 +17,6 @@ docs/ColumnProfileDetailOneOf2.md docs/ColumnProfileDetailOneOf3.md docs/ColumnProfileDetailOneOf4.md docs/ColumnProfileInfo.md -docs/ColumnTypeSpec.md docs/ConnectionHealthResponse.md docs/ConnectionInfo.md docs/ConnectionRefreshResult.md @@ -30,8 +29,6 @@ docs/CreateConnectionRequest.md docs/CreateConnectionResponse.md docs/CreateDatabaseRequest.md docs/CreateDatabaseResponse.md -docs/CreateDatasetRequest.md -docs/CreateDatasetResponse.md docs/CreateEmbeddingProviderRequest.md docs/CreateEmbeddingProviderResponse.md docs/CreateIndexRequest.md @@ -48,15 +45,6 @@ docs/DatabaseDefaultTableDecl.md docs/DatabaseDetailResponse.md docs/DatabaseSummary.md docs/DatabasesApi.md -docs/DatasetSource.md -docs/DatasetSourceOneOf.md -docs/DatasetSourceOneOf1.md -docs/DatasetSourceOneOf2.md -docs/DatasetSourceOneOf3.md -docs/DatasetSourceOneOf4.md -docs/DatasetSummary.md -docs/DatasetVersionSummary.md -docs/DatasetsApi.md docs/DiscoveryStatus.md docs/EmbeddingProviderResponse.md docs/EmbeddingProvidersApi.md @@ -64,7 +52,6 @@ docs/Error.md docs/ExecuteSavedQueryRequest.md docs/GetConnectionResponse.md docs/GetDatabaseContextResponse.md -docs/GetDatasetResponse.md docs/GetResultResponse.md docs/GetSecretResponse.md docs/IndexEntryResponse.md @@ -73,8 +60,6 @@ docs/IndexStatus.md docs/IndexesApi.md docs/InformationSchemaApi.md docs/InformationSchemaResponse.md -docs/InlineData.md -docs/InlineDatasetSource.md docs/JobResult.md docs/JobStatus.md docs/JobStatusResponse.md @@ -84,8 +69,6 @@ docs/ListConnectionTypesResponse.md docs/ListConnectionsResponse.md docs/ListDatabaseContextsResponse.md docs/ListDatabasesResponse.md -docs/ListDatasetVersionsResponse.md -docs/ListDatasetsResponse.md docs/ListEmbeddingProvidersResponse.md docs/ListIndexesPageResponse.md docs/ListIndexesResponse.md @@ -108,7 +91,6 @@ docs/QueryResponse.md docs/QueryRunInfo.md docs/QueryRunsApi.md docs/RefreshApi.md -docs/RefreshDatasetResponse.md docs/RefreshRequest.md docs/RefreshResponse.md docs/RefreshWarning.md @@ -116,14 +98,12 @@ docs/ResultInfo.md docs/ResultsApi.md docs/ResultsFormatQuery.md docs/SavedQueriesApi.md -docs/SavedQueryDatasetSource.md docs/SavedQueryDetail.md docs/SavedQuerySummary.md docs/SavedQueryVersionInfo.md docs/SchemaRefreshResult.md docs/SecretMetadataResponse.md docs/SecretsApi.md -docs/SqlQueryDatasetSource.md docs/SubmitJobResponse.md docs/TableInfo.md docs/TableProfileResponse.md @@ -131,29 +111,26 @@ docs/TableRefreshError.md docs/TableRefreshResult.md docs/TemporalProfileDetail.md docs/TextProfileDetail.md -docs/UpdateDatasetRequest.md -docs/UpdateDatasetResponse.md docs/UpdateEmbeddingProviderRequest.md docs/UpdateEmbeddingProviderResponse.md docs/UpdateSavedQueryRequest.md docs/UpdateSecretRequest.md docs/UpdateSecretResponse.md -docs/UploadDatasetSource.md docs/UploadInfo.md docs/UploadResponse.md docs/UploadsApi.md docs/UpsertDatabaseContextRequest.md docs/UpsertDatabaseContextResponse.md -docs/UrlDatasetSource.md +docs/UsageApi.md docs/WorkspaceDetail.md docs/WorkspaceListItem.md +docs/WorkspaceUsageResponse.md docs/WorkspacesApi.md src/apis/configuration.rs src/apis/connection_types_api.rs src/apis/connections_api.rs src/apis/database_context_api.rs src/apis/databases_api.rs -src/apis/datasets_api.rs src/apis/embedding_providers_api.rs src/apis/indexes_api.rs src/apis/information_schema_api.rs @@ -166,6 +143,7 @@ src/apis/results_api.rs src/apis/saved_queries_api.rs src/apis/secrets_api.rs src/apis/uploads_api.rs +src/apis/usage_api.rs src/apis/workspaces_api.rs src/models/add_managed_schema_request.rs src/models/add_managed_table_decl.rs @@ -185,7 +163,6 @@ src/models/column_profile_detail_one_of_2.rs src/models/column_profile_detail_one_of_3.rs src/models/column_profile_detail_one_of_4.rs src/models/column_profile_info.rs -src/models/column_type_spec.rs src/models/connection_health_response.rs src/models/connection_info.rs src/models/connection_refresh_result.rs @@ -196,8 +173,6 @@ src/models/create_connection_request.rs src/models/create_connection_response.rs src/models/create_database_request.rs src/models/create_database_response.rs -src/models/create_dataset_request.rs -src/models/create_dataset_response.rs src/models/create_embedding_provider_request.rs src/models/create_embedding_provider_response.rs src/models/create_index_request.rs @@ -212,29 +187,18 @@ src/models/database_default_schema_decl.rs src/models/database_default_table_decl.rs src/models/database_detail_response.rs src/models/database_summary.rs -src/models/dataset_source.rs -src/models/dataset_source_one_of.rs -src/models/dataset_source_one_of_1.rs -src/models/dataset_source_one_of_2.rs -src/models/dataset_source_one_of_3.rs -src/models/dataset_source_one_of_4.rs -src/models/dataset_summary.rs -src/models/dataset_version_summary.rs src/models/discovery_status.rs src/models/embedding_provider_response.rs src/models/error.rs src/models/execute_saved_query_request.rs src/models/get_connection_response.rs src/models/get_database_context_response.rs -src/models/get_dataset_response.rs src/models/get_result_response.rs src/models/get_secret_response.rs src/models/index_entry_response.rs src/models/index_info_response.rs src/models/index_status.rs src/models/information_schema_response.rs -src/models/inline_data.rs -src/models/inline_dataset_source.rs src/models/job_result.rs src/models/job_status.rs src/models/job_status_response.rs @@ -243,8 +207,6 @@ src/models/list_connection_types_response.rs src/models/list_connections_response.rs src/models/list_database_contexts_response.rs src/models/list_databases_response.rs -src/models/list_dataset_versions_response.rs -src/models/list_datasets_response.rs src/models/list_embedding_providers_response.rs src/models/list_indexes_page_response.rs src/models/list_indexes_response.rs @@ -265,19 +227,16 @@ src/models/numeric_profile_detail.rs src/models/query_request.rs src/models/query_response.rs src/models/query_run_info.rs -src/models/refresh_dataset_response.rs src/models/refresh_request.rs src/models/refresh_response.rs src/models/refresh_warning.rs src/models/result_info.rs src/models/results_format_query.rs -src/models/saved_query_dataset_source.rs src/models/saved_query_detail.rs src/models/saved_query_summary.rs src/models/saved_query_version_info.rs src/models/schema_refresh_result.rs src/models/secret_metadata_response.rs -src/models/sql_query_dataset_source.rs src/models/submit_job_response.rs src/models/table_info.rs src/models/table_profile_response.rs @@ -285,18 +244,15 @@ src/models/table_refresh_error.rs src/models/table_refresh_result.rs src/models/temporal_profile_detail.rs src/models/text_profile_detail.rs -src/models/update_dataset_request.rs -src/models/update_dataset_response.rs src/models/update_embedding_provider_request.rs src/models/update_embedding_provider_response.rs src/models/update_saved_query_request.rs src/models/update_secret_request.rs src/models/update_secret_response.rs -src/models/upload_dataset_source.rs src/models/upload_info.rs src/models/upload_response.rs src/models/upsert_database_context_request.rs src/models/upsert_database_context_response.rs -src/models/url_dataset_source.rs src/models/workspace_detail.rs src/models/workspace_list_item.rs +src/models/workspace_usage_response.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc5ad1..af8ae80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- chore: remove datasets API and related job types + ### Fixed - Pre-response connection errors are now retried transparently on **any** method, diff --git a/docs/ColumnTypeSpec.md b/docs/ColumnTypeSpec.md deleted file mode 100644 index c35ea75..0000000 --- a/docs/ColumnTypeSpec.md +++ /dev/null @@ -1,15 +0,0 @@ -# ColumnTypeSpec - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**geometry_type** | Option<**String**> | Geometry type for GEOMETRY/GEOGRAPHY columns. E.g., \"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\", \"GeometryCollection\", or \"Geometry\" (any). | [optional] -**precision** | Option<**i32**> | Precision for DECIMAL type (1-38) | [optional] -**scale** | Option<**i32**> | Scale for DECIMAL type | [optional] -**srid** | Option<**i32**> | Spatial Reference System Identifier for GEOMETRY/GEOGRAPHY types. Common values: 4326 (WGS84), 3857 (Web Mercator). | [optional] -**r#type** | **String** | The data type name (e.g., \"DECIMAL\", \"TIMESTAMP\", \"GEOMETRY\") | - -[[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/CreateDatabaseRequest.md b/docs/CreateDatabaseRequest.md index eaabb7b..da653fc 100644 --- a/docs/CreateDatabaseRequest.md +++ b/docs/CreateDatabaseRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**default_catalog** | Option<**String**> | Optional name the database's auto-created default catalog answers to inside its query scope. Must be a valid SQL identifier (`[a-z0-9_]`, not starting with a digit) and may not collide with the system catalogs `hotdata`, `datasets`, or `information_schema`. Defaults to `default` when omitted, so `default.main.` keeps working. | [optional] +**default_catalog** | Option<**String**> | Optional name the database's auto-created default catalog answers to inside its query scope. Must be a valid SQL identifier (`[a-z0-9_]`, not starting with a digit) and may not collide with the reserved catalog names `hotdata`, `datasets`, or `information_schema`. Defaults to `default` when omitted, so `default.main.
` keeps working. | [optional] **expires_at** | Option<**String**> | When this database expires. Accepts either an RFC 3339 timestamp (e.g. `\"2026-06-01T00:00:00Z\"`) or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days) — for example `\"24h\"`, `\"48h\"`, or `\"7d\"`. Omitted (or empty) means the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. | [optional] **name** | Option<**String**> | Optional free-form display label (for UIs/CLIs). Not unique. Not an identifier — databases are always addressed by `id`. Accepts the legacy `description` key as an alias so clients that predate the rename keep populating this field. | [optional] **schemas** | Option<[**Vec**](DatabaseDefaultSchemaDecl.md)> | Optional schemas/tables to declare on the database's auto-created default catalog. Tables declared here can be loaded via the standard managed-table load endpoint targeting `default_connection_id`. Omitted or empty means the default catalog starts empty. | [optional] diff --git a/docs/CreateDatasetRequest.md b/docs/CreateDatasetRequest.md deleted file mode 100644 index b64439c..0000000 --- a/docs/CreateDatasetRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateDatasetRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**label** | **String** | | -**source** | [**models::DatasetSource**](DatasetSource.md) | | -**table_name** | Option<**String**> | Optional table_name - if not provided, derived from label | [optional] - -[[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/CreateDatasetResponse.md b/docs/CreateDatasetResponse.md deleted file mode 100644 index 46d3dcb..0000000 --- a/docs/CreateDatasetResponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateDatasetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | **String** | | -**id** | **String** | | -**label** | **String** | | -**schema_name** | **String** | | -**status** | **String** | | -**table_name** | **String** | | - -[[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/DatabaseContextApi.md b/docs/DatabaseContextApi.md index c4f3d44..6f5cecf 100644 --- a/docs/DatabaseContextApi.md +++ b/docs/DatabaseContextApi.md @@ -24,7 +24,7 @@ Removes a named context document from a database. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **database_id** | **String** | Database ID | [required] | -**name** | **String** | Context key: same character rules as a dataset table name | [required] | +**name** | **String** | Context key: same character rules as a table name | [required] | ### Return type @@ -53,7 +53,7 @@ Get one database context Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **database_id** | **String** | Database ID | [required] | -**name** | **String** | Context key: same character rules as a dataset table name | [required] | +**name** | **String** | Context key: same character rules as a table name | [required] | ### Return type diff --git a/docs/DatabasesApi.md b/docs/DatabasesApi.md index b05011c..1b06e71 100644 --- a/docs/DatabasesApi.md +++ b/docs/DatabasesApi.md @@ -114,7 +114,7 @@ Name | Type | Description | Required | Notes > models::CreateDatabaseResponse create_database(create_database_request) Create database -Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), with a `main` schema pre-declared so `default.main.
` works out of the box. The optional `name` is a free-form display label and is not required to be unique. Optional `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the `hotdata`, `datasets`, or `information_schema` system catalogs. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. When omitted, the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. +Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), with a `main` schema pre-declared so `default.main.
` works out of the box. The optional `name` is a free-form display label and is not required to be unique. Optional `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the reserved catalog names `hotdata`, `datasets`, or `information_schema`. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. When omitted, the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. ### Parameters diff --git a/docs/DatasetSource.md b/docs/DatasetSource.md deleted file mode 100644 index 121c1be..0000000 --- a/docs/DatasetSource.md +++ /dev/null @@ -1,15 +0,0 @@ -# DatasetSource - -## Enum Variants - -| Name | Description | -|---- | -----| -| DatasetSourceOneOf | Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. | -| DatasetSourceOneOf1 | Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. | -| DatasetSourceOneOf2 | Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. | -| DatasetSourceOneOf3 | Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. | -| DatasetSourceOneOf4 | Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. | - -[[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/DatasetSourceOneOf.md b/docs/DatasetSourceOneOf.md deleted file mode 100644 index 0d7c476..0000000 --- a/docs/DatasetSourceOneOf.md +++ /dev/null @@ -1,14 +0,0 @@ -# DatasetSourceOneOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**columns** | Option<**std::collections::HashMap**> | Optional explicit column definitions. Keys are column names, values are type specs. When provided, the schema is built from these definitions instead of being inferred. | [optional] -**format** | Option<**String**> | | [optional] -**upload_id** | **String** | | -**r#type** | **Type** | (enum: upload) | - -[[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/DatasetSourceOneOf1.md b/docs/DatasetSourceOneOf1.md deleted file mode 100644 index 739248b..0000000 --- a/docs/DatasetSourceOneOf1.md +++ /dev/null @@ -1,13 +0,0 @@ -# DatasetSourceOneOf1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**saved_query_id** | **String** | | -**version** | Option<**i32**> | | [optional] -**r#type** | **Type** | (enum: saved_query) | - -[[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/DatasetSourceOneOf2.md b/docs/DatasetSourceOneOf2.md deleted file mode 100644 index 81f0f52..0000000 --- a/docs/DatasetSourceOneOf2.md +++ /dev/null @@ -1,14 +0,0 @@ -# DatasetSourceOneOf2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | Optional description for the auto-created saved query. | [optional] -**name** | Option<**String**> | Optional name for the auto-created saved query. Defaults to the dataset label. | [optional] -**sql** | **String** | | -**r#type** | **Type** | (enum: sql_query) | - -[[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/DatasetSourceOneOf3.md b/docs/DatasetSourceOneOf3.md deleted file mode 100644 index 8119ad8..0000000 --- a/docs/DatasetSourceOneOf3.md +++ /dev/null @@ -1,14 +0,0 @@ -# DatasetSourceOneOf3 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**columns** | Option<**std::collections::HashMap**> | Optional explicit column definitions. Keys are column names, values are type specs. | [optional] -**format** | Option<**String**> | | [optional] -**url** | **String** | | -**r#type** | **Type** | (enum: url) | - -[[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/DatasetSourceOneOf4.md b/docs/DatasetSourceOneOf4.md deleted file mode 100644 index 1f83cb1..0000000 --- a/docs/DatasetSourceOneOf4.md +++ /dev/null @@ -1,12 +0,0 @@ -# DatasetSourceOneOf4 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**inline** | [**models::InlineData**](InlineData.md) | | -**r#type** | **Type** | (enum: inline) | - -[[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/DatasetSummary.md b/docs/DatasetSummary.md deleted file mode 100644 index 3bf5c29..0000000 --- a/docs/DatasetSummary.md +++ /dev/null @@ -1,18 +0,0 @@ -# DatasetSummary - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | **String** | | -**id** | **String** | | -**label** | **String** | | -**latest_version** | **i32** | | -**pinned_version** | Option<**i32**> | | [optional] -**schema_name** | **String** | | -**table_name** | **String** | | -**updated_at** | **String** | | - -[[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/DatasetVersionSummary.md b/docs/DatasetVersionSummary.md deleted file mode 100644 index 0ef88bb..0000000 --- a/docs/DatasetVersionSummary.md +++ /dev/null @@ -1,14 +0,0 @@ -# DatasetVersionSummary - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | **String** | | -**id** | **String** | | -**source_type** | **String** | | -**version** | **i32** | | - -[[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/DatasetsApi.md b/docs/DatasetsApi.md deleted file mode 100644 index 214b8d8..0000000 --- a/docs/DatasetsApi.md +++ /dev/null @@ -1,189 +0,0 @@ -# \DatasetsApi - -All URIs are relative to *https://api.hotdata.dev* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_dataset**](DatasetsApi.md#create_dataset) | **POST** /v1/datasets | Create dataset -[**delete_dataset**](DatasetsApi.md#delete_dataset) | **DELETE** /v1/datasets/{id} | Delete dataset -[**get_dataset**](DatasetsApi.md#get_dataset) | **GET** /v1/datasets/{id} | Get dataset -[**list_dataset_versions**](DatasetsApi.md#list_dataset_versions) | **GET** /v1/datasets/{id}/versions | List dataset versions -[**list_datasets**](DatasetsApi.md#list_datasets) | **GET** /v1/datasets | List datasets -[**update_dataset**](DatasetsApi.md#update_dataset) | **PUT** /v1/datasets/{id} | Update dataset - - - -## create_dataset - -> models::CreateDatasetResponse create_dataset(create_dataset_request, x_database_id) -Create dataset - -Create a new dataset from an uploaded file, inline data, a URL, or a SQL/saved query. The dataset becomes a queryable table under the `datasets` schema (e.g., `SELECT * FROM datasets.my_table`). Supports CSV, JSON, and Parquet formats. Optionally specify explicit column types. For `sql_query` / `saved_query` sources the dataset materializes by running that SQL, so the `X-Database-Id` header is required and the query sees only that database's catalogs (the scope is also reused on refresh). Upload/url/inline sources ignore the header. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**create_dataset_request** | [**CreateDatasetRequest**](CreateDatasetRequest.md) | | [required] | -**x_database_id** | Option<**String**> | Required for query-backed datasets (sql_query / saved_query): the database whose catalogs the materializing query runs against. An unknown id is a 404. | | - -### Return type - -[**models::CreateDatasetResponse**](CreateDatasetResponse.md) - -### Authorization - -[WorkspaceId](../README.md#WorkspaceId), [SessionId](../README.md#SessionId), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[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 - -> delete_dataset(id) -Delete dataset - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | Dataset ID | [required] | - -### Return type - - (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 - -[[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_dataset - -> models::GetDatasetResponse get_dataset(id) -Get dataset - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | Dataset ID | [required] | - -### Return type - -[**models::GetDatasetResponse**](GetDatasetResponse.md) - -### Authorization - -[WorkspaceId](../README.md#WorkspaceId), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[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_versions - -> models::ListDatasetVersionsResponse list_dataset_versions(id, limit, offset) -List dataset versions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | Dataset ID | [required] | -**limit** | Option<**i32**> | Maximum number of versions (default: 100, max: 1000) | | -**offset** | Option<**i32**> | Pagination offset (default: 0) | | - -### Return type - -[**models::ListDatasetVersionsResponse**](ListDatasetVersionsResponse.md) - -### Authorization - -[WorkspaceId](../README.md#WorkspaceId), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[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_datasets - -> models::ListDatasetsResponse list_datasets(limit, offset) -List datasets - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i32**> | Maximum number of datasets (default: 100, max: 1000) | | -**offset** | Option<**i32**> | Pagination offset (default: 0) | | - -### Return type - -[**models::ListDatasetsResponse**](ListDatasetsResponse.md) - -### Authorization - -[WorkspaceId](../README.md#WorkspaceId), [SessionId](../README.md#SessionId), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[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) - - -## update_dataset - -> models::UpdateDatasetResponse update_dataset(id, update_dataset_request) -Update dataset - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | Dataset ID | [required] | -**update_dataset_request** | [**UpdateDatasetRequest**](UpdateDatasetRequest.md) | | [required] | - -### Return type - -[**models::UpdateDatasetResponse**](UpdateDatasetResponse.md) - -### Authorization - -[WorkspaceId](../README.md#WorkspaceId), [SessionId](../README.md#SessionId), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[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) - diff --git a/docs/GetDatasetResponse.md b/docs/GetDatasetResponse.md deleted file mode 100644 index 7db9ee3..0000000 --- a/docs/GetDatasetResponse.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetDatasetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**columns** | [**Vec**](ColumnInfo.md) | | -**created_at** | **String** | | -**id** | **String** | | -**label** | **String** | | -**latest_version** | **i32** | | -**pinned_version** | Option<**i32**> | | [optional] -**schema_name** | **String** | | -**source_type** | **String** | | -**table_name** | **String** | | -**updated_at** | **String** | | - -[[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/IndexesApi.md b/docs/IndexesApi.md index ba27fc2..e21a270 100644 --- a/docs/IndexesApi.md +++ b/docs/IndexesApi.md @@ -4,47 +4,13 @@ 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 [**list_indexes_collection**](IndexesApi.md#list_indexes_collection) | **GET** /v1/indexes | List indexes across tables in a database -## create_dataset_index - -> models::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. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**dataset_id** | **String** | Dataset ID | [required] | -**create_index_request** | [**CreateIndexRequest**](CreateIndexRequest.md) | | [required] | - -### Return type - -[**models::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 - -[[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 > models::IndexInfoResponse create_index(connection_id, schema, table, create_index_request) @@ -78,37 +44,6 @@ Name | Type | Description | Required | 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. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**dataset_id** | **String** | Dataset ID | [required] | -**index_name** | **String** | Index name | [required] | - -### Return type - - (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 - -[[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, schema, table, index_name) @@ -142,36 +77,6 @@ Name | Type | Description | Required | 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) -## list_dataset_indexes - -> models::ListIndexesResponse list_dataset_indexes(dataset_id) -List indexes on a dataset - -List all indexes created on a dataset. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**dataset_id** | **String** | Dataset ID | [required] | - -### Return type - -[**models::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 - -[[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 > models::ListIndexesResponse list_indexes(connection_id, schema, table) diff --git a/docs/InlineData.md b/docs/InlineData.md deleted file mode 100644 index 90053fa..0000000 --- a/docs/InlineData.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**columns** | Option<**std::collections::HashMap**> | Optional explicit column definitions. Keys are column names, values are type specs. When provided, the schema is built from these definitions instead of being inferred. | [optional] -**content** | **String** | | -**format** | **String** | | - -[[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/InlineDatasetSource.md b/docs/InlineDatasetSource.md deleted file mode 100644 index 9021f90..0000000 --- a/docs/InlineDatasetSource.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineDatasetSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**inline** | [**models::InlineData**](InlineData.md) | | - -[[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/JobResult.md b/docs/JobResult.md index 8f36928..06636f0 100644 --- a/docs/JobResult.md +++ b/docs/JobResult.md @@ -6,7 +6,6 @@ |---- | -----| | ConnectionRefreshResult | Job-specific result payload. The shape depends on the job type. Null while the job is pending or running. | | IndexInfoResponse | Job-specific result payload. The shape depends on the job type. Null while the job is pending or running. | -| RefreshDatasetResponse | Job-specific result payload. The shape depends on the job type. Null while the job is pending or running. | | TableRefreshResult | Job-specific result payload. The shape depends on the job type. Null while the job is pending or running. | [[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/JobType.md b/docs/JobType.md index 63ed30d..e5b5b48 100644 --- a/docs/JobType.md +++ b/docs/JobType.md @@ -7,9 +7,7 @@ | Noop | noop | | DataRefreshTable | data_refresh_table | | DataRefreshConnection | data_refresh_connection | -| DatasetRefresh | dataset_refresh | | CreateIndex | create_index | -| CreateDatasetIndex | create_dataset_index | | ManagedLoad | managed_load | diff --git a/docs/ListDatasetVersionsResponse.md b/docs/ListDatasetVersionsResponse.md deleted file mode 100644 index 0202ec4..0000000 --- a/docs/ListDatasetVersionsResponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListDatasetVersionsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **i32** | | -**dataset_id** | **String** | | -**has_more** | **bool** | | -**limit** | **i32** | | -**offset** | **i32** | | -**versions** | [**Vec**](DatasetVersionSummary.md) | | - -[[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/ListDatasetsResponse.md b/docs/ListDatasetsResponse.md deleted file mode 100644 index de9e3b8..0000000 --- a/docs/ListDatasetsResponse.md +++ /dev/null @@ -1,15 +0,0 @@ -# ListDatasetsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **i32** | Number of datasets returned in this response | -**datasets** | [**Vec**](DatasetSummary.md) | | -**has_more** | **bool** | Whether there are more datasets available after this page | -**limit** | **i32** | Limit used for this request | -**offset** | **i32** | Pagination offset used for this request | - -[[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/RefreshApi.md b/docs/RefreshApi.md index b0c4a01..1c53a24 100644 --- a/docs/RefreshApi.md +++ b/docs/RefreshApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description > models::RefreshResponse refresh(refresh_request) Refresh connection data -Refresh schema metadata, table data, or dataset data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. - **Dataset refresh**: set `dataset_id` — re-runs the dataset's source (URL fetch or saved query) and creates a new version. Mutually exclusive with `connection_id`. Set `async: true` on data or dataset refresh operations to run in the background and return a job ID for polling. +Refresh schema metadata or table data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. Set `async: true` on data refresh operations to run in the background and return a job ID for polling. ### Parameters diff --git a/docs/RefreshDatasetResponse.md b/docs/RefreshDatasetResponse.md deleted file mode 100644 index c66690f..0000000 --- a/docs/RefreshDatasetResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# RefreshDatasetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | **String** | | -**id** | **String** | | -**status** | **String** | | -**version** | **i32** | | - -[[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/RefreshRequest.md b/docs/RefreshRequest.md index 9e517c5..d2fd148 100644 --- a/docs/RefreshRequest.md +++ b/docs/RefreshRequest.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes **r#async** | Option<**bool**> | When true, submit the refresh as a background job and return immediately with a job ID for status polling. Only supported for data refresh operations. | [optional] **connection_id** | Option<**String**> | | [optional] **data** | Option<**bool**> | | [optional] -**dataset_id** | Option<**String**> | | [optional] **include_uncached** | Option<**bool**> | Controls whether uncached tables are included in connection-wide data refresh. - `false` (default): Only refresh tables that already have cached data. This is the common case for keeping existing data up-to-date. - `true`: Also sync tables that haven't been cached yet, essentially performing an initial sync for any new tables discovered since the connection was created. This field only applies to connection-wide data refresh (when `data=true` and `table_name` is not specified). It has no effect on single-table refresh or schema refresh operations. | [optional] **schema_name** | Option<**String**> | | [optional] **table_name** | Option<**String**> | | [optional] diff --git a/docs/RefreshResponse.md b/docs/RefreshResponse.md index 2f55c0f..9a518ba 100644 --- a/docs/RefreshResponse.md +++ b/docs/RefreshResponse.md @@ -5,7 +5,6 @@ | Name | Description | |---- | -----| | ConnectionRefreshResult | Unified response type for refresh operations | -| RefreshDatasetResponse | Unified response type for refresh operations | | SchemaRefreshResult | Unified response type for refresh operations | | SubmitJobResponse | Unified response type for refresh operations | | TableRefreshResult | Unified response type for refresh operations | diff --git a/docs/SavedQueryDatasetSource.md b/docs/SavedQueryDatasetSource.md deleted file mode 100644 index f26c790..0000000 --- a/docs/SavedQueryDatasetSource.md +++ /dev/null @@ -1,12 +0,0 @@ -# SavedQueryDatasetSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**saved_query_id** | **String** | | -**version** | Option<**i32**> | | [optional] - -[[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/SqlQueryDatasetSource.md b/docs/SqlQueryDatasetSource.md deleted file mode 100644 index 0e9bad1..0000000 --- a/docs/SqlQueryDatasetSource.md +++ /dev/null @@ -1,13 +0,0 @@ -# SqlQueryDatasetSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | Optional description for the auto-created saved query. | [optional] -**name** | Option<**String**> | Optional name for the auto-created saved query. Defaults to the dataset label. | [optional] -**sql** | **String** | | - -[[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/UpdateDatasetRequest.md b/docs/UpdateDatasetRequest.md deleted file mode 100644 index 0341012..0000000 --- a/docs/UpdateDatasetRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# UpdateDatasetRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**label** | Option<**String**> | | [optional] -**pinned_version** | Option<**i32**> | Pin to a specific version, or send null to unpin. Omit the field entirely to leave pinning unchanged. | [optional] -**table_name** | Option<**String**> | | [optional] - -[[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/UpdateDatasetResponse.md b/docs/UpdateDatasetResponse.md deleted file mode 100644 index 51b0b4a..0000000 --- a/docs/UpdateDatasetResponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateDatasetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**label** | **String** | | -**latest_version** | **i32** | | -**pinned_version** | Option<**i32**> | | [optional] -**table_name** | **String** | | -**updated_at** | **String** | | - -[[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/UploadDatasetSource.md b/docs/UploadDatasetSource.md deleted file mode 100644 index e589ec9..0000000 --- a/docs/UploadDatasetSource.md +++ /dev/null @@ -1,13 +0,0 @@ -# UploadDatasetSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**columns** | Option<**std::collections::HashMap**> | Optional explicit column definitions. Keys are column names, values are type specs. When provided, the schema is built from these definitions instead of being inferred. | [optional] -**format** | Option<**String**> | | [optional] -**upload_id** | **String** | | - -[[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 2c8d694..07f47ad 100644 --- a/docs/UploadsApi.md +++ b/docs/UploadsApi.md @@ -42,7 +42,7 @@ Name | Type | Description | Required | Notes > models::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 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. +Upload a Parquet file to publish as the contents of a managed table. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `application/parquet`). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to the managed-table load endpoint. ### Parameters diff --git a/docs/UpsertDatabaseContextRequest.md b/docs/UpsertDatabaseContextRequest.md index a911a9a..690495e 100644 --- a/docs/UpsertDatabaseContextRequest.md +++ b/docs/UpsertDatabaseContextRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **content** | **String** | | -**name** | **String** | Upsert key in the catalog. Validated with dataset table-name rules (preserves case): ASCII letter or `_` first; then alphanumeric or `_` only; 1–128 chars; not a SQL reserved word. | +**name** | **String** | Upsert key in the catalog. Validated with table-name rules (preserves case): ASCII letter or `_` first; then alphanumeric or `_` only; 1–128 chars; not a SQL reserved word. | [[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/UrlDatasetSource.md b/docs/UrlDatasetSource.md deleted file mode 100644 index 0390ca9..0000000 --- a/docs/UrlDatasetSource.md +++ /dev/null @@ -1,13 +0,0 @@ -# UrlDatasetSource - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**columns** | Option<**std::collections::HashMap**> | Optional explicit column definitions. Keys are column names, values are type specs. | [optional] -**format** | Option<**String**> | | [optional] -**url** | **String** | | - -[[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/UsageApi.md b/docs/UsageApi.md new file mode 100644 index 0000000..e38502a --- /dev/null +++ b/docs/UsageApi.md @@ -0,0 +1,39 @@ +# \UsageApi + +All URIs are relative to *https://api.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_usage**](UsageApi.md#get_usage) | **GET** /v1/usage | Get workspace usage snapshot + + + +## get_usage + +> models::WorkspaceUsageResponse get_usage(since) +Get workspace usage snapshot + +Return aggregated bytes scanned and current storage size for a billing period. Pass `since` as the subscription's `current_period_start` so the meter value aligns with the Stripe invoice window rather than the calendar month. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**since** | Option<**String**> | Billing period start (ISO-8601). Defaults to the start of the current UTC calendar month when omitted. | | + +### Return type + +[**models::WorkspaceUsageResponse**](WorkspaceUsageResponse.md) + +### Authorization + +[WorkspaceId](../README.md#WorkspaceId), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[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) + diff --git a/docs/WorkspaceUsageResponse.md b/docs/WorkspaceUsageResponse.md new file mode 100644 index 0000000..8f3785f --- /dev/null +++ b/docs/WorkspaceUsageResponse.md @@ -0,0 +1,15 @@ +# WorkspaceUsageResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bytes_scanned** | **i64** | Sum of `bytes_scanned` across all completed/failed query runs since `since`. Null bytes (queries that touched no row data) contribute 0. | +**query_count** | **i64** | Number of query runs (succeeded + failed) since `since`. | +**since** | **String** | The period start used for this response (echoed back for the caller to verify). | +**storage_bytes** | **i64** | The workspace's current stored-data footprint in bytes, measured at request time: managed-database and dataset data, plus un-consumed uploads, connection caches, and search-index artifacts. | +**storage_captured_at** | Option<**String**> | When `storage_bytes` was measured (the time this response was produced). | [optional] + +[[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/src/apis/databases_api.rs b/src/apis/databases_api.rs index a53d43e..e6277af 100644 --- a/src/apis/databases_api.rs +++ b/src/apis/databases_api.rs @@ -291,7 +291,7 @@ pub async fn attach_database_catalog( } } -/// Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), with a `main` schema pre-declared so `default.main.
` works out of the box. The optional `name` is a free-form display label and is not required to be unique. Optional `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the `hotdata`, `datasets`, or `information_schema` system catalogs. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. When omitted, the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. +/// Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), with a `main` schema pre-declared so `default.main.
` works out of the box. The optional `name` is a free-form display label and is not required to be unique. Optional `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the reserved catalog names `hotdata`, `datasets`, or `information_schema`. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. When omitted, the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. pub async fn create_database( configuration: &configuration::Configuration, create_database_request: models::CreateDatabaseRequest, diff --git a/src/apis/datasets_api.rs b/src/apis/datasets_api.rs deleted file mode 100644 index 3a2f6ab..0000000 --- a/src/apis/datasets_api.rs +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`create_dataset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateDatasetError { - Status400(models::ApiErrorResponse), - Status404(models::ApiErrorResponse), - Status409(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_dataset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteDatasetError { - Status404(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_dataset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetDatasetError { - Status404(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_dataset_versions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListDatasetVersionsError { - Status404(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_datasets`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListDatasetsError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_dataset`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateDatasetError { - Status404(models::ApiErrorResponse), - Status409(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - -/// Create a new dataset from an uploaded file, inline data, a URL, or a SQL/saved query. The dataset becomes a queryable table under the `datasets` schema (e.g., `SELECT * FROM datasets.my_table`). Supports CSV, JSON, and Parquet formats. Optionally specify explicit column types. For `sql_query` / `saved_query` sources the dataset materializes by running that SQL, so the `X-Database-Id` header is required and the query sees only that database's catalogs (the scope is also reused on refresh). Upload/url/inline sources ignore the header. -pub async fn create_dataset( - configuration: &configuration::Configuration, - create_dataset_request: models::CreateDatasetRequest, - x_database_id: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_create_dataset_request = create_dataset_request; - let p_header_x_database_id = x_database_id; - - let uri_str = format!("{}/v1/datasets", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(param_value) = p_header_x_database_id { - req_builder = req_builder.header("X-Database-Id", param_value.to_string()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - req_builder = req_builder.json(&p_body_create_dataset_request); - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateDatasetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateDatasetResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_dataset( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/v1/datasets/{id}", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_dataset( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/v1/datasets/{id}", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetDatasetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetDatasetResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_dataset_versions( - configuration: &configuration::Configuration, - id: &str, - limit: Option, - offset: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_limit = limit; - let p_query_offset = offset; - - let uri_str = format!( - "{}/v1/datasets/{id}/versions", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_offset { - req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListDatasetVersionsResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListDatasetVersionsResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_datasets( - configuration: &configuration::Configuration, - limit: Option, - offset: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_limit = limit; - let p_query_offset = offset; - - let uri_str = format!("{}/v1/datasets", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_offset { - req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListDatasetsResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListDatasetsResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_dataset( - configuration: &configuration::Configuration, - id: &str, - update_dataset_request: models::UpdateDatasetRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_update_dataset_request = update_dataset_request; - - let uri_str = format!( - "{}/v1/datasets/{id}", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - req_builder = req_builder.json(&p_body_update_dataset_request); - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateDatasetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UpdateDatasetResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/indexes_api.rs b/src/apis/indexes_api.rs index 8f3d6f2..6e50b86 100644 --- a/src/apis/indexes_api.rs +++ b/src/apis/indexes_api.rs @@ -13,16 +13,6 @@ use crate::{apis::ResponseContent, models}; use reqwest; use serde::{de::Error as _, Deserialize, Serialize}; -/// struct for typed errors of method [`create_dataset_index`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateDatasetIndexError { - Status400(models::ApiErrorResponse), - Status404(models::ApiErrorResponse), - Status500(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`create_index`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -33,14 +23,6 @@ pub enum CreateIndexError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`delete_dataset_index`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteDatasetIndexError { - Status404(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`delete_index`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -50,14 +32,6 @@ pub enum DeleteIndexError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`list_dataset_indexes`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListDatasetIndexesError { - Status404(models::ApiErrorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`list_indexes`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -77,86 +51,6 @@ pub enum ListIndexesCollectionError { UnknownValue(serde_json::Value), } -/// Create a sorted, BM25, or vector index on a dataset. -pub async fn create_dataset_index( - configuration: &configuration::Configuration, - dataset_id: &str, - create_index_request: models::CreateIndexRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_dataset_id = dataset_id; - let p_body_create_index_request = create_index_request; - - let uri_str = format!( - "{}/v1/datasets/{dataset_id}/indexes", - configuration.base_path, - dataset_id = crate::apis::urlencode(p_path_dataset_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - req_builder = req_builder.json(&p_body_create_index_request); - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IndexInfoResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IndexInfoResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Create a sorted or BM25 full-text index on a cached table. pub async fn create_index( configuration: &configuration::Configuration, @@ -235,74 +129,6 @@ pub async fn create_index( } } -/// Delete a specific index from a dataset. -pub async fn delete_dataset_index( - configuration: &configuration::Configuration, - dataset_id: &str, - index_name: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_dataset_id = dataset_id; - let p_path_index_name = index_name; - - let uri_str = format!( - "{}/v1/datasets/{dataset_id}/indexes/{index_name}", - configuration.base_path, - dataset_id = crate::apis::urlencode(p_path_dataset_id), - index_name = crate::apis::urlencode(p_path_index_name) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Delete a specific index from a cached table. pub async fn delete_index( configuration: &configuration::Configuration, @@ -369,81 +195,6 @@ pub async fn delete_index( } } -/// List all indexes created on a dataset. -pub async fn list_dataset_indexes( - configuration: &configuration::Configuration, - dataset_id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_dataset_id = dataset_id; - - let uri_str = format!( - "{}/v1/datasets/{dataset_id}/indexes", - configuration.base_path, - dataset_id = crate::apis::urlencode(p_path_dataset_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Workspace-Id", value); - }; - if let Some(apikey) = configuration.api_keys.get("X-Session-Id") { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-Session-Id", value); - }; - if let Some(token) = configuration.resolve_bearer_token().await { - req_builder = req_builder.bearer_auth(token); - }; - - let req = req_builder.build()?; - crate::http_log::log_request(&req); - // Route through the shared retry helper so HTTP 429 (OVERLOADED admission - // shedding) is retried per `configuration.retry` on every generated op, not - // just the hand-written query path. See crate::http::execute_retrying. - let resp = - crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; - - let status = resp.status(); - crate::http_log::log_response_status(status); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListIndexesResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListIndexesResponse`")))), - } - } else { - let content = resp.text().await?; - crate::http_log::log_response_body(&content); - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// List all indexes created on a cached table. pub async fn list_indexes( configuration: &configuration::Configuration, diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 72e4de5..c2fd0fd 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -117,7 +117,6 @@ pub mod connection_types_api; pub mod connections_api; pub mod database_context_api; pub mod databases_api; -pub mod datasets_api; pub mod embedding_providers_api; pub mod indexes_api; pub mod information_schema_api; @@ -129,6 +128,7 @@ pub mod results_api; pub mod saved_queries_api; pub mod secrets_api; pub mod uploads_api; +pub mod usage_api; pub mod workspaces_api; pub mod configuration; diff --git a/src/apis/refresh_api.rs b/src/apis/refresh_api.rs index fe1a85e..2c8a27f 100644 --- a/src/apis/refresh_api.rs +++ b/src/apis/refresh_api.rs @@ -22,7 +22,7 @@ pub enum RefreshError { UnknownValue(serde_json::Value), } -/// Refresh schema metadata, table data, or dataset data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. - **Dataset refresh**: set `dataset_id` — re-runs the dataset's source (URL fetch or saved query) and creates a new version. Mutually exclusive with `connection_id`. Set `async: true` on data or dataset refresh operations to run in the background and return a job ID for polling. +/// Refresh schema metadata or table data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. Set `async: true` on data refresh operations to run in the background and return a job ID for polling. pub async fn refresh( configuration: &configuration::Configuration, refresh_request: models::RefreshRequest, diff --git a/src/apis/uploads_api.rs b/src/apis/uploads_api.rs index 447d0b4..c45e7bf 100644 --- a/src/apis/uploads_api.rs +++ b/src/apis/uploads_api.rs @@ -95,7 +95,7 @@ pub async fn list_uploads( } } -/// 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. +/// Upload a Parquet file to publish as the contents of a managed table. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `application/parquet`). The body is streamed to disk, so files up to 20GB are supported. The returned upload ID can be passed to the managed-table load endpoint. pub async fn upload_file( configuration: &configuration::Configuration, body: std::path::PathBuf, diff --git a/src/apis/usage_api.rs b/src/apis/usage_api.rs new file mode 100644 index 0000000..93cbbb9 --- /dev/null +++ b/src/apis/usage_api.rs @@ -0,0 +1,87 @@ +/* + * Hotdata API + * + * Powerful data platform API for datasets, queries, and analytics. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: developers@hotdata.dev + * Generated by: https://openapi-generator.tech + */ + +use super::{configuration, ContentType, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{de::Error as _, Deserialize, Serialize}; + +/// struct for typed errors of method [`get_usage`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUsageError { + UnknownValue(serde_json::Value), +} + +/// Return aggregated bytes scanned and current storage size for a billing period. Pass `since` as the subscription's `current_period_start` so the meter value aligns with the Stripe invoice window rather than the calendar month. +pub async fn get_usage( + configuration: &configuration::Configuration, + since: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_since = since; + + let uri_str = format!("{}/v1/usage", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_since { + req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(apikey) = configuration.api_keys.get("X-Workspace-Id") { + let key = apikey.key.clone(); + let value = match apikey.prefix { + Some(ref prefix) => format!("{} {}", prefix, key), + None => key, + }; + req_builder = req_builder.header("X-Workspace-Id", value); + }; + if let Some(token) = configuration.resolve_bearer_token().await { + req_builder = req_builder.bearer_auth(token); + }; + + let req = req_builder.build()?; + crate::http_log::log_request(&req); + // Route through the shared retry helper so HTTP 429 (OVERLOADED admission + // shedding) is retried per `configuration.retry` on every generated op, not + // just the hand-written query path. See crate::http::execute_retrying. + let resp = + crate::http::execute_retrying(&configuration.client, req, &configuration.retry).await?; + + let status = resp.status(); + crate::http_log::log_response_status(status); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + crate::http_log::log_response_body(&content); + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkspaceUsageResponse`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkspaceUsageResponse`")))), + } + } else { + let content = resp.text().await?; + crate::http_log::log_response_body(&content); + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/src/models/column_type_spec.rs b/src/models/column_type_spec.rs deleted file mode 100644 index b2c0aaf..0000000 --- a/src/models/column_type_spec.rs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ColumnTypeSpec : Detailed column type specification with optional properties. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ColumnTypeSpec { - /// Geometry type for GEOMETRY/GEOGRAPHY columns. E.g., \"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\", \"GeometryCollection\", or \"Geometry\" (any). - #[serde( - rename = "geometry_type", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub geometry_type: Option>, - /// Precision for DECIMAL type (1-38) - #[serde( - rename = "precision", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub precision: Option>, - /// Scale for DECIMAL type - #[serde( - rename = "scale", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub scale: Option>, - /// Spatial Reference System Identifier for GEOMETRY/GEOGRAPHY types. Common values: 4326 (WGS84), 3857 (Web Mercator). - #[serde( - rename = "srid", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub srid: Option>, - /// The data type name (e.g., \"DECIMAL\", \"TIMESTAMP\", \"GEOMETRY\") - #[serde(rename = "type")] - pub r#type: String, -} - -impl ColumnTypeSpec { - /// Detailed column type specification with optional properties. - pub fn new(r#type: String) -> ColumnTypeSpec { - ColumnTypeSpec { - geometry_type: None, - precision: None, - scale: None, - srid: None, - r#type, - } - } -} diff --git a/src/models/create_database_request.rs b/src/models/create_database_request.rs index b3d0da7..2a4ee34 100644 --- a/src/models/create_database_request.rs +++ b/src/models/create_database_request.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; /// CreateDatabaseRequest : Request body for POST /databases #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateDatabaseRequest { - /// Optional name the database's auto-created default catalog answers to inside its query scope. Must be a valid SQL identifier (`[a-z0-9_]`, not starting with a digit) and may not collide with the system catalogs `hotdata`, `datasets`, or `information_schema`. Defaults to `default` when omitted, so `default.main.
` keeps working. + /// Optional name the database's auto-created default catalog answers to inside its query scope. Must be a valid SQL identifier (`[a-z0-9_]`, not starting with a digit) and may not collide with the reserved catalog names `hotdata`, `datasets`, or `information_schema`. Defaults to `default` when omitted, so `default.main.
` keeps working. #[serde( rename = "default_catalog", default, diff --git a/src/models/create_dataset_request.rs b/src/models/create_dataset_request.rs deleted file mode 100644 index 3115f85..0000000 --- a/src/models/create_dataset_request.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateDatasetRequest : Request body for POST /v1/datasets -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateDatasetRequest { - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "source")] - pub source: Box, - /// Optional table_name - if not provided, derived from label - #[serde( - rename = "table_name", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub table_name: Option>, -} - -impl CreateDatasetRequest { - /// Request body for POST /v1/datasets - pub fn new(label: String, source: models::DatasetSource) -> CreateDatasetRequest { - CreateDatasetRequest { - label, - source: Box::new(source), - table_name: None, - } - } -} diff --git a/src/models/create_dataset_response.rs b/src/models/create_dataset_response.rs deleted file mode 100644 index 2acab8c..0000000 --- a/src/models/create_dataset_response.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateDatasetResponse : Response body for POST /v1/datasets -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateDatasetResponse { - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "schema_name")] - pub schema_name: String, - #[serde(rename = "status")] - pub status: String, - #[serde(rename = "table_name")] - pub table_name: String, -} - -impl CreateDatasetResponse { - /// Response body for POST /v1/datasets - pub fn new( - created_at: String, - id: String, - label: String, - schema_name: String, - status: String, - table_name: String, - ) -> CreateDatasetResponse { - CreateDatasetResponse { - created_at, - id, - label, - schema_name, - status, - table_name, - } - } -} diff --git a/src/models/dataset_source.rs b/src/models/dataset_source.rs deleted file mode 100644 index a1a3f7e..0000000 --- a/src/models/dataset_source.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DatasetSource : Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. -/// Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DatasetSource { - DatasetSourceOneOf(Box), - DatasetSourceOneOf1(Box), - DatasetSourceOneOf2(Box), - DatasetSourceOneOf3(Box), - DatasetSourceOneOf4(Box), -} - -impl Default for DatasetSource { - fn default() -> Self { - Self::DatasetSourceOneOf(Default::default()) - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "upload")] - Upload, - #[serde(rename = "saved_query")] - SavedQuery, - #[serde(rename = "sql_query")] - SqlQuery, - #[serde(rename = "url")] - Url, - #[serde(rename = "inline")] - Inline, -} - -impl Default for Type { - fn default() -> Type { - Self::Upload - } -} diff --git a/src/models/dataset_source_one_of.rs b/src/models/dataset_source_one_of.rs deleted file mode 100644 index ac27385..0000000 --- a/src/models/dataset_source_one_of.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetSourceOneOf { - /// Optional explicit column definitions. Keys are column names, values are type specs. When provided, the schema is built from these definitions instead of being inferred. - #[serde(rename = "columns", skip_serializing_if = "Option::is_none")] - pub columns: Option>, - #[serde(rename = "format", skip_serializing_if = "Option::is_none")] - pub format: Option, - #[serde(rename = "upload_id")] - pub upload_id: String, - #[serde(rename = "type")] - pub r#type: Type, -} - -impl DatasetSourceOneOf { - pub fn new(upload_id: String, r#type: Type) -> DatasetSourceOneOf { - DatasetSourceOneOf { - columns: None, - format: None, - upload_id, - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "upload")] - Upload, -} - -impl Default for Type { - fn default() -> Type { - Self::Upload - } -} diff --git a/src/models/dataset_source_one_of_1.rs b/src/models/dataset_source_one_of_1.rs deleted file mode 100644 index 8dfe5d6..0000000 --- a/src/models/dataset_source_one_of_1.rs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetSourceOneOf1 { - #[serde(rename = "saved_query_id")] - pub saved_query_id: String, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - #[serde(rename = "type")] - pub r#type: Type, -} - -impl DatasetSourceOneOf1 { - pub fn new(saved_query_id: String, r#type: Type) -> DatasetSourceOneOf1 { - DatasetSourceOneOf1 { - saved_query_id, - version: None, - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "saved_query")] - SavedQuery, -} - -impl Default for Type { - fn default() -> Type { - Self::SavedQuery - } -} diff --git a/src/models/dataset_source_one_of_2.rs b/src/models/dataset_source_one_of_2.rs deleted file mode 100644 index c839eca..0000000 --- a/src/models/dataset_source_one_of_2.rs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetSourceOneOf2 { - /// Optional description for the auto-created saved query. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - /// Optional name for the auto-created saved query. Defaults to the dataset label. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "sql")] - pub sql: String, - #[serde(rename = "type")] - pub r#type: Type, -} - -impl DatasetSourceOneOf2 { - pub fn new(sql: String, r#type: Type) -> DatasetSourceOneOf2 { - DatasetSourceOneOf2 { - description: None, - name: None, - sql, - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "sql_query")] - SqlQuery, -} - -impl Default for Type { - fn default() -> Type { - Self::SqlQuery - } -} diff --git a/src/models/dataset_source_one_of_3.rs b/src/models/dataset_source_one_of_3.rs deleted file mode 100644 index b383ce4..0000000 --- a/src/models/dataset_source_one_of_3.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetSourceOneOf3 { - /// Optional explicit column definitions. Keys are column names, values are type specs. - #[serde(rename = "columns", skip_serializing_if = "Option::is_none")] - pub columns: Option>, - #[serde(rename = "format", skip_serializing_if = "Option::is_none")] - pub format: Option, - #[serde(rename = "url")] - pub url: String, - #[serde(rename = "type")] - pub r#type: Type, -} - -impl DatasetSourceOneOf3 { - pub fn new(url: String, r#type: Type) -> DatasetSourceOneOf3 { - DatasetSourceOneOf3 { - columns: None, - format: None, - url, - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "url")] - Url, -} - -impl Default for Type { - fn default() -> Type { - Self::Url - } -} diff --git a/src/models/dataset_source_one_of_4.rs b/src/models/dataset_source_one_of_4.rs deleted file mode 100644 index 5a36f58..0000000 --- a/src/models/dataset_source_one_of_4.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetSourceOneOf4 { - #[serde(rename = "inline")] - pub inline: Box, - #[serde(rename = "type")] - pub r#type: Type, -} - -impl DatasetSourceOneOf4 { - pub fn new(inline: models::InlineData, r#type: Type) -> DatasetSourceOneOf4 { - DatasetSourceOneOf4 { - inline: Box::new(inline), - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "inline")] - Inline, -} - -impl Default for Type { - fn default() -> Type { - Self::Inline - } -} diff --git a/src/models/dataset_summary.rs b/src/models/dataset_summary.rs deleted file mode 100644 index 7a5b127..0000000 --- a/src/models/dataset_summary.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DatasetSummary : Dataset summary for listing -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetSummary { - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "latest_version")] - pub latest_version: i32, - #[serde( - rename = "pinned_version", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub pinned_version: Option>, - #[serde(rename = "schema_name")] - pub schema_name: String, - #[serde(rename = "table_name")] - pub table_name: String, - #[serde(rename = "updated_at")] - pub updated_at: String, -} - -impl DatasetSummary { - /// Dataset summary for listing - pub fn new( - created_at: String, - id: String, - label: String, - latest_version: i32, - schema_name: String, - table_name: String, - updated_at: String, - ) -> DatasetSummary { - DatasetSummary { - created_at, - id, - label, - latest_version, - pinned_version: None, - schema_name, - table_name, - updated_at, - } - } -} diff --git a/src/models/dataset_version_summary.rs b/src/models/dataset_version_summary.rs deleted file mode 100644 index 49b44d5..0000000 --- a/src/models/dataset_version_summary.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DatasetVersionSummary : Dataset version summary -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DatasetVersionSummary { - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "source_type")] - pub source_type: String, - #[serde(rename = "version")] - pub version: i32, -} - -impl DatasetVersionSummary { - /// Dataset version summary - pub fn new( - created_at: String, - id: String, - source_type: String, - version: i32, - ) -> DatasetVersionSummary { - DatasetVersionSummary { - created_at, - id, - source_type, - version, - } - } -} diff --git a/src/models/get_dataset_response.rs b/src/models/get_dataset_response.rs deleted file mode 100644 index e15ce91..0000000 --- a/src/models/get_dataset_response.rs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GetDatasetResponse : Response body for GET /v1/datasets/{id} -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GetDatasetResponse { - #[serde(rename = "columns")] - pub columns: Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "latest_version")] - pub latest_version: i32, - #[serde( - rename = "pinned_version", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub pinned_version: Option>, - #[serde(rename = "schema_name")] - pub schema_name: String, - #[serde(rename = "source_type")] - pub source_type: String, - #[serde(rename = "table_name")] - pub table_name: String, - #[serde(rename = "updated_at")] - pub updated_at: String, -} - -impl GetDatasetResponse { - /// Response body for GET /v1/datasets/{id} - pub fn new( - columns: Vec, - created_at: String, - id: String, - label: String, - latest_version: i32, - schema_name: String, - source_type: String, - table_name: String, - updated_at: String, - ) -> GetDatasetResponse { - GetDatasetResponse { - columns, - created_at, - id, - label, - latest_version, - pinned_version: None, - schema_name, - source_type, - table_name, - updated_at, - } - } -} diff --git a/src/models/inline_data.rs b/src/models/inline_data.rs deleted file mode 100644 index cf6f841..0000000 --- a/src/models/inline_data.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// InlineData : Inline data specification -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InlineData { - /// Optional explicit column definitions. Keys are column names, values are type specs. When provided, the schema is built from these definitions instead of being inferred. - #[serde(rename = "columns", skip_serializing_if = "Option::is_none")] - pub columns: Option>, - #[serde(rename = "content")] - pub content: String, - #[serde(rename = "format")] - pub format: String, -} - -impl InlineData { - /// Inline data specification - pub fn new(content: String, format: String) -> InlineData { - InlineData { - columns: None, - content, - format, - } - } -} diff --git a/src/models/inline_dataset_source.rs b/src/models/inline_dataset_source.rs deleted file mode 100644 index d54c25f..0000000 --- a/src/models/inline_dataset_source.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// InlineDatasetSource : Create dataset from inline data (small payloads) -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InlineDatasetSource { - #[serde(rename = "inline")] - pub inline: Box, -} - -impl InlineDatasetSource { - /// Create dataset from inline data (small payloads) - pub fn new(inline: models::InlineData) -> InlineDatasetSource { - InlineDatasetSource { - inline: Box::new(inline), - } - } -} diff --git a/src/models/job_result.rs b/src/models/job_result.rs index a1b33e1..f08c160 100644 --- a/src/models/job_result.rs +++ b/src/models/job_result.rs @@ -18,7 +18,6 @@ use serde::{Deserialize, Serialize}; pub enum JobResult { TableRefreshResult(Box), ConnectionRefreshResult(Box), - RefreshDatasetResponse(Box), IndexInfoResponse(Box), } diff --git a/src/models/job_type.rs b/src/models/job_type.rs index 6bd50f6..8a8a914 100644 --- a/src/models/job_type.rs +++ b/src/models/job_type.rs @@ -21,12 +21,8 @@ pub enum JobType { DataRefreshTable, #[serde(rename = "data_refresh_connection")] DataRefreshConnection, - #[serde(rename = "dataset_refresh")] - DatasetRefresh, #[serde(rename = "create_index")] CreateIndex, - #[serde(rename = "create_dataset_index")] - CreateDatasetIndex, #[serde(rename = "managed_load")] ManagedLoad, } @@ -37,9 +33,7 @@ impl std::fmt::Display for JobType { Self::Noop => write!(f, "noop"), Self::DataRefreshTable => write!(f, "data_refresh_table"), Self::DataRefreshConnection => write!(f, "data_refresh_connection"), - Self::DatasetRefresh => write!(f, "dataset_refresh"), Self::CreateIndex => write!(f, "create_index"), - Self::CreateDatasetIndex => write!(f, "create_dataset_index"), Self::ManagedLoad => write!(f, "managed_load"), } } diff --git a/src/models/list_dataset_versions_response.rs b/src/models/list_dataset_versions_response.rs deleted file mode 100644 index 5b2b747..0000000 --- a/src/models/list_dataset_versions_response.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ListDatasetVersionsResponse : Response body for GET /v1/datasets/{id}/versions -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ListDatasetVersionsResponse { - #[serde(rename = "count")] - pub count: i32, - #[serde(rename = "dataset_id")] - pub dataset_id: String, - #[serde(rename = "has_more")] - pub has_more: bool, - #[serde(rename = "limit")] - pub limit: i32, - #[serde(rename = "offset")] - pub offset: i32, - #[serde(rename = "versions")] - pub versions: Vec, -} - -impl ListDatasetVersionsResponse { - /// Response body for GET /v1/datasets/{id}/versions - pub fn new( - count: i32, - dataset_id: String, - has_more: bool, - limit: i32, - offset: i32, - versions: Vec, - ) -> ListDatasetVersionsResponse { - ListDatasetVersionsResponse { - count, - dataset_id, - has_more, - limit, - offset, - versions, - } - } -} diff --git a/src/models/list_datasets_response.rs b/src/models/list_datasets_response.rs deleted file mode 100644 index 0b2792a..0000000 --- a/src/models/list_datasets_response.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ListDatasetsResponse : Response body for GET /v1/datasets -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ListDatasetsResponse { - /// Number of datasets returned in this response - #[serde(rename = "count")] - pub count: i32, - #[serde(rename = "datasets")] - pub datasets: Vec, - /// Whether there are more datasets available after this page - #[serde(rename = "has_more")] - pub has_more: bool, - /// Limit used for this request - #[serde(rename = "limit")] - pub limit: i32, - /// Pagination offset used for this request - #[serde(rename = "offset")] - pub offset: i32, -} - -impl ListDatasetsResponse { - /// Response body for GET /v1/datasets - pub fn new( - count: i32, - datasets: Vec, - has_more: bool, - limit: i32, - offset: i32, - ) -> ListDatasetsResponse { - ListDatasetsResponse { - count, - datasets, - has_more, - limit, - offset, - } - } -} diff --git a/src/models/mod.rs b/src/models/mod.rs index 0a6f305..bdbf7da 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -34,8 +34,6 @@ pub mod column_profile_detail_one_of_4; pub use self::column_profile_detail_one_of_4::ColumnProfileDetailOneOf4; pub mod column_profile_info; pub use self::column_profile_info::ColumnProfileInfo; -pub mod column_type_spec; -pub use self::column_type_spec::ColumnTypeSpec; pub mod connection_health_response; pub use self::connection_health_response::ConnectionHealthResponse; pub mod connection_info; @@ -56,10 +54,6 @@ pub mod create_database_request; pub use self::create_database_request::CreateDatabaseRequest; pub mod create_database_response; pub use self::create_database_response::CreateDatabaseResponse; -pub mod create_dataset_request; -pub use self::create_dataset_request::CreateDatasetRequest; -pub mod create_dataset_response; -pub use self::create_dataset_response::CreateDatasetResponse; pub mod create_embedding_provider_request; pub use self::create_embedding_provider_request::CreateEmbeddingProviderRequest; pub mod create_embedding_provider_response; @@ -88,22 +82,6 @@ pub mod database_detail_response; pub use self::database_detail_response::DatabaseDetailResponse; pub mod database_summary; pub use self::database_summary::DatabaseSummary; -pub mod dataset_source; -pub use self::dataset_source::DatasetSource; -pub mod dataset_source_one_of; -pub use self::dataset_source_one_of::DatasetSourceOneOf; -pub mod dataset_source_one_of_1; -pub use self::dataset_source_one_of_1::DatasetSourceOneOf1; -pub mod dataset_source_one_of_2; -pub use self::dataset_source_one_of_2::DatasetSourceOneOf2; -pub mod dataset_source_one_of_3; -pub use self::dataset_source_one_of_3::DatasetSourceOneOf3; -pub mod dataset_source_one_of_4; -pub use self::dataset_source_one_of_4::DatasetSourceOneOf4; -pub mod dataset_summary; -pub use self::dataset_summary::DatasetSummary; -pub mod dataset_version_summary; -pub use self::dataset_version_summary::DatasetVersionSummary; pub mod discovery_status; pub use self::discovery_status::DiscoveryStatus; pub mod embedding_provider_response; @@ -116,8 +94,6 @@ pub mod get_connection_response; pub use self::get_connection_response::GetConnectionResponse; pub mod get_database_context_response; pub use self::get_database_context_response::GetDatabaseContextResponse; -pub mod get_dataset_response; -pub use self::get_dataset_response::GetDatasetResponse; pub mod get_result_response; pub use self::get_result_response::GetResultResponse; pub mod get_secret_response; @@ -130,10 +106,6 @@ pub mod index_status; pub use self::index_status::IndexStatus; pub mod information_schema_response; pub use self::information_schema_response::InformationSchemaResponse; -pub mod inline_data; -pub use self::inline_data::InlineData; -pub mod inline_dataset_source; -pub use self::inline_dataset_source::InlineDatasetSource; pub mod job_result; pub use self::job_result::JobResult; pub mod job_status; @@ -150,10 +122,6 @@ pub mod list_database_contexts_response; pub use self::list_database_contexts_response::ListDatabaseContextsResponse; pub mod list_databases_response; pub use self::list_databases_response::ListDatabasesResponse; -pub mod list_dataset_versions_response; -pub use self::list_dataset_versions_response::ListDatasetVersionsResponse; -pub mod list_datasets_response; -pub use self::list_datasets_response::ListDatasetsResponse; pub mod list_embedding_providers_response; pub use self::list_embedding_providers_response::ListEmbeddingProvidersResponse; pub mod list_indexes_page_response; @@ -192,8 +160,6 @@ pub mod query_response; pub use self::query_response::QueryResponse; pub mod query_run_info; pub use self::query_run_info::QueryRunInfo; -pub mod refresh_dataset_response; -pub use self::refresh_dataset_response::RefreshDatasetResponse; pub mod refresh_request; pub use self::refresh_request::RefreshRequest; pub mod refresh_response; @@ -204,8 +170,6 @@ pub mod result_info; pub use self::result_info::ResultInfo; pub mod results_format_query; pub use self::results_format_query::ResultsFormatQuery; -pub mod saved_query_dataset_source; -pub use self::saved_query_dataset_source::SavedQueryDatasetSource; pub mod saved_query_detail; pub use self::saved_query_detail::SavedQueryDetail; pub mod saved_query_summary; @@ -216,8 +180,6 @@ pub mod schema_refresh_result; pub use self::schema_refresh_result::SchemaRefreshResult; pub mod secret_metadata_response; pub use self::secret_metadata_response::SecretMetadataResponse; -pub mod sql_query_dataset_source; -pub use self::sql_query_dataset_source::SqlQueryDatasetSource; pub mod submit_job_response; pub use self::submit_job_response::SubmitJobResponse; pub mod table_info; @@ -232,10 +194,6 @@ pub mod temporal_profile_detail; pub use self::temporal_profile_detail::TemporalProfileDetail; pub mod text_profile_detail; pub use self::text_profile_detail::TextProfileDetail; -pub mod update_dataset_request; -pub use self::update_dataset_request::UpdateDatasetRequest; -pub mod update_dataset_response; -pub use self::update_dataset_response::UpdateDatasetResponse; pub mod update_embedding_provider_request; pub use self::update_embedding_provider_request::UpdateEmbeddingProviderRequest; pub mod update_embedding_provider_response; @@ -246,8 +204,6 @@ pub mod update_secret_request; pub use self::update_secret_request::UpdateSecretRequest; pub mod update_secret_response; pub use self::update_secret_response::UpdateSecretResponse; -pub mod upload_dataset_source; -pub use self::upload_dataset_source::UploadDatasetSource; pub mod upload_info; pub use self::upload_info::UploadInfo; pub mod upload_response; @@ -256,9 +212,9 @@ pub mod upsert_database_context_request; pub use self::upsert_database_context_request::UpsertDatabaseContextRequest; pub mod upsert_database_context_response; pub use self::upsert_database_context_response::UpsertDatabaseContextResponse; -pub mod url_dataset_source; -pub use self::url_dataset_source::UrlDatasetSource; pub mod workspace_detail; pub use self::workspace_detail::WorkspaceDetail; pub mod workspace_list_item; pub use self::workspace_list_item::WorkspaceListItem; +pub mod workspace_usage_response; +pub use self::workspace_usage_response::WorkspaceUsageResponse; diff --git a/src/models/refresh_dataset_response.rs b/src/models/refresh_dataset_response.rs deleted file mode 100644 index 3679ecd..0000000 --- a/src/models/refresh_dataset_response.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RefreshDatasetResponse : Response body for POST /v1/datasets/{id}/refresh -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RefreshDatasetResponse { - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "status")] - pub status: String, - #[serde(rename = "version")] - pub version: i32, -} - -impl RefreshDatasetResponse { - /// Response body for POST /v1/datasets/{id}/refresh - pub fn new( - created_at: String, - id: String, - status: String, - version: i32, - ) -> RefreshDatasetResponse { - RefreshDatasetResponse { - created_at, - id, - status, - version, - } - } -} diff --git a/src/models/refresh_request.rs b/src/models/refresh_request.rs index e01cad6..c776005 100644 --- a/src/models/refresh_request.rs +++ b/src/models/refresh_request.rs @@ -26,13 +26,6 @@ pub struct RefreshRequest { pub connection_id: Option>, #[serde(rename = "data", skip_serializing_if = "Option::is_none")] pub data: Option, - #[serde( - rename = "dataset_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub dataset_id: Option>, /// Controls whether uncached tables are included in connection-wide data refresh. - `false` (default): Only refresh tables that already have cached data. This is the common case for keeping existing data up-to-date. - `true`: Also sync tables that haven't been cached yet, essentially performing an initial sync for any new tables discovered since the connection was created. This field only applies to connection-wide data refresh (when `data=true` and `table_name` is not specified). It has no effect on single-table refresh or schema refresh operations. #[serde(rename = "include_uncached", skip_serializing_if = "Option::is_none")] pub include_uncached: Option, @@ -59,7 +52,6 @@ impl RefreshRequest { r#async: None, connection_id: None, data: None, - dataset_id: None, include_uncached: None, schema_name: None, table_name: None, diff --git a/src/models/refresh_response.rs b/src/models/refresh_response.rs index 61b81e0..d105e08 100644 --- a/src/models/refresh_response.rs +++ b/src/models/refresh_response.rs @@ -19,7 +19,6 @@ pub enum RefreshResponse { SchemaRefreshResult(Box), TableRefreshResult(Box), ConnectionRefreshResult(Box), - RefreshDatasetResponse(Box), SubmitJobResponse(Box), } diff --git a/src/models/saved_query_dataset_source.rs b/src/models/saved_query_dataset_source.rs deleted file mode 100644 index ab47e4e..0000000 --- a/src/models/saved_query_dataset_source.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// SavedQueryDatasetSource : Create dataset from a saved query result -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SavedQueryDatasetSource { - #[serde(rename = "saved_query_id")] - pub saved_query_id: String, - #[serde( - rename = "version", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub version: Option>, -} - -impl SavedQueryDatasetSource { - /// Create dataset from a saved query result - pub fn new(saved_query_id: String) -> SavedQueryDatasetSource { - SavedQueryDatasetSource { - saved_query_id, - version: None, - } - } -} diff --git a/src/models/sql_query_dataset_source.rs b/src/models/sql_query_dataset_source.rs deleted file mode 100644 index 7227a26..0000000 --- a/src/models/sql_query_dataset_source.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// SqlQueryDatasetSource : Create dataset from a SQL query (auto-creates a saved query) -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlQueryDatasetSource { - /// Optional description for the auto-created saved query. - #[serde( - rename = "description", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub description: Option>, - /// Optional name for the auto-created saved query. Defaults to the dataset label. - #[serde( - rename = "name", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name: Option>, - #[serde(rename = "sql")] - pub sql: String, -} - -impl SqlQueryDatasetSource { - /// Create dataset from a SQL query (auto-creates a saved query) - pub fn new(sql: String) -> SqlQueryDatasetSource { - SqlQueryDatasetSource { - description: None, - name: None, - sql, - } - } -} diff --git a/src/models/update_dataset_request.rs b/src/models/update_dataset_request.rs deleted file mode 100644 index 7b67ef2..0000000 --- a/src/models/update_dataset_request.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UpdateDatasetRequest : Request body for PUT /v1/datasets/{id} -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateDatasetRequest { - #[serde( - rename = "label", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub label: Option>, - /// Pin to a specific version, or send null to unpin. Omit the field entirely to leave pinning unchanged. - #[serde( - rename = "pinned_version", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub pinned_version: Option>, - #[serde( - rename = "table_name", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub table_name: Option>, -} - -impl UpdateDatasetRequest { - /// Request body for PUT /v1/datasets/{id} - pub fn new() -> UpdateDatasetRequest { - UpdateDatasetRequest { - label: None, - pinned_version: None, - table_name: None, - } - } -} diff --git a/src/models/update_dataset_response.rs b/src/models/update_dataset_response.rs deleted file mode 100644 index db88a5a..0000000 --- a/src/models/update_dataset_response.rs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UpdateDatasetResponse : Response body for PUT /v1/datasets/{id} -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateDatasetResponse { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "latest_version")] - pub latest_version: i32, - #[serde( - rename = "pinned_version", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub pinned_version: Option>, - #[serde(rename = "table_name")] - pub table_name: String, - #[serde(rename = "updated_at")] - pub updated_at: String, -} - -impl UpdateDatasetResponse { - /// Response body for PUT /v1/datasets/{id} - pub fn new( - id: String, - label: String, - latest_version: i32, - table_name: String, - updated_at: String, - ) -> UpdateDatasetResponse { - UpdateDatasetResponse { - id, - label, - latest_version, - pinned_version: None, - table_name, - updated_at, - } - } -} diff --git a/src/models/upload_dataset_source.rs b/src/models/upload_dataset_source.rs deleted file mode 100644 index 9415d87..0000000 --- a/src/models/upload_dataset_source.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UploadDatasetSource : Create dataset from a previously uploaded file -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UploadDatasetSource { - /// Optional explicit column definitions. Keys are column names, values are type specs. When provided, the schema is built from these definitions instead of being inferred. - #[serde(rename = "columns", skip_serializing_if = "Option::is_none")] - pub columns: Option>, - #[serde( - rename = "format", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub format: Option>, - #[serde(rename = "upload_id")] - pub upload_id: String, -} - -impl UploadDatasetSource { - /// Create dataset from a previously uploaded file - pub fn new(upload_id: String) -> UploadDatasetSource { - UploadDatasetSource { - columns: None, - format: None, - upload_id, - } - } -} diff --git a/src/models/upsert_database_context_request.rs b/src/models/upsert_database_context_request.rs index 4b7855b..6978d27 100644 --- a/src/models/upsert_database_context_request.rs +++ b/src/models/upsert_database_context_request.rs @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize}; pub struct UpsertDatabaseContextRequest { #[serde(rename = "content")] pub content: String, - /// Upsert key in the catalog. Validated with dataset table-name rules (preserves case): ASCII letter or `_` first; then alphanumeric or `_` only; 1–128 chars; not a SQL reserved word. + /// Upsert key in the catalog. Validated with table-name rules (preserves case): ASCII letter or `_` first; then alphanumeric or `_` only; 1–128 chars; not a SQL reserved word. #[serde(rename = "name")] pub name: String, } diff --git a/src/models/url_dataset_source.rs b/src/models/url_dataset_source.rs deleted file mode 100644 index cedc7d2..0000000 --- a/src/models/url_dataset_source.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Hotdata API - * - * Powerful data platform API for datasets, queries, and analytics. - * - * The version of the OpenAPI document: 1.0.0 - * Contact: developers@hotdata.dev - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UrlDatasetSource : Create dataset from an external HTTP URL -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UrlDatasetSource { - /// Optional explicit column definitions. Keys are column names, values are type specs. - #[serde(rename = "columns", skip_serializing_if = "Option::is_none")] - pub columns: Option>, - #[serde( - rename = "format", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub format: Option>, - #[serde(rename = "url")] - pub url: String, -} - -impl UrlDatasetSource { - /// Create dataset from an external HTTP URL - pub fn new(url: String) -> UrlDatasetSource { - UrlDatasetSource { - columns: None, - format: None, - url, - } - } -} diff --git a/src/models/workspace_usage_response.rs b/src/models/workspace_usage_response.rs new file mode 100644 index 0000000..9a08c39 --- /dev/null +++ b/src/models/workspace_usage_response.rs @@ -0,0 +1,55 @@ +/* + * Hotdata API + * + * Powerful data platform API for datasets, queries, and analytics. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: developers@hotdata.dev + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// WorkspaceUsageResponse : Response for GET /v1/usage +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceUsageResponse { + /// Sum of `bytes_scanned` across all completed/failed query runs since `since`. Null bytes (queries that touched no row data) contribute 0. + #[serde(rename = "bytes_scanned")] + pub bytes_scanned: i64, + /// Number of query runs (succeeded + failed) since `since`. + #[serde(rename = "query_count")] + pub query_count: i64, + /// The period start used for this response (echoed back for the caller to verify). + #[serde(rename = "since")] + pub since: String, + /// The workspace's current stored-data footprint in bytes, measured at request time: managed-database and dataset data, plus un-consumed uploads, connection caches, and search-index artifacts. + #[serde(rename = "storage_bytes")] + pub storage_bytes: i64, + /// When `storage_bytes` was measured (the time this response was produced). + #[serde( + rename = "storage_captured_at", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub storage_captured_at: Option>, +} + +impl WorkspaceUsageResponse { + /// Response for GET /v1/usage + pub fn new( + bytes_scanned: i64, + query_count: i64, + since: String, + storage_bytes: i64, + ) -> WorkspaceUsageResponse { + WorkspaceUsageResponse { + bytes_scanned, + query_count, + since, + storage_bytes, + storage_captured_at: None, + } + } +} From 8e35d026be82dd9534876b08dabab63af8dae33d Mon Sep 17 00:00:00 2001 From: Zac Farrell Date: Fri, 19 Jun 2026 15:56:33 -0700 Subject: [PATCH 2/2] chore: drop dataset wrappers and tests after API removal --- README.md | 18 +++--- examples/quickstart.rs | 12 ++-- src/client.rs | 13 ++-- src/field.rs | 12 ++-- src/lib.rs | 2 +- src/resources.rs | 108 ++------------------------------ tests/auth_unknown_workspace.rs | 6 +- tests/dataset_versioning.rs | 64 ------------------- tests/datasets_crud.rs | 76 ---------------------- tests/indexes_lifecycle.rs | 3 +- 10 files changed, 36 insertions(+), 278 deletions(-) delete mode 100644 tests/dataset_versioning.rs delete mode 100644 tests/datasets_crud.rs diff --git a/README.md b/README.md index eb1907c..b3dcc3c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # hotdata -Official Rust client for the [Hotdata](https://www.hotdata.dev) HTTP API: workspaces, connections, datasets, SQL queries, results, secrets, uploads, indexes, jobs, embedding providers, and workspace context. +Official Rust client for the [Hotdata](https://www.hotdata.dev) HTTP API: workspaces, connections, databases, SQL queries, results, secrets, uploads, indexes, jobs, embedding providers, and workspace context. The crate pairs a fully generated, typed API surface (`hotdata::apis`, `hotdata::models`) with a hand-written ergonomic layer: a flat [`Client`](#quickstart) that handles transparent API-token to JWT exchange, plus an optional Apache Arrow result decoder. @@ -88,13 +88,13 @@ ergonomic, workspace-scoped handles so you never pass a `Configuration` around: ```rust // Grouped handles: client.().(..) -let datasets = client.datasets().list(Some(20), None).await?; -let dataset = client.datasets().get(&datasets.datasets[0].id).await?; +let connections = client.connections().list().await?; +let connection = client.connections().get(&connections.connections[0].id).await?; let secrets = client.secrets().list().await?; let runs = client.query_runs().list(Some(50), None, None, None).await?; ``` -Handles exist for every resource — `datasets`, `connections`, `connection_types`, +Handles exist for every resource — `connections`, `connection_types`, `databases`, `database_context`, `embedding_providers`, `indexes`, `information_schema`, `jobs`, `queries`, `query_runs`, `results`, `refresh`, `saved_queries`, `secrets`, `uploads`, `workspaces`. The hottest @@ -142,11 +142,11 @@ intents so call sites read clearly: ```rust use hotdata::field; -let mut req = UpdateDatasetRequest::new(); -req.label = field::set("renamed"); // set -req.pinned_version = field::clear(); // send null (unpin) -// req.table_name left as None -> omitted -> unchanged -client.datasets().update(&dataset.id, req).await?; +let mut req = UpdateSavedQueryRequest::new(); +req.name = field::set("renamed"); // set +req.description = field::clear(); // send null (clear) +// req.sql left as None -> omitted -> unchanged +client.saved_queries().update(&saved_query_id, req).await?; ``` Every resource lives under `hotdata::apis::_api`, and request/response diff --git a/examples/quickstart.rs b/examples/quickstart.rs index 73ff86c..d95c9d0 100644 --- a/examples/quickstart.rs +++ b/examples/quickstart.rs @@ -4,7 +4,7 @@ //! (`hotdata::prelude::*`). It: //! //! 1. builds a [`Client`] from an API token + workspace id, -//! 2. lists workspaces and datasets via grouped resource handles, +//! 2. lists workspaces and connections via grouped resource handles, //! 3. submits a SQL query and awaits the persisted result with one call, //! 4. fetches that result as Arrow record batches (behind the `arrow` feature), //! 5. shows the one-call `query_to_arrow` shortcut. @@ -81,13 +81,13 @@ async fn run() -> Result<(), Box> { println!(" - {} ({})", ws.name, ws.public_id); } - let datasets = client.datasets().list(Some(5), None).await?; + let connections = client.connections().list().await?; println!( - "First {} dataset(s) in this workspace:", - datasets.datasets.len() + "Connections in this workspace ({}):", + connections.connections.len() ); - for ds in &datasets.datasets { - println!(" - {} ({})", ds.label, ds.id); + for conn in &connections.connections { + println!(" - {} ({})", conn.name, conn.id); } // --- 3. Submit a query ----------------------------------------------- diff --git a/src/client.rs b/src/client.rs index 7e81c96..8680cdf 100644 --- a/src/client.rs +++ b/src/client.rs @@ -311,7 +311,7 @@ impl Client { /// Borrow the underlying [`Configuration`] so any generated API free /// function can be called directly, e.g. - /// `hotdata::apis::datasets_api::list_datasets(client.configuration(), ..)`. + /// `hotdata::apis::connections_api::list_connections(client.configuration(), ..)`. pub fn configuration(&self) -> &Configuration { &self.configuration } @@ -718,15 +718,10 @@ impl Client { // --- Resource handles ----------------------------------------------------- // // Grouped, ergonomic accessors over the generated `apis::*_api` free - // functions so callers write `client.datasets().create(req)` instead of - // `datasets_api::create_dataset(client.configuration(), req, ..)`. Each + // functions so callers write `client.connections().list()` instead of + // `connections_api::list_connections(client.configuration())`. Each // handle borrows the `Configuration`; see `crate::resources`. - /// Datasets resource handle. - pub fn datasets(&self) -> crate::resources::DatasetsApi<'_> { - crate::resources::DatasetsApi::new(&self.configuration) - } - /// Connections resource handle. pub fn connections(&self) -> crate::resources::ConnectionsApi<'_> { crate::resources::ConnectionsApi::new(&self.configuration) @@ -783,7 +778,7 @@ impl Client { crate::resources::ResultsApi::new(&self.configuration) } - /// Dataset-refresh resource handle. + /// Refresh resource handle. pub fn refresh(&self) -> crate::resources::RefreshApi<'_> { crate::resources::RefreshApi::new(&self.configuration) } diff --git a/src/field.rs b/src/field.rs index 4838417..d93185e 100644 --- a/src/field.rs +++ b/src/field.rs @@ -1,7 +1,7 @@ //! Ergonomic constructors for nullable, optional request fields. //! //! Several generated request models (e.g. -//! [`UpdateDatasetRequest`](crate::models::UpdateDatasetRequest)) represent a +//! [`UpdateSavedQueryRequest`](crate::models::UpdateSavedQueryRequest)) represent a //! field that is *both* optional (may be omitted from the request) *and* //! nullable (may be sent as JSON `null`) as a double option //! `Option>`, serialized with serde's `double_option`: @@ -18,12 +18,12 @@ //! //! ``` //! use hotdata::field; -//! use hotdata::models::UpdateDatasetRequest; +//! use hotdata::models::UpdateSavedQueryRequest; //! -//! let mut req = UpdateDatasetRequest::new(); -//! req.label = field::set("renamed"); // set label to "renamed" -//! req.pinned_version = field::clear(); // unpin (send null) -//! // req.table_name stays `None` -> omitted -> unchanged +//! let mut req = UpdateSavedQueryRequest::new(); +//! req.name = field::set("renamed"); // set name to "renamed" +//! req.description = field::clear(); // clear description (send null) +//! // req.sql stays `None` -> omitted -> unchanged //! ``` //! //! This module is hand-written and regeneration-immune (it never touches the diff --git a/src/lib.rs b/src/lib.rs index 8f077c4..e14a1d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,7 +49,7 @@ pub use query::{ DEFAULT_MAX_AUTO_BYTES, DEFAULT_MAX_AUTO_ROWS, OVERLOADED_ERROR_CODE, }; pub use resources::{ - ConnectionTypesApi, ConnectionsApi, DatabaseContextApi, DatabasesApi, DatasetsApi, + ConnectionTypesApi, ConnectionsApi, DatabaseContextApi, DatabasesApi, EmbeddingProvidersApi, IndexesApi, InformationSchemaApi, JobsApi, QueryApi, QueryRunsApi, RefreshApi, ResultsApi, SavedQueriesApi, SecretsApi, UploadsApi, WorkspacesApi, }; diff --git a/src/resources.rs b/src/resources.rs index c8b50bf..7675a62 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -9,7 +9,7 @@ //! operation to the matching free function. //! //! Handles are obtained from [`Client`](crate::Client) accessors, e.g. -//! `client.datasets().create(req).await?`. They hold only a `&Configuration`, so +//! `client.connections().list().await?`. They hold only a `&Configuration`, so //! they are cheap to construct and never own state. use crate::apis; @@ -17,73 +17,6 @@ use crate::apis::configuration::Configuration; use crate::apis::Error; use crate::models; -/// Datasets resource handle. Wraps [`apis::datasets_api`](crate::apis::datasets_api). -pub struct DatasetsApi<'a> { - config: &'a Configuration, -} - -impl<'a> DatasetsApi<'a> { - pub(crate) fn new(config: &'a Configuration) -> Self { - Self { config } - } - - /// Create a new dataset. `x_database_id` is required for SQL/saved-query sources. - pub async fn create( - &self, - request: models::CreateDatasetRequest, - x_database_id: Option<&str>, - ) -> Result> { - apis::datasets_api::create_dataset(self.config, request, x_database_id).await - } - - /// Fetch a dataset by id. - pub async fn get( - &self, - id: &str, - ) -> Result> { - apis::datasets_api::get_dataset(self.config, id).await - } - - /// List datasets. - pub async fn list( - &self, - limit: Option, - offset: Option, - ) -> Result> { - apis::datasets_api::list_datasets(self.config, limit, offset).await - } - - /// Update a dataset by id. - pub async fn update( - &self, - id: &str, - request: models::UpdateDatasetRequest, - ) -> Result> { - apis::datasets_api::update_dataset(self.config, id, request).await - } - - /// Delete a dataset by id. - pub async fn delete( - &self, - id: &str, - ) -> Result<(), Error> { - apis::datasets_api::delete_dataset(self.config, id).await - } - - /// List versions of a dataset. - pub async fn list_versions( - &self, - id: &str, - limit: Option, - offset: Option, - ) -> Result< - models::ListDatasetVersionsResponse, - Error, - > { - apis::datasets_api::list_dataset_versions(self.config, id, limit, offset).await - } -} - /// Connections resource handle. Wraps [`apis::connections_api`](crate::apis::connections_api). pub struct ConnectionsApi<'a> { config: &'a Configuration, @@ -411,8 +344,7 @@ impl<'a> EmbeddingProvidersApi<'a> { /// Indexes resource handle. Wraps [`apis::indexes_api`](crate::apis::indexes_api). /// -/// Covers both dataset-scoped indexes and managed-table (connection/schema/table) -/// indexes, so method names keep the disambiguating suffix. +/// Covers managed-table (connection/schema/table) indexes. pub struct IndexesApi<'a> { config: &'a Configuration, } @@ -422,33 +354,6 @@ impl<'a> IndexesApi<'a> { Self { config } } - /// Create an index on a dataset. - pub async fn create_dataset_index( - &self, - dataset_id: &str, - request: models::CreateIndexRequest, - ) -> Result> { - apis::indexes_api::create_dataset_index(self.config, dataset_id, request).await - } - - /// List indexes on a dataset. - pub async fn list_dataset_indexes( - &self, - dataset_id: &str, - ) -> Result> - { - apis::indexes_api::list_dataset_indexes(self.config, dataset_id).await - } - - /// Delete an index from a dataset. - pub async fn delete_dataset_index( - &self, - dataset_id: &str, - index_name: &str, - ) -> Result<(), Error> { - apis::indexes_api::delete_dataset_index(self.config, dataset_id, index_name).await - } - /// Create an index on a managed table. pub async fn create_index( &self, @@ -647,7 +552,7 @@ impl<'a> RefreshApi<'a> { Self { config } } - /// Refresh a dataset or other refreshable resource. + /// Refresh a refreshable resource. pub async fn refresh( &self, request: models::RefreshRequest, @@ -864,7 +769,7 @@ mod tests { #[test] fn handle_borrows_provided_config() { let config = Configuration::default(); - let handle = DatasetsApi::new(&config); + let handle = ConnectionsApi::new(&config); assert!(std::ptr::eq(handle.config, &config)); } @@ -873,11 +778,11 @@ mod tests { #[test] fn multiple_handles_share_one_config() { let config = Configuration::default(); - let datasets = DatasetsApi::new(&config); + let databases = DatabasesApi::new(&config); let connections = ConnectionsApi::new(&config); let queries = QueryApi::new(&config); - assert!(std::ptr::eq(datasets.config, &config)); + assert!(std::ptr::eq(databases.config, &config)); assert!(std::ptr::eq(connections.config, &config)); assert!(std::ptr::eq(queries.config, &config)); } @@ -887,7 +792,6 @@ mod tests { #[test] fn all_handles_constructible() { let config = Configuration::default(); - let _ = DatasetsApi::new(&config); let _ = ConnectionsApi::new(&config); let _ = ConnectionTypesApi::new(&config); let _ = DatabaseContextApi::new(&config); diff --git a/tests/auth_unknown_workspace.rs b/tests/auth_unknown_workspace.rs index aaa5999..37b2357 100644 --- a/tests/auth_unknown_workspace.rs +++ b/tests/auth_unknown_workspace.rs @@ -6,7 +6,7 @@ mod common; -use hotdata::apis::datasets_api; +use hotdata::apis::connections_api; use hotdata::Client; #[tokio::test] @@ -31,7 +31,7 @@ async fn auth_unknown_workspace() { .build() .expect("Client::build should succeed"); - let result = datasets_api::list_datasets(client.configuration(), None, None).await; + let result = connections_api::list_connections(client.configuration()).await; match result { Err(err) => { let status = common::status_of(&err); @@ -41,7 +41,7 @@ async fn auth_unknown_workspace() { ); } Ok(_) => panic!( - "list_datasets with fabricated workspace {fake_workspace} must not succeed \ + "list_connections with fabricated workspace {fake_workspace} must not succeed \ (potential cross-workspace leak)" ), } diff --git a/tests/dataset_versioning.rs b/tests/dataset_versioning.rs deleted file mode 100644 index 6fafc66..0000000 --- a/tests/dataset_versioning.rs +++ /dev/null @@ -1,64 +0,0 @@ -//! Scenario: dataset_versioning. -//! -//! Create a dataset, exercise list_dataset_versions, pin to a specific version, -//! then confirm the pin is reflected. Confirms the versioning surface is -//! reachable and consistent. - -mod common; - -use hotdata::apis::datasets_api; -use hotdata::models; - -fn inline_csv_source() -> models::DatasetSource { - models::DatasetSource::DatasetSourceOneOf4(Box::new(models::DatasetSourceOneOf4::new( - models::InlineData::new("a,b\n1,2\n3,4\n".to_string(), "csv".to_string()), - models::dataset_source_one_of_4::Type::Inline, - ))) -} - -#[tokio::test] -async fn dataset_versioning() { - let client = skip_if_no_creds!(); - let config = client.configuration(); - - let label = common::sdkci_name("dataset-versioning"); - - let created = datasets_api::create_dataset( - config, - models::CreateDatasetRequest::new(label, inline_csv_source()), - None, - ) - .await - .expect("create_dataset should succeed"); - - let versions = datasets_api::list_dataset_versions(config, &created.id, None, None) - .await - .expect("list_dataset_versions should succeed"); - assert_eq!(versions.dataset_id, created.id); - assert!(versions.count >= 1, "expected at least one version"); - assert!( - versions.versions.iter().any(|v| v.version == 1), - "expected version 1 in {:?}", - versions - .versions - .iter() - .map(|v| v.version) - .collect::>() - ); - - let mut pin = models::UpdateDatasetRequest::new(); - pin.pinned_version = Some(Some(1)); - let pinned = datasets_api::update_dataset(config, &created.id, pin) - .await - .expect("update_dataset (pin) should succeed"); - assert_eq!(pinned.pinned_version, Some(Some(1))); - assert!(pinned.latest_version >= 1); - - let fetched = datasets_api::get_dataset(config, &created.id) - .await - .expect("get_dataset should succeed"); - assert_eq!(fetched.pinned_version, Some(Some(1))); - - // Cleanup. - let _ = datasets_api::delete_dataset(config, &created.id).await; -} diff --git a/tests/datasets_crud.rs b/tests/datasets_crud.rs deleted file mode 100644 index 07fe227..0000000 --- a/tests/datasets_crud.rs +++ /dev/null @@ -1,76 +0,0 @@ -//! Scenario: datasets_crud. -//! -//! Defined in www.hotdata.dev/api/test-scenarios.yaml — create, read, list, -//! update, and delete a dataset; assert 404 after delete. - -mod common; - -use hotdata::apis::datasets_api; -use hotdata::models; - -fn inline_csv_source() -> models::DatasetSource { - models::DatasetSource::DatasetSourceOneOf4(Box::new(models::DatasetSourceOneOf4::new( - models::InlineData::new("a,b\n1,2\n3,4\n".to_string(), "csv".to_string()), - models::dataset_source_one_of_4::Type::Inline, - ))) -} - -#[tokio::test] -async fn datasets_crud() { - let client = skip_if_no_creds!(); - let config = client.configuration(); - - let label = common::sdkci_name("datasets-crud"); - let new_label = format!("{label}-renamed"); - - let created = datasets_api::create_dataset( - config, - models::CreateDatasetRequest::new(label.clone(), inline_csv_source()), - None, - ) - .await - .expect("create_dataset should succeed"); - assert_eq!(created.label, label); - assert!(!created.id.is_empty(), "created dataset must have an id"); - - let fetched = datasets_api::get_dataset(config, &created.id) - .await - .expect("get_dataset should succeed"); - assert_eq!(fetched.id, created.id); - assert_eq!(fetched.label, label); - assert!( - !fetched.columns.is_empty(), - "expected inferred columns from inline CSV" - ); - - let listing = datasets_api::list_datasets(config, None, None) - .await - .expect("list_datasets should succeed"); - assert!( - listing.datasets.iter().any(|d| d.id == created.id), - "newly created dataset {} not present in list_datasets", - created.id - ); - - let mut update = models::UpdateDatasetRequest::new(); - update.label = Some(Some(new_label.clone())); - let updated = datasets_api::update_dataset(config, &created.id, update) - .await - .expect("update_dataset should succeed"); - assert_eq!(updated.label, new_label); - - // Delete and assert 404 afterwards. - datasets_api::delete_dataset(config, &created.id) - .await - .expect("delete_dataset should succeed"); - - let after_delete = datasets_api::get_dataset(config, &created.id).await; - match after_delete { - Err(err) => assert_eq!( - common::status_of(&err), - Some(404), - "expected 404 after delete, got {err:?}" - ), - Ok(_) => panic!("get_dataset should fail with 404 after delete"), - } -} diff --git a/tests/indexes_lifecycle.rs b/tests/indexes_lifecycle.rs index 9a142c4..9a9e573 100644 --- a/tests/indexes_lifecycle.rs +++ b/tests/indexes_lifecycle.rs @@ -2,8 +2,7 @@ //! //! Exempt for every SDK (`optional_for: [python, typescript, rust]` in //! test-scenarios.yaml) — indexes are scoped to (connection_id, schema, table) -//! of *real* source tables, which the inline-CSV datasets used elsewhere in the -//! suite can't reach. Implementing it requires a dedicated indexable test table +//! of *real* source tables. Implementing it requires a dedicated indexable test table //! plus env vars naming the schema/table/column to target, and the generated //! Rust client does not (yet) expose an indexes API. //!