hotdata 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. hotdata/__init__.py +300 -0
  2. hotdata/api/__init__.py +20 -0
  3. hotdata/api/connection_types_api.py +549 -0
  4. hotdata/api/connections_api.py +2213 -0
  5. hotdata/api/datasets_api.py +1711 -0
  6. hotdata/api/embedding_providers_api.py +1380 -0
  7. hotdata/api/indexes_api.py +977 -0
  8. hotdata/api/information_schema_api.py +390 -0
  9. hotdata/api/jobs_api.py +619 -0
  10. hotdata/api/query_api.py +320 -0
  11. hotdata/api/query_runs_api.py +615 -0
  12. hotdata/api/refresh_api.py +317 -0
  13. hotdata/api/results_api.py +581 -0
  14. hotdata/api/saved_queries_api.py +2003 -0
  15. hotdata/api/secrets_api.py +1380 -0
  16. hotdata/api/uploads_api.py +595 -0
  17. hotdata/api/workspace_context_api.py +828 -0
  18. hotdata/api/workspaces_api.py +602 -0
  19. hotdata/api_client.py +806 -0
  20. hotdata/api_response.py +21 -0
  21. hotdata/configuration.py +620 -0
  22. hotdata/exceptions.py +219 -0
  23. hotdata/models/__init__.py +125 -0
  24. hotdata/models/api_error_detail.py +90 -0
  25. hotdata/models/api_error_response.py +92 -0
  26. hotdata/models/async_query_response.py +99 -0
  27. hotdata/models/boolean_profile_detail.py +91 -0
  28. hotdata/models/categorical_profile_detail.py +96 -0
  29. hotdata/models/category_value_info.py +96 -0
  30. hotdata/models/column_definition.py +140 -0
  31. hotdata/models/column_info.py +92 -0
  32. hotdata/models/column_profile_detail.py +180 -0
  33. hotdata/models/column_profile_detail_one_of.py +105 -0
  34. hotdata/models/column_profile_detail_one_of1.py +102 -0
  35. hotdata/models/column_profile_detail_one_of2.py +101 -0
  36. hotdata/models/column_profile_detail_one_of3.py +99 -0
  37. hotdata/models/column_profile_detail_one_of4.py +100 -0
  38. hotdata/models/column_profile_info.py +108 -0
  39. hotdata/models/column_type_spec.py +117 -0
  40. hotdata/models/connection_health_response.py +100 -0
  41. hotdata/models/connection_info.py +92 -0
  42. hotdata/models/connection_refresh_result.py +117 -0
  43. hotdata/models/connection_schema_error.py +90 -0
  44. hotdata/models/connection_type_detail.py +104 -0
  45. hotdata/models/connection_type_summary.py +90 -0
  46. hotdata/models/create_connection_request.py +108 -0
  47. hotdata/models/create_connection_response.py +105 -0
  48. hotdata/models/create_dataset_request.py +101 -0
  49. hotdata/models/create_dataset_response.py +99 -0
  50. hotdata/models/create_embedding_provider_request.py +111 -0
  51. hotdata/models/create_embedding_provider_response.py +102 -0
  52. hotdata/models/create_index_request.py +130 -0
  53. hotdata/models/create_saved_query_request.py +104 -0
  54. hotdata/models/create_secret_request.py +90 -0
  55. hotdata/models/create_secret_response.py +93 -0
  56. hotdata/models/create_workspace201_response.py +93 -0
  57. hotdata/models/create_workspace_request.py +90 -0
  58. hotdata/models/create_workspace_response.py +94 -0
  59. hotdata/models/dataset_source.py +180 -0
  60. hotdata/models/dataset_source_one_of.py +109 -0
  61. hotdata/models/dataset_source_one_of1.py +91 -0
  62. hotdata/models/dataset_summary.py +108 -0
  63. hotdata/models/dataset_version_summary.py +95 -0
  64. hotdata/models/discovery_status.py +39 -0
  65. hotdata/models/embedding_provider_response.py +108 -0
  66. hotdata/models/error.py +88 -0
  67. hotdata/models/execute_saved_query_request.py +93 -0
  68. hotdata/models/get_connection_response.py +97 -0
  69. hotdata/models/get_dataset_response.py +120 -0
  70. hotdata/models/get_result_response.py +126 -0
  71. hotdata/models/get_secret_response.py +93 -0
  72. hotdata/models/get_workspace_context_response.py +92 -0
  73. hotdata/models/index_info_response.py +107 -0
  74. hotdata/models/index_status.py +38 -0
  75. hotdata/models/information_schema_response.py +110 -0
  76. hotdata/models/inline_data.py +92 -0
  77. hotdata/models/inline_dataset_source.py +92 -0
  78. hotdata/models/job_result.py +152 -0
  79. hotdata/models/job_status.py +41 -0
  80. hotdata/models/job_status_response.py +124 -0
  81. hotdata/models/job_type.py +40 -0
  82. hotdata/models/list_connection_types_response.py +96 -0
  83. hotdata/models/list_connections_response.py +96 -0
  84. hotdata/models/list_dataset_versions_response.py +107 -0
  85. hotdata/models/list_datasets_response.py +105 -0
  86. hotdata/models/list_embedding_providers_response.py +96 -0
  87. hotdata/models/list_indexes_response.py +96 -0
  88. hotdata/models/list_jobs_response.py +96 -0
  89. hotdata/models/list_query_runs_response.py +110 -0
  90. hotdata/models/list_results_response.py +105 -0
  91. hotdata/models/list_saved_queries_response.py +105 -0
  92. hotdata/models/list_saved_query_versions_response.py +107 -0
  93. hotdata/models/list_secrets_response.py +96 -0
  94. hotdata/models/list_uploads_response.py +96 -0
  95. hotdata/models/list_workspace_contexts_response.py +96 -0
  96. hotdata/models/list_workspaces200_response.py +97 -0
  97. hotdata/models/list_workspaces_response.py +98 -0
  98. hotdata/models/numeric_profile_detail.py +92 -0
  99. hotdata/models/query_request.py +98 -0
  100. hotdata/models/query_response.py +113 -0
  101. hotdata/models/query_run_info.py +176 -0
  102. hotdata/models/refresh_dataset_response.py +95 -0
  103. hotdata/models/refresh_request.py +120 -0
  104. hotdata/models/refresh_response.py +180 -0
  105. hotdata/models/refresh_warning.py +102 -0
  106. hotdata/models/result_info.py +100 -0
  107. hotdata/models/saved_query_dataset_source.py +95 -0
  108. hotdata/models/saved_query_detail.py +168 -0
  109. hotdata/models/saved_query_summary.py +101 -0
  110. hotdata/models/saved_query_version_info.py +158 -0
  111. hotdata/models/schema_refresh_result.py +107 -0
  112. hotdata/models/secret_metadata_response.py +93 -0
  113. hotdata/models/sql_query_dataset_source.py +102 -0
  114. hotdata/models/submit_job_response.py +93 -0
  115. hotdata/models/table_info.py +116 -0
  116. hotdata/models/table_profile_response.py +112 -0
  117. hotdata/models/table_refresh_error.py +92 -0
  118. hotdata/models/table_refresh_result.py +107 -0
  119. hotdata/models/temporal_profile_detail.py +90 -0
  120. hotdata/models/text_profile_detail.py +93 -0
  121. hotdata/models/update_dataset_request.py +107 -0
  122. hotdata/models/update_dataset_response.py +104 -0
  123. hotdata/models/update_embedding_provider_request.py +114 -0
  124. hotdata/models/update_embedding_provider_response.py +93 -0
  125. hotdata/models/update_saved_query_request.py +128 -0
  126. hotdata/models/update_secret_request.py +88 -0
  127. hotdata/models/update_secret_response.py +91 -0
  128. hotdata/models/upload_dataset_source.py +97 -0
  129. hotdata/models/upload_info.py +102 -0
  130. hotdata/models/upload_response.py +102 -0
  131. hotdata/models/upsert_workspace_context_request.py +90 -0
  132. hotdata/models/upsert_workspace_context_response.py +92 -0
  133. hotdata/models/url_dataset_source.py +97 -0
  134. hotdata/models/workspace_context_entry.py +93 -0
  135. hotdata/models/workspace_detail.py +94 -0
  136. hotdata/models/workspace_list_item.py +98 -0
  137. hotdata/py.typed +0 -0
  138. hotdata/rest.py +264 -0
  139. hotdata-0.0.1.dist-info/METADATA +93 -0
  140. hotdata-0.0.1.dist-info/RECORD +142 -0
  141. hotdata-0.0.1.dist-info/WHEEL +5 -0
  142. hotdata-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ HotData API
5
+
6
+ Powerful data platform API for datasets, queries, and analytics.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictBool
21
+ from typing import Any, ClassVar, Dict, List
22
+ from hotdata.models.workspace_detail import WorkspaceDetail
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateWorkspace201Response(BaseModel):
27
+ """
28
+ CreateWorkspace201Response
29
+ """ # noqa: E501
30
+ ok: StrictBool
31
+ workspace: WorkspaceDetail
32
+ __properties: ClassVar[List[str]] = ["ok", "workspace"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CreateWorkspace201Response from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of workspace
74
+ if self.workspace:
75
+ _dict['workspace'] = self.workspace.to_dict()
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of CreateWorkspace201Response from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "ok": obj.get("ok"),
89
+ "workspace": WorkspaceDetail.from_dict(obj["workspace"]) if obj.get("workspace") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,90 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hotdata API
5
+
6
+ Powerful data platform API for datasets, queries, and analytics.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: developers@hotdata.dev
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateWorkspaceRequest(BaseModel):
27
+ """
28
+ CreateWorkspaceRequest
29
+ """ # noqa: E501
30
+ name: StrictStr = Field(description="Name for the new workspace.")
31
+ organization_public_id: Optional[StrictStr] = Field(default=None, description="Target organization. Defaults to the user's current organization.")
32
+ __properties: ClassVar[List[str]] = ["name", "organization_public_id"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CreateWorkspaceRequest from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of CreateWorkspaceRequest from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "name": obj.get("name"),
86
+ "organization_public_id": obj.get("organization_public_id")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hotdata API
5
+
6
+ Powerful data platform API for datasets, queries, and analytics.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: developers@hotdata.dev
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictBool
22
+ from typing import Any, ClassVar, Dict, List
23
+ from hotdata.models.workspace_detail import WorkspaceDetail
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CreateWorkspaceResponse(BaseModel):
28
+ """
29
+ CreateWorkspaceResponse
30
+ """ # noqa: E501
31
+ ok: StrictBool
32
+ workspace: WorkspaceDetail
33
+ __properties: ClassVar[List[str]] = ["ok", "workspace"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of CreateWorkspaceResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of workspace
75
+ if self.workspace:
76
+ _dict['workspace'] = self.workspace.to_dict()
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of CreateWorkspaceResponse from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "ok": obj.get("ok"),
90
+ "workspace": WorkspaceDetail.from_dict(obj["workspace"]) if obj.get("workspace") is not None else None
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,180 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hotdata API
5
+
6
+ Powerful data platform API for datasets, queries, and analytics.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: developers@hotdata.dev
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import json
18
+ import pprint
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
+ from typing import Any, List, Optional
21
+ from hotdata.models.inline_dataset_source import InlineDatasetSource
22
+ from hotdata.models.saved_query_dataset_source import SavedQueryDatasetSource
23
+ from hotdata.models.sql_query_dataset_source import SqlQueryDatasetSource
24
+ from hotdata.models.upload_dataset_source import UploadDatasetSource
25
+ from hotdata.models.url_dataset_source import UrlDatasetSource
26
+ from pydantic import StrictStr, Field
27
+ from typing import Union, List, Set, Optional, Dict
28
+ from typing_extensions import Literal, Self
29
+
30
+ DATASETSOURCE_ONE_OF_SCHEMAS = ["InlineDatasetSource", "SavedQueryDatasetSource", "SqlQueryDatasetSource", "UploadDatasetSource", "UrlDatasetSource"]
31
+
32
+ class DatasetSource(BaseModel):
33
+ """
34
+ Dataset source specification
35
+ """
36
+ # data type: UploadDatasetSource
37
+ oneof_schema_1_validator: Optional[UploadDatasetSource] = None
38
+ # data type: SavedQueryDatasetSource
39
+ oneof_schema_2_validator: Optional[SavedQueryDatasetSource] = None
40
+ # data type: SqlQueryDatasetSource
41
+ oneof_schema_3_validator: Optional[SqlQueryDatasetSource] = None
42
+ # data type: UrlDatasetSource
43
+ oneof_schema_4_validator: Optional[UrlDatasetSource] = None
44
+ # data type: InlineDatasetSource
45
+ oneof_schema_5_validator: Optional[InlineDatasetSource] = None
46
+ actual_instance: Optional[Union[InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource]] = None
47
+ one_of_schemas: Set[str] = { "InlineDatasetSource", "SavedQueryDatasetSource", "SqlQueryDatasetSource", "UploadDatasetSource", "UrlDatasetSource" }
48
+
49
+ model_config = ConfigDict(
50
+ validate_assignment=True,
51
+ protected_namespaces=(),
52
+ )
53
+
54
+
55
+ def __init__(self, *args, **kwargs) -> None:
56
+ if args:
57
+ if len(args) > 1:
58
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
59
+ if kwargs:
60
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
61
+ super().__init__(actual_instance=args[0])
62
+ else:
63
+ super().__init__(**kwargs)
64
+
65
+ @field_validator('actual_instance')
66
+ def actual_instance_must_validate_oneof(cls, v):
67
+ instance = DatasetSource.model_construct()
68
+ error_messages = []
69
+ match = 0
70
+ # validate data type: UploadDatasetSource
71
+ if not isinstance(v, UploadDatasetSource):
72
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UploadDatasetSource`")
73
+ else:
74
+ match += 1
75
+ # validate data type: SavedQueryDatasetSource
76
+ if not isinstance(v, SavedQueryDatasetSource):
77
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SavedQueryDatasetSource`")
78
+ else:
79
+ match += 1
80
+ # validate data type: SqlQueryDatasetSource
81
+ if not isinstance(v, SqlQueryDatasetSource):
82
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SqlQueryDatasetSource`")
83
+ else:
84
+ match += 1
85
+ # validate data type: UrlDatasetSource
86
+ if not isinstance(v, UrlDatasetSource):
87
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UrlDatasetSource`")
88
+ else:
89
+ match += 1
90
+ # validate data type: InlineDatasetSource
91
+ if not isinstance(v, InlineDatasetSource):
92
+ error_messages.append(f"Error! Input type `{type(v)}` is not `InlineDatasetSource`")
93
+ else:
94
+ match += 1
95
+ if match > 1:
96
+ # more than 1 match
97
+ raise ValueError("Multiple matches found when setting `actual_instance` in DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages))
98
+ elif match == 0:
99
+ # no match
100
+ raise ValueError("No match found when setting `actual_instance` in DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages))
101
+ else:
102
+ return v
103
+
104
+ @classmethod
105
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
106
+ return cls.from_json(json.dumps(obj))
107
+
108
+ @classmethod
109
+ def from_json(cls, json_str: str) -> Self:
110
+ """Returns the object represented by the json string"""
111
+ instance = cls.model_construct()
112
+ error_messages = []
113
+ match = 0
114
+
115
+ # deserialize data into UploadDatasetSource
116
+ try:
117
+ instance.actual_instance = UploadDatasetSource.from_json(json_str)
118
+ match += 1
119
+ except (ValidationError, ValueError) as e:
120
+ error_messages.append(str(e))
121
+ # deserialize data into SavedQueryDatasetSource
122
+ try:
123
+ instance.actual_instance = SavedQueryDatasetSource.from_json(json_str)
124
+ match += 1
125
+ except (ValidationError, ValueError) as e:
126
+ error_messages.append(str(e))
127
+ # deserialize data into SqlQueryDatasetSource
128
+ try:
129
+ instance.actual_instance = SqlQueryDatasetSource.from_json(json_str)
130
+ match += 1
131
+ except (ValidationError, ValueError) as e:
132
+ error_messages.append(str(e))
133
+ # deserialize data into UrlDatasetSource
134
+ try:
135
+ instance.actual_instance = UrlDatasetSource.from_json(json_str)
136
+ match += 1
137
+ except (ValidationError, ValueError) as e:
138
+ error_messages.append(str(e))
139
+ # deserialize data into InlineDatasetSource
140
+ try:
141
+ instance.actual_instance = InlineDatasetSource.from_json(json_str)
142
+ match += 1
143
+ except (ValidationError, ValueError) as e:
144
+ error_messages.append(str(e))
145
+
146
+ if match > 1:
147
+ # more than 1 match
148
+ raise ValueError("Multiple matches found when deserializing the JSON string into DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages))
149
+ elif match == 0:
150
+ # no match
151
+ raise ValueError("No match found when deserializing the JSON string into DatasetSource with oneOf schemas: InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource. Details: " + ", ".join(error_messages))
152
+ else:
153
+ return instance
154
+
155
+ def to_json(self) -> str:
156
+ """Returns the JSON representation of the actual instance"""
157
+ if self.actual_instance is None:
158
+ return "null"
159
+
160
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
161
+ return self.actual_instance.to_json()
162
+ else:
163
+ return json.dumps(self.actual_instance)
164
+
165
+ def to_dict(self) -> Optional[Union[Dict[str, Any], InlineDatasetSource, SavedQueryDatasetSource, SqlQueryDatasetSource, UploadDatasetSource, UrlDatasetSource]]:
166
+ """Returns the dict representation of the actual instance"""
167
+ if self.actual_instance is None:
168
+ return None
169
+
170
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
171
+ return self.actual_instance.to_dict()
172
+ else:
173
+ # primitive type
174
+ return self.actual_instance
175
+
176
+ def to_str(self) -> str:
177
+ """Returns the string representation of the actual instance"""
178
+ return pprint.pformat(self.model_dump())
179
+
180
+
@@ -0,0 +1,109 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ HotData API
5
+
6
+ Powerful data platform API for datasets, queries, and analytics.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from hotdata.models.column_definition import ColumnDefinition
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DatasetSourceOneOf(BaseModel):
27
+ """
28
+ Create from a previously uploaded file
29
+ """ # noqa: E501
30
+ 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.")
31
+ format: Optional[Any] = None
32
+ upload_id: StrictStr
33
+ __properties: ClassVar[List[str]] = ["columns", "format", "upload_id"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of DatasetSourceOneOf from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each value in columns (dict)
75
+ _field_dict = {}
76
+ if self.columns:
77
+ for _key_columns in self.columns:
78
+ if self.columns[_key_columns]:
79
+ _field_dict[_key_columns] = self.columns[_key_columns].to_dict()
80
+ _dict['columns'] = _field_dict
81
+ # set to None if format (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.format is None and "format" in self.model_fields_set:
84
+ _dict['format'] = None
85
+
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of DatasetSourceOneOf from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate({
98
+ "columns": dict(
99
+ (_k, ColumnDefinition.from_dict(_v))
100
+ for _k, _v in obj["columns"].items()
101
+ )
102
+ if obj.get("columns") is not None
103
+ else None,
104
+ "format": obj.get("format"),
105
+ "upload_id": obj.get("upload_id")
106
+ })
107
+ return _obj
108
+
109
+
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ HotData API
5
+
6
+ Powerful data platform API for datasets, queries, and analytics.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from hotdata.models.inline_data import InlineData
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DatasetSourceOneOf1(BaseModel):
27
+ """
28
+ Create from inline data (small payloads)
29
+ """ # noqa: E501
30
+ inline: InlineData
31
+ __properties: ClassVar[List[str]] = ["inline"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of DatasetSourceOneOf1 from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of inline
73
+ if self.inline:
74
+ _dict['inline'] = self.inline.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of DatasetSourceOneOf1 from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "inline": InlineData.from_dict(obj["inline"]) if obj.get("inline") is not None else None
88
+ })
89
+ return _obj
90
+
91
+