From a28205c936d3a7012d74f85b06cd0581d9545e65 Mon Sep 17 00:00:00 2001 From: "hotdata-automation[bot]" <267177015+hotdata-automation[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2026 03:46:28 +0000 Subject: [PATCH] chore: regenerate client from OpenAPI spec --- .gitignore | 4 +- .openapi-generator/FILES | 182 +++++++++ .openapi-generator/VERSION | 1 + Cargo.toml | 22 +- docs/ApiErrorDetail.md | 12 + docs/ApiErrorResponse.md | 11 + docs/BooleanProfileDetail.md | 12 + docs/CategoricalProfileDetail.md | 11 + docs/CategoryValueInfo.md | 12 + docs/ColumnInfo.md | 13 + docs/ColumnProfileDetail.md | 15 + docs/ColumnProfileDetailOneOf.md | 12 + docs/ColumnProfileDetailOneOf1.md | 14 + docs/ColumnProfileDetailOneOf2.md | 14 + docs/ColumnProfileDetailOneOf3.md | 13 + docs/ColumnProfileDetailOneOf4.md | 13 + docs/ColumnProfileInfo.md | 16 + docs/ColumnTypeSpec.md | 15 + docs/ConnectionHealthResponse.md | 14 + docs/ConnectionInfo.md | 13 + docs/ConnectionRefreshResult.md | 17 + docs/ConnectionSchemaError.md | 12 + docs/ConnectionsApi.md | 257 ++++++++++++ docs/CreateConnectionRequest.md | 15 + docs/CreateConnectionResponse.md | 16 + docs/CreateDatasetRequest.md | 13 + docs/CreateDatasetResponse.md | 15 + docs/CreateSavedQueryRequest.md | 14 + docs/CreateSecretRequest.md | 12 + docs/CreateSecretResponse.md | 13 + docs/CreateWorkspaceRequest.md | 12 + docs/CreateWorkspaceResponse.md | 12 + docs/DatasetSource.md | 12 + docs/DatasetSummary.md | 15 + docs/DatasetsApi.md | 157 ++++++++ docs/DiscoveryStatus.md | 14 + docs/Error.md | 11 + docs/ExecuteSavedQueryRequest.md | 11 + docs/GetConnectionResponse.md | 15 + docs/GetDatasetResponse.md | 18 + docs/GetResultResponse.md | 17 + docs/GetSecretResponse.md | 13 + docs/InformationSchemaApi.md | 44 +++ docs/InformationSchemaResponse.md | 15 + docs/InlineData.md | 13 + docs/InlineDatasetSource.md | 11 + docs/ListConnectionsResponse.md | 11 + docs/ListDatasetsResponse.md | 15 + docs/ListQueryRunsResponse.md | 15 + docs/ListResultsResponse.md | 15 + docs/ListSavedQueriesResponse.md | 15 + docs/ListSavedQueryVersionsResponse.md | 16 + docs/ListSecretsResponse.md | 11 + docs/ListUploadsResponse.md | 11 + docs/ListWorkspacesResponse.md | 12 + docs/NumericProfileDetail.md | 13 + docs/QueryApi.md | 39 ++ docs/QueryRequest.md | 11 + docs/QueryResponse.md | 18 + docs/QueryRunInfo.md | 25 ++ docs/QueryRunsApi.md | 38 ++ docs/RefreshApi.md | 39 ++ docs/RefreshRequest.md | 15 + docs/RefreshResponse.md | 13 + docs/RefreshWarning.md | 13 + docs/ResultInfo.md | 14 + docs/ResultsApi.md | 69 ++++ docs/SavedQueriesApi.md | 222 +++++++++++ docs/SavedQueryDetail.md | 28 ++ docs/SavedQuerySummary.md | 17 + docs/SavedQueryVersionInfo.md | 23 ++ docs/SchemaRefreshResult.md | 16 + docs/SecretMetadataResponse.md | 13 + docs/SecretsApi.md | 157 ++++++++ docs/TableInfo.md | 16 + docs/TableProfileResponse.md | 16 + docs/TableRefreshError.md | 13 + docs/TableRefreshResult.md | 16 + docs/TemporalProfileDetail.md | 12 + docs/TextProfileDetail.md | 13 + docs/UpdateDatasetRequest.md | 12 + docs/UpdateDatasetResponse.md | 14 + docs/UpdateSavedQueryRequest.md | 16 + docs/UpdateSecretRequest.md | 11 + docs/UpdateSecretResponse.md | 12 + docs/UploadDatasetSource.md | 13 + docs/UploadInfo.md | 15 + docs/UploadResponse.md | 15 + docs/UploadsApi.md | 68 ++++ docs/WorkspaceDetail.md | 14 + docs/WorkspaceListItem.md | 16 + docs/WorkspacesApi.md | 70 ++++ openapitools.json | 7 + src/apis/configuration.rs | 51 +++ src/apis/connections_api.rs | 372 ++++++++++++++++++ src/apis/datasets_api.rs | 254 ++++++++++++ src/apis/information_schema_api.rs | 89 +++++ src/apis/mod.rs | 126 ++++++ src/apis/query_api.rs | 68 ++++ src/apis/query_runs_api.rs | 71 ++++ src/apis/refresh_api.rs | 68 ++++ src/apis/results_api.rs | 119 ++++++ src/apis/saved_queries_api.rs | 359 +++++++++++++++++ src/apis/secrets_api.rs | 245 ++++++++++++ src/apis/uploads_api.rs | 116 ++++++ src/apis/workspaces_api.rs | 124 ++++++ src/lib.rs | 58 +-- src/models/api_error_detail.rs | 32 ++ src/models/api_error_response.rs | 29 ++ src/models/boolean_profile_detail.rs | 34 ++ src/models/categorical_profile_detail.rs | 30 ++ src/models/category_value_info.rs | 34 ++ src/models/column_info.rs | 35 ++ src/models/column_profile_detail.rs | 49 +++ src/models/column_profile_detail_one_of.rs | 43 ++ src/models/column_profile_detail_one_of_1.rs | 51 +++ src/models/column_profile_detail_one_of_2.rs | 51 +++ src/models/column_profile_detail_one_of_3.rs | 47 +++ src/models/column_profile_detail_one_of_4.rs | 47 +++ src/models/column_profile_info.rs | 50 +++ src/models/column_type_spec.rs | 46 +++ src/models/connection_health_response.rs | 38 ++ src/models/connection_info.rs | 35 ++ src/models/connection_refresh_result.rs | 47 +++ src/models/connection_schema_error.rs | 32 ++ src/models/create_connection_request.rs | 44 +++ src/models/create_connection_response.rs | 44 +++ src/models/create_dataset_request.rs | 36 ++ src/models/create_dataset_response.rs | 41 ++ src/models/create_saved_query_request.rs | 38 ++ src/models/create_secret_request.rs | 32 ++ src/models/create_secret_response.rs | 35 ++ src/models/create_workspace_request.rs | 32 ++ src/models/create_workspace_response.rs | 30 ++ src/models/dataset_source.rs | 28 ++ src/models/dataset_summary.rs | 41 ++ src/models/discovery_status.rs | 42 ++ src/models/error.rs | 28 ++ src/models/execute_saved_query_request.rs | 29 ++ src/models/get_connection_response.rs | 41 ++ src/models/get_dataset_response.rs | 50 +++ src/models/get_result_response.rs | 48 +++ src/models/get_secret_response.rs | 35 ++ src/models/information_schema_response.rs | 41 ++ src/models/inline_data.rs | 36 ++ src/models/inline_dataset_source.rs | 29 ++ src/models/list_connections_response.rs | 29 ++ src/models/list_datasets_response.rs | 45 +++ src/models/list_query_runs_response.rs | 41 ++ src/models/list_results_response.rs | 45 +++ src/models/list_saved_queries_response.rs | 41 ++ .../list_saved_query_versions_response.rs | 44 +++ src/models/list_secrets_response.rs | 29 ++ src/models/list_uploads_response.rs | 29 ++ src/models/list_workspaces_response.rs | 30 ++ src/models/mod.rs | 154 ++++++++ src/models/numeric_profile_detail.rs | 38 ++ src/models/query_request.rs | 29 ++ src/models/query_response.rs | 55 +++ src/models/query_run_info.rs | 71 ++++ src/models/refresh_request.rs | 42 ++ src/models/refresh_response.rs | 29 ++ src/models/refresh_warning.rs | 35 ++ src/models/result_info.rs | 38 ++ src/models/saved_query_detail.rs | 80 ++++ src/models/saved_query_summary.rs | 47 +++ src/models/saved_query_version_info.rs | 65 +++ src/models/schema_refresh_result.rs | 44 +++ src/models/secret_metadata_response.rs | 35 ++ src/models/table_info.rs | 44 +++ src/models/table_profile_response.rs | 50 +++ src/models/table_refresh_error.rs | 35 ++ src/models/table_refresh_result.rs | 44 +++ src/models/temporal_profile_detail.rs | 34 ++ src/models/text_profile_detail.rs | 38 ++ src/models/update_dataset_request.rs | 32 ++ src/models/update_dataset_response.rs | 38 ++ src/models/update_saved_query_request.rs | 48 +++ src/models/update_secret_request.rs | 29 ++ src/models/update_secret_response.rs | 32 ++ src/models/upload_dataset_source.rs | 36 ++ src/models/upload_info.rs | 41 ++ src/models/upload_response.rs | 41 ++ src/models/workspace_detail.rs | 36 ++ src/models/workspace_list_item.rs | 42 ++ 185 files changed, 7753 insertions(+), 58 deletions(-) create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 docs/ApiErrorDetail.md create mode 100644 docs/ApiErrorResponse.md create mode 100644 docs/BooleanProfileDetail.md create mode 100644 docs/CategoricalProfileDetail.md create mode 100644 docs/CategoryValueInfo.md create mode 100644 docs/ColumnInfo.md create mode 100644 docs/ColumnProfileDetail.md create mode 100644 docs/ColumnProfileDetailOneOf.md create mode 100644 docs/ColumnProfileDetailOneOf1.md create mode 100644 docs/ColumnProfileDetailOneOf2.md create mode 100644 docs/ColumnProfileDetailOneOf3.md create mode 100644 docs/ColumnProfileDetailOneOf4.md create mode 100644 docs/ColumnProfileInfo.md create mode 100644 docs/ColumnTypeSpec.md create mode 100644 docs/ConnectionHealthResponse.md create mode 100644 docs/ConnectionInfo.md create mode 100644 docs/ConnectionRefreshResult.md create mode 100644 docs/ConnectionSchemaError.md create mode 100644 docs/ConnectionsApi.md create mode 100644 docs/CreateConnectionRequest.md create mode 100644 docs/CreateConnectionResponse.md create mode 100644 docs/CreateDatasetRequest.md create mode 100644 docs/CreateDatasetResponse.md create mode 100644 docs/CreateSavedQueryRequest.md create mode 100644 docs/CreateSecretRequest.md create mode 100644 docs/CreateSecretResponse.md create mode 100644 docs/CreateWorkspaceRequest.md create mode 100644 docs/CreateWorkspaceResponse.md create mode 100644 docs/DatasetSource.md create mode 100644 docs/DatasetSummary.md create mode 100644 docs/DatasetsApi.md create mode 100644 docs/DiscoveryStatus.md create mode 100644 docs/Error.md create mode 100644 docs/ExecuteSavedQueryRequest.md create mode 100644 docs/GetConnectionResponse.md create mode 100644 docs/GetDatasetResponse.md create mode 100644 docs/GetResultResponse.md create mode 100644 docs/GetSecretResponse.md create mode 100644 docs/InformationSchemaApi.md create mode 100644 docs/InformationSchemaResponse.md create mode 100644 docs/InlineData.md create mode 100644 docs/InlineDatasetSource.md create mode 100644 docs/ListConnectionsResponse.md create mode 100644 docs/ListDatasetsResponse.md create mode 100644 docs/ListQueryRunsResponse.md create mode 100644 docs/ListResultsResponse.md create mode 100644 docs/ListSavedQueriesResponse.md create mode 100644 docs/ListSavedQueryVersionsResponse.md create mode 100644 docs/ListSecretsResponse.md create mode 100644 docs/ListUploadsResponse.md create mode 100644 docs/ListWorkspacesResponse.md create mode 100644 docs/NumericProfileDetail.md create mode 100644 docs/QueryApi.md create mode 100644 docs/QueryRequest.md create mode 100644 docs/QueryResponse.md create mode 100644 docs/QueryRunInfo.md create mode 100644 docs/QueryRunsApi.md create mode 100644 docs/RefreshApi.md create mode 100644 docs/RefreshRequest.md create mode 100644 docs/RefreshResponse.md create mode 100644 docs/RefreshWarning.md create mode 100644 docs/ResultInfo.md create mode 100644 docs/ResultsApi.md create mode 100644 docs/SavedQueriesApi.md create mode 100644 docs/SavedQueryDetail.md create mode 100644 docs/SavedQuerySummary.md create mode 100644 docs/SavedQueryVersionInfo.md create mode 100644 docs/SchemaRefreshResult.md create mode 100644 docs/SecretMetadataResponse.md create mode 100644 docs/SecretsApi.md create mode 100644 docs/TableInfo.md create mode 100644 docs/TableProfileResponse.md create mode 100644 docs/TableRefreshError.md create mode 100644 docs/TableRefreshResult.md create mode 100644 docs/TemporalProfileDetail.md create mode 100644 docs/TextProfileDetail.md create mode 100644 docs/UpdateDatasetRequest.md create mode 100644 docs/UpdateDatasetResponse.md create mode 100644 docs/UpdateSavedQueryRequest.md create mode 100644 docs/UpdateSecretRequest.md create mode 100644 docs/UpdateSecretResponse.md create mode 100644 docs/UploadDatasetSource.md create mode 100644 docs/UploadInfo.md create mode 100644 docs/UploadResponse.md create mode 100644 docs/UploadsApi.md create mode 100644 docs/WorkspaceDetail.md create mode 100644 docs/WorkspaceListItem.md create mode 100644 docs/WorkspacesApi.md create mode 100644 openapitools.json create mode 100644 src/apis/configuration.rs create mode 100644 src/apis/connections_api.rs create mode 100644 src/apis/datasets_api.rs create mode 100644 src/apis/information_schema_api.rs create mode 100644 src/apis/mod.rs create mode 100644 src/apis/query_api.rs create mode 100644 src/apis/query_runs_api.rs create mode 100644 src/apis/refresh_api.rs create mode 100644 src/apis/results_api.rs create mode 100644 src/apis/saved_queries_api.rs create mode 100644 src/apis/secrets_api.rs create mode 100644 src/apis/uploads_api.rs create mode 100644 src/apis/workspaces_api.rs create mode 100644 src/models/api_error_detail.rs create mode 100644 src/models/api_error_response.rs create mode 100644 src/models/boolean_profile_detail.rs create mode 100644 src/models/categorical_profile_detail.rs create mode 100644 src/models/category_value_info.rs create mode 100644 src/models/column_info.rs create mode 100644 src/models/column_profile_detail.rs create mode 100644 src/models/column_profile_detail_one_of.rs create mode 100644 src/models/column_profile_detail_one_of_1.rs create mode 100644 src/models/column_profile_detail_one_of_2.rs create mode 100644 src/models/column_profile_detail_one_of_3.rs create mode 100644 src/models/column_profile_detail_one_of_4.rs create mode 100644 src/models/column_profile_info.rs create mode 100644 src/models/column_type_spec.rs create mode 100644 src/models/connection_health_response.rs create mode 100644 src/models/connection_info.rs create mode 100644 src/models/connection_refresh_result.rs create mode 100644 src/models/connection_schema_error.rs create mode 100644 src/models/create_connection_request.rs create mode 100644 src/models/create_connection_response.rs create mode 100644 src/models/create_dataset_request.rs create mode 100644 src/models/create_dataset_response.rs create mode 100644 src/models/create_saved_query_request.rs create mode 100644 src/models/create_secret_request.rs create mode 100644 src/models/create_secret_response.rs create mode 100644 src/models/create_workspace_request.rs create mode 100644 src/models/create_workspace_response.rs create mode 100644 src/models/dataset_source.rs create mode 100644 src/models/dataset_summary.rs create mode 100644 src/models/discovery_status.rs create mode 100644 src/models/error.rs create mode 100644 src/models/execute_saved_query_request.rs create mode 100644 src/models/get_connection_response.rs create mode 100644 src/models/get_dataset_response.rs create mode 100644 src/models/get_result_response.rs create mode 100644 src/models/get_secret_response.rs create mode 100644 src/models/information_schema_response.rs create mode 100644 src/models/inline_data.rs create mode 100644 src/models/inline_dataset_source.rs create mode 100644 src/models/list_connections_response.rs create mode 100644 src/models/list_datasets_response.rs create mode 100644 src/models/list_query_runs_response.rs create mode 100644 src/models/list_results_response.rs create mode 100644 src/models/list_saved_queries_response.rs create mode 100644 src/models/list_saved_query_versions_response.rs create mode 100644 src/models/list_secrets_response.rs create mode 100644 src/models/list_uploads_response.rs create mode 100644 src/models/list_workspaces_response.rs create mode 100644 src/models/mod.rs create mode 100644 src/models/numeric_profile_detail.rs create mode 100644 src/models/query_request.rs create mode 100644 src/models/query_response.rs create mode 100644 src/models/query_run_info.rs create mode 100644 src/models/refresh_request.rs create mode 100644 src/models/refresh_response.rs create mode 100644 src/models/refresh_warning.rs create mode 100644 src/models/result_info.rs create mode 100644 src/models/saved_query_detail.rs create mode 100644 src/models/saved_query_summary.rs create mode 100644 src/models/saved_query_version_info.rs create mode 100644 src/models/schema_refresh_result.rs create mode 100644 src/models/secret_metadata_response.rs create mode 100644 src/models/table_info.rs create mode 100644 src/models/table_profile_response.rs create mode 100644 src/models/table_refresh_error.rs create mode 100644 src/models/table_refresh_result.rs create mode 100644 src/models/temporal_profile_detail.rs create mode 100644 src/models/text_profile_detail.rs create mode 100644 src/models/update_dataset_request.rs create mode 100644 src/models/update_dataset_response.rs create mode 100644 src/models/update_saved_query_request.rs create mode 100644 src/models/update_secret_request.rs create mode 100644 src/models/update_secret_response.rs create mode 100644 src/models/upload_dataset_source.rs create mode 100644 src/models/upload_info.rs create mode 100644 src/models/upload_response.rs create mode 100644 src/models/workspace_detail.rs create mode 100644 src/models/workspace_list_item.rs diff --git a/.gitignore b/.gitignore index ea8c4bf..6aa1064 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/target +/target/ +**/*.rs.bk +Cargo.lock diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..07c0d64 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,182 @@ +.gitignore +Cargo.toml +docs/ApiErrorDetail.md +docs/ApiErrorResponse.md +docs/BooleanProfileDetail.md +docs/CategoricalProfileDetail.md +docs/CategoryValueInfo.md +docs/ColumnInfo.md +docs/ColumnProfileDetail.md +docs/ColumnProfileDetailOneOf.md +docs/ColumnProfileDetailOneOf1.md +docs/ColumnProfileDetailOneOf2.md +docs/ColumnProfileDetailOneOf3.md +docs/ColumnProfileDetailOneOf4.md +docs/ColumnProfileInfo.md +docs/ColumnTypeSpec.md +docs/ConnectionHealthResponse.md +docs/ConnectionInfo.md +docs/ConnectionRefreshResult.md +docs/ConnectionSchemaError.md +docs/ConnectionsApi.md +docs/CreateConnectionRequest.md +docs/CreateConnectionResponse.md +docs/CreateDatasetRequest.md +docs/CreateDatasetResponse.md +docs/CreateSavedQueryRequest.md +docs/CreateSecretRequest.md +docs/CreateSecretResponse.md +docs/CreateWorkspaceRequest.md +docs/CreateWorkspaceResponse.md +docs/DatasetSource.md +docs/DatasetSummary.md +docs/DatasetsApi.md +docs/DiscoveryStatus.md +docs/Error.md +docs/ExecuteSavedQueryRequest.md +docs/GetConnectionResponse.md +docs/GetDatasetResponse.md +docs/GetResultResponse.md +docs/GetSecretResponse.md +docs/InformationSchemaApi.md +docs/InformationSchemaResponse.md +docs/InlineData.md +docs/InlineDatasetSource.md +docs/ListConnectionsResponse.md +docs/ListDatasetsResponse.md +docs/ListQueryRunsResponse.md +docs/ListResultsResponse.md +docs/ListSavedQueriesResponse.md +docs/ListSavedQueryVersionsResponse.md +docs/ListSecretsResponse.md +docs/ListUploadsResponse.md +docs/ListWorkspacesResponse.md +docs/NumericProfileDetail.md +docs/QueryApi.md +docs/QueryRequest.md +docs/QueryResponse.md +docs/QueryRunInfo.md +docs/QueryRunsApi.md +docs/RefreshApi.md +docs/RefreshRequest.md +docs/RefreshResponse.md +docs/RefreshWarning.md +docs/ResultInfo.md +docs/ResultsApi.md +docs/SavedQueriesApi.md +docs/SavedQueryDetail.md +docs/SavedQuerySummary.md +docs/SavedQueryVersionInfo.md +docs/SchemaRefreshResult.md +docs/SecretMetadataResponse.md +docs/SecretsApi.md +docs/TableInfo.md +docs/TableProfileResponse.md +docs/TableRefreshError.md +docs/TableRefreshResult.md +docs/TemporalProfileDetail.md +docs/TextProfileDetail.md +docs/UpdateDatasetRequest.md +docs/UpdateDatasetResponse.md +docs/UpdateSavedQueryRequest.md +docs/UpdateSecretRequest.md +docs/UpdateSecretResponse.md +docs/UploadDatasetSource.md +docs/UploadInfo.md +docs/UploadResponse.md +docs/UploadsApi.md +docs/WorkspaceDetail.md +docs/WorkspaceListItem.md +docs/WorkspacesApi.md +src/apis/configuration.rs +src/apis/connections_api.rs +src/apis/datasets_api.rs +src/apis/information_schema_api.rs +src/apis/mod.rs +src/apis/query_api.rs +src/apis/query_runs_api.rs +src/apis/refresh_api.rs +src/apis/results_api.rs +src/apis/saved_queries_api.rs +src/apis/secrets_api.rs +src/apis/uploads_api.rs +src/apis/workspaces_api.rs +src/lib.rs +src/models/api_error_detail.rs +src/models/api_error_response.rs +src/models/boolean_profile_detail.rs +src/models/categorical_profile_detail.rs +src/models/category_value_info.rs +src/models/column_info.rs +src/models/column_profile_detail.rs +src/models/column_profile_detail_one_of.rs +src/models/column_profile_detail_one_of_1.rs +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 +src/models/connection_schema_error.rs +src/models/create_connection_request.rs +src/models/create_connection_response.rs +src/models/create_dataset_request.rs +src/models/create_dataset_response.rs +src/models/create_saved_query_request.rs +src/models/create_secret_request.rs +src/models/create_secret_response.rs +src/models/create_workspace_request.rs +src/models/create_workspace_response.rs +src/models/dataset_source.rs +src/models/dataset_summary.rs +src/models/discovery_status.rs +src/models/error.rs +src/models/execute_saved_query_request.rs +src/models/get_connection_response.rs +src/models/get_dataset_response.rs +src/models/get_result_response.rs +src/models/get_secret_response.rs +src/models/information_schema_response.rs +src/models/inline_data.rs +src/models/inline_dataset_source.rs +src/models/list_connections_response.rs +src/models/list_datasets_response.rs +src/models/list_query_runs_response.rs +src/models/list_results_response.rs +src/models/list_saved_queries_response.rs +src/models/list_saved_query_versions_response.rs +src/models/list_secrets_response.rs +src/models/list_uploads_response.rs +src/models/list_workspaces_response.rs +src/models/mod.rs +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_request.rs +src/models/refresh_response.rs +src/models/refresh_warning.rs +src/models/result_info.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/table_info.rs +src/models/table_profile_response.rs +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_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/workspace_detail.rs +src/models/workspace_list_item.rs diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..2540a3a --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.20.0 diff --git a/Cargo.toml b/Cargo.toml index 91b96d7..6a0804c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,20 @@ [package] name = "hotdata" version = "0.1.0" -edition = "2024" -description = "Rust client for the HotData API" +authors = ["developers@hotdata.dev"] +description = "Powerful data platform API for datasets, queries, and analytics." license = "MIT" +edition = "2021" [dependencies] -reqwest = { version = "0.12", features = ["json"] } -serde = { version = "1", features = ["derive"] } -serde_json = "1" -tokio = { version = "1", features = ["full"] } -thiserror = "2" -url = "2" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +reqwest = { version = "^0.13", default-features = false, features = ["json", "multipart", "query", "form"] } + +[features] +default = ["native-tls"] +native-tls = ["reqwest/native-tls"] +rustls = ["reqwest/rustls"] diff --git a/docs/ApiErrorDetail.md b/docs/ApiErrorDetail.md new file mode 100644 index 0000000..1f690ca --- /dev/null +++ b/docs/ApiErrorDetail.md @@ -0,0 +1,12 @@ +# ApiErrorDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**message** | **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/ApiErrorResponse.md b/docs/ApiErrorResponse.md new file mode 100644 index 0000000..6203c5c --- /dev/null +++ b/docs/ApiErrorResponse.md @@ -0,0 +1,11 @@ +# ApiErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**models::ApiErrorDetail**](ApiErrorDetail.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/BooleanProfileDetail.md b/docs/BooleanProfileDetail.md new file mode 100644 index 0000000..51ac1ee --- /dev/null +++ b/docs/BooleanProfileDetail.md @@ -0,0 +1,12 @@ +# BooleanProfileDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**false_count** | **i64** | Number of false values | +**true_count** | **i64** | Number of true values | + +[[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/CategoricalProfileDetail.md b/docs/CategoricalProfileDetail.md new file mode 100644 index 0000000..2ca5f23 --- /dev/null +++ b/docs/CategoricalProfileDetail.md @@ -0,0 +1,11 @@ +# CategoricalProfileDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | [**Vec**](CategoryValueInfo.md) | Distinct values with their counts, ordered by count descending | + +[[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/CategoryValueInfo.md b/docs/CategoryValueInfo.md new file mode 100644 index 0000000..fd2f18a --- /dev/null +++ b/docs/CategoryValueInfo.md @@ -0,0 +1,12 @@ +# CategoryValueInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i64** | Number of occurrences | +**value** | Option<**String**> | The distinct value (as a string, or null) | [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/ColumnInfo.md b/docs/ColumnInfo.md new file mode 100644 index 0000000..c6fecfb --- /dev/null +++ b/docs/ColumnInfo.md @@ -0,0 +1,13 @@ +# ColumnInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_type** | **String** | | +**name** | **String** | | +**nullable** | **bool** | | + +[[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/ColumnProfileDetail.md b/docs/ColumnProfileDetail.md new file mode 100644 index 0000000..676c1fc --- /dev/null +++ b/docs/ColumnProfileDetail.md @@ -0,0 +1,15 @@ +# ColumnProfileDetail + +## Enum Variants + +| Name | Description | +|---- | -----| +| ColumnProfileDetailOneOf | | +| ColumnProfileDetailOneOf1 | | +| ColumnProfileDetailOneOf2 | | +| ColumnProfileDetailOneOf3 | | +| ColumnProfileDetailOneOf4 | | + +[[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/ColumnProfileDetailOneOf.md b/docs/ColumnProfileDetailOneOf.md new file mode 100644 index 0000000..c915d05 --- /dev/null +++ b/docs/ColumnProfileDetailOneOf.md @@ -0,0 +1,12 @@ +# ColumnProfileDetailOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | [**Vec**](CategoryValueInfo.md) | Distinct values with their counts, ordered by count descending | +**r#type** | **Type** | (enum: categorical) | + +[[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/ColumnProfileDetailOneOf1.md b/docs/ColumnProfileDetailOneOf1.md new file mode 100644 index 0000000..54ef214 --- /dev/null +++ b/docs/ColumnProfileDetailOneOf1.md @@ -0,0 +1,14 @@ +# ColumnProfileDetailOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avg_length** | **f64** | Average string length | +**max_length** | **i64** | Longest string length in the column | +**min_length** | **i64** | Shortest string length in the column | +**r#type** | **Type** | (enum: text) | + +[[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/ColumnProfileDetailOneOf2.md b/docs/ColumnProfileDetailOneOf2.md new file mode 100644 index 0000000..5f14e12 --- /dev/null +++ b/docs/ColumnProfileDetailOneOf2.md @@ -0,0 +1,14 @@ +# ColumnProfileDetailOneOf2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **String** | Maximum value (string to preserve precision for large integers and decimals) | +**mean** | **f64** | Arithmetic mean | +**min** | **String** | Minimum value (string to preserve precision for large integers and decimals) | +**r#type** | **Type** | (enum: numeric) | + +[[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/ColumnProfileDetailOneOf3.md b/docs/ColumnProfileDetailOneOf3.md new file mode 100644 index 0000000..7f3fb77 --- /dev/null +++ b/docs/ColumnProfileDetailOneOf3.md @@ -0,0 +1,13 @@ +# ColumnProfileDetailOneOf3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **String** | Latest value as ISO-8601 string | +**min** | **String** | Earliest value as ISO-8601 string | +**r#type** | **Type** | (enum: temporal) | + +[[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/ColumnProfileDetailOneOf4.md b/docs/ColumnProfileDetailOneOf4.md new file mode 100644 index 0000000..9047d21 --- /dev/null +++ b/docs/ColumnProfileDetailOneOf4.md @@ -0,0 +1,13 @@ +# ColumnProfileDetailOneOf4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**false_count** | **i64** | Number of false values | +**true_count** | **i64** | Number of true values | +**r#type** | **Type** | (enum: boolean) | + +[[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/ColumnProfileInfo.md b/docs/ColumnProfileInfo.md new file mode 100644 index 0000000..e5329a2 --- /dev/null +++ b/docs/ColumnProfileInfo.md @@ -0,0 +1,16 @@ +# ColumnProfileInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cardinality** | **i64** | Approximate number of distinct non-null values | +**data_type** | **String** | Arrow data type (e.g. \"Utf8\", \"Int32\", \"Timestamp(Microsecond, Some(\\\"UTC\\\"))\") | +**name** | **String** | Column name | +**null_count** | **i64** | Number of null values | +**null_percentage** | **f64** | Percentage of null values (0.0 to 100.0) | +**profile** | Option<[**models::ColumnProfileDetail**](ColumnProfileDetail.md)> | Type-specific profile detail. Null when the column is all-null or has an unsupported type. | [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/ColumnTypeSpec.md b/docs/ColumnTypeSpec.md new file mode 100644 index 0000000..c35ea75 --- /dev/null +++ b/docs/ColumnTypeSpec.md @@ -0,0 +1,15 @@ +# 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/ConnectionHealthResponse.md b/docs/ConnectionHealthResponse.md new file mode 100644 index 0000000..a1098ed --- /dev/null +++ b/docs/ConnectionHealthResponse.md @@ -0,0 +1,14 @@ +# ConnectionHealthResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connection_id** | **String** | | +**error** | Option<**String**> | | [optional] +**healthy** | **bool** | | +**latency_ms** | **i64** | | + +[[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/ConnectionInfo.md b/docs/ConnectionInfo.md new file mode 100644 index 0000000..59d33a5 --- /dev/null +++ b/docs/ConnectionInfo.md @@ -0,0 +1,13 @@ +# ConnectionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | | +**source_type** | **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/ConnectionRefreshResult.md b/docs/ConnectionRefreshResult.md new file mode 100644 index 0000000..5069c95 --- /dev/null +++ b/docs/ConnectionRefreshResult.md @@ -0,0 +1,17 @@ +# ConnectionRefreshResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connection_id** | **String** | | +**duration_ms** | **i64** | | +**errors** | [**Vec**](TableRefreshError.md) | | +**tables_failed** | **i32** | | +**tables_refreshed** | **i32** | | +**total_rows** | **i32** | | +**warnings** | Option<[**Vec**](RefreshWarning.md)> | | [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/ConnectionSchemaError.md b/docs/ConnectionSchemaError.md new file mode 100644 index 0000000..8444b93 --- /dev/null +++ b/docs/ConnectionSchemaError.md @@ -0,0 +1,12 @@ +# ConnectionSchemaError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connection_id** | **String** | | +**error** | **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/ConnectionsApi.md b/docs/ConnectionsApi.md new file mode 100644 index 0000000..533a562 --- /dev/null +++ b/docs/ConnectionsApi.md @@ -0,0 +1,257 @@ +# \ConnectionsApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**check_connection_health**](ConnectionsApi.md#check_connection_health) | **GET** /v1/connections/{connection_id}/health | Check connection health +[**create_connection**](ConnectionsApi.md#create_connection) | **POST** /v1/connections | Create connection +[**delete_connection**](ConnectionsApi.md#delete_connection) | **DELETE** /v1/connections/{connection_id} | Delete connection +[**get_connection**](ConnectionsApi.md#get_connection) | **GET** /v1/connections/{connection_id} | Get connection +[**get_table_profile**](ConnectionsApi.md#get_table_profile) | **GET** /v1/connections/{connection_id}/tables/{schema}/{table}/profile | Get table profile +[**list_connections**](ConnectionsApi.md#list_connections) | **GET** /v1/connections | List connections +[**purge_connection_cache**](ConnectionsApi.md#purge_connection_cache) | **DELETE** /v1/connections/{connection_id}/cache | Purge connection cache +[**purge_table_cache**](ConnectionsApi.md#purge_table_cache) | **DELETE** /v1/connections/{connection_id}/tables/{schema}/{table}/cache | Purge table cache + + + +## check_connection_health + +> models::ConnectionHealthResponse check_connection_health(connection_id) +Check connection health + +Test connectivity to the remote database. Returns health status and latency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | **String** | Connection ID | [required] | + +### Return type + +[**models::ConnectionHealthResponse**](ConnectionHealthResponse.md) + +### Authorization + +[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) + + +## create_connection + +> models::CreateConnectionResponse create_connection(create_connection_request) +Create connection + +Register a new database connection. Provide the source type and connection config (host, port, database, etc.). Credentials can be supplied inline (password/token fields are auto-converted to secrets) or by referencing an existing secret by name or ID. Schema discovery runs automatically after registration. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_connection_request** | [**CreateConnectionRequest**](CreateConnectionRequest.md) | | [required] | + +### Return type + +[**models::CreateConnectionResponse**](CreateConnectionResponse.md) + +### Authorization + +[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_connection + +> delete_connection(connection_id) +Delete connection + +Delete a connection and its cached data. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | **String** | Connection ID | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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_connection + +> models::GetConnectionResponse get_connection(connection_id) +Get connection + +Get details for a specific connection, including table and sync counts. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | **String** | Connection ID | [required] | + +### Return type + +[**models::GetConnectionResponse**](GetConnectionResponse.md) + +### Authorization + +[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_table_profile + +> models::TableProfileResponse get_table_profile(connection_id, schema, table) +Get table profile + +Get column-level statistics for a synced table. Returns per-column profiles including cardinality, null counts, and type-specific details (distinct values for categorical columns, min/max for temporal/numeric, length stats for text). Profiles are computed at sync time. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | **String** | Connection ID | [required] | +**schema** | **String** | Schema name | [required] | +**table** | **String** | Table name | [required] | + +### Return type + +[**models::TableProfileResponse**](TableProfileResponse.md) + +### Authorization + +[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_connections + +> models::ListConnectionsResponse list_connections() +List connections + +List all registered database connections. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::ListConnectionsResponse**](ListConnectionsResponse.md) + +### Authorization + +[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) + + +## purge_connection_cache + +> purge_connection_cache(connection_id) +Purge connection cache + +Purge all cached data for a connection. The next query against these tables will trigger a fresh sync from the remote source. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | **String** | Connection ID | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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) + + +## purge_table_cache + +> purge_table_cache(connection_id, schema, table) +Purge table cache + +Purge the cached data for a single table. The next query will trigger a fresh sync. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | **String** | Connection ID | [required] | +**schema** | **String** | Schema name | [required] | +**table** | **String** | Table name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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/CreateConnectionRequest.md b/docs/CreateConnectionRequest.md new file mode 100644 index 0000000..5c9efda --- /dev/null +++ b/docs/CreateConnectionRequest.md @@ -0,0 +1,15 @@ +# CreateConnectionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | **std::collections::HashMap** | Connection configuration object. Fields vary by source type (host, port, database, etc.). | +**name** | **String** | | +**secret_id** | Option<**String**> | Optional reference to a secret by ID (e.g., \"secr_abc123\"). If provided, this secret will be used for authentication. Mutually exclusive with `secret_name`. | [optional] +**secret_name** | Option<**String**> | Optional reference to a secret by name. If provided, this secret will be used for authentication. Mutually exclusive with `secret_id`. | [optional] +**source_type** | **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/CreateConnectionResponse.md b/docs/CreateConnectionResponse.md new file mode 100644 index 0000000..79aef54 --- /dev/null +++ b/docs/CreateConnectionResponse.md @@ -0,0 +1,16 @@ +# CreateConnectionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**discovery_error** | Option<**String**> | | [optional] +**discovery_status** | [**models::DiscoveryStatus**](DiscoveryStatus.md) | | +**id** | **String** | | +**name** | **String** | | +**source_type** | **String** | | +**tables_discovered** | **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/CreateDatasetRequest.md b/docs/CreateDatasetRequest.md new file mode 100644 index 0000000..b64439c --- /dev/null +++ b/docs/CreateDatasetRequest.md @@ -0,0 +1,13 @@ +# 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 new file mode 100644 index 0000000..e76e4a9 --- /dev/null +++ b/docs/CreateDatasetResponse.md @@ -0,0 +1,15 @@ +# CreateDatasetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**id** | **String** | | +**label** | **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/CreateSavedQueryRequest.md b/docs/CreateSavedQueryRequest.md new file mode 100644 index 0000000..d764976 --- /dev/null +++ b/docs/CreateSavedQueryRequest.md @@ -0,0 +1,14 @@ +# CreateSavedQueryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**name** | **String** | | +**sql** | **String** | | +**tags** | Option<**Vec**> | | [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/CreateSecretRequest.md b/docs/CreateSecretRequest.md new file mode 100644 index 0000000..be96055 --- /dev/null +++ b/docs/CreateSecretRequest.md @@ -0,0 +1,12 @@ +# CreateSecretRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**value** | **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/CreateSecretResponse.md b/docs/CreateSecretResponse.md new file mode 100644 index 0000000..a94e316 --- /dev/null +++ b/docs/CreateSecretResponse.md @@ -0,0 +1,13 @@ +# CreateSecretResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**id** | **String** | | +**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/CreateWorkspaceRequest.md b/docs/CreateWorkspaceRequest.md new file mode 100644 index 0000000..5781259 --- /dev/null +++ b/docs/CreateWorkspaceRequest.md @@ -0,0 +1,12 @@ +# CreateWorkspaceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name for the new workspace. | +**organization_public_id** | Option<**String**> | Target organization. Defaults to the user's current organization. | [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/CreateWorkspaceResponse.md b/docs/CreateWorkspaceResponse.md new file mode 100644 index 0000000..dfadcb9 --- /dev/null +++ b/docs/CreateWorkspaceResponse.md @@ -0,0 +1,12 @@ +# CreateWorkspaceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ok** | **bool** | | +**workspace** | [**models::WorkspaceDetail**](WorkspaceDetail.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/DatasetSource.md b/docs/DatasetSource.md new file mode 100644 index 0000000..3404469 --- /dev/null +++ b/docs/DatasetSource.md @@ -0,0 +1,12 @@ +# DatasetSource + +## Enum Variants + +| Name | Description | +|---- | -----| +| InlineDatasetSource | Dataset source specification | +| UploadDatasetSource | Dataset source specification | + +[[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 new file mode 100644 index 0000000..f10bd36 --- /dev/null +++ b/docs/DatasetSummary.md @@ -0,0 +1,15 @@ +# DatasetSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**id** | **String** | | +**label** | **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/DatasetsApi.md b/docs/DatasetsApi.md new file mode 100644 index 0000000..e2ab20b --- /dev/null +++ b/docs/DatasetsApi.md @@ -0,0 +1,157 @@ +# \DatasetsApi + +All URIs are relative to *https://app.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_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) +Create dataset + +Create a new dataset from an uploaded file or inline data. 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. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_dataset_request** | [**CreateDatasetRequest**](CreateDatasetRequest.md) | | [required] | + +### Return type + +[**models::CreateDatasetResponse**](CreateDatasetResponse.md) + +### Authorization + +[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 + +[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 + +[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 + +[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 + +[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/DiscoveryStatus.md b/docs/DiscoveryStatus.md new file mode 100644 index 0000000..ce34027 --- /dev/null +++ b/docs/DiscoveryStatus.md @@ -0,0 +1,14 @@ +# DiscoveryStatus + +## Enum Variants + +| Name | Value | +|---- | -----| +| Success | success | +| Skipped | skipped | +| Failed | failed | + + +[[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/Error.md b/docs/Error.md new file mode 100644 index 0000000..f4e4982 --- /dev/null +++ b/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **String** | Machine-readable error code. | + +[[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/ExecuteSavedQueryRequest.md b/docs/ExecuteSavedQueryRequest.md new file mode 100644 index 0000000..36d9206 --- /dev/null +++ b/docs/ExecuteSavedQueryRequest.md @@ -0,0 +1,11 @@ +# ExecuteSavedQueryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/GetConnectionResponse.md b/docs/GetConnectionResponse.md new file mode 100644 index 0000000..94a8e1c --- /dev/null +++ b/docs/GetConnectionResponse.md @@ -0,0 +1,15 @@ +# GetConnectionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | | +**source_type** | **String** | | +**synced_table_count** | **i32** | | +**table_count** | **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/GetDatasetResponse.md b/docs/GetDatasetResponse.md new file mode 100644 index 0000000..aa8fa00 --- /dev/null +++ b/docs/GetDatasetResponse.md @@ -0,0 +1,18 @@ +# GetDatasetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**columns** | [**Vec**](ColumnInfo.md) | | +**created_at** | **String** | | +**id** | **String** | | +**label** | **String** | | +**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/GetResultResponse.md b/docs/GetResultResponse.md new file mode 100644 index 0000000..5586e62 --- /dev/null +++ b/docs/GetResultResponse.md @@ -0,0 +1,17 @@ +# GetResultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**columns** | Option<**Vec**> | | [optional] +**error_message** | Option<**String**> | | [optional] +**nullable** | Option<**Vec**> | | [optional] +**result_id** | **String** | | +**row_count** | Option<**i32**> | | [optional] +**rows** | Option<[**Vec>**](Vec.md)> | Array of rows, where each row is an array of column values. | [optional] +**status** | **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/GetSecretResponse.md b/docs/GetSecretResponse.md new file mode 100644 index 0000000..9802647 --- /dev/null +++ b/docs/GetSecretResponse.md @@ -0,0 +1,13 @@ +# GetSecretResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**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/InformationSchemaApi.md b/docs/InformationSchemaApi.md new file mode 100644 index 0000000..e51de7f --- /dev/null +++ b/docs/InformationSchemaApi.md @@ -0,0 +1,44 @@ +# \InformationSchemaApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**information_schema**](InformationSchemaApi.md#information_schema) | **GET** /v1/information_schema | List tables + + + +## information_schema + +> models::InformationSchemaResponse information_schema(connection_id, schema, table, include_columns, limit, cursor) +List tables + +List discovered tables with optional filtering and pagination. Supports wildcard patterns (SQL %) for schema and table name filters. Set include_columns=true to include column definitions (omitted by default). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**connection_id** | Option<**String**> | Filter by connection ID | | +**schema** | Option<**String**> | Filter by schema name (supports % wildcards) | | +**table** | Option<**String**> | Filter by table name (supports % wildcards) | | +**include_columns** | Option<**bool**> | Include column definitions (default: false) | | +**limit** | Option<**i32**> | Maximum number of tables per page | | +**cursor** | Option<**String**> | Pagination cursor from a previous response | | + +### Return type + +[**models::InformationSchemaResponse**](InformationSchemaResponse.md) + +### Authorization + +[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/InformationSchemaResponse.md b/docs/InformationSchemaResponse.md new file mode 100644 index 0000000..b1ec159 --- /dev/null +++ b/docs/InformationSchemaResponse.md @@ -0,0 +1,15 @@ +# InformationSchemaResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | | +**has_more** | **bool** | | +**limit** | **i32** | | +**next_cursor** | Option<**String**> | | [optional] +**tables** | [**Vec**](TableInfo.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/InlineData.md b/docs/InlineData.md new file mode 100644 index 0000000..90053fa --- /dev/null +++ b/docs/InlineData.md @@ -0,0 +1,13 @@ +# 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 new file mode 100644 index 0000000..9021f90 --- /dev/null +++ b/docs/InlineDatasetSource.md @@ -0,0 +1,11 @@ +# 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/ListConnectionsResponse.md b/docs/ListConnectionsResponse.md new file mode 100644 index 0000000..ab0d739 --- /dev/null +++ b/docs/ListConnectionsResponse.md @@ -0,0 +1,11 @@ +# ListConnectionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connections** | [**Vec**](ConnectionInfo.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 new file mode 100644 index 0000000..de9e3b8 --- /dev/null +++ b/docs/ListDatasetsResponse.md @@ -0,0 +1,15 @@ +# 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/ListQueryRunsResponse.md b/docs/ListQueryRunsResponse.md new file mode 100644 index 0000000..821ef5f --- /dev/null +++ b/docs/ListQueryRunsResponse.md @@ -0,0 +1,15 @@ +# ListQueryRunsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | | +**has_more** | **bool** | | +**limit** | **i32** | | +**next_cursor** | Option<**String**> | | [optional] +**query_runs** | [**Vec**](QueryRunInfo.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/ListResultsResponse.md b/docs/ListResultsResponse.md new file mode 100644 index 0000000..c480909 --- /dev/null +++ b/docs/ListResultsResponse.md @@ -0,0 +1,15 @@ +# ListResultsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | Number of results returned in this response | +**has_more** | **bool** | Whether there are more results available after this page | +**limit** | **i32** | Limit used for this request | +**offset** | **i32** | Pagination offset used for this request | +**results** | [**Vec**](ResultInfo.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/ListSavedQueriesResponse.md b/docs/ListSavedQueriesResponse.md new file mode 100644 index 0000000..4895017 --- /dev/null +++ b/docs/ListSavedQueriesResponse.md @@ -0,0 +1,15 @@ +# ListSavedQueriesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | | +**has_more** | **bool** | | +**limit** | **i32** | | +**offset** | **i32** | | +**queries** | [**Vec**](SavedQuerySummary.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/ListSavedQueryVersionsResponse.md b/docs/ListSavedQueryVersionsResponse.md new file mode 100644 index 0000000..fe1f028 --- /dev/null +++ b/docs/ListSavedQueryVersionsResponse.md @@ -0,0 +1,16 @@ +# ListSavedQueryVersionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | | +**has_more** | **bool** | | +**limit** | **i32** | | +**offset** | **i32** | | +**saved_query_id** | **String** | | +**versions** | [**Vec**](SavedQueryVersionInfo.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/ListSecretsResponse.md b/docs/ListSecretsResponse.md new file mode 100644 index 0000000..a35be48 --- /dev/null +++ b/docs/ListSecretsResponse.md @@ -0,0 +1,11 @@ +# ListSecretsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secrets** | [**Vec**](SecretMetadataResponse.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/ListUploadsResponse.md b/docs/ListUploadsResponse.md new file mode 100644 index 0000000..abcfa72 --- /dev/null +++ b/docs/ListUploadsResponse.md @@ -0,0 +1,11 @@ +# ListUploadsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uploads** | [**Vec**](UploadInfo.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/ListWorkspacesResponse.md b/docs/ListWorkspacesResponse.md new file mode 100644 index 0000000..c292d3d --- /dev/null +++ b/docs/ListWorkspacesResponse.md @@ -0,0 +1,12 @@ +# ListWorkspacesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ok** | **bool** | | +**workspaces** | [**Vec**](WorkspaceListItem.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/NumericProfileDetail.md b/docs/NumericProfileDetail.md new file mode 100644 index 0000000..f4a217d --- /dev/null +++ b/docs/NumericProfileDetail.md @@ -0,0 +1,13 @@ +# NumericProfileDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **String** | Maximum value (string to preserve precision for large integers and decimals) | +**mean** | **f64** | Arithmetic mean | +**min** | **String** | Minimum value (string to preserve precision for large integers and decimals) | + +[[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/QueryApi.md b/docs/QueryApi.md new file mode 100644 index 0000000..72f0982 --- /dev/null +++ b/docs/QueryApi.md @@ -0,0 +1,39 @@ +# \QueryApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**query**](QueryApi.md#query) | **POST** /v1/query | Execute SQL query + + + +## query + +> models::QueryResponse query(query_request) +Execute SQL query + +Execute a SQL query against all registered connections and datasets. Use standard Postgres-compatible SQL to reference tables from any connection using the format `connection_name.schema.table`. Results are returned inline and a `result_id` is provided for later retrieval via the Results API. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**query_request** | [**QueryRequest**](QueryRequest.md) | | [required] | + +### Return type + +[**models::QueryResponse**](QueryResponse.md) + +### Authorization + +[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/QueryRequest.md b/docs/QueryRequest.md new file mode 100644 index 0000000..0b5237b --- /dev/null +++ b/docs/QueryRequest.md @@ -0,0 +1,11 @@ +# QueryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/QueryResponse.md b/docs/QueryResponse.md new file mode 100644 index 0000000..3034eee --- /dev/null +++ b/docs/QueryResponse.md @@ -0,0 +1,18 @@ +# QueryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**columns** | **Vec** | | +**execution_time_ms** | **i64** | | +**nullable** | **Vec** | Nullable flags for each column (parallel to columns vec). True if the column allows NULL values, false if NOT NULL. | +**query_run_id** | **String** | Unique identifier for the query run record (qrun...). | +**result_id** | Option<**String**> | Unique identifier for retrieving this result via GET /results/{id}. Null if catalog registration failed (see `warning` field for details). When non-null, the result is being persisted asynchronously. | [optional] +**row_count** | **i32** | | +**rows** | [**Vec>**](Vec.md) | Array of rows, where each row is an array of column values. Values can be strings, numbers, booleans, or null. | +**warning** | Option<**String**> | Warning message if result persistence could not be initiated. When present, `result_id` will be null and the result cannot be retrieved later. The query results are still returned in this response. | [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/QueryRunInfo.md b/docs/QueryRunInfo.md new file mode 100644 index 0000000..7aac375 --- /dev/null +++ b/docs/QueryRunInfo.md @@ -0,0 +1,25 @@ +# QueryRunInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**completed_at** | Option<**String**> | | [optional] +**created_at** | **String** | | +**error_message** | Option<**String**> | | [optional] +**execution_time_ms** | Option<**i64**> | | [optional] +**id** | **String** | | +**result_id** | Option<**String**> | | [optional] +**row_count** | Option<**i64**> | | [optional] +**saved_query_id** | Option<**String**> | | [optional] +**saved_query_version** | Option<**i32**> | | [optional] +**snapshot_id** | **String** | | +**sql_hash** | **String** | | +**sql_text** | **String** | | +**status** | **String** | | +**trace_id** | Option<**String**> | | [optional] +**warning_message** | 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/QueryRunsApi.md b/docs/QueryRunsApi.md new file mode 100644 index 0000000..7286242 --- /dev/null +++ b/docs/QueryRunsApi.md @@ -0,0 +1,38 @@ +# \QueryRunsApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_query_runs**](QueryRunsApi.md#list_query_runs) | **GET** /v1/query-runs | List query runs + + + +## list_query_runs + +> models::ListQueryRunsResponse list_query_runs(limit, cursor) +List query runs + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Maximum number of results | | +**cursor** | Option<**String**> | Pagination cursor | | + +### Return type + +[**models::ListQueryRunsResponse**](ListQueryRunsResponse.md) + +### Authorization + +[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/RefreshApi.md b/docs/RefreshApi.md new file mode 100644 index 0000000..eae9665 --- /dev/null +++ b/docs/RefreshApi.md @@ -0,0 +1,39 @@ +# \RefreshApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**refresh**](RefreshApi.md#refresh) | **POST** /v1/refresh | Refresh connection data + + + +## refresh + +> models::RefreshResponse refresh(refresh_request) +Refresh connection data + +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. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**refresh_request** | [**RefreshRequest**](RefreshRequest.md) | | [required] | + +### Return type + +[**models::RefreshResponse**](RefreshResponse.md) + +### Authorization + +[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/RefreshRequest.md b/docs/RefreshRequest.md new file mode 100644 index 0000000..d594831 --- /dev/null +++ b/docs/RefreshRequest.md @@ -0,0 +1,15 @@ +# RefreshRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connection_id** | Option<**String**> | | [optional] +**data** | Option<**bool**> | | [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] + +[[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/RefreshResponse.md b/docs/RefreshResponse.md new file mode 100644 index 0000000..6ad2ad1 --- /dev/null +++ b/docs/RefreshResponse.md @@ -0,0 +1,13 @@ +# RefreshResponse + +## Enum Variants + +| Name | Description | +|---- | -----| +| ConnectionRefreshResult | Unified response type for refresh operations | +| SchemaRefreshResult | Unified response type for refresh operations | +| TableRefreshResult | Unified response type for refresh operations | + +[[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/RefreshWarning.md b/docs/RefreshWarning.md new file mode 100644 index 0000000..715093d --- /dev/null +++ b/docs/RefreshWarning.md @@ -0,0 +1,13 @@ +# RefreshWarning + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | +**schema_name** | Option<**String**> | | [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/ResultInfo.md b/docs/ResultInfo.md new file mode 100644 index 0000000..aaeb965 --- /dev/null +++ b/docs/ResultInfo.md @@ -0,0 +1,14 @@ +# ResultInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**error_message** | Option<**String**> | | [optional] +**id** | **String** | | +**status** | **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/ResultsApi.md b/docs/ResultsApi.md new file mode 100644 index 0000000..ce63cda --- /dev/null +++ b/docs/ResultsApi.md @@ -0,0 +1,69 @@ +# \ResultsApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_result**](ResultsApi.md#get_result) | **GET** /v1/results/{id} | Get result +[**list_results**](ResultsApi.md#list_results) | **GET** /v1/results | List results + + + +## get_result + +> models::GetResultResponse get_result(id) +Get result + +Retrieve a persisted query result by ID. If the result is still being processed, only the status is returned. Once ready, the full column and row data is included in the response. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Result ID | [required] | + +### Return type + +[**models::GetResultResponse**](GetResultResponse.md) + +### Authorization + +[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_results + +> models::ListResultsResponse list_results(limit, offset) +List results + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Maximum number of results (default: 100, max: 1000) | | +**offset** | Option<**i32**> | Pagination offset (default: 0) | | + +### Return type + +[**models::ListResultsResponse**](ListResultsResponse.md) + +### Authorization + +[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/SavedQueriesApi.md b/docs/SavedQueriesApi.md new file mode 100644 index 0000000..712a0f1 --- /dev/null +++ b/docs/SavedQueriesApi.md @@ -0,0 +1,222 @@ +# \SavedQueriesApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_saved_query**](SavedQueriesApi.md#create_saved_query) | **POST** /v1/queries | Create saved query +[**delete_saved_query**](SavedQueriesApi.md#delete_saved_query) | **DELETE** /v1/queries/{id} | Delete saved query +[**execute_saved_query**](SavedQueriesApi.md#execute_saved_query) | **POST** /v1/queries/{id}/execute | Execute saved query +[**get_saved_query**](SavedQueriesApi.md#get_saved_query) | **GET** /v1/queries/{id} | Get saved query +[**list_saved_queries**](SavedQueriesApi.md#list_saved_queries) | **GET** /v1/queries | List saved queries +[**list_saved_query_versions**](SavedQueriesApi.md#list_saved_query_versions) | **GET** /v1/queries/{id}/versions | List saved query versions +[**update_saved_query**](SavedQueriesApi.md#update_saved_query) | **PUT** /v1/queries/{id} | Update saved query + + + +## create_saved_query + +> models::SavedQueryDetail create_saved_query(create_saved_query_request) +Create saved query + +Save a named SQL query. The SQL is stored as version 1 and automatically analyzed for classification metadata (category, table count, predicate/join/aggregation flags). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_saved_query_request** | [**CreateSavedQueryRequest**](CreateSavedQueryRequest.md) | | [required] | + +### Return type + +[**models::SavedQueryDetail**](SavedQueryDetail.md) + +### Authorization + +[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_saved_query + +> delete_saved_query(id) +Delete saved query + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Saved query ID | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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) + + +## execute_saved_query + +> models::QueryResponse execute_saved_query(id, execute_saved_query_request) +Execute saved query + +Execute a saved query. By default runs the latest version. Optionally specify a version number to execute a previous version. Returns the same response format as POST /v1/query. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Saved query ID | [required] | +**execute_saved_query_request** | Option<[**ExecuteSavedQueryRequest**](ExecuteSavedQueryRequest.md)> | Optional version to execute | | + +### Return type + +[**models::QueryResponse**](QueryResponse.md) + +### Authorization + +[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) + + +## get_saved_query + +> models::SavedQueryDetail get_saved_query(id) +Get saved query + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Saved query ID | [required] | + +### Return type + +[**models::SavedQueryDetail**](SavedQueryDetail.md) + +### Authorization + +[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_saved_queries + +> models::ListSavedQueriesResponse list_saved_queries(limit, offset) +List saved queries + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Maximum number of results | | +**offset** | Option<**i32**> | Pagination offset | | + +### Return type + +[**models::ListSavedQueriesResponse**](ListSavedQueriesResponse.md) + +### Authorization + +[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_saved_query_versions + +> models::ListSavedQueryVersionsResponse list_saved_query_versions(id, limit, offset) +List saved query versions + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Saved query ID | [required] | +**limit** | Option<**i32**> | Maximum number of versions | | +**offset** | Option<**i32**> | Pagination offset | | + +### Return type + +[**models::ListSavedQueryVersionsResponse**](ListSavedQueryVersionsResponse.md) + +### Authorization + +[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_saved_query + +> models::SavedQueryDetail update_saved_query(id, update_saved_query_request) +Update saved query + +Update a saved query. If the SQL changes, a new version is created (previous versions are preserved). Name, tags, description, and classification overrides can also be updated. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | Saved query ID | [required] | +**update_saved_query_request** | [**UpdateSavedQueryRequest**](UpdateSavedQueryRequest.md) | | [required] | + +### Return type + +[**models::SavedQueryDetail**](SavedQueryDetail.md) + +### Authorization + +[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/SavedQueryDetail.md b/docs/SavedQueryDetail.md new file mode 100644 index 0000000..e998cfc --- /dev/null +++ b/docs/SavedQueryDetail.md @@ -0,0 +1,28 @@ +# SavedQueryDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | Option<**String**> | | [optional] +**created_at** | **String** | | +**description** | **String** | | +**has_aggregation** | Option<**bool**> | | [optional] +**has_group_by** | Option<**bool**> | | [optional] +**has_join** | Option<**bool**> | | [optional] +**has_limit** | Option<**bool**> | | [optional] +**has_order_by** | Option<**bool**> | | [optional] +**has_predicate** | Option<**bool**> | | [optional] +**id** | **String** | | +**latest_version** | **i32** | | +**name** | **String** | | +**num_tables** | Option<**i32**> | | [optional] +**sql** | **String** | | +**sql_hash** | **String** | | +**table_size** | Option<**String**> | | [optional] +**tags** | **Vec** | | +**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/SavedQuerySummary.md b/docs/SavedQuerySummary.md new file mode 100644 index 0000000..8b3ebe7 --- /dev/null +++ b/docs/SavedQuerySummary.md @@ -0,0 +1,17 @@ +# SavedQuerySummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**description** | **String** | | +**id** | **String** | | +**latest_version** | **i32** | | +**name** | **String** | | +**tags** | **Vec** | | +**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/SavedQueryVersionInfo.md b/docs/SavedQueryVersionInfo.md new file mode 100644 index 0000000..7525b0e --- /dev/null +++ b/docs/SavedQueryVersionInfo.md @@ -0,0 +1,23 @@ +# SavedQueryVersionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | Option<**String**> | | [optional] +**created_at** | **String** | | +**has_aggregation** | Option<**bool**> | | [optional] +**has_group_by** | Option<**bool**> | | [optional] +**has_join** | Option<**bool**> | | [optional] +**has_limit** | Option<**bool**> | | [optional] +**has_order_by** | Option<**bool**> | | [optional] +**has_predicate** | Option<**bool**> | | [optional] +**num_tables** | Option<**i32**> | | [optional] +**sql** | **String** | | +**sql_hash** | **String** | | +**table_size** | Option<**String**> | | [optional] +**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/SchemaRefreshResult.md b/docs/SchemaRefreshResult.md new file mode 100644 index 0000000..f4a4a2d --- /dev/null +++ b/docs/SchemaRefreshResult.md @@ -0,0 +1,16 @@ +# SchemaRefreshResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connections_failed** | **i32** | | +**connections_refreshed** | **i32** | | +**errors** | Option<[**Vec**](ConnectionSchemaError.md)> | | [optional] +**tables_added** | **i32** | | +**tables_discovered** | **i32** | | +**tables_modified** | **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/SecretMetadataResponse.md b/docs/SecretMetadataResponse.md new file mode 100644 index 0000000..73237f2 --- /dev/null +++ b/docs/SecretMetadataResponse.md @@ -0,0 +1,13 @@ +# SecretMetadataResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **String** | | +**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/SecretsApi.md b/docs/SecretsApi.md new file mode 100644 index 0000000..03c1a7f --- /dev/null +++ b/docs/SecretsApi.md @@ -0,0 +1,157 @@ +# \SecretsApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_secret**](SecretsApi.md#create_secret) | **POST** /v1/secrets | Create secret +[**delete_secret**](SecretsApi.md#delete_secret) | **DELETE** /v1/secrets/{name} | Delete secret +[**get_secret**](SecretsApi.md#get_secret) | **GET** /v1/secrets/{name} | Get secret +[**list_secrets**](SecretsApi.md#list_secrets) | **GET** /v1/secrets | List secrets +[**update_secret**](SecretsApi.md#update_secret) | **PUT** /v1/secrets/{name} | Update secret + + + +## create_secret + +> models::CreateSecretResponse create_secret(create_secret_request) +Create secret + +Store a new named secret. The value is encrypted at rest and can be referenced by connections for authentication. Secret names must be unique. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_secret_request** | [**CreateSecretRequest**](CreateSecretRequest.md) | | [required] | + +### Return type + +[**models::CreateSecretResponse**](CreateSecretResponse.md) + +### Authorization + +[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_secret + +> delete_secret(name) +Delete secret + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | Secret name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[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_secret + +> models::GetSecretResponse get_secret(name) +Get secret + +Get metadata for a secret. The secret value is never returned. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | Secret name | [required] | + +### Return type + +[**models::GetSecretResponse**](GetSecretResponse.md) + +### Authorization + +[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_secrets + +> models::ListSecretsResponse list_secrets() +List secrets + +List all stored secrets. Only metadata (name, timestamps) is returned — secret values are never exposed. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::ListSecretsResponse**](ListSecretsResponse.md) + +### Authorization + +[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_secret + +> models::UpdateSecretResponse update_secret(name, update_secret_request) +Update secret + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | Secret name | [required] | +**update_secret_request** | [**UpdateSecretRequest**](UpdateSecretRequest.md) | | [required] | + +### Return type + +[**models::UpdateSecretResponse**](UpdateSecretResponse.md) + +### Authorization + +[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/TableInfo.md b/docs/TableInfo.md new file mode 100644 index 0000000..38bf966 --- /dev/null +++ b/docs/TableInfo.md @@ -0,0 +1,16 @@ +# TableInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**columns** | Option<[**Vec**](ColumnInfo.md)> | | [optional] +**connection** | **String** | | +**last_sync** | Option<**String**> | | [optional] +**schema** | **String** | | +**synced** | **bool** | | +**table** | **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/TableProfileResponse.md b/docs/TableProfileResponse.md new file mode 100644 index 0000000..d3cad91 --- /dev/null +++ b/docs/TableProfileResponse.md @@ -0,0 +1,16 @@ +# TableProfileResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**columns** | [**Vec**](ColumnProfileInfo.md) | Per-column profile statistics | +**connection** | **String** | Connection name | +**row_count** | **i32** | Total number of rows in the table | +**schema** | **String** | Schema name | +**synced_at** | Option<**String**> | When the table was last synced | [optional] +**table** | **String** | Table name | + +[[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/TableRefreshError.md b/docs/TableRefreshError.md new file mode 100644 index 0000000..3e28a54 --- /dev/null +++ b/docs/TableRefreshError.md @@ -0,0 +1,13 @@ +# TableRefreshError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **String** | | +**schema_name** | **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/TableRefreshResult.md b/docs/TableRefreshResult.md new file mode 100644 index 0000000..1894999 --- /dev/null +++ b/docs/TableRefreshResult.md @@ -0,0 +1,16 @@ +# TableRefreshResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connection_id** | **String** | | +**duration_ms** | **i64** | | +**rows_synced** | **i32** | | +**schema_name** | **String** | | +**table_name** | **String** | | +**warnings** | Option<[**Vec**](RefreshWarning.md)> | | [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/TemporalProfileDetail.md b/docs/TemporalProfileDetail.md new file mode 100644 index 0000000..e54c0b4 --- /dev/null +++ b/docs/TemporalProfileDetail.md @@ -0,0 +1,12 @@ +# TemporalProfileDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max** | **String** | Latest value as ISO-8601 string | +**min** | **String** | Earliest value as ISO-8601 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/TextProfileDetail.md b/docs/TextProfileDetail.md new file mode 100644 index 0000000..011778e --- /dev/null +++ b/docs/TextProfileDetail.md @@ -0,0 +1,13 @@ +# TextProfileDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avg_length** | **f64** | Average string length | +**max_length** | **i64** | Longest string length in the column | +**min_length** | **i64** | Shortest string length in the column | + +[[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 new file mode 100644 index 0000000..ce31193 --- /dev/null +++ b/docs/UpdateDatasetRequest.md @@ -0,0 +1,12 @@ +# UpdateDatasetRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | Option<**String**> | | [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 new file mode 100644 index 0000000..9e81eba --- /dev/null +++ b/docs/UpdateDatasetResponse.md @@ -0,0 +1,14 @@ +# UpdateDatasetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**label** | **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/UpdateSavedQueryRequest.md b/docs/UpdateSavedQueryRequest.md new file mode 100644 index 0000000..35e4b9f --- /dev/null +++ b/docs/UpdateSavedQueryRequest.md @@ -0,0 +1,16 @@ +# UpdateSavedQueryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_override** | Option<**String**> | Override the auto-detected category. Send `null` to clear (revert to auto). | [optional] +**description** | Option<**String**> | | [optional] +**name** | Option<**String**> | Optional new name. When omitted the existing name is preserved. | [optional] +**sql** | Option<**String**> | Optional new SQL. When omitted the existing SQL is preserved. | [optional] +**table_size_override** | Option<**String**> | User annotation for table size. Send `null` to clear. | [optional] +**tags** | Option<**Vec**> | | [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/UpdateSecretRequest.md b/docs/UpdateSecretRequest.md new file mode 100644 index 0000000..ebdfced --- /dev/null +++ b/docs/UpdateSecretRequest.md @@ -0,0 +1,11 @@ +# UpdateSecretRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **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/UpdateSecretResponse.md b/docs/UpdateSecretResponse.md new file mode 100644 index 0000000..b2ab1dd --- /dev/null +++ b/docs/UpdateSecretResponse.md @@ -0,0 +1,12 @@ +# UpdateSecretResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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 new file mode 100644 index 0000000..e589ec9 --- /dev/null +++ b/docs/UploadDatasetSource.md @@ -0,0 +1,13 @@ +# 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/UploadInfo.md b/docs/UploadInfo.md new file mode 100644 index 0000000..e380769 --- /dev/null +++ b/docs/UploadInfo.md @@ -0,0 +1,15 @@ +# UploadInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_type** | Option<**String**> | | [optional] +**created_at** | **String** | | +**id** | **String** | | +**size_bytes** | **i64** | | +**status** | **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/UploadResponse.md b/docs/UploadResponse.md new file mode 100644 index 0000000..3de57f8 --- /dev/null +++ b/docs/UploadResponse.md @@ -0,0 +1,15 @@ +# UploadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_type** | Option<**String**> | | [optional] +**created_at** | **String** | | +**id** | **String** | | +**size_bytes** | **i64** | | +**status** | **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 new file mode 100644 index 0000000..5a8b973 --- /dev/null +++ b/docs/UploadsApi.md @@ -0,0 +1,68 @@ +# \UploadsApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_uploads**](UploadsApi.md#list_uploads) | **GET** /v1/files | List uploads +[**upload_file**](UploadsApi.md#upload_file) | **POST** /v1/files | Upload file + + + +## list_uploads + +> models::ListUploadsResponse list_uploads(status) +List uploads + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**status** | Option<**String**> | Filter by upload status | | + +### Return type + +[**models::ListUploadsResponse**](ListUploadsResponse.md) + +### Authorization + +[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) + + +## upload_file + +> models::UploadResponse upload_file(request_body) +Upload file + +Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The returned upload ID can be passed to POST /v1/datasets to create a queryable table. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**request_body** | [**Vec**](I32.md) | | [required] | + +### Return type + +[**models::UploadResponse**](UploadResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **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/WorkspaceDetail.md b/docs/WorkspaceDetail.md new file mode 100644 index 0000000..0cfcc17 --- /dev/null +++ b/docs/WorkspaceDetail.md @@ -0,0 +1,14 @@ +# WorkspaceDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**public_id** | **String** | | +**name** | **String** | | +**provision_status** | **String** | | +**namespace** | **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/WorkspaceListItem.md b/docs/WorkspaceListItem.md new file mode 100644 index 0000000..ef31c32 --- /dev/null +++ b/docs/WorkspaceListItem.md @@ -0,0 +1,16 @@ +# WorkspaceListItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**public_id** | **String** | | +**name** | **String** | | +**active** | **bool** | | +**favorite** | **bool** | | +**provision_status** | **String** | | +**namespace** | **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/WorkspacesApi.md b/docs/WorkspacesApi.md new file mode 100644 index 0000000..bdb6494 --- /dev/null +++ b/docs/WorkspacesApi.md @@ -0,0 +1,70 @@ +# \WorkspacesApi + +All URIs are relative to *https://app.hotdata.dev* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_workspace**](WorkspacesApi.md#create_workspace) | **POST** /v1/workspaces | Create a workspace +[**list_workspaces**](WorkspacesApi.md#list_workspaces) | **GET** /v1/workspaces | List workspaces + + + +## create_workspace + +> models::CreateWorkspaceResponse create_workspace(create_workspace_request) +Create a workspace + +Creates a new workspace in the specified organization. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**create_workspace_request** | [**CreateWorkspaceRequest**](CreateWorkspaceRequest.md) | | [required] | + +### Return type + +[**models::CreateWorkspaceResponse**](CreateWorkspaceResponse.md) + +### Authorization + +[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) + + +## list_workspaces + +> models::ListWorkspacesResponse list_workspaces(organization_public_id) +List workspaces + +Lists all workspaces in the user's organization. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**organization_public_id** | Option<**String**> | Filter by organization. Defaults to the user's current organization. | | + +### Return type + +[**models::ListWorkspacesResponse**](ListWorkspacesResponse.md) + +### Authorization + +[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/openapitools.json b/openapitools.json new file mode 100644 index 0000000..c121433 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.20.0" + } +} diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs new file mode 100644 index 0000000..95bf139 --- /dev/null +++ b/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * 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 + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "https://app.hotdata.dev".to_owned(), + user_agent: Some("hotdata-rust/0.1.0".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/src/apis/connections_api.rs b/src/apis/connections_api.rs new file mode 100644 index 0000000..4e6aa99 --- /dev/null +++ b/src/apis/connections_api.rs @@ -0,0 +1,372 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`check_connection_health`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CheckConnectionHealthError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_connection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateConnectionError { + Status400(models::ApiErrorResponse), + Status409(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_connection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteConnectionError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_connection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetConnectionError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_table_profile`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTableProfileError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_connections`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListConnectionsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`purge_connection_cache`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PurgeConnectionCacheError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`purge_table_cache`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PurgeTableCacheError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Test connectivity to the remote database. Returns health status and latency. +pub async fn check_connection_health(configuration: &configuration::Configuration, connection_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_id = connection_id; + + let uri_str = format!("{}/v1/connections/{connection_id}/health", configuration.base_path, connection_id=crate::apis::urlencode(p_path_connection_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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ConnectionHealthResponse`"))), + 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::ConnectionHealthResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Register a new database connection. Provide the source type and connection config (host, port, database, etc.). Credentials can be supplied inline (password/token fields are auto-converted to secrets) or by referencing an existing secret by name or ID. Schema discovery runs automatically after registration. +pub async fn create_connection(configuration: &configuration::Configuration, create_connection_request: models::CreateConnectionRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_create_connection_request = create_connection_request; + + let uri_str = format!("{}/v1/connections", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_create_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::CreateConnectionResponse`"))), + 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::CreateConnectionResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Delete a connection and its cached data. +pub async fn delete_connection(configuration: &configuration::Configuration, connection_id: &str) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_id = connection_id; + + let uri_str = format!("{}/v1/connections/{connection_id}", configuration.base_path, connection_id=crate::apis::urlencode(p_path_connection_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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Get details for a specific connection, including table and sync counts. +pub async fn get_connection(configuration: &configuration::Configuration, connection_id: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_id = connection_id; + + let uri_str = format!("{}/v1/connections/{connection_id}", configuration.base_path, connection_id=crate::apis::urlencode(p_path_connection_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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::GetConnectionResponse`"))), + 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::GetConnectionResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Get column-level statistics for a synced table. Returns per-column profiles including cardinality, null counts, and type-specific details (distinct values for categorical columns, min/max for temporal/numeric, length stats for text). Profiles are computed at sync time. +pub async fn get_table_profile(configuration: &configuration::Configuration, connection_id: &str, schema: &str, table: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_id = connection_id; + let p_path_schema = schema; + let p_path_table = table; + + let uri_str = format!("{}/v1/connections/{connection_id}/tables/{schema}/{table}/profile", configuration.base_path, connection_id=crate::apis::urlencode(p_path_connection_id), schema=crate::apis::urlencode(p_path_schema), table=crate::apis::urlencode(p_path_table)); + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::TableProfileResponse`"))), + 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::TableProfileResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// List all registered database connections. +pub async fn list_connections(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/v1/connections", configuration.base_path); + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListConnectionsResponse`"))), + 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::ListConnectionsResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Purge all cached data for a connection. The next query against these tables will trigger a fresh sync from the remote source. +pub async fn purge_connection_cache(configuration: &configuration::Configuration, connection_id: &str) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_id = connection_id; + + let uri_str = format!("{}/v1/connections/{connection_id}/cache", configuration.base_path, connection_id=crate::apis::urlencode(p_path_connection_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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Purge the cached data for a single table. The next query will trigger a fresh sync. +pub async fn purge_table_cache(configuration: &configuration::Configuration, connection_id: &str, schema: &str, table: &str) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_id = connection_id; + let p_path_schema = schema; + let p_path_table = table; + + let uri_str = format!("{}/v1/connections/{connection_id}/tables/{schema}/{table}/cache", configuration.base_path, connection_id=crate::apis::urlencode(p_path_connection_id), schema=crate::apis::urlencode(p_path_schema), table=crate::apis::urlencode(p_path_table)); + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/datasets_api.rs b/src/apis/datasets_api.rs new file mode 100644 index 0000000..fac8ac8 --- /dev/null +++ b/src/apis/datasets_api.rs @@ -0,0 +1,254 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`create_dataset`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateDatasetError { + Status400(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_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 or inline data. 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. +pub async fn create_dataset(configuration: &configuration::Configuration, create_dataset_request: models::CreateDatasetRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_create_dataset_request = create_dataset_request; + + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_create_dataset_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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?; + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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?; + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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?; + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_update_dataset_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/information_schema_api.rs b/src/apis/information_schema_api.rs new file mode 100644 index 0000000..75fcfeb --- /dev/null +++ b/src/apis/information_schema_api.rs @@ -0,0 +1,89 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`information_schema`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InformationSchemaError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// List discovered tables with optional filtering and pagination. Supports wildcard patterns (SQL %) for schema and table name filters. Set include_columns=true to include column definitions (omitted by default). +pub async fn information_schema(configuration: &configuration::Configuration, connection_id: Option<&str>, schema: Option<&str>, table: Option<&str>, include_columns: Option, limit: Option, cursor: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_connection_id = connection_id; + let p_query_schema = schema; + let p_query_table = table; + let p_query_include_columns = include_columns; + let p_query_limit = limit; + let p_query_cursor = cursor; + + let uri_str = format!("{}/v1/information_schema", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_connection_id { + req_builder = req_builder.query(&[("connection_id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_schema { + req_builder = req_builder.query(&[("schema", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_table { + req_builder = req_builder.query(&[("table", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_columns { + req_builder = req_builder.query(&[("include_columns", ¶m_value.to_string())]); + } + 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_cursor { + req_builder = req_builder.query(&[("cursor", ¶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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::InformationSchemaResponse`"))), + 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::InformationSchemaResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/mod.rs b/src/apis/mod.rs new file mode 100644 index 0000000..74fe0be --- /dev/null +++ b/src/apis/mod.rs @@ -0,0 +1,126 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +/// Internal use only +/// A content type supported by this client. +#[allow(dead_code)] +enum ContentType { + Json, + Text, + Unsupported(String) +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.starts_with("application") && content_type.contains("json") { + return Self::Json; + } else if content_type.starts_with("text/plain") { + return Self::Text; + } else { + return Self::Unsupported(content_type.to_string()); + } + } +} + +pub mod connections_api; +pub mod datasets_api; +pub mod information_schema_api; +pub mod query_api; +pub mod query_runs_api; +pub mod refresh_api; +pub mod results_api; +pub mod saved_queries_api; +pub mod secrets_api; +pub mod uploads_api; +pub mod workspaces_api; + +pub mod configuration; diff --git a/src/apis/query_api.rs b/src/apis/query_api.rs new file mode 100644 index 0000000..3099b7c --- /dev/null +++ b/src/apis/query_api.rs @@ -0,0 +1,68 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`query`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum QueryError { + Status400(models::ApiErrorResponse), + Status500(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Execute a SQL query against all registered connections and datasets. Use standard Postgres-compatible SQL to reference tables from any connection using the format `connection_name.schema.table`. Results are returned inline and a `result_id` is provided for later retrieval via the Results API. +pub async fn query(configuration: &configuration::Configuration, query_request: models::QueryRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_query_request = query_request; + + let uri_str = format!("{}/v1/query", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_query_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::QueryResponse`"))), + 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::QueryResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/query_runs_api.rs b/src/apis/query_runs_api.rs new file mode 100644 index 0000000..2e6dc9f --- /dev/null +++ b/src/apis/query_runs_api.rs @@ -0,0 +1,71 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`list_query_runs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListQueryRunsError { + UnknownValue(serde_json::Value), +} + + +pub async fn list_query_runs(configuration: &configuration::Configuration, limit: Option, cursor: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_limit = limit; + let p_query_cursor = cursor; + + let uri_str = format!("{}/v1/query-runs", 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_cursor { + req_builder = req_builder.query(&[("cursor", ¶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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListQueryRunsResponse`"))), + 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::ListQueryRunsResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/refresh_api.rs b/src/apis/refresh_api.rs new file mode 100644 index 0000000..686c775 --- /dev/null +++ b/src/apis/refresh_api.rs @@ -0,0 +1,68 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`refresh`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RefreshError { + Status400(models::ApiErrorResponse), + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// 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. +pub async fn refresh(configuration: &configuration::Configuration, refresh_request: models::RefreshRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_refresh_request = refresh_request; + + let uri_str = format!("{}/v1/refresh", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_refresh_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::RefreshResponse`"))), + 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::RefreshResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/results_api.rs b/src/apis/results_api.rs new file mode 100644 index 0000000..c6f965e --- /dev/null +++ b/src/apis/results_api.rs @@ -0,0 +1,119 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`get_result`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetResultError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_results`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListResultsError { + UnknownValue(serde_json::Value), +} + + +/// Retrieve a persisted query result by ID. If the result is still being processed, only the status is returned. Once ready, the full column and row data is included in the response. +pub async fn get_result(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/results/{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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::GetResultResponse`"))), + 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::GetResultResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn list_results(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/results", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListResultsResponse`"))), + 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::ListResultsResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/saved_queries_api.rs b/src/apis/saved_queries_api.rs new file mode 100644 index 0000000..96e1629 --- /dev/null +++ b/src/apis/saved_queries_api.rs @@ -0,0 +1,359 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`create_saved_query`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateSavedQueryError { + Status400(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_saved_query`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteSavedQueryError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`execute_saved_query`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExecuteSavedQueryError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_saved_query`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSavedQueryError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_saved_queries`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListSavedQueriesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_saved_query_versions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListSavedQueryVersionsError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_saved_query`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateSavedQueryError { + Status400(models::ApiErrorResponse), + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Save a named SQL query. The SQL is stored as version 1 and automatically analyzed for classification metadata (category, table count, predicate/join/aggregation flags). +pub async fn create_saved_query(configuration: &configuration::Configuration, create_saved_query_request: models::CreateSavedQueryRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_create_saved_query_request = create_saved_query_request; + + let uri_str = format!("{}/v1/queries", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_create_saved_query_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::SavedQueryDetail`"))), + 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::SavedQueryDetail`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn delete_saved_query(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/queries/{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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Execute a saved query. By default runs the latest version. Optionally specify a version number to execute a previous version. Returns the same response format as POST /v1/query. +pub async fn execute_saved_query(configuration: &configuration::Configuration, id: &str, execute_saved_query_request: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_execute_saved_query_request = execute_saved_query_request; + + let uri_str = format!("{}/v1/queries/{id}/execute", configuration.base_path, id=crate::apis::urlencode(p_path_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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_execute_saved_query_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::QueryResponse`"))), + 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::QueryResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn get_saved_query(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/queries/{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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::SavedQueryDetail`"))), + 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::SavedQueryDetail`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn list_saved_queries(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/queries", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListSavedQueriesResponse`"))), + 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::ListSavedQueriesResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn list_saved_query_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/queries/{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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListSavedQueryVersionsResponse`"))), + 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::ListSavedQueryVersionsResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Update a saved query. If the SQL changes, a new version is created (previous versions are preserved). Name, tags, description, and classification overrides can also be updated. +pub async fn update_saved_query(configuration: &configuration::Configuration, id: &str, update_saved_query_request: models::UpdateSavedQueryRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_update_saved_query_request = update_saved_query_request; + + let uri_str = format!("{}/v1/queries/{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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_update_saved_query_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::SavedQueryDetail`"))), + 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::SavedQueryDetail`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/secrets_api.rs b/src/apis/secrets_api.rs new file mode 100644 index 0000000..be373cc --- /dev/null +++ b/src/apis/secrets_api.rs @@ -0,0 +1,245 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`create_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateSecretError { + Status409(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteSecretError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSecretError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_secrets`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListSecretsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_secret`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateSecretError { + Status404(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Store a new named secret. The value is encrypted at rest and can be referenced by connections for authentication. Secret names must be unique. +pub async fn create_secret(configuration: &configuration::Configuration, create_secret_request: models::CreateSecretRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_create_secret_request = create_secret_request; + + let uri_str = format!("{}/v1/secrets", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_create_secret_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::CreateSecretResponse`"))), + 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::CreateSecretResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn delete_secret(configuration: &configuration::Configuration, name: &str) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_name = name; + + let uri_str = format!("{}/v1/secrets/{name}", configuration.base_path, name=crate::apis::urlencode(p_path_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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Get metadata for a secret. The secret value is never returned. +pub async fn get_secret(configuration: &configuration::Configuration, name: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_name = name; + + let uri_str = format!("{}/v1/secrets/{name}", configuration.base_path, name=crate::apis::urlencode(p_path_name)); + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::GetSecretResponse`"))), + 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::GetSecretResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// List all stored secrets. Only metadata (name, timestamps) is returned — secret values are never exposed. +pub async fn list_secrets(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/v1/secrets", configuration.base_path); + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListSecretsResponse`"))), + 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::ListSecretsResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn update_secret(configuration: &configuration::Configuration, name: &str, update_secret_request: models::UpdateSecretRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_name = name; + let p_body_update_secret_request = update_secret_request; + + let uri_str = format!("{}/v1/secrets/{name}", configuration.base_path, name=crate::apis::urlencode(p_path_name)); + 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_update_secret_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::UpdateSecretResponse`"))), + 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::UpdateSecretResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/uploads_api.rs b/src/apis/uploads_api.rs new file mode 100644 index 0000000..15de5b1 --- /dev/null +++ b/src/apis/uploads_api.rs @@ -0,0 +1,116 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`list_uploads`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUploadsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`upload_file`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UploadFileError { + Status400(models::ApiErrorResponse), + UnknownValue(serde_json::Value), +} + + +pub async fn list_uploads(configuration: &configuration::Configuration, status: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_status = status; + + let uri_str = format!("{}/v1/files", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_status { + req_builder = req_builder.query(&[("status", ¶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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListUploadsResponse`"))), + 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::ListUploadsResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., `text/csv`, `application/json`, `application/parquet`). The returned upload ID can be passed to POST /v1/datasets to create a queryable table. +pub async fn upload_file(configuration: &configuration::Configuration, request_body: Vec) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_request_body = request_body; + + let uri_str = format!("{}/v1/files", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_request_body); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::UploadResponse`"))), + 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::UploadResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/apis/workspaces_api.rs b/src/apis/workspaces_api.rs new file mode 100644 index 0000000..e11636c --- /dev/null +++ b/src/apis/workspaces_api.rs @@ -0,0 +1,124 @@ +/* + * 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 reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`create_workspace`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateWorkspaceError { + Status400(models::Error), + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + Status422(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_workspaces`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListWorkspacesError { + Status401(models::Error), + Status403(models::Error), + Status404(models::Error), + UnknownValue(serde_json::Value), +} + + +/// Creates a new workspace in the specified organization. +pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace_request: models::CreateWorkspaceRequest) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_create_workspace_request = create_workspace_request; + + let uri_str = format!("{}/v1/workspaces", 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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_create_workspace_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::CreateWorkspaceResponse`"))), + 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::CreateWorkspaceResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Lists all workspaces in the user's organization. +pub async fn list_workspaces(configuration: &configuration::Configuration, organization_public_id: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_organization_public_id = organization_public_id; + + let uri_str = format!("{}/v1/workspaces", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_organization_public_id { + req_builder = req_builder.query(&[("organization_public_id", ¶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(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.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?; + 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::ListWorkspacesResponse`"))), + 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::ListWorkspacesResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/src/lib.rs b/src/lib.rs index ee191fc..e152062 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,51 +1,11 @@ -// This client is a minimal scaffold. It will be replaced by auto-generated -// code from the HotData OpenAPI spec via the regenerate workflow. +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] -use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION}; +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error("HTTP error: {0}")] - Http(#[from] reqwest::Error), - #[error("Invalid header value: {0}")] - Header(#[from] reqwest::header::InvalidHeaderValue), -} - -pub struct HotdataClient { - client: reqwest::Client, - base_url: String, -} - -impl HotdataClient { - pub fn new(api_token: &str, workspace_id: &str) -> Result { - let mut headers = HeaderMap::new(); - headers.insert( - AUTHORIZATION, - HeaderValue::from_str(&format!("Bearer {api_token}"))?, - ); - headers.insert("X-Workspace-Id", HeaderValue::from_str(workspace_id)?); - - let client = reqwest::Client::builder() - .default_headers(headers) - .build()?; - - Ok(Self { - client, - base_url: "https://api.hotdata.dev".to_string(), - }) - } - - pub fn with_base_url(mut self, base_url: impl Into) -> Self { - self.base_url = base_url.into(); - self - } - - pub async fn health(&self) -> Result { - let resp = self - .client - .get(format!("{}/health", self.base_url)) - .send() - .await?; - Ok(resp.status()) - } -} +pub mod apis; +pub mod models; diff --git a/src/models/api_error_detail.rs b/src/models/api_error_detail.rs new file mode 100644 index 0000000..bd6a871 --- /dev/null +++ b/src/models/api_error_detail.rs @@ -0,0 +1,32 @@ +/* + * 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}; + +/// ApiErrorDetail : Error detail within an API error response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApiErrorDetail { + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "message")] + pub message: String, +} + +impl ApiErrorDetail { + /// Error detail within an API error response + pub fn new(code: String, message: String) -> ApiErrorDetail { + ApiErrorDetail { + code, + message, + } + } +} + diff --git a/src/models/api_error_response.rs b/src/models/api_error_response.rs new file mode 100644 index 0000000..82b722f --- /dev/null +++ b/src/models/api_error_response.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// ApiErrorResponse : Standard error response body +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApiErrorResponse { + #[serde(rename = "error")] + pub error: Box, +} + +impl ApiErrorResponse { + /// Standard error response body + pub fn new(error: models::ApiErrorDetail) -> ApiErrorResponse { + ApiErrorResponse { + error: Box::new(error), + } + } +} + diff --git a/src/models/boolean_profile_detail.rs b/src/models/boolean_profile_detail.rs new file mode 100644 index 0000000..ca4034f --- /dev/null +++ b/src/models/boolean_profile_detail.rs @@ -0,0 +1,34 @@ +/* + * 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}; + +/// BooleanProfileDetail : Boolean column. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BooleanProfileDetail { + /// Number of false values + #[serde(rename = "false_count")] + pub false_count: i64, + /// Number of true values + #[serde(rename = "true_count")] + pub true_count: i64, +} + +impl BooleanProfileDetail { + /// Boolean column. + pub fn new(false_count: i64, true_count: i64) -> BooleanProfileDetail { + BooleanProfileDetail { + false_count, + true_count, + } + } +} + diff --git a/src/models/categorical_profile_detail.rs b/src/models/categorical_profile_detail.rs new file mode 100644 index 0000000..7036db4 --- /dev/null +++ b/src/models/categorical_profile_detail.rs @@ -0,0 +1,30 @@ +/* + * 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}; + +/// CategoricalProfileDetail : Type-specific column profile detail. The `type` discriminator field determines which variant is present. Profile type is chosen based on the column's Arrow data type and cardinality: - **categorical**: Text or numeric columns with ≤200 distinct values. Lists each value with its frequency. - **text**: Text columns with >200 distinct values. Reports string length statistics. - **numeric**: Numeric columns with >200 distinct values. Reports min, max, and mean. - **temporal**: Date and timestamp columns. Reports min and max as ISO-8601 strings. - **boolean**: Boolean columns. Reports true and false counts. Low-cardinality column (≤200 distinct values). Values sorted by frequency descending. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategoricalProfileDetail { + /// Distinct values with their counts, ordered by count descending + #[serde(rename = "values")] + pub values: Vec, +} + +impl CategoricalProfileDetail { + /// Type-specific column profile detail. The `type` discriminator field determines which variant is present. Profile type is chosen based on the column's Arrow data type and cardinality: - **categorical**: Text or numeric columns with ≤200 distinct values. Lists each value with its frequency. - **text**: Text columns with >200 distinct values. Reports string length statistics. - **numeric**: Numeric columns with >200 distinct values. Reports min, max, and mean. - **temporal**: Date and timestamp columns. Reports min and max as ISO-8601 strings. - **boolean**: Boolean columns. Reports true and false counts. Low-cardinality column (≤200 distinct values). Values sorted by frequency descending. + pub fn new(values: Vec) -> CategoricalProfileDetail { + CategoricalProfileDetail { + values, + } + } +} + diff --git a/src/models/category_value_info.rs b/src/models/category_value_info.rs new file mode 100644 index 0000000..19eb387 --- /dev/null +++ b/src/models/category_value_info.rs @@ -0,0 +1,34 @@ +/* + * 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}; + +/// CategoryValueInfo : A distinct value with its frequency count, used in categorical profiles. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategoryValueInfo { + /// Number of occurrences + #[serde(rename = "count")] + pub count: i64, + /// The distinct value (as a string, or null) + #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub value: Option>, +} + +impl CategoryValueInfo { + /// A distinct value with its frequency count, used in categorical profiles. + pub fn new(count: i64) -> CategoryValueInfo { + CategoryValueInfo { + count, + value: None, + } + } +} + diff --git a/src/models/column_info.rs b/src/models/column_info.rs new file mode 100644 index 0000000..6b066e9 --- /dev/null +++ b/src/models/column_info.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// ColumnInfo : Column metadata for API responses +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ColumnInfo { + #[serde(rename = "data_type")] + pub data_type: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "nullable")] + pub nullable: bool, +} + +impl ColumnInfo { + /// Column metadata for API responses + pub fn new(data_type: String, name: String, nullable: bool) -> ColumnInfo { + ColumnInfo { + data_type, + name, + nullable, + } + } +} + diff --git a/src/models/column_profile_detail.rs b/src/models/column_profile_detail.rs new file mode 100644 index 0000000..d87bed8 --- /dev/null +++ b/src/models/column_profile_detail.rs @@ -0,0 +1,49 @@ +/* + * 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, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ColumnProfileDetail { + ColumnProfileDetailOneOf(Box), + ColumnProfileDetailOneOf1(Box), + ColumnProfileDetailOneOf2(Box), + ColumnProfileDetailOneOf3(Box), + ColumnProfileDetailOneOf4(Box), +} + +impl Default for ColumnProfileDetail { + fn default() -> Self { + Self::ColumnProfileDetailOneOf(Default::default()) + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "categorical")] + Categorical, + #[serde(rename = "text")] + Text, + #[serde(rename = "numeric")] + Numeric, + #[serde(rename = "temporal")] + Temporal, + #[serde(rename = "boolean")] + Boolean, +} + +impl Default for Type { + fn default() -> Type { + Self::Categorical + } +} + diff --git a/src/models/column_profile_detail_one_of.rs b/src/models/column_profile_detail_one_of.rs new file mode 100644 index 0000000..ef57a9f --- /dev/null +++ b/src/models/column_profile_detail_one_of.rs @@ -0,0 +1,43 @@ +/* + * 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 ColumnProfileDetailOneOf { + /// Distinct values with their counts, ordered by count descending + #[serde(rename = "values")] + pub values: Vec, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ColumnProfileDetailOneOf { + pub fn new(values: Vec, r#type: Type) -> ColumnProfileDetailOneOf { + ColumnProfileDetailOneOf { + values, + r#type, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "categorical")] + Categorical, +} + +impl Default for Type { + fn default() -> Type { + Self::Categorical + } +} + diff --git a/src/models/column_profile_detail_one_of_1.rs b/src/models/column_profile_detail_one_of_1.rs new file mode 100644 index 0000000..cbf8f67 --- /dev/null +++ b/src/models/column_profile_detail_one_of_1.rs @@ -0,0 +1,51 @@ +/* + * 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 ColumnProfileDetailOneOf1 { + /// Average string length + #[serde(rename = "avg_length")] + pub avg_length: f64, + /// Longest string length in the column + #[serde(rename = "max_length")] + pub max_length: i64, + /// Shortest string length in the column + #[serde(rename = "min_length")] + pub min_length: i64, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ColumnProfileDetailOneOf1 { + pub fn new(avg_length: f64, max_length: i64, min_length: i64, r#type: Type) -> ColumnProfileDetailOneOf1 { + ColumnProfileDetailOneOf1 { + avg_length, + max_length, + min_length, + r#type, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "text")] + Text, +} + +impl Default for Type { + fn default() -> Type { + Self::Text + } +} + diff --git a/src/models/column_profile_detail_one_of_2.rs b/src/models/column_profile_detail_one_of_2.rs new file mode 100644 index 0000000..6eb3c80 --- /dev/null +++ b/src/models/column_profile_detail_one_of_2.rs @@ -0,0 +1,51 @@ +/* + * 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 ColumnProfileDetailOneOf2 { + /// Maximum value (string to preserve precision for large integers and decimals) + #[serde(rename = "max")] + pub max: String, + /// Arithmetic mean + #[serde(rename = "mean")] + pub mean: f64, + /// Minimum value (string to preserve precision for large integers and decimals) + #[serde(rename = "min")] + pub min: String, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ColumnProfileDetailOneOf2 { + pub fn new(max: String, mean: f64, min: String, r#type: Type) -> ColumnProfileDetailOneOf2 { + ColumnProfileDetailOneOf2 { + max, + mean, + min, + r#type, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "numeric")] + Numeric, +} + +impl Default for Type { + fn default() -> Type { + Self::Numeric + } +} + diff --git a/src/models/column_profile_detail_one_of_3.rs b/src/models/column_profile_detail_one_of_3.rs new file mode 100644 index 0000000..16ed3a6 --- /dev/null +++ b/src/models/column_profile_detail_one_of_3.rs @@ -0,0 +1,47 @@ +/* + * 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 ColumnProfileDetailOneOf3 { + /// Latest value as ISO-8601 string + #[serde(rename = "max")] + pub max: String, + /// Earliest value as ISO-8601 string + #[serde(rename = "min")] + pub min: String, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ColumnProfileDetailOneOf3 { + pub fn new(max: String, min: String, r#type: Type) -> ColumnProfileDetailOneOf3 { + ColumnProfileDetailOneOf3 { + max, + min, + r#type, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "temporal")] + Temporal, +} + +impl Default for Type { + fn default() -> Type { + Self::Temporal + } +} + diff --git a/src/models/column_profile_detail_one_of_4.rs b/src/models/column_profile_detail_one_of_4.rs new file mode 100644 index 0000000..acef72a --- /dev/null +++ b/src/models/column_profile_detail_one_of_4.rs @@ -0,0 +1,47 @@ +/* + * 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 ColumnProfileDetailOneOf4 { + /// Number of false values + #[serde(rename = "false_count")] + pub false_count: i64, + /// Number of true values + #[serde(rename = "true_count")] + pub true_count: i64, + #[serde(rename = "type")] + pub r#type: Type, +} + +impl ColumnProfileDetailOneOf4 { + pub fn new(false_count: i64, true_count: i64, r#type: Type) -> ColumnProfileDetailOneOf4 { + ColumnProfileDetailOneOf4 { + false_count, + true_count, + r#type, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "boolean")] + Boolean, +} + +impl Default for Type { + fn default() -> Type { + Self::Boolean + } +} + diff --git a/src/models/column_profile_info.rs b/src/models/column_profile_info.rs new file mode 100644 index 0000000..d9093a1 --- /dev/null +++ b/src/models/column_profile_info.rs @@ -0,0 +1,50 @@ +/* + * 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}; + +/// ColumnProfileInfo : Statistics for a single column. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ColumnProfileInfo { + /// Approximate number of distinct non-null values + #[serde(rename = "cardinality")] + pub cardinality: i64, + /// Arrow data type (e.g. \"Utf8\", \"Int32\", \"Timestamp(Microsecond, Some(\\\"UTC\\\"))\") + #[serde(rename = "data_type")] + pub data_type: String, + /// Column name + #[serde(rename = "name")] + pub name: String, + /// Number of null values + #[serde(rename = "null_count")] + pub null_count: i64, + /// Percentage of null values (0.0 to 100.0) + #[serde(rename = "null_percentage")] + pub null_percentage: f64, + /// Type-specific profile detail. Null when the column is all-null or has an unsupported type. + #[serde(rename = "profile", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub profile: Option>>, +} + +impl ColumnProfileInfo { + /// Statistics for a single column. + pub fn new(cardinality: i64, data_type: String, name: String, null_count: i64, null_percentage: f64) -> ColumnProfileInfo { + ColumnProfileInfo { + cardinality, + data_type, + name, + null_count, + null_percentage, + profile: None, + } + } +} + diff --git a/src/models/column_type_spec.rs b/src/models/column_type_spec.rs new file mode 100644 index 0000000..06bb905 --- /dev/null +++ b/src/models/column_type_spec.rs @@ -0,0 +1,46 @@ +/* + * 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/connection_health_response.rs b/src/models/connection_health_response.rs new file mode 100644 index 0000000..d3479dd --- /dev/null +++ b/src/models/connection_health_response.rs @@ -0,0 +1,38 @@ +/* + * 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}; + +/// ConnectionHealthResponse : Response body for GET /connections/{connection_id}/health +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionHealthResponse { + #[serde(rename = "connection_id")] + pub connection_id: String, + #[serde(rename = "error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error: Option>, + #[serde(rename = "healthy")] + pub healthy: bool, + #[serde(rename = "latency_ms")] + pub latency_ms: i64, +} + +impl ConnectionHealthResponse { + /// Response body for GET /connections/{connection_id}/health + pub fn new(connection_id: String, healthy: bool, latency_ms: i64) -> ConnectionHealthResponse { + ConnectionHealthResponse { + connection_id, + error: None, + healthy, + latency_ms, + } + } +} + diff --git a/src/models/connection_info.rs b/src/models/connection_info.rs new file mode 100644 index 0000000..9f74b37 --- /dev/null +++ b/src/models/connection_info.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// ConnectionInfo : Single connection metadata for API responses +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionInfo { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "source_type")] + pub source_type: String, +} + +impl ConnectionInfo { + /// Single connection metadata for API responses + pub fn new(id: String, name: String, source_type: String) -> ConnectionInfo { + ConnectionInfo { + id, + name, + source_type, + } + } +} + diff --git a/src/models/connection_refresh_result.rs b/src/models/connection_refresh_result.rs new file mode 100644 index 0000000..4b4cc9d --- /dev/null +++ b/src/models/connection_refresh_result.rs @@ -0,0 +1,47 @@ +/* + * 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}; + +/// ConnectionRefreshResult : Response for connection-wide data refresh +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionRefreshResult { + #[serde(rename = "connection_id")] + pub connection_id: String, + #[serde(rename = "duration_ms")] + pub duration_ms: i64, + #[serde(rename = "errors")] + pub errors: Vec, + #[serde(rename = "tables_failed")] + pub tables_failed: i32, + #[serde(rename = "tables_refreshed")] + pub tables_refreshed: i32, + #[serde(rename = "total_rows")] + pub total_rows: i32, + #[serde(rename = "warnings", skip_serializing_if = "Option::is_none")] + pub warnings: Option>, +} + +impl ConnectionRefreshResult { + /// Response for connection-wide data refresh + pub fn new(connection_id: String, duration_ms: i64, errors: Vec, tables_failed: i32, tables_refreshed: i32, total_rows: i32) -> ConnectionRefreshResult { + ConnectionRefreshResult { + connection_id, + duration_ms, + errors, + tables_failed, + tables_refreshed, + total_rows, + warnings: None, + } + } +} + diff --git a/src/models/connection_schema_error.rs b/src/models/connection_schema_error.rs new file mode 100644 index 0000000..f058c35 --- /dev/null +++ b/src/models/connection_schema_error.rs @@ -0,0 +1,32 @@ +/* + * 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}; + +/// ConnectionSchemaError : Error details for a failed connection schema refresh +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionSchemaError { + #[serde(rename = "connection_id")] + pub connection_id: String, + #[serde(rename = "error")] + pub error: String, +} + +impl ConnectionSchemaError { + /// Error details for a failed connection schema refresh + pub fn new(connection_id: String, error: String) -> ConnectionSchemaError { + ConnectionSchemaError { + connection_id, + error, + } + } +} + diff --git a/src/models/create_connection_request.rs b/src/models/create_connection_request.rs new file mode 100644 index 0000000..4daa18f --- /dev/null +++ b/src/models/create_connection_request.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// CreateConnectionRequest : Request body for POST /connections +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateConnectionRequest { + /// Connection configuration object. Fields vary by source type (host, port, database, etc.). + #[serde(rename = "config")] + pub config: std::collections::HashMap, + #[serde(rename = "name")] + pub name: String, + /// Optional reference to a secret by ID (e.g., \"secr_abc123\"). If provided, this secret will be used for authentication. Mutually exclusive with `secret_name`. + #[serde(rename = "secret_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub secret_id: Option>, + /// Optional reference to a secret by name. If provided, this secret will be used for authentication. Mutually exclusive with `secret_id`. + #[serde(rename = "secret_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub secret_name: Option>, + #[serde(rename = "source_type")] + pub source_type: String, +} + +impl CreateConnectionRequest { + /// Request body for POST /connections + pub fn new(config: std::collections::HashMap, name: String, source_type: String) -> CreateConnectionRequest { + CreateConnectionRequest { + config, + name, + secret_id: None, + secret_name: None, + source_type, + } + } +} + diff --git a/src/models/create_connection_response.rs b/src/models/create_connection_response.rs new file mode 100644 index 0000000..a4a1a2b --- /dev/null +++ b/src/models/create_connection_response.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// CreateConnectionResponse : Response body for POST /connections +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateConnectionResponse { + #[serde(rename = "discovery_error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub discovery_error: Option>, + #[serde(rename = "discovery_status")] + pub discovery_status: models::DiscoveryStatus, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "source_type")] + pub source_type: String, + #[serde(rename = "tables_discovered")] + pub tables_discovered: i32, +} + +impl CreateConnectionResponse { + /// Response body for POST /connections + pub fn new(discovery_status: models::DiscoveryStatus, id: String, name: String, source_type: String, tables_discovered: i32) -> CreateConnectionResponse { + CreateConnectionResponse { + discovery_error: None, + discovery_status, + id, + name, + source_type, + tables_discovered, + } + } +} + diff --git a/src/models/create_dataset_request.rs b/src/models/create_dataset_request.rs new file mode 100644 index 0000000..b2c1d68 --- /dev/null +++ b/src/models/create_dataset_request.rs @@ -0,0 +1,36 @@ +/* + * 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 new file mode 100644 index 0000000..6e4e525 --- /dev/null +++ b/src/models/create_dataset_response.rs @@ -0,0 +1,41 @@ +/* + * 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 = "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, status: String, table_name: String) -> CreateDatasetResponse { + CreateDatasetResponse { + created_at, + id, + label, + status, + table_name, + } + } +} + diff --git a/src/models/create_saved_query_request.rs b/src/models/create_saved_query_request.rs new file mode 100644 index 0000000..d8336f3 --- /dev/null +++ b/src/models/create_saved_query_request.rs @@ -0,0 +1,38 @@ +/* + * 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}; + +/// CreateSavedQueryRequest : Request body for POST /v1/queries +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateSavedQueryRequest { + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "sql")] + pub sql: String, + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, +} + +impl CreateSavedQueryRequest { + /// Request body for POST /v1/queries + pub fn new(name: String, sql: String) -> CreateSavedQueryRequest { + CreateSavedQueryRequest { + description: None, + name, + sql, + tags: None, + } + } +} + diff --git a/src/models/create_secret_request.rs b/src/models/create_secret_request.rs new file mode 100644 index 0000000..33acb54 --- /dev/null +++ b/src/models/create_secret_request.rs @@ -0,0 +1,32 @@ +/* + * 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}; + +/// CreateSecretRequest : Request body for POST /secrets +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateSecretRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "value")] + pub value: String, +} + +impl CreateSecretRequest { + /// Request body for POST /secrets + pub fn new(name: String, value: String) -> CreateSecretRequest { + CreateSecretRequest { + name, + value, + } + } +} + diff --git a/src/models/create_secret_response.rs b/src/models/create_secret_response.rs new file mode 100644 index 0000000..ad75f73 --- /dev/null +++ b/src/models/create_secret_response.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// CreateSecretResponse : Response body for POST /secrets +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateSecretResponse { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, +} + +impl CreateSecretResponse { + /// Response body for POST /secrets + pub fn new(created_at: String, id: String, name: String) -> CreateSecretResponse { + CreateSecretResponse { + created_at, + id, + name, + } + } +} + diff --git a/src/models/create_workspace_request.rs b/src/models/create_workspace_request.rs new file mode 100644 index 0000000..4dd9825 --- /dev/null +++ b/src/models/create_workspace_request.rs @@ -0,0 +1,32 @@ +/* + * 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 CreateWorkspaceRequest { + /// Name for the new workspace. + #[serde(rename = "name")] + pub name: String, + /// Target organization. Defaults to the user's current organization. + #[serde(rename = "organization_public_id", skip_serializing_if = "Option::is_none")] + pub organization_public_id: Option, +} + +impl CreateWorkspaceRequest { + pub fn new(name: String) -> CreateWorkspaceRequest { + CreateWorkspaceRequest { + name, + organization_public_id: None, + } + } +} + diff --git a/src/models/create_workspace_response.rs b/src/models/create_workspace_response.rs new file mode 100644 index 0000000..afa57c9 --- /dev/null +++ b/src/models/create_workspace_response.rs @@ -0,0 +1,30 @@ +/* + * 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 CreateWorkspaceResponse { + #[serde(rename = "ok")] + pub ok: bool, + #[serde(rename = "workspace")] + pub workspace: Box, +} + +impl CreateWorkspaceResponse { + pub fn new(ok: bool, workspace: models::WorkspaceDetail) -> CreateWorkspaceResponse { + CreateWorkspaceResponse { + ok, + workspace: Box::new(workspace), + } + } +} + diff --git a/src/models/dataset_source.rs b/src/models/dataset_source.rs new file mode 100644 index 0000000..c35c9fb --- /dev/null +++ b/src/models/dataset_source.rs @@ -0,0 +1,28 @@ +/* + * 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 +/// Dataset source specification +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DatasetSource { + UploadDatasetSource(Box), + InlineDatasetSource(Box), +} + +impl Default for DatasetSource { + fn default() -> Self { + Self::UploadDatasetSource(Default::default()) + } +} + diff --git a/src/models/dataset_summary.rs b/src/models/dataset_summary.rs new file mode 100644 index 0000000..cdc2831 --- /dev/null +++ b/src/models/dataset_summary.rs @@ -0,0 +1,41 @@ +/* + * 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 = "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, table_name: String, updated_at: String) -> DatasetSummary { + DatasetSummary { + created_at, + id, + label, + table_name, + updated_at, + } + } +} + diff --git a/src/models/discovery_status.rs b/src/models/discovery_status.rs new file mode 100644 index 0000000..8128d57 --- /dev/null +++ b/src/models/discovery_status.rs @@ -0,0 +1,42 @@ +/* + * 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}; + +/// DiscoveryStatus : Discovery status for connection creation +/// Discovery status for connection creation +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DiscoveryStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "failed")] + Failed, + +} + +impl std::fmt::Display for DiscoveryStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Success => write!(f, "success"), + Self::Skipped => write!(f, "skipped"), + Self::Failed => write!(f, "failed"), + } + } +} + +impl Default for DiscoveryStatus { + fn default() -> DiscoveryStatus { + Self::Success + } +} + diff --git a/src/models/error.rs b/src/models/error.rs new file mode 100644 index 0000000..2377ce5 --- /dev/null +++ b/src/models/error.rs @@ -0,0 +1,28 @@ +/* + * 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 Error { + /// Machine-readable error code. + #[serde(rename = "error")] + pub error: String, +} + +impl Error { + pub fn new(error: String) -> Error { + Error { + error, + } + } +} + diff --git a/src/models/execute_saved_query_request.rs b/src/models/execute_saved_query_request.rs new file mode 100644 index 0000000..17e9355 --- /dev/null +++ b/src/models/execute_saved_query_request.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// ExecuteSavedQueryRequest : Request body for POST /v1/queries/{id}/execute +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExecuteSavedQueryRequest { + #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub version: Option>, +} + +impl ExecuteSavedQueryRequest { + /// Request body for POST /v1/queries/{id}/execute + pub fn new() -> ExecuteSavedQueryRequest { + ExecuteSavedQueryRequest { + version: None, + } + } +} + diff --git a/src/models/get_connection_response.rs b/src/models/get_connection_response.rs new file mode 100644 index 0000000..2e1bb2e --- /dev/null +++ b/src/models/get_connection_response.rs @@ -0,0 +1,41 @@ +/* + * 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}; + +/// GetConnectionResponse : Response body for GET /connections/{connection_id} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GetConnectionResponse { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "source_type")] + pub source_type: String, + #[serde(rename = "synced_table_count")] + pub synced_table_count: i32, + #[serde(rename = "table_count")] + pub table_count: i32, +} + +impl GetConnectionResponse { + /// Response body for GET /connections/{connection_id} + pub fn new(id: String, name: String, source_type: String, synced_table_count: i32, table_count: i32) -> GetConnectionResponse { + GetConnectionResponse { + id, + name, + source_type, + synced_table_count, + table_count, + } + } +} + diff --git a/src/models/get_dataset_response.rs b/src/models/get_dataset_response.rs new file mode 100644 index 0000000..8caeb05 --- /dev/null +++ b/src/models/get_dataset_response.rs @@ -0,0 +1,50 @@ +/* + * 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 = "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, schema_name: String, source_type: String, table_name: String, updated_at: String) -> GetDatasetResponse { + GetDatasetResponse { + columns, + created_at, + id, + label, + schema_name, + source_type, + table_name, + updated_at, + } + } +} + diff --git a/src/models/get_result_response.rs b/src/models/get_result_response.rs new file mode 100644 index 0000000..6ee60f1 --- /dev/null +++ b/src/models/get_result_response.rs @@ -0,0 +1,48 @@ +/* + * 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}; + +/// GetResultResponse : Response body for GET /results/{id} Returns status and optionally the result data +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GetResultResponse { + #[serde(rename = "columns", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub columns: Option>>, + #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error_message: Option>, + #[serde(rename = "nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub nullable: Option>>, + #[serde(rename = "result_id")] + pub result_id: String, + #[serde(rename = "row_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub row_count: Option>, + /// Array of rows, where each row is an array of column values. + #[serde(rename = "rows", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub rows: Option>>>, + #[serde(rename = "status")] + pub status: String, +} + +impl GetResultResponse { + /// Response body for GET /results/{id} Returns status and optionally the result data + pub fn new(result_id: String, status: String) -> GetResultResponse { + GetResultResponse { + columns: None, + error_message: None, + nullable: None, + result_id, + row_count: None, + rows: None, + status, + } + } +} + diff --git a/src/models/get_secret_response.rs b/src/models/get_secret_response.rs new file mode 100644 index 0000000..b84ca82 --- /dev/null +++ b/src/models/get_secret_response.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// GetSecretResponse : Response body for GET /secrets/{name} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GetSecretResponse { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "updated_at")] + pub updated_at: String, +} + +impl GetSecretResponse { + /// Response body for GET /secrets/{name} + pub fn new(created_at: String, name: String, updated_at: String) -> GetSecretResponse { + GetSecretResponse { + created_at, + name, + updated_at, + } + } +} + diff --git a/src/models/information_schema_response.rs b/src/models/information_schema_response.rs new file mode 100644 index 0000000..7683b95 --- /dev/null +++ b/src/models/information_schema_response.rs @@ -0,0 +1,41 @@ +/* + * 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}; + +/// InformationSchemaResponse : Response body for GET /information_schema +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InformationSchemaResponse { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "has_more")] + pub has_more: bool, + #[serde(rename = "limit")] + pub limit: i32, + #[serde(rename = "next_cursor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next_cursor: Option>, + #[serde(rename = "tables")] + pub tables: Vec, +} + +impl InformationSchemaResponse { + /// Response body for GET /information_schema + pub fn new(count: i32, has_more: bool, limit: i32, tables: Vec) -> InformationSchemaResponse { + InformationSchemaResponse { + count, + has_more, + limit, + next_cursor: None, + tables, + } + } +} + diff --git a/src/models/inline_data.rs b/src/models/inline_data.rs new file mode 100644 index 0000000..ee2f305 --- /dev/null +++ b/src/models/inline_data.rs @@ -0,0 +1,36 @@ +/* + * 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 new file mode 100644 index 0000000..4013cf9 --- /dev/null +++ b/src/models/inline_dataset_source.rs @@ -0,0 +1,29 @@ +/* + * 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/list_connections_response.rs b/src/models/list_connections_response.rs new file mode 100644 index 0000000..8a3edd6 --- /dev/null +++ b/src/models/list_connections_response.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// ListConnectionsResponse : Response body for GET /connections +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListConnectionsResponse { + #[serde(rename = "connections")] + pub connections: Vec, +} + +impl ListConnectionsResponse { + /// Response body for GET /connections + pub fn new(connections: Vec) -> ListConnectionsResponse { + ListConnectionsResponse { + connections, + } + } +} + diff --git a/src/models/list_datasets_response.rs b/src/models/list_datasets_response.rs new file mode 100644 index 0000000..2eaf1e2 --- /dev/null +++ b/src/models/list_datasets_response.rs @@ -0,0 +1,45 @@ +/* + * 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/list_query_runs_response.rs b/src/models/list_query_runs_response.rs new file mode 100644 index 0000000..3fabf04 --- /dev/null +++ b/src/models/list_query_runs_response.rs @@ -0,0 +1,41 @@ +/* + * 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}; + +/// ListQueryRunsResponse : Response body for GET /query-runs +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListQueryRunsResponse { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "has_more")] + pub has_more: bool, + #[serde(rename = "limit")] + pub limit: i32, + #[serde(rename = "next_cursor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next_cursor: Option>, + #[serde(rename = "query_runs")] + pub query_runs: Vec, +} + +impl ListQueryRunsResponse { + /// Response body for GET /query-runs + pub fn new(count: i32, has_more: bool, limit: i32, query_runs: Vec) -> ListQueryRunsResponse { + ListQueryRunsResponse { + count, + has_more, + limit, + next_cursor: None, + query_runs, + } + } +} + diff --git a/src/models/list_results_response.rs b/src/models/list_results_response.rs new file mode 100644 index 0000000..966af50 --- /dev/null +++ b/src/models/list_results_response.rs @@ -0,0 +1,45 @@ +/* + * 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}; + +/// ListResultsResponse : Response body for GET /results +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListResultsResponse { + /// Number of results returned in this response + #[serde(rename = "count")] + pub count: i32, + /// Whether there are more results 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, + #[serde(rename = "results")] + pub results: Vec, +} + +impl ListResultsResponse { + /// Response body for GET /results + pub fn new(count: i32, has_more: bool, limit: i32, offset: i32, results: Vec) -> ListResultsResponse { + ListResultsResponse { + count, + has_more, + limit, + offset, + results, + } + } +} + diff --git a/src/models/list_saved_queries_response.rs b/src/models/list_saved_queries_response.rs new file mode 100644 index 0000000..df5ef1c --- /dev/null +++ b/src/models/list_saved_queries_response.rs @@ -0,0 +1,41 @@ +/* + * 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}; + +/// ListSavedQueriesResponse : Response body for GET /v1/queries +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListSavedQueriesResponse { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "has_more")] + pub has_more: bool, + #[serde(rename = "limit")] + pub limit: i32, + #[serde(rename = "offset")] + pub offset: i32, + #[serde(rename = "queries")] + pub queries: Vec, +} + +impl ListSavedQueriesResponse { + /// Response body for GET /v1/queries + pub fn new(count: i32, has_more: bool, limit: i32, offset: i32, queries: Vec) -> ListSavedQueriesResponse { + ListSavedQueriesResponse { + count, + has_more, + limit, + offset, + queries, + } + } +} + diff --git a/src/models/list_saved_query_versions_response.rs b/src/models/list_saved_query_versions_response.rs new file mode 100644 index 0000000..a163a19 --- /dev/null +++ b/src/models/list_saved_query_versions_response.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// ListSavedQueryVersionsResponse : Response body for GET /v1/queries/{id}/versions +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListSavedQueryVersionsResponse { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "has_more")] + pub has_more: bool, + #[serde(rename = "limit")] + pub limit: i32, + #[serde(rename = "offset")] + pub offset: i32, + #[serde(rename = "saved_query_id")] + pub saved_query_id: String, + #[serde(rename = "versions")] + pub versions: Vec, +} + +impl ListSavedQueryVersionsResponse { + /// Response body for GET /v1/queries/{id}/versions + pub fn new(count: i32, has_more: bool, limit: i32, offset: i32, saved_query_id: String, versions: Vec) -> ListSavedQueryVersionsResponse { + ListSavedQueryVersionsResponse { + count, + has_more, + limit, + offset, + saved_query_id, + versions, + } + } +} + diff --git a/src/models/list_secrets_response.rs b/src/models/list_secrets_response.rs new file mode 100644 index 0000000..f14728c --- /dev/null +++ b/src/models/list_secrets_response.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// ListSecretsResponse : Response body for GET /secrets +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListSecretsResponse { + #[serde(rename = "secrets")] + pub secrets: Vec, +} + +impl ListSecretsResponse { + /// Response body for GET /secrets + pub fn new(secrets: Vec) -> ListSecretsResponse { + ListSecretsResponse { + secrets, + } + } +} + diff --git a/src/models/list_uploads_response.rs b/src/models/list_uploads_response.rs new file mode 100644 index 0000000..2c26d19 --- /dev/null +++ b/src/models/list_uploads_response.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// ListUploadsResponse : Response body for GET /v1/files +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListUploadsResponse { + #[serde(rename = "uploads")] + pub uploads: Vec, +} + +impl ListUploadsResponse { + /// Response body for GET /v1/files + pub fn new(uploads: Vec) -> ListUploadsResponse { + ListUploadsResponse { + uploads, + } + } +} + diff --git a/src/models/list_workspaces_response.rs b/src/models/list_workspaces_response.rs new file mode 100644 index 0000000..ab04685 --- /dev/null +++ b/src/models/list_workspaces_response.rs @@ -0,0 +1,30 @@ +/* + * 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 ListWorkspacesResponse { + #[serde(rename = "ok")] + pub ok: bool, + #[serde(rename = "workspaces")] + pub workspaces: Vec, +} + +impl ListWorkspacesResponse { + pub fn new(ok: bool, workspaces: Vec) -> ListWorkspacesResponse { + ListWorkspacesResponse { + ok, + workspaces, + } + } +} + diff --git a/src/models/mod.rs b/src/models/mod.rs new file mode 100644 index 0000000..f0b3998 --- /dev/null +++ b/src/models/mod.rs @@ -0,0 +1,154 @@ +pub mod api_error_detail; +pub use self::api_error_detail::ApiErrorDetail; +pub mod api_error_response; +pub use self::api_error_response::ApiErrorResponse; +pub mod boolean_profile_detail; +pub use self::boolean_profile_detail::BooleanProfileDetail; +pub mod categorical_profile_detail; +pub use self::categorical_profile_detail::CategoricalProfileDetail; +pub mod category_value_info; +pub use self::category_value_info::CategoryValueInfo; +pub mod column_info; +pub use self::column_info::ColumnInfo; +pub mod column_profile_detail; +pub use self::column_profile_detail::ColumnProfileDetail; +pub mod column_profile_detail_one_of; +pub use self::column_profile_detail_one_of::ColumnProfileDetailOneOf; +pub mod column_profile_detail_one_of_1; +pub use self::column_profile_detail_one_of_1::ColumnProfileDetailOneOf1; +pub mod column_profile_detail_one_of_2; +pub use self::column_profile_detail_one_of_2::ColumnProfileDetailOneOf2; +pub mod column_profile_detail_one_of_3; +pub use self::column_profile_detail_one_of_3::ColumnProfileDetailOneOf3; +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; +pub use self::connection_info::ConnectionInfo; +pub mod connection_refresh_result; +pub use self::connection_refresh_result::ConnectionRefreshResult; +pub mod connection_schema_error; +pub use self::connection_schema_error::ConnectionSchemaError; +pub mod create_connection_request; +pub use self::create_connection_request::CreateConnectionRequest; +pub mod create_connection_response; +pub use self::create_connection_response::CreateConnectionResponse; +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_saved_query_request; +pub use self::create_saved_query_request::CreateSavedQueryRequest; +pub mod create_secret_request; +pub use self::create_secret_request::CreateSecretRequest; +pub mod create_secret_response; +pub use self::create_secret_response::CreateSecretResponse; +pub mod create_workspace_request; +pub use self::create_workspace_request::CreateWorkspaceRequest; +pub mod create_workspace_response; +pub use self::create_workspace_response::CreateWorkspaceResponse; +pub mod dataset_source; +pub use self::dataset_source::DatasetSource; +pub mod dataset_summary; +pub use self::dataset_summary::DatasetSummary; +pub mod discovery_status; +pub use self::discovery_status::DiscoveryStatus; +pub mod error; +pub use self::error::Error; +pub mod execute_saved_query_request; +pub use self::execute_saved_query_request::ExecuteSavedQueryRequest; +pub mod get_connection_response; +pub use self::get_connection_response::GetConnectionResponse; +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; +pub use self::get_secret_response::GetSecretResponse; +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 list_connections_response; +pub use self::list_connections_response::ListConnectionsResponse; +pub mod list_datasets_response; +pub use self::list_datasets_response::ListDatasetsResponse; +pub mod list_query_runs_response; +pub use self::list_query_runs_response::ListQueryRunsResponse; +pub mod list_results_response; +pub use self::list_results_response::ListResultsResponse; +pub mod list_saved_queries_response; +pub use self::list_saved_queries_response::ListSavedQueriesResponse; +pub mod list_saved_query_versions_response; +pub use self::list_saved_query_versions_response::ListSavedQueryVersionsResponse; +pub mod list_secrets_response; +pub use self::list_secrets_response::ListSecretsResponse; +pub mod list_uploads_response; +pub use self::list_uploads_response::ListUploadsResponse; +pub mod list_workspaces_response; +pub use self::list_workspaces_response::ListWorkspacesResponse; +pub mod numeric_profile_detail; +pub use self::numeric_profile_detail::NumericProfileDetail; +pub mod query_request; +pub use self::query_request::QueryRequest; +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_request; +pub use self::refresh_request::RefreshRequest; +pub mod refresh_response; +pub use self::refresh_response::RefreshResponse; +pub mod refresh_warning; +pub use self::refresh_warning::RefreshWarning; +pub mod result_info; +pub use self::result_info::ResultInfo; +pub mod saved_query_detail; +pub use self::saved_query_detail::SavedQueryDetail; +pub mod saved_query_summary; +pub use self::saved_query_summary::SavedQuerySummary; +pub mod saved_query_version_info; +pub use self::saved_query_version_info::SavedQueryVersionInfo; +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 table_info; +pub use self::table_info::TableInfo; +pub mod table_profile_response; +pub use self::table_profile_response::TableProfileResponse; +pub mod table_refresh_error; +pub use self::table_refresh_error::TableRefreshError; +pub mod table_refresh_result; +pub use self::table_refresh_result::TableRefreshResult; +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_saved_query_request; +pub use self::update_saved_query_request::UpdateSavedQueryRequest; +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; +pub use self::upload_response::UploadResponse; +pub mod workspace_detail; +pub use self::workspace_detail::WorkspaceDetail; +pub mod workspace_list_item; +pub use self::workspace_list_item::WorkspaceListItem; diff --git a/src/models/numeric_profile_detail.rs b/src/models/numeric_profile_detail.rs new file mode 100644 index 0000000..a0c39fb --- /dev/null +++ b/src/models/numeric_profile_detail.rs @@ -0,0 +1,38 @@ +/* + * 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}; + +/// NumericProfileDetail : High-cardinality numeric column (>200 distinct values). +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumericProfileDetail { + /// Maximum value (string to preserve precision for large integers and decimals) + #[serde(rename = "max")] + pub max: String, + /// Arithmetic mean + #[serde(rename = "mean")] + pub mean: f64, + /// Minimum value (string to preserve precision for large integers and decimals) + #[serde(rename = "min")] + pub min: String, +} + +impl NumericProfileDetail { + /// High-cardinality numeric column (>200 distinct values). + pub fn new(max: String, mean: f64, min: String) -> NumericProfileDetail { + NumericProfileDetail { + max, + mean, + min, + } + } +} + diff --git a/src/models/query_request.rs b/src/models/query_request.rs new file mode 100644 index 0000000..18c157e --- /dev/null +++ b/src/models/query_request.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// QueryRequest : Request body for POST /query +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryRequest { + #[serde(rename = "sql")] + pub sql: String, +} + +impl QueryRequest { + /// Request body for POST /query + pub fn new(sql: String) -> QueryRequest { + QueryRequest { + sql, + } + } +} + diff --git a/src/models/query_response.rs b/src/models/query_response.rs new file mode 100644 index 0000000..3f0ba5d --- /dev/null +++ b/src/models/query_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}; + +/// QueryResponse : Response body for POST /query Query results are returned immediately along with a `result_id` for later retrieval. The actual persistence to storage happens asynchronously in the background. To check if a result is ready for SQL queries, poll GET /results/{id} and check `status`: - `\"processing\"`: Persistence is still in progress - `\"ready\"`: Result is available for retrieval and SQL queries - `\"failed\"`: Persistence failed (check `error_message` for details) +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryResponse { + #[serde(rename = "columns")] + pub columns: Vec, + #[serde(rename = "execution_time_ms")] + pub execution_time_ms: i64, + /// Nullable flags for each column (parallel to columns vec). True if the column allows NULL values, false if NOT NULL. + #[serde(rename = "nullable")] + pub nullable: Vec, + /// Unique identifier for the query run record (qrun...). + #[serde(rename = "query_run_id")] + pub query_run_id: String, + /// Unique identifier for retrieving this result via GET /results/{id}. Null if catalog registration failed (see `warning` field for details). When non-null, the result is being persisted asynchronously. + #[serde(rename = "result_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub result_id: Option>, + #[serde(rename = "row_count")] + pub row_count: i32, + /// Array of rows, where each row is an array of column values. Values can be strings, numbers, booleans, or null. + #[serde(rename = "rows")] + pub rows: Vec>, + /// Warning message if result persistence could not be initiated. When present, `result_id` will be null and the result cannot be retrieved later. The query results are still returned in this response. + #[serde(rename = "warning", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub warning: Option>, +} + +impl QueryResponse { + /// Response body for POST /query Query results are returned immediately along with a `result_id` for later retrieval. The actual persistence to storage happens asynchronously in the background. To check if a result is ready for SQL queries, poll GET /results/{id} and check `status`: - `\"processing\"`: Persistence is still in progress - `\"ready\"`: Result is available for retrieval and SQL queries - `\"failed\"`: Persistence failed (check `error_message` for details) + pub fn new(columns: Vec, execution_time_ms: i64, nullable: Vec, query_run_id: String, row_count: i32, rows: Vec>) -> QueryResponse { + QueryResponse { + columns, + execution_time_ms, + nullable, + query_run_id, + result_id: None, + row_count, + rows, + warning: None, + } + } +} + diff --git a/src/models/query_run_info.rs b/src/models/query_run_info.rs new file mode 100644 index 0000000..e5e2b4e --- /dev/null +++ b/src/models/query_run_info.rs @@ -0,0 +1,71 @@ +/* + * 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}; + +/// QueryRunInfo : Single query run for listing +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryRunInfo { + #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub completed_at: Option>, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error_message: Option>, + #[serde(rename = "execution_time_ms", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub execution_time_ms: Option>, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "result_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub result_id: Option>, + #[serde(rename = "row_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub row_count: Option>, + #[serde(rename = "saved_query_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub saved_query_id: Option>, + #[serde(rename = "saved_query_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub saved_query_version: Option>, + #[serde(rename = "snapshot_id")] + pub snapshot_id: String, + #[serde(rename = "sql_hash")] + pub sql_hash: String, + #[serde(rename = "sql_text")] + pub sql_text: String, + #[serde(rename = "status")] + pub status: String, + #[serde(rename = "trace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub trace_id: Option>, + #[serde(rename = "warning_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub warning_message: Option>, +} + +impl QueryRunInfo { + /// Single query run for listing + pub fn new(created_at: String, id: String, snapshot_id: String, sql_hash: String, sql_text: String, status: String) -> QueryRunInfo { + QueryRunInfo { + completed_at: None, + created_at, + error_message: None, + execution_time_ms: None, + id, + result_id: None, + row_count: None, + saved_query_id: None, + saved_query_version: None, + snapshot_id, + sql_hash, + sql_text, + status, + trace_id: None, + warning_message: None, + } + } +} + diff --git a/src/models/refresh_request.rs b/src/models/refresh_request.rs new file mode 100644 index 0000000..39479d6 --- /dev/null +++ b/src/models/refresh_request.rs @@ -0,0 +1,42 @@ +/* + * 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}; + +/// RefreshRequest : Request body for POST /refresh +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RefreshRequest { + #[serde(rename = "connection_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_id: Option>, + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: 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, + #[serde(rename = "schema_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub schema_name: Option>, + #[serde(rename = "table_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub table_name: Option>, +} + +impl RefreshRequest { + /// Request body for POST /refresh + pub fn new() -> RefreshRequest { + RefreshRequest { + connection_id: None, + data: None, + include_uncached: None, + schema_name: None, + table_name: None, + } + } +} + diff --git a/src/models/refresh_response.rs b/src/models/refresh_response.rs new file mode 100644 index 0000000..d95ca02 --- /dev/null +++ b/src/models/refresh_response.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// RefreshResponse : Unified response type for refresh operations +/// Unified response type for refresh operations +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RefreshResponse { + SchemaRefreshResult(Box), + TableRefreshResult(Box), + ConnectionRefreshResult(Box), +} + +impl Default for RefreshResponse { + fn default() -> Self { + Self::SchemaRefreshResult(Default::default()) + } +} + diff --git a/src/models/refresh_warning.rs b/src/models/refresh_warning.rs new file mode 100644 index 0000000..f7c7079 --- /dev/null +++ b/src/models/refresh_warning.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// RefreshWarning : Non-fatal warning that occurred during a refresh operation. Used to report issues like failed deletion scheduling that don't prevent the refresh from succeeding. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RefreshWarning { + #[serde(rename = "message")] + pub message: String, + #[serde(rename = "schema_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub schema_name: Option>, + #[serde(rename = "table_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub table_name: Option>, +} + +impl RefreshWarning { + /// Non-fatal warning that occurred during a refresh operation. Used to report issues like failed deletion scheduling that don't prevent the refresh from succeeding. + pub fn new(message: String) -> RefreshWarning { + RefreshWarning { + message, + schema_name: None, + table_name: None, + } + } +} + diff --git a/src/models/result_info.rs b/src/models/result_info.rs new file mode 100644 index 0000000..a8e7342 --- /dev/null +++ b/src/models/result_info.rs @@ -0,0 +1,38 @@ +/* + * 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}; + +/// ResultInfo : Summary of a persisted query result for listing +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResultInfo { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error_message: Option>, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "status")] + pub status: String, +} + +impl ResultInfo { + /// Summary of a persisted query result for listing + pub fn new(created_at: String, id: String, status: String) -> ResultInfo { + ResultInfo { + created_at, + error_message: None, + id, + status, + } + } +} + diff --git a/src/models/saved_query_detail.rs b/src/models/saved_query_detail.rs new file mode 100644 index 0000000..79c9e54 --- /dev/null +++ b/src/models/saved_query_detail.rs @@ -0,0 +1,80 @@ +/* + * 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}; + +/// SavedQueryDetail : Saved query detail (includes latest version's SQL) +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SavedQueryDetail { + #[serde(rename = "category", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category: Option>, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "has_aggregation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_aggregation: Option>, + #[serde(rename = "has_group_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_group_by: Option>, + #[serde(rename = "has_join", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_join: Option>, + #[serde(rename = "has_limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_limit: Option>, + #[serde(rename = "has_order_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_order_by: Option>, + #[serde(rename = "has_predicate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_predicate: Option>, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "latest_version")] + pub latest_version: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "num_tables", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub num_tables: Option>, + #[serde(rename = "sql")] + pub sql: String, + #[serde(rename = "sql_hash")] + pub sql_hash: String, + #[serde(rename = "table_size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub table_size: Option>, + #[serde(rename = "tags")] + pub tags: Vec, + #[serde(rename = "updated_at")] + pub updated_at: String, +} + +impl SavedQueryDetail { + /// Saved query detail (includes latest version's SQL) + pub fn new(created_at: String, description: String, id: String, latest_version: i32, name: String, sql: String, sql_hash: String, tags: Vec, updated_at: String) -> SavedQueryDetail { + SavedQueryDetail { + category: None, + created_at, + description, + has_aggregation: None, + has_group_by: None, + has_join: None, + has_limit: None, + has_order_by: None, + has_predicate: None, + id, + latest_version, + name, + num_tables: None, + sql, + sql_hash, + table_size: None, + tags, + updated_at, + } + } +} + diff --git a/src/models/saved_query_summary.rs b/src/models/saved_query_summary.rs new file mode 100644 index 0000000..7f64bc8 --- /dev/null +++ b/src/models/saved_query_summary.rs @@ -0,0 +1,47 @@ +/* + * 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}; + +/// SavedQuerySummary : Saved query summary for listing +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SavedQuerySummary { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "latest_version")] + pub latest_version: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "tags")] + pub tags: Vec, + #[serde(rename = "updated_at")] + pub updated_at: String, +} + +impl SavedQuerySummary { + /// Saved query summary for listing + pub fn new(created_at: String, description: String, id: String, latest_version: i32, name: String, tags: Vec, updated_at: String) -> SavedQuerySummary { + SavedQuerySummary { + created_at, + description, + id, + latest_version, + name, + tags, + updated_at, + } + } +} + diff --git a/src/models/saved_query_version_info.rs b/src/models/saved_query_version_info.rs new file mode 100644 index 0000000..c364dad --- /dev/null +++ b/src/models/saved_query_version_info.rs @@ -0,0 +1,65 @@ +/* + * 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}; + +/// SavedQueryVersionInfo : Single saved query version +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SavedQueryVersionInfo { + #[serde(rename = "category", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category: Option>, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "has_aggregation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_aggregation: Option>, + #[serde(rename = "has_group_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_group_by: Option>, + #[serde(rename = "has_join", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_join: Option>, + #[serde(rename = "has_limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_limit: Option>, + #[serde(rename = "has_order_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_order_by: Option>, + #[serde(rename = "has_predicate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub has_predicate: Option>, + #[serde(rename = "num_tables", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub num_tables: Option>, + #[serde(rename = "sql")] + pub sql: String, + #[serde(rename = "sql_hash")] + pub sql_hash: String, + #[serde(rename = "table_size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub table_size: Option>, + #[serde(rename = "version")] + pub version: i32, +} + +impl SavedQueryVersionInfo { + /// Single saved query version + pub fn new(created_at: String, sql: String, sql_hash: String, version: i32) -> SavedQueryVersionInfo { + SavedQueryVersionInfo { + category: None, + created_at, + has_aggregation: None, + has_group_by: None, + has_join: None, + has_limit: None, + has_order_by: None, + has_predicate: None, + num_tables: None, + sql, + sql_hash, + table_size: None, + version, + } + } +} + diff --git a/src/models/schema_refresh_result.rs b/src/models/schema_refresh_result.rs new file mode 100644 index 0000000..dc98bac --- /dev/null +++ b/src/models/schema_refresh_result.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// SchemaRefreshResult : Response for schema refresh operations +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SchemaRefreshResult { + #[serde(rename = "connections_failed")] + pub connections_failed: i32, + #[serde(rename = "connections_refreshed")] + pub connections_refreshed: i32, + #[serde(rename = "errors", skip_serializing_if = "Option::is_none")] + pub errors: Option>, + #[serde(rename = "tables_added")] + pub tables_added: i32, + #[serde(rename = "tables_discovered")] + pub tables_discovered: i32, + #[serde(rename = "tables_modified")] + pub tables_modified: i32, +} + +impl SchemaRefreshResult { + /// Response for schema refresh operations + pub fn new(connections_failed: i32, connections_refreshed: i32, tables_added: i32, tables_discovered: i32, tables_modified: i32) -> SchemaRefreshResult { + SchemaRefreshResult { + connections_failed, + connections_refreshed, + errors: None, + tables_added, + tables_discovered, + tables_modified, + } + } +} + diff --git a/src/models/secret_metadata_response.rs b/src/models/secret_metadata_response.rs new file mode 100644 index 0000000..ba0397c --- /dev/null +++ b/src/models/secret_metadata_response.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// SecretMetadataResponse : Single secret metadata for API responses +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecretMetadataResponse { + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "updated_at")] + pub updated_at: String, +} + +impl SecretMetadataResponse { + /// Single secret metadata for API responses + pub fn new(created_at: String, name: String, updated_at: String) -> SecretMetadataResponse { + SecretMetadataResponse { + created_at, + name, + updated_at, + } + } +} + diff --git a/src/models/table_info.rs b/src/models/table_info.rs new file mode 100644 index 0000000..91dcfd6 --- /dev/null +++ b/src/models/table_info.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// TableInfo : Single table metadata +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TableInfo { + #[serde(rename = "columns", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub columns: Option>>, + #[serde(rename = "connection")] + pub connection: String, + #[serde(rename = "last_sync", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub last_sync: Option>, + #[serde(rename = "schema")] + pub schema: String, + #[serde(rename = "synced")] + pub synced: bool, + #[serde(rename = "table")] + pub table: String, +} + +impl TableInfo { + /// Single table metadata + pub fn new(connection: String, schema: String, synced: bool, table: String) -> TableInfo { + TableInfo { + columns: None, + connection, + last_sync: None, + schema, + synced, + table, + } + } +} + diff --git a/src/models/table_profile_response.rs b/src/models/table_profile_response.rs new file mode 100644 index 0000000..7bd1604 --- /dev/null +++ b/src/models/table_profile_response.rs @@ -0,0 +1,50 @@ +/* + * 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}; + +/// TableProfileResponse : Column-level statistics for a synced table. Profiles are computed at sync time and include per-column cardinality, null counts, and type-specific details. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TableProfileResponse { + /// Per-column profile statistics + #[serde(rename = "columns")] + pub columns: Vec, + /// Connection name + #[serde(rename = "connection")] + pub connection: String, + /// Total number of rows in the table + #[serde(rename = "row_count")] + pub row_count: i32, + /// Schema name + #[serde(rename = "schema")] + pub schema: String, + /// When the table was last synced + #[serde(rename = "synced_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub synced_at: Option>, + /// Table name + #[serde(rename = "table")] + pub table: String, +} + +impl TableProfileResponse { + /// Column-level statistics for a synced table. Profiles are computed at sync time and include per-column cardinality, null counts, and type-specific details. + pub fn new(columns: Vec, connection: String, row_count: i32, schema: String, table: String) -> TableProfileResponse { + TableProfileResponse { + columns, + connection, + row_count, + schema, + synced_at: None, + table, + } + } +} + diff --git a/src/models/table_refresh_error.rs b/src/models/table_refresh_error.rs new file mode 100644 index 0000000..4918296 --- /dev/null +++ b/src/models/table_refresh_error.rs @@ -0,0 +1,35 @@ +/* + * 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}; + +/// TableRefreshError : Error details for a failed table refresh +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TableRefreshError { + #[serde(rename = "error")] + pub error: String, + #[serde(rename = "schema_name")] + pub schema_name: String, + #[serde(rename = "table_name")] + pub table_name: String, +} + +impl TableRefreshError { + /// Error details for a failed table refresh + pub fn new(error: String, schema_name: String, table_name: String) -> TableRefreshError { + TableRefreshError { + error, + schema_name, + table_name, + } + } +} + diff --git a/src/models/table_refresh_result.rs b/src/models/table_refresh_result.rs new file mode 100644 index 0000000..76f03ea --- /dev/null +++ b/src/models/table_refresh_result.rs @@ -0,0 +1,44 @@ +/* + * 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}; + +/// TableRefreshResult : Response for single table data refresh +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TableRefreshResult { + #[serde(rename = "connection_id")] + pub connection_id: String, + #[serde(rename = "duration_ms")] + pub duration_ms: i64, + #[serde(rename = "rows_synced")] + pub rows_synced: i32, + #[serde(rename = "schema_name")] + pub schema_name: String, + #[serde(rename = "table_name")] + pub table_name: String, + #[serde(rename = "warnings", skip_serializing_if = "Option::is_none")] + pub warnings: Option>, +} + +impl TableRefreshResult { + /// Response for single table data refresh + pub fn new(connection_id: String, duration_ms: i64, rows_synced: i32, schema_name: String, table_name: String) -> TableRefreshResult { + TableRefreshResult { + connection_id, + duration_ms, + rows_synced, + schema_name, + table_name, + warnings: None, + } + } +} + diff --git a/src/models/temporal_profile_detail.rs b/src/models/temporal_profile_detail.rs new file mode 100644 index 0000000..19513bd --- /dev/null +++ b/src/models/temporal_profile_detail.rs @@ -0,0 +1,34 @@ +/* + * 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}; + +/// TemporalProfileDetail : Date or timestamp column. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TemporalProfileDetail { + /// Latest value as ISO-8601 string + #[serde(rename = "max")] + pub max: String, + /// Earliest value as ISO-8601 string + #[serde(rename = "min")] + pub min: String, +} + +impl TemporalProfileDetail { + /// Date or timestamp column. + pub fn new(max: String, min: String) -> TemporalProfileDetail { + TemporalProfileDetail { + max, + min, + } + } +} + diff --git a/src/models/text_profile_detail.rs b/src/models/text_profile_detail.rs new file mode 100644 index 0000000..bb4c899 --- /dev/null +++ b/src/models/text_profile_detail.rs @@ -0,0 +1,38 @@ +/* + * 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}; + +/// TextProfileDetail : High-cardinality text column (>200 distinct values). +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TextProfileDetail { + /// Average string length + #[serde(rename = "avg_length")] + pub avg_length: f64, + /// Longest string length in the column + #[serde(rename = "max_length")] + pub max_length: i64, + /// Shortest string length in the column + #[serde(rename = "min_length")] + pub min_length: i64, +} + +impl TextProfileDetail { + /// High-cardinality text column (>200 distinct values). + pub fn new(avg_length: f64, max_length: i64, min_length: i64) -> TextProfileDetail { + TextProfileDetail { + avg_length, + max_length, + min_length, + } + } +} + diff --git a/src/models/update_dataset_request.rs b/src/models/update_dataset_request.rs new file mode 100644 index 0000000..60ae8bd --- /dev/null +++ b/src/models/update_dataset_request.rs @@ -0,0 +1,32 @@ +/* + * 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>, + #[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, + table_name: None, + } + } +} + diff --git a/src/models/update_dataset_response.rs b/src/models/update_dataset_response.rs new file mode 100644 index 0000000..80cdae5 --- /dev/null +++ b/src/models/update_dataset_response.rs @@ -0,0 +1,38 @@ +/* + * 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 = "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, table_name: String, updated_at: String) -> UpdateDatasetResponse { + UpdateDatasetResponse { + id, + label, + table_name, + updated_at, + } + } +} + diff --git a/src/models/update_saved_query_request.rs b/src/models/update_saved_query_request.rs new file mode 100644 index 0000000..797c56b --- /dev/null +++ b/src/models/update_saved_query_request.rs @@ -0,0 +1,48 @@ +/* + * 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}; + +/// UpdateSavedQueryRequest : Request body for PUT /v1/queries/{id} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateSavedQueryRequest { + /// Override the auto-detected category. Send `null` to clear (revert to auto). + #[serde(rename = "category_override", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_override: Option>, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + /// Optional new name. When omitted the existing name is preserved. + #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub name: Option>, + /// Optional new SQL. When omitted the existing SQL is preserved. + #[serde(rename = "sql", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sql: Option>, + /// User annotation for table size. Send `null` to clear. + #[serde(rename = "table_size_override", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub table_size_override: Option>, + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, +} + +impl UpdateSavedQueryRequest { + /// Request body for PUT /v1/queries/{id} + pub fn new() -> UpdateSavedQueryRequest { + UpdateSavedQueryRequest { + category_override: None, + description: None, + name: None, + sql: None, + table_size_override: None, + tags: None, + } + } +} + diff --git a/src/models/update_secret_request.rs b/src/models/update_secret_request.rs new file mode 100644 index 0000000..7c079a9 --- /dev/null +++ b/src/models/update_secret_request.rs @@ -0,0 +1,29 @@ +/* + * 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}; + +/// UpdateSecretRequest : Request body for PUT /secrets/{name} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateSecretRequest { + #[serde(rename = "value")] + pub value: String, +} + +impl UpdateSecretRequest { + /// Request body for PUT /secrets/{name} + pub fn new(value: String) -> UpdateSecretRequest { + UpdateSecretRequest { + value, + } + } +} + diff --git a/src/models/update_secret_response.rs b/src/models/update_secret_response.rs new file mode 100644 index 0000000..09b5fd1 --- /dev/null +++ b/src/models/update_secret_response.rs @@ -0,0 +1,32 @@ +/* + * 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}; + +/// UpdateSecretResponse : Response body for PUT /secrets/{name} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateSecretResponse { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "updated_at")] + pub updated_at: String, +} + +impl UpdateSecretResponse { + /// Response body for PUT /secrets/{name} + pub fn new(name: String, updated_at: String) -> UpdateSecretResponse { + UpdateSecretResponse { + name, + updated_at, + } + } +} + diff --git a/src/models/upload_dataset_source.rs b/src/models/upload_dataset_source.rs new file mode 100644 index 0000000..1d6511c --- /dev/null +++ b/src/models/upload_dataset_source.rs @@ -0,0 +1,36 @@ +/* + * 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/upload_info.rs b/src/models/upload_info.rs new file mode 100644 index 0000000..732d3ee --- /dev/null +++ b/src/models/upload_info.rs @@ -0,0 +1,41 @@ +/* + * 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}; + +/// UploadInfo : Single upload info for listing +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UploadInfo { + #[serde(rename = "content_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub content_type: Option>, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "size_bytes")] + pub size_bytes: i64, + #[serde(rename = "status")] + pub status: String, +} + +impl UploadInfo { + /// Single upload info for listing + pub fn new(created_at: String, id: String, size_bytes: i64, status: String) -> UploadInfo { + UploadInfo { + content_type: None, + created_at, + id, + size_bytes, + status, + } + } +} + diff --git a/src/models/upload_response.rs b/src/models/upload_response.rs new file mode 100644 index 0000000..f8b8246 --- /dev/null +++ b/src/models/upload_response.rs @@ -0,0 +1,41 @@ +/* + * 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}; + +/// UploadResponse : Response body for POST /v1/files +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UploadResponse { + #[serde(rename = "content_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub content_type: Option>, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "size_bytes")] + pub size_bytes: i64, + #[serde(rename = "status")] + pub status: String, +} + +impl UploadResponse { + /// Response body for POST /v1/files + pub fn new(created_at: String, id: String, size_bytes: i64, status: String) -> UploadResponse { + UploadResponse { + content_type: None, + created_at, + id, + size_bytes, + status, + } + } +} + diff --git a/src/models/workspace_detail.rs b/src/models/workspace_detail.rs new file mode 100644 index 0000000..ece2fd6 --- /dev/null +++ b/src/models/workspace_detail.rs @@ -0,0 +1,36 @@ +/* + * 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 WorkspaceDetail { + #[serde(rename = "public_id")] + pub public_id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "provision_status")] + pub provision_status: String, + #[serde(rename = "namespace")] + pub namespace: String, +} + +impl WorkspaceDetail { + pub fn new(public_id: String, name: String, provision_status: String, namespace: String) -> WorkspaceDetail { + WorkspaceDetail { + public_id, + name, + provision_status, + namespace, + } + } +} + diff --git a/src/models/workspace_list_item.rs b/src/models/workspace_list_item.rs new file mode 100644 index 0000000..70680f9 --- /dev/null +++ b/src/models/workspace_list_item.rs @@ -0,0 +1,42 @@ +/* + * 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 WorkspaceListItem { + #[serde(rename = "public_id")] + pub public_id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "active")] + pub active: bool, + #[serde(rename = "favorite")] + pub favorite: bool, + #[serde(rename = "provision_status")] + pub provision_status: String, + #[serde(rename = "namespace")] + pub namespace: String, +} + +impl WorkspaceListItem { + pub fn new(public_id: String, name: String, active: bool, favorite: bool, provision_status: String, namespace: String) -> WorkspaceListItem { + WorkspaceListItem { + public_id, + name, + active, + favorite, + provision_status, + namespace, + } + } +} +