diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 78006a5..58067ca 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -38,6 +38,11 @@ docs/CreateSecretResponse.md docs/CreateWorkspaceRequest.md docs/CreateWorkspaceResponse.md docs/DatasetSource.md +docs/DatasetSourceOneOf.md +docs/DatasetSourceOneOf1.md +docs/DatasetSourceOneOf2.md +docs/DatasetSourceOneOf3.md +docs/DatasetSourceOneOf4.md docs/DatasetSummary.md docs/DatasetVersionSummary.md docs/DatasetsApi.md @@ -191,6 +196,11 @@ hotdata/models/create_secret_response.py hotdata/models/create_workspace_request.py hotdata/models/create_workspace_response.py hotdata/models/dataset_source.py +hotdata/models/dataset_source_one_of.py +hotdata/models/dataset_source_one_of1.py +hotdata/models/dataset_source_one_of2.py +hotdata/models/dataset_source_one_of3.py +hotdata/models/dataset_source_one_of4.py hotdata/models/dataset_summary.py hotdata/models/dataset_version_summary.py hotdata/models/delete_sandbox_response.py @@ -275,14 +285,9 @@ hotdata/rest.py pyproject.toml requirements.txt setup.cfg -setup.py test-requirements.txt test/__init__.py -test/test_create_sandbox_request.py -test/test_delete_sandbox_response.py -test/test_list_sandboxes_response.py -test/test_sandbox.py -test/test_sandbox_response.py -test/test_sandboxes_api.py -test/test_update_sandbox_request.py +test/test_dataset_source_one_of2.py +test/test_dataset_source_one_of3.py +test/test_dataset_source_one_of4.py tox.ini diff --git a/docs/DatasetSource.md b/docs/DatasetSource.md index 16d43c5..14d01fb 100644 --- a/docs/DatasetSource.md +++ b/docs/DatasetSource.md @@ -1,6 +1,6 @@ # DatasetSource -Dataset source specification +Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. ## Properties @@ -9,6 +9,7 @@ Name | Type | Description | Notes **columns** | **Dict[str, str]** | Optional explicit column definitions. Keys are column names, values are type specs. | [optional] **format** | **str** | | [optional] **upload_id** | **str** | | +**type** | **str** | | **saved_query_id** | **str** | | **version** | **int** | | [optional] **description** | **str** | Optional description for the auto-created saved query. | [optional] diff --git a/docs/DatasetSourceOneOf.md b/docs/DatasetSourceOneOf.md index afd4c13..aa924e7 100644 --- a/docs/DatasetSourceOneOf.md +++ b/docs/DatasetSourceOneOf.md @@ -1,14 +1,14 @@ # DatasetSourceOneOf -Create from a previously uploaded file ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**columns** | [**Dict[str, ColumnDefinition]**](ColumnDefinition.md) | 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** | **object** | | [optional] +**columns** | **Dict[str, str]** | 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** | **str** | | [optional] **upload_id** | **str** | | +**type** | **str** | | ## Example diff --git a/docs/DatasetSourceOneOf1.md b/docs/DatasetSourceOneOf1.md index 7a40e86..5587e12 100644 --- a/docs/DatasetSourceOneOf1.md +++ b/docs/DatasetSourceOneOf1.md @@ -1,12 +1,13 @@ # DatasetSourceOneOf1 -Create from inline data (small payloads) ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**inline** | [**InlineData**](InlineData.md) | | +**saved_query_id** | **str** | | +**version** | **int** | | [optional] +**type** | **str** | | ## Example diff --git a/docs/DatasetSourceOneOf2.md b/docs/DatasetSourceOneOf2.md new file mode 100644 index 0000000..8a4f995 --- /dev/null +++ b/docs/DatasetSourceOneOf2.md @@ -0,0 +1,32 @@ +# DatasetSourceOneOf2 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | Optional description for the auto-created saved query. | [optional] +**name** | **str** | Optional name for the auto-created saved query. Defaults to the dataset label. | [optional] +**sql** | **str** | | +**type** | **str** | | + +## Example + +```python +from hotdata.models.dataset_source_one_of2 import DatasetSourceOneOf2 + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetSourceOneOf2 from a JSON string +dataset_source_one_of2_instance = DatasetSourceOneOf2.from_json(json) +# print the JSON string representation of the object +print(DatasetSourceOneOf2.to_json()) + +# convert the object into a dict +dataset_source_one_of2_dict = dataset_source_one_of2_instance.to_dict() +# create an instance of DatasetSourceOneOf2 from a dict +dataset_source_one_of2_from_dict = DatasetSourceOneOf2.from_dict(dataset_source_one_of2_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetSourceOneOf3.md b/docs/DatasetSourceOneOf3.md new file mode 100644 index 0000000..5d43931 --- /dev/null +++ b/docs/DatasetSourceOneOf3.md @@ -0,0 +1,32 @@ +# DatasetSourceOneOf3 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**columns** | **Dict[str, str]** | Optional explicit column definitions. Keys are column names, values are type specs. | [optional] +**format** | **str** | | [optional] +**url** | **str** | | +**type** | **str** | | + +## Example + +```python +from hotdata.models.dataset_source_one_of3 import DatasetSourceOneOf3 + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetSourceOneOf3 from a JSON string +dataset_source_one_of3_instance = DatasetSourceOneOf3.from_json(json) +# print the JSON string representation of the object +print(DatasetSourceOneOf3.to_json()) + +# convert the object into a dict +dataset_source_one_of3_dict = dataset_source_one_of3_instance.to_dict() +# create an instance of DatasetSourceOneOf3 from a dict +dataset_source_one_of3_from_dict = DatasetSourceOneOf3.from_dict(dataset_source_one_of3_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DatasetSourceOneOf4.md b/docs/DatasetSourceOneOf4.md new file mode 100644 index 0000000..e6b2f4d --- /dev/null +++ b/docs/DatasetSourceOneOf4.md @@ -0,0 +1,30 @@ +# DatasetSourceOneOf4 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inline** | [**InlineData**](InlineData.md) | | +**type** | **str** | | + +## Example + +```python +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 + +# TODO update the JSON string below +json = "{}" +# create an instance of DatasetSourceOneOf4 from a JSON string +dataset_source_one_of4_instance = DatasetSourceOneOf4.from_json(json) +# print the JSON string representation of the object +print(DatasetSourceOneOf4.to_json()) + +# convert the object into a dict +dataset_source_one_of4_dict = dataset_source_one_of4_instance.to_dict() +# create an instance of DatasetSourceOneOf4 from a dict +dataset_source_one_of4_from_dict = DatasetSourceOneOf4.from_dict(dataset_source_one_of4_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/JobResult.md b/docs/JobResult.md index 4d72bb6..79c6fb9 100644 --- a/docs/JobResult.md +++ b/docs/JobResult.md @@ -16,12 +16,14 @@ Name | Type | Description | Notes **tables_failed** | **int** | | **tables_refreshed** | **int** | | **total_rows** | **int** | | -**columns** | **List[str]** | | **created_at** | **datetime** | | +**id** | **str** | | +**status** | [**IndexStatus**](IndexStatus.md) | | +**version** | **int** | | +**columns** | **List[str]** | | **index_name** | **str** | | **index_type** | **str** | | **metric** | **str** | Distance metric this index was built with. Only present for vector indexes. | [optional] -**status** | [**IndexStatus**](IndexStatus.md) | | **updated_at** | **datetime** | | ## Example diff --git a/docs/JobType.md b/docs/JobType.md index c5905a4..012b04b 100644 --- a/docs/JobType.md +++ b/docs/JobType.md @@ -10,6 +10,8 @@ Background job types returned by the API. * `DATA_REFRESH_CONNECTION` (value: `'data_refresh_connection'`) +* `DATASET_REFRESH` (value: `'dataset_refresh'`) + * `CREATE_INDEX` (value: `'create_index'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RefreshApi.md b/docs/RefreshApi.md index e0d2c4f..a6c4e33 100644 --- a/docs/RefreshApi.md +++ b/docs/RefreshApi.md @@ -12,14 +12,15 @@ Method | HTTP request | Description Refresh connection data -Refresh schema metadata or table data. The behavior depends on the request fields: +Refresh schema metadata, table data, or dataset data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. +- **Dataset refresh**: set `dataset_id` — re-runs the dataset's source (URL fetch or saved query) and creates a new version. Mutually exclusive with `connection_id`. -Set `async: true` on data refresh operations to run in the background and return a job ID for polling. +Set `async: true` on data or dataset refresh operations to run in the background and return a job ID for polling. ### Example diff --git a/hotdata/__init__.py b/hotdata/__init__.py index 0574fe5..157fc84 100644 --- a/hotdata/__init__.py +++ b/hotdata/__init__.py @@ -85,6 +85,11 @@ "CreateWorkspaceRequest", "CreateWorkspaceResponse", "DatasetSource", + "DatasetSourceOneOf", + "DatasetSourceOneOf1", + "DatasetSourceOneOf2", + "DatasetSourceOneOf3", + "DatasetSourceOneOf4", "DatasetSummary", "DatasetVersionSummary", "DeleteSandboxResponse", @@ -232,6 +237,11 @@ from hotdata.models.create_workspace_request import CreateWorkspaceRequest as CreateWorkspaceRequest from hotdata.models.create_workspace_response import CreateWorkspaceResponse as CreateWorkspaceResponse from hotdata.models.dataset_source import DatasetSource as DatasetSource +from hotdata.models.dataset_source_one_of import DatasetSourceOneOf as DatasetSourceOneOf +from hotdata.models.dataset_source_one_of1 import DatasetSourceOneOf1 as DatasetSourceOneOf1 +from hotdata.models.dataset_source_one_of2 import DatasetSourceOneOf2 as DatasetSourceOneOf2 +from hotdata.models.dataset_source_one_of3 import DatasetSourceOneOf3 as DatasetSourceOneOf3 +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 as DatasetSourceOneOf4 from hotdata.models.dataset_summary import DatasetSummary as DatasetSummary from hotdata.models.dataset_version_summary import DatasetVersionSummary as DatasetVersionSummary from hotdata.models.delete_sandbox_response import DeleteSandboxResponse as DeleteSandboxResponse diff --git a/hotdata/api/refresh_api.py b/hotdata/api/refresh_api.py index 1708bf2..71867c7 100644 --- a/hotdata/api/refresh_api.py +++ b/hotdata/api/refresh_api.py @@ -56,7 +56,7 @@ def refresh( ) -> RefreshResponse: """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. Set `async: true` on data refresh operations to run in the background and return a job ID for polling. + Refresh schema metadata, table data, or dataset data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. - **Dataset refresh**: set `dataset_id` — re-runs the dataset's source (URL fetch or saved query) and creates a new version. Mutually exclusive with `connection_id`. Set `async: true` on data or dataset refresh operations to run in the background and return a job ID for polling. :param refresh_request: (required) :type refresh_request: RefreshRequest @@ -125,7 +125,7 @@ def refresh_with_http_info( ) -> ApiResponse[RefreshResponse]: """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. Set `async: true` on data refresh operations to run in the background and return a job ID for polling. + Refresh schema metadata, table data, or dataset data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. - **Dataset refresh**: set `dataset_id` — re-runs the dataset's source (URL fetch or saved query) and creates a new version. Mutually exclusive with `connection_id`. Set `async: true` on data or dataset refresh operations to run in the background and return a job ID for polling. :param refresh_request: (required) :type refresh_request: RefreshRequest @@ -194,7 +194,7 @@ def refresh_without_preload_content( ) -> RESTResponseType: """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. Set `async: true` on data refresh operations to run in the background and return a job ID for polling. + Refresh schema metadata, table data, or dataset data. The behavior depends on the request fields: - **Schema refresh (all)**: omit all fields — re-discovers tables for every connection. - **Schema refresh (single)**: set `connection_id` — re-discovers tables for one connection. - **Data refresh (single table)**: set `connection_id`, `schema_name`, `table_name`, and `data: true`. - **Data refresh (connection)**: set `connection_id` and `data: true` — refreshes all cached tables. Set `include_uncached: true` to also sync tables that haven't been cached yet. - **Dataset refresh**: set `dataset_id` — re-runs the dataset's source (URL fetch or saved query) and creates a new version. Mutually exclusive with `connection_id`. Set `async: true` on data or dataset refresh operations to run in the background and return a job ID for polling. :param refresh_request: (required) :type refresh_request: RefreshRequest diff --git a/hotdata/api_client.py b/hotdata/api_client.py index 926507e..bc3e660 100644 --- a/hotdata/api_client.py +++ b/hotdata/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.user_agent = 'OpenAPI-Generator/0.1.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/hotdata/models/__init__.py b/hotdata/models/__init__.py index 0541d21..8ffe434 100644 --- a/hotdata/models/__init__.py +++ b/hotdata/models/__init__.py @@ -49,6 +49,11 @@ from hotdata.models.create_workspace_request import CreateWorkspaceRequest from hotdata.models.create_workspace_response import CreateWorkspaceResponse from hotdata.models.dataset_source import DatasetSource +from hotdata.models.dataset_source_one_of import DatasetSourceOneOf +from hotdata.models.dataset_source_one_of1 import DatasetSourceOneOf1 +from hotdata.models.dataset_source_one_of2 import DatasetSourceOneOf2 +from hotdata.models.dataset_source_one_of3 import DatasetSourceOneOf3 +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 from hotdata.models.dataset_summary import DatasetSummary from hotdata.models.dataset_version_summary import DatasetVersionSummary from hotdata.models.delete_sandbox_response import DeleteSandboxResponse diff --git a/hotdata/models/dataset_source.py b/hotdata/models/dataset_source.py index 744857b..4a3ecfb 100644 --- a/hotdata/models/dataset_source.py +++ b/hotdata/models/dataset_source.py @@ -18,33 +18,33 @@ import pprint from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from hotdata.models.inline_dataset_source import InlineDatasetSource -from hotdata.models.saved_query_dataset_source import SavedQueryDatasetSource -from hotdata.models.sql_query_dataset_source import SqlQueryDatasetSource -from hotdata.models.upload_dataset_source import UploadDatasetSource -from hotdata.models.url_dataset_source import UrlDatasetSource +from hotdata.models.dataset_source_one_of import DatasetSourceOneOf +from hotdata.models.dataset_source_one_of1 import DatasetSourceOneOf1 +from hotdata.models.dataset_source_one_of2 import DatasetSourceOneOf2 +from hotdata.models.dataset_source_one_of3 import DatasetSourceOneOf3 +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -DATASETSOURCE_ONE_OF_SCHEMAS = ["InlineDatasetSource", "SavedQueryDatasetSource", "SqlQueryDatasetSource", "UploadDatasetSource", "UrlDatasetSource"] +DATASETSOURCE_ONE_OF_SCHEMAS = ["DatasetSourceOneOf", "DatasetSourceOneOf1", "DatasetSourceOneOf2", "DatasetSourceOneOf3", "DatasetSourceOneOf4"] class DatasetSource(BaseModel): """ - Dataset source specification + Dataset source specification. Internally tagged on `type`, e.g. `{\"type\": \"upload\", \"upload_id\": \"...\"}`. Discriminator values: `upload`, `saved_query`, `sql_query`, `url`, `inline`. """ - # data type: UploadDatasetSource - oneof_schema_1_validator: Optional[UploadDatasetSource] = None - # data type: SavedQueryDatasetSource - oneof_schema_2_validator: Optional[SavedQueryDatasetSource] = None - # data type: SqlQueryDatasetSource - oneof_schema_3_validator: Optional[SqlQueryDatasetSource] = None - # data type: UrlDatasetSource - oneof_schema_4_validator: Optional[UrlDatasetSource] = None - # data type: InlineDatasetSource - oneof_schema_5_validator: Optional[InlineDatasetSource] = None - actual_instance: Optional[Union[InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource]] = None - one_of_schemas: Set[str] = { "InlineDatasetSource", "SavedQueryDatasetSource", "SqlQueryDatasetSource", "UploadDatasetSource", "UrlDatasetSource" } + # data type: DatasetSourceOneOf + oneof_schema_1_validator: Optional[DatasetSourceOneOf] = None + # data type: DatasetSourceOneOf1 + oneof_schema_2_validator: Optional[DatasetSourceOneOf1] = None + # data type: DatasetSourceOneOf2 + oneof_schema_3_validator: Optional[DatasetSourceOneOf2] = None + # data type: DatasetSourceOneOf3 + oneof_schema_4_validator: Optional[DatasetSourceOneOf3] = None + # data type: DatasetSourceOneOf4 + oneof_schema_5_validator: Optional[DatasetSourceOneOf4] = None + actual_instance: Optional[Union[DatasetSourceOneOf, DatasetSourceOneOf1, DatasetSourceOneOf2, DatasetSourceOneOf3, DatasetSourceOneOf4]] = None + one_of_schemas: Set[str] = { "DatasetSourceOneOf", "DatasetSourceOneOf1", "DatasetSourceOneOf2", "DatasetSourceOneOf3", "DatasetSourceOneOf4" } model_config = ConfigDict( validate_assignment=True, @@ -67,37 +67,37 @@ def actual_instance_must_validate_oneof(cls, v): instance = DatasetSource.model_construct() error_messages = [] match = 0 - # validate data type: UploadDatasetSource - if not isinstance(v, UploadDatasetSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `UploadDatasetSource`") + # validate data type: DatasetSourceOneOf + if not isinstance(v, DatasetSourceOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `DatasetSourceOneOf`") else: match += 1 - # validate data type: SavedQueryDatasetSource - if not isinstance(v, SavedQueryDatasetSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `SavedQueryDatasetSource`") + # validate data type: DatasetSourceOneOf1 + if not isinstance(v, DatasetSourceOneOf1): + error_messages.append(f"Error! Input type `{type(v)}` is not `DatasetSourceOneOf1`") else: match += 1 - # validate data type: SqlQueryDatasetSource - if not isinstance(v, SqlQueryDatasetSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `SqlQueryDatasetSource`") + # validate data type: DatasetSourceOneOf2 + if not isinstance(v, DatasetSourceOneOf2): + error_messages.append(f"Error! Input type `{type(v)}` is not `DatasetSourceOneOf2`") else: match += 1 - # validate data type: UrlDatasetSource - if not isinstance(v, UrlDatasetSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `UrlDatasetSource`") + # validate data type: DatasetSourceOneOf3 + if not isinstance(v, DatasetSourceOneOf3): + error_messages.append(f"Error! Input type `{type(v)}` is not `DatasetSourceOneOf3`") else: match += 1 - # validate data type: InlineDatasetSource - if not isinstance(v, InlineDatasetSource): - error_messages.append(f"Error! Input type `{type(v)}` is not `InlineDatasetSource`") + # validate data type: DatasetSourceOneOf4 + if not isinstance(v, DatasetSourceOneOf4): + error_messages.append(f"Error! Input type `{type(v)}` is not `DatasetSourceOneOf4`") else: match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in DatasetSource with oneOf schemas: DatasetSourceOneOf, DatasetSourceOneOf1, DatasetSourceOneOf2, DatasetSourceOneOf3, DatasetSourceOneOf4. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in DatasetSource with oneOf schemas: DatasetSourceOneOf, DatasetSourceOneOf1, DatasetSourceOneOf2, DatasetSourceOneOf3, DatasetSourceOneOf4. Details: " + ", ".join(error_messages)) else: return v @@ -112,43 +112,43 @@ def from_json(cls, json_str: str) -> Self: error_messages = [] match = 0 - # deserialize data into UploadDatasetSource + # deserialize data into DatasetSourceOneOf try: - instance.actual_instance = UploadDatasetSource.from_json(json_str) + instance.actual_instance = DatasetSourceOneOf.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into SavedQueryDatasetSource + # deserialize data into DatasetSourceOneOf1 try: - instance.actual_instance = SavedQueryDatasetSource.from_json(json_str) + instance.actual_instance = DatasetSourceOneOf1.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into SqlQueryDatasetSource + # deserialize data into DatasetSourceOneOf2 try: - instance.actual_instance = SqlQueryDatasetSource.from_json(json_str) + instance.actual_instance = DatasetSourceOneOf2.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into UrlDatasetSource + # deserialize data into DatasetSourceOneOf3 try: - instance.actual_instance = UrlDatasetSource.from_json(json_str) + instance.actual_instance = DatasetSourceOneOf3.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into InlineDatasetSource + # deserialize data into DatasetSourceOneOf4 try: - instance.actual_instance = InlineDatasetSource.from_json(json_str) + instance.actual_instance = DatasetSourceOneOf4.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into DatasetSource with oneOf schemas: DatasetSourceOneOf, DatasetSourceOneOf1, DatasetSourceOneOf2, DatasetSourceOneOf3, DatasetSourceOneOf4. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into DatasetSource with oneOf schemas: DatasetSourceOneOf, DatasetSourceOneOf1, DatasetSourceOneOf2, DatasetSourceOneOf3, DatasetSourceOneOf4. Details: " + ", ".join(error_messages)) else: return instance @@ -162,7 +162,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], DatasetSourceOneOf, DatasetSourceOneOf1, DatasetSourceOneOf2, DatasetSourceOneOf3, DatasetSourceOneOf4]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/hotdata/models/dataset_source_one_of.py b/hotdata/models/dataset_source_one_of.py index 95b0b9a..428883b 100644 --- a/hotdata/models/dataset_source_one_of.py +++ b/hotdata/models/dataset_source_one_of.py @@ -1,11 +1,12 @@ # coding: utf-8 """ - HotData API + 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 OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -17,20 +18,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from hotdata.models.column_definition import ColumnDefinition from typing import Optional, Set from typing_extensions import Self class DatasetSourceOneOf(BaseModel): """ - Create from a previously uploaded file + DatasetSourceOneOf """ # noqa: E501 - columns: Optional[Dict[str, ColumnDefinition]] = Field(default=None, description="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.") - format: Optional[Any] = None + columns: Optional[Dict[str, StrictStr]] = Field(default=None, description="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.") + format: Optional[StrictStr] = None upload_id: StrictStr - __properties: ClassVar[List[str]] = ["columns", "format", "upload_id"] + type: StrictStr + __properties: ClassVar[List[str]] = ["columns", "format", "upload_id", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['upload']): + raise ValueError("must be one of enum values ('upload')") + return value model_config = ConfigDict( populate_by_name=True, @@ -71,18 +79,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each value in columns (dict) - _field_dict = {} - if self.columns: - for _key_columns in self.columns: - if self.columns[_key_columns]: - _field_dict[_key_columns] = self.columns[_key_columns].to_dict() - _dict['columns'] = _field_dict - # set to None if format (nullable) is None - # and model_fields_set contains the field - if self.format is None and "format" in self.model_fields_set: - _dict['format'] = None - return _dict @classmethod @@ -95,14 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "columns": dict( - (_k, ColumnDefinition.from_dict(_v)) - for _k, _v in obj["columns"].items() - ) - if obj.get("columns") is not None - else None, + "columns": obj.get("columns"), "format": obj.get("format"), - "upload_id": obj.get("upload_id") + "upload_id": obj.get("upload_id"), + "type": obj.get("type") }) return _obj diff --git a/hotdata/models/dataset_source_one_of1.py b/hotdata/models/dataset_source_one_of1.py index 7230904..45fd516 100644 --- a/hotdata/models/dataset_source_one_of1.py +++ b/hotdata/models/dataset_source_one_of1.py @@ -1,11 +1,12 @@ # coding: utf-8 """ - HotData API + 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 OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -17,18 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hotdata.models.inline_data import InlineData +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self class DatasetSourceOneOf1(BaseModel): """ - Create from inline data (small payloads) + DatasetSourceOneOf1 """ # noqa: E501 - inline: InlineData - __properties: ClassVar[List[str]] = ["inline"] + saved_query_id: StrictStr + version: Optional[StrictInt] = None + type: StrictStr + __properties: ClassVar[List[str]] = ["saved_query_id", "version", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['saved_query']): + raise ValueError("must be one of enum values ('saved_query')") + return value model_config = ConfigDict( populate_by_name=True, @@ -69,9 +78,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of inline - if self.inline: - _dict['inline'] = self.inline.to_dict() return _dict @classmethod @@ -84,7 +90,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "inline": InlineData.from_dict(obj["inline"]) if obj.get("inline") is not None else None + "saved_query_id": obj.get("saved_query_id"), + "version": obj.get("version"), + "type": obj.get("type") }) return _obj diff --git a/hotdata/models/dataset_source_one_of2.py b/hotdata/models/dataset_source_one_of2.py new file mode 100644 index 0000000..c9227f2 --- /dev/null +++ b/hotdata/models/dataset_source_one_of2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DatasetSourceOneOf2(BaseModel): + """ + DatasetSourceOneOf2 + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="Optional description for the auto-created saved query.") + name: Optional[StrictStr] = Field(default=None, description="Optional name for the auto-created saved query. Defaults to the dataset label.") + sql: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["description", "name", "sql", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['sql_query']): + raise ValueError("must be one of enum values ('sql_query')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetSourceOneOf2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetSourceOneOf2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "name": obj.get("name"), + "sql": obj.get("sql"), + "type": obj.get("type") + }) + return _obj + + diff --git a/hotdata/models/dataset_source_one_of3.py b/hotdata/models/dataset_source_one_of3.py new file mode 100644 index 0000000..a21f03b --- /dev/null +++ b/hotdata/models/dataset_source_one_of3.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DatasetSourceOneOf3(BaseModel): + """ + DatasetSourceOneOf3 + """ # noqa: E501 + columns: Optional[Dict[str, StrictStr]] = Field(default=None, description="Optional explicit column definitions. Keys are column names, values are type specs.") + format: Optional[StrictStr] = None + url: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["columns", "format", "url", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['url']): + raise ValueError("must be one of enum values ('url')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetSourceOneOf3 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetSourceOneOf3 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "columns": obj.get("columns"), + "format": obj.get("format"), + "url": obj.get("url"), + "type": obj.get("type") + }) + return _obj + + diff --git a/hotdata/models/dataset_source_one_of4.py b/hotdata/models/dataset_source_one_of4.py new file mode 100644 index 0000000..463d298 --- /dev/null +++ b/hotdata/models/dataset_source_one_of4.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from hotdata.models.inline_data import InlineData +from typing import Optional, Set +from typing_extensions import Self + +class DatasetSourceOneOf4(BaseModel): + """ + DatasetSourceOneOf4 + """ # noqa: E501 + inline: InlineData + type: StrictStr + __properties: ClassVar[List[str]] = ["inline", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['inline']): + raise ValueError("must be one of enum values ('inline')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DatasetSourceOneOf4 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of inline + if self.inline: + _dict['inline'] = self.inline.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DatasetSourceOneOf4 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inline": InlineData.from_dict(obj["inline"]) if obj.get("inline") is not None else None, + "type": obj.get("type") + }) + return _obj + + diff --git a/hotdata/models/job_result.py b/hotdata/models/job_result.py index ec31472..15d2778 100644 --- a/hotdata/models/job_result.py +++ b/hotdata/models/job_result.py @@ -20,12 +20,13 @@ from typing import Any, List, Optional from hotdata.models.connection_refresh_result import ConnectionRefreshResult from hotdata.models.index_info_response import IndexInfoResponse +from hotdata.models.refresh_dataset_response import RefreshDatasetResponse from hotdata.models.table_refresh_result import TableRefreshResult from pydantic import StrictStr, Field from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -JOBRESULT_ONE_OF_SCHEMAS = ["ConnectionRefreshResult", "IndexInfoResponse", "TableRefreshResult"] +JOBRESULT_ONE_OF_SCHEMAS = ["ConnectionRefreshResult", "IndexInfoResponse", "RefreshDatasetResponse", "TableRefreshResult"] class JobResult(BaseModel): """ @@ -35,10 +36,12 @@ class JobResult(BaseModel): oneof_schema_1_validator: Optional[TableRefreshResult] = Field(default=None, description="Result of a single table data refresh.") # data type: ConnectionRefreshResult oneof_schema_2_validator: Optional[ConnectionRefreshResult] = Field(default=None, description="Result of a connection-wide data refresh.") + # data type: RefreshDatasetResponse + oneof_schema_3_validator: Optional[RefreshDatasetResponse] = Field(default=None, description="Result of a dataset refresh.") # data type: IndexInfoResponse - oneof_schema_3_validator: Optional[IndexInfoResponse] = Field(default=None, description="Result of an index creation.") - actual_instance: Optional[Union[ConnectionRefreshResult, IndexInfoResponse, TableRefreshResult]] = None - one_of_schemas: Set[str] = { "ConnectionRefreshResult", "IndexInfoResponse", "TableRefreshResult" } + oneof_schema_4_validator: Optional[IndexInfoResponse] = Field(default=None, description="Result of an index creation.") + actual_instance: Optional[Union[ConnectionRefreshResult, IndexInfoResponse, RefreshDatasetResponse, TableRefreshResult]] = None + one_of_schemas: Set[str] = { "ConnectionRefreshResult", "IndexInfoResponse", "RefreshDatasetResponse", "TableRefreshResult" } model_config = ConfigDict( validate_assignment=True, @@ -71,6 +74,11 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `ConnectionRefreshResult`") else: match += 1 + # validate data type: RefreshDatasetResponse + if not isinstance(v, RefreshDatasetResponse): + error_messages.append(f"Error! Input type `{type(v)}` is not `RefreshDatasetResponse`") + else: + match += 1 # validate data type: IndexInfoResponse if not isinstance(v, IndexInfoResponse): error_messages.append(f"Error! Input type `{type(v)}` is not `IndexInfoResponse`") @@ -78,10 +86,10 @@ def actual_instance_must_validate_oneof(cls, v): match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, RefreshDatasetResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, RefreshDatasetResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) else: return v @@ -108,6 +116,12 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into RefreshDatasetResponse + try: + instance.actual_instance = RefreshDatasetResponse.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) # deserialize data into IndexInfoResponse try: instance.actual_instance = IndexInfoResponse.from_json(json_str) @@ -117,10 +131,10 @@ def from_json(cls, json_str: str) -> Self: if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, RefreshDatasetResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into JobResult with oneOf schemas: ConnectionRefreshResult, IndexInfoResponse, RefreshDatasetResponse, TableRefreshResult. Details: " + ", ".join(error_messages)) else: return instance @@ -134,7 +148,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], ConnectionRefreshResult, IndexInfoResponse, TableRefreshResult]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], ConnectionRefreshResult, IndexInfoResponse, RefreshDatasetResponse, TableRefreshResult]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/hotdata/models/job_type.py b/hotdata/models/job_type.py index 7783b49..6ae7faa 100644 --- a/hotdata/models/job_type.py +++ b/hotdata/models/job_type.py @@ -30,6 +30,7 @@ class JobType(str, Enum): NOOP = 'noop' DATA_REFRESH_TABLE = 'data_refresh_table' DATA_REFRESH_CONNECTION = 'data_refresh_connection' + DATASET_REFRESH = 'dataset_refresh' CREATE_INDEX = 'create_index' @classmethod diff --git a/pyproject.toml b/pyproject.toml index 2af112b..d52bf27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "hotdata" version = "0.1.0" -description = "Official Python client for the Hotdata API" +description = "Hotdata API" authors = [ {name = "Hotdata",email = "developers@hotdata.dev"}, ] @@ -37,13 +37,6 @@ mypy = ">= 1.5" requires = ["setuptools"] build-backend = "setuptools.build_meta" -[tool.setuptools.packages.find] -include = ["hotdata*"] -exclude = ["test*", "tests*", "docs*"] - -[tool.setuptools.package-data] -hotdata = ["py.typed"] - [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" diff --git a/test/test_dataset_source_one_of2.py b/test/test_dataset_source_one_of2.py new file mode 100644 index 0000000..a5f701c --- /dev/null +++ b/test/test_dataset_source_one_of2.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hotdata.models.dataset_source_one_of2 import DatasetSourceOneOf2 + +class TestDatasetSourceOneOf2(unittest.TestCase): + """DatasetSourceOneOf2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DatasetSourceOneOf2: + """Test DatasetSourceOneOf2 + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DatasetSourceOneOf2` + """ + model = DatasetSourceOneOf2() + if include_optional: + return DatasetSourceOneOf2( + description = '', + name = '', + sql = '', + type = 'sql_query' + ) + else: + return DatasetSourceOneOf2( + sql = '', + type = 'sql_query', + ) + """ + + def testDatasetSourceOneOf2(self): + """Test DatasetSourceOneOf2""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_dataset_source_one_of3.py b/test/test_dataset_source_one_of3.py new file mode 100644 index 0000000..c59df74 --- /dev/null +++ b/test/test_dataset_source_one_of3.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hotdata.models.dataset_source_one_of3 import DatasetSourceOneOf3 + +class TestDatasetSourceOneOf3(unittest.TestCase): + """DatasetSourceOneOf3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DatasetSourceOneOf3: + """Test DatasetSourceOneOf3 + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DatasetSourceOneOf3` + """ + model = DatasetSourceOneOf3() + if include_optional: + return DatasetSourceOneOf3( + columns = { + 'key' : '' + }, + format = '', + url = '', + type = 'url' + ) + else: + return DatasetSourceOneOf3( + url = '', + type = 'url', + ) + """ + + def testDatasetSourceOneOf3(self): + """Test DatasetSourceOneOf3""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_dataset_source_one_of4.py b/test/test_dataset_source_one_of4.py new file mode 100644 index 0000000..2f7ef76 --- /dev/null +++ b/test/test_dataset_source_one_of4.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 + +class TestDatasetSourceOneOf4(unittest.TestCase): + """DatasetSourceOneOf4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DatasetSourceOneOf4: + """Test DatasetSourceOneOf4 + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DatasetSourceOneOf4` + """ + model = DatasetSourceOneOf4() + if include_optional: + return DatasetSourceOneOf4( + inline = hotdata.models.inline_data.InlineData( + columns = { + 'key' : '' + }, + content = '', + format = '', ), + type = 'inline' + ) + else: + return DatasetSourceOneOf4( + inline = hotdata.models.inline_data.InlineData( + columns = { + 'key' : '' + }, + content = '', + format = '', ), + type = 'inline', + ) + """ + + def testDatasetSourceOneOf4(self): + """Test DatasetSourceOneOf4""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/integration/test_dataset_versioning.py b/tests/integration/test_dataset_versioning.py index 681970f..a523003 100644 --- a/tests/integration/test_dataset_versioning.py +++ b/tests/integration/test_dataset_versioning.py @@ -10,15 +10,16 @@ from hotdata.exceptions import ApiException from hotdata.models.create_dataset_request import CreateDatasetRequest from hotdata.models.dataset_source import DatasetSource +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 from hotdata.models.inline_data import InlineData -from hotdata.models.inline_dataset_source import InlineDatasetSource from hotdata.models.update_dataset_request import UpdateDatasetRequest def _inline_csv_source() -> DatasetSource: return DatasetSource( - InlineDatasetSource( - inline=InlineData(content="a,b\n1,2\n3,4\n", format="csv") + DatasetSourceOneOf4( + type="inline", + inline=InlineData(content="a,b\n1,2\n3,4\n", format="csv"), ) ) diff --git a/tests/integration/test_datasets_crud.py b/tests/integration/test_datasets_crud.py index 98cab62..7563506 100644 --- a/tests/integration/test_datasets_crud.py +++ b/tests/integration/test_datasets_crud.py @@ -12,18 +12,19 @@ from hotdata.exceptions import ApiException from hotdata.models.create_dataset_request import CreateDatasetRequest from hotdata.models.dataset_source import DatasetSource +from hotdata.models.dataset_source_one_of4 import DatasetSourceOneOf4 from hotdata.models.inline_data import InlineData -from hotdata.models.inline_dataset_source import InlineDatasetSource from hotdata.models.update_dataset_request import UpdateDatasetRequest def _inline_csv_source() -> DatasetSource: return DatasetSource( - InlineDatasetSource( + DatasetSourceOneOf4( + type="inline", inline=InlineData( content="a,b\n1,2\n3,4\n", format="csv", - ) + ), ) )