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
hotdata/exceptions.py ADDED
@@ -0,0 +1,219 @@
1
+ """
2
+ Hotdata API
3
+
4
+ Powerful data platform API for datasets, queries, and analytics.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: developers@hotdata.dev
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+
14
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+ class OpenApiException(Exception):
18
+ """The base exception class for all OpenAPIExceptions"""
19
+
20
+
21
+ class ApiTypeError(OpenApiException, TypeError):
22
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
23
+ key_type=None) -> None:
24
+ """ Raises an exception for TypeErrors
25
+
26
+ Args:
27
+ msg (str): the exception message
28
+
29
+ Keyword Args:
30
+ path_to_item (list): a list of keys an indices to get to the
31
+ current_item
32
+ None if unset
33
+ valid_classes (tuple): the primitive classes that current item
34
+ should be an instance of
35
+ None if unset
36
+ key_type (bool): False if our value is a value in a dict
37
+ True if it is a key in a dict
38
+ False if our item is an item in a list
39
+ None if unset
40
+ """
41
+ self.path_to_item = path_to_item
42
+ self.valid_classes = valid_classes
43
+ self.key_type = key_type
44
+ full_msg = msg
45
+ if path_to_item:
46
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
47
+ super(ApiTypeError, self).__init__(full_msg)
48
+
49
+
50
+ class ApiValueError(OpenApiException, ValueError):
51
+ def __init__(self, msg, path_to_item=None) -> None:
52
+ """
53
+ Args:
54
+ msg (str): the exception message
55
+
56
+ Keyword Args:
57
+ path_to_item (list) the path to the exception in the
58
+ received_data dict. None if unset
59
+ """
60
+
61
+ self.path_to_item = path_to_item
62
+ full_msg = msg
63
+ if path_to_item:
64
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
65
+ super(ApiValueError, self).__init__(full_msg)
66
+
67
+
68
+ class ApiAttributeError(OpenApiException, AttributeError):
69
+ def __init__(self, msg, path_to_item=None) -> None:
70
+ """
71
+ Raised when an attribute reference or assignment fails.
72
+
73
+ Args:
74
+ msg (str): the exception message
75
+
76
+ Keyword Args:
77
+ path_to_item (None/list) the path to the exception in the
78
+ received_data dict
79
+ """
80
+ self.path_to_item = path_to_item
81
+ full_msg = msg
82
+ if path_to_item:
83
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
84
+ super(ApiAttributeError, self).__init__(full_msg)
85
+
86
+
87
+ class ApiKeyError(OpenApiException, KeyError):
88
+ def __init__(self, msg, path_to_item=None) -> None:
89
+ """
90
+ Args:
91
+ msg (str): the exception message
92
+
93
+ Keyword Args:
94
+ path_to_item (None/list) the path to the exception in the
95
+ received_data dict
96
+ """
97
+ self.path_to_item = path_to_item
98
+ full_msg = msg
99
+ if path_to_item:
100
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
101
+ super(ApiKeyError, self).__init__(full_msg)
102
+
103
+
104
+ class ApiException(OpenApiException):
105
+
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
121
+ if http_resp:
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
131
+ self.headers = http_resp.headers
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ # Added new conditions for 409 and 422
154
+ if http_resp.status == 409:
155
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
156
+
157
+ if http_resp.status == 422:
158
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
159
+
160
+ if 500 <= http_resp.status <= 599:
161
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
162
+ raise ApiException(http_resp=http_resp, body=body, data=data)
163
+
164
+ def __str__(self):
165
+ """Custom error messages for exception"""
166
+ error_message = "({0})\n"\
167
+ "Reason: {1}\n".format(self.status, self.reason)
168
+ if self.headers:
169
+ error_message += "HTTP response headers: {0}\n".format(
170
+ self.headers)
171
+
172
+ if self.body:
173
+ error_message += "HTTP response body: {0}\n".format(self.body)
174
+
175
+ if self.data:
176
+ error_message += "HTTP response data: {0}\n".format(self.data)
177
+
178
+ return error_message
179
+
180
+
181
+ class BadRequestException(ApiException):
182
+ pass
183
+
184
+
185
+ class NotFoundException(ApiException):
186
+ pass
187
+
188
+
189
+ class UnauthorizedException(ApiException):
190
+ pass
191
+
192
+
193
+ class ForbiddenException(ApiException):
194
+ pass
195
+
196
+
197
+ class ServiceException(ApiException):
198
+ pass
199
+
200
+
201
+ class ConflictException(ApiException):
202
+ """Exception for HTTP 409 Conflict."""
203
+ pass
204
+
205
+
206
+ class UnprocessableEntityException(ApiException):
207
+ """Exception for HTTP 422 Unprocessable Entity."""
208
+ pass
209
+
210
+
211
+ def render_path(path_to_item):
212
+ """Returns a string representation of a path"""
213
+ result = ""
214
+ for pth in path_to_item:
215
+ if isinstance(pth, int):
216
+ result += "[{0}]".format(pth)
217
+ else:
218
+ result += "['{0}']".format(pth)
219
+ return result
@@ -0,0 +1,125 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Hotdata API
6
+
7
+ Powerful data platform API for datasets, queries, and analytics.
8
+
9
+ The version of the OpenAPI document: 1.0.0
10
+ Contact: developers@hotdata.dev
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+ # import models into model package
17
+ from hotdata.models.api_error_detail import ApiErrorDetail
18
+ from hotdata.models.api_error_response import ApiErrorResponse
19
+ from hotdata.models.async_query_response import AsyncQueryResponse
20
+ from hotdata.models.boolean_profile_detail import BooleanProfileDetail
21
+ from hotdata.models.categorical_profile_detail import CategoricalProfileDetail
22
+ from hotdata.models.category_value_info import CategoryValueInfo
23
+ from hotdata.models.column_info import ColumnInfo
24
+ from hotdata.models.column_profile_detail import ColumnProfileDetail
25
+ from hotdata.models.column_profile_detail_one_of import ColumnProfileDetailOneOf
26
+ from hotdata.models.column_profile_detail_one_of1 import ColumnProfileDetailOneOf1
27
+ from hotdata.models.column_profile_detail_one_of2 import ColumnProfileDetailOneOf2
28
+ from hotdata.models.column_profile_detail_one_of3 import ColumnProfileDetailOneOf3
29
+ from hotdata.models.column_profile_detail_one_of4 import ColumnProfileDetailOneOf4
30
+ from hotdata.models.column_profile_info import ColumnProfileInfo
31
+ from hotdata.models.column_type_spec import ColumnTypeSpec
32
+ from hotdata.models.connection_health_response import ConnectionHealthResponse
33
+ from hotdata.models.connection_info import ConnectionInfo
34
+ from hotdata.models.connection_refresh_result import ConnectionRefreshResult
35
+ from hotdata.models.connection_schema_error import ConnectionSchemaError
36
+ from hotdata.models.connection_type_detail import ConnectionTypeDetail
37
+ from hotdata.models.connection_type_summary import ConnectionTypeSummary
38
+ from hotdata.models.create_connection_request import CreateConnectionRequest
39
+ from hotdata.models.create_connection_response import CreateConnectionResponse
40
+ from hotdata.models.create_dataset_request import CreateDatasetRequest
41
+ from hotdata.models.create_dataset_response import CreateDatasetResponse
42
+ from hotdata.models.create_embedding_provider_request import CreateEmbeddingProviderRequest
43
+ from hotdata.models.create_embedding_provider_response import CreateEmbeddingProviderResponse
44
+ from hotdata.models.create_index_request import CreateIndexRequest
45
+ from hotdata.models.create_saved_query_request import CreateSavedQueryRequest
46
+ from hotdata.models.create_secret_request import CreateSecretRequest
47
+ from hotdata.models.create_secret_response import CreateSecretResponse
48
+ from hotdata.models.create_workspace_request import CreateWorkspaceRequest
49
+ from hotdata.models.create_workspace_response import CreateWorkspaceResponse
50
+ from hotdata.models.dataset_source import DatasetSource
51
+ from hotdata.models.dataset_summary import DatasetSummary
52
+ from hotdata.models.dataset_version_summary import DatasetVersionSummary
53
+ from hotdata.models.discovery_status import DiscoveryStatus
54
+ from hotdata.models.embedding_provider_response import EmbeddingProviderResponse
55
+ from hotdata.models.error import Error
56
+ from hotdata.models.execute_saved_query_request import ExecuteSavedQueryRequest
57
+ from hotdata.models.get_connection_response import GetConnectionResponse
58
+ from hotdata.models.get_dataset_response import GetDatasetResponse
59
+ from hotdata.models.get_result_response import GetResultResponse
60
+ from hotdata.models.get_secret_response import GetSecretResponse
61
+ from hotdata.models.get_workspace_context_response import GetWorkspaceContextResponse
62
+ from hotdata.models.index_info_response import IndexInfoResponse
63
+ from hotdata.models.index_status import IndexStatus
64
+ from hotdata.models.information_schema_response import InformationSchemaResponse
65
+ from hotdata.models.inline_data import InlineData
66
+ from hotdata.models.inline_dataset_source import InlineDatasetSource
67
+ from hotdata.models.job_result import JobResult
68
+ from hotdata.models.job_status import JobStatus
69
+ from hotdata.models.job_status_response import JobStatusResponse
70
+ from hotdata.models.job_type import JobType
71
+ from hotdata.models.list_connection_types_response import ListConnectionTypesResponse
72
+ from hotdata.models.list_connections_response import ListConnectionsResponse
73
+ from hotdata.models.list_dataset_versions_response import ListDatasetVersionsResponse
74
+ from hotdata.models.list_datasets_response import ListDatasetsResponse
75
+ from hotdata.models.list_embedding_providers_response import ListEmbeddingProvidersResponse
76
+ from hotdata.models.list_indexes_response import ListIndexesResponse
77
+ from hotdata.models.list_jobs_response import ListJobsResponse
78
+ from hotdata.models.list_query_runs_response import ListQueryRunsResponse
79
+ from hotdata.models.list_results_response import ListResultsResponse
80
+ from hotdata.models.list_saved_queries_response import ListSavedQueriesResponse
81
+ from hotdata.models.list_saved_query_versions_response import ListSavedQueryVersionsResponse
82
+ from hotdata.models.list_secrets_response import ListSecretsResponse
83
+ from hotdata.models.list_uploads_response import ListUploadsResponse
84
+ from hotdata.models.list_workspace_contexts_response import ListWorkspaceContextsResponse
85
+ from hotdata.models.list_workspaces_response import ListWorkspacesResponse
86
+ from hotdata.models.numeric_profile_detail import NumericProfileDetail
87
+ from hotdata.models.query_request import QueryRequest
88
+ from hotdata.models.query_response import QueryResponse
89
+ from hotdata.models.query_run_info import QueryRunInfo
90
+ from hotdata.models.refresh_dataset_response import RefreshDatasetResponse
91
+ from hotdata.models.refresh_request import RefreshRequest
92
+ from hotdata.models.refresh_response import RefreshResponse
93
+ from hotdata.models.refresh_warning import RefreshWarning
94
+ from hotdata.models.result_info import ResultInfo
95
+ from hotdata.models.saved_query_dataset_source import SavedQueryDatasetSource
96
+ from hotdata.models.saved_query_detail import SavedQueryDetail
97
+ from hotdata.models.saved_query_summary import SavedQuerySummary
98
+ from hotdata.models.saved_query_version_info import SavedQueryVersionInfo
99
+ from hotdata.models.schema_refresh_result import SchemaRefreshResult
100
+ from hotdata.models.secret_metadata_response import SecretMetadataResponse
101
+ from hotdata.models.sql_query_dataset_source import SqlQueryDatasetSource
102
+ from hotdata.models.submit_job_response import SubmitJobResponse
103
+ from hotdata.models.table_info import TableInfo
104
+ from hotdata.models.table_profile_response import TableProfileResponse
105
+ from hotdata.models.table_refresh_error import TableRefreshError
106
+ from hotdata.models.table_refresh_result import TableRefreshResult
107
+ from hotdata.models.temporal_profile_detail import TemporalProfileDetail
108
+ from hotdata.models.text_profile_detail import TextProfileDetail
109
+ from hotdata.models.update_dataset_request import UpdateDatasetRequest
110
+ from hotdata.models.update_dataset_response import UpdateDatasetResponse
111
+ from hotdata.models.update_embedding_provider_request import UpdateEmbeddingProviderRequest
112
+ from hotdata.models.update_embedding_provider_response import UpdateEmbeddingProviderResponse
113
+ from hotdata.models.update_saved_query_request import UpdateSavedQueryRequest
114
+ from hotdata.models.update_secret_request import UpdateSecretRequest
115
+ from hotdata.models.update_secret_response import UpdateSecretResponse
116
+ from hotdata.models.upload_dataset_source import UploadDatasetSource
117
+ from hotdata.models.upload_info import UploadInfo
118
+ from hotdata.models.upload_response import UploadResponse
119
+ from hotdata.models.upsert_workspace_context_request import UpsertWorkspaceContextRequest
120
+ from hotdata.models.upsert_workspace_context_response import UpsertWorkspaceContextResponse
121
+ from hotdata.models.url_dataset_source import UrlDatasetSource
122
+ from hotdata.models.workspace_context_entry import WorkspaceContextEntry
123
+ from hotdata.models.workspace_detail import WorkspaceDetail
124
+ from hotdata.models.workspace_list_item import WorkspaceListItem
125
+
@@ -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, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ApiErrorDetail(BaseModel):
27
+ """
28
+ Error detail within an API error response
29
+ """ # noqa: E501
30
+ code: StrictStr
31
+ message: StrictStr
32
+ __properties: ClassVar[List[str]] = ["code", "message"]
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 ApiErrorDetail 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 ApiErrorDetail 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
+ "code": obj.get("code"),
86
+ "message": obj.get("message")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,92 @@
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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from hotdata.models.api_error_detail import ApiErrorDetail
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class ApiErrorResponse(BaseModel):
28
+ """
29
+ Standard error response body
30
+ """ # noqa: E501
31
+ error: ApiErrorDetail
32
+ __properties: ClassVar[List[str]] = ["error"]
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 ApiErrorResponse 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 error
74
+ if self.error:
75
+ _dict['error'] = self.error.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 ApiErrorResponse 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
+ "error": ApiErrorDetail.from_dict(obj["error"]) if obj.get("error") is not None else None
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,99 @@
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 AsyncQueryResponse(BaseModel):
27
+ """
28
+ Response returned when a query is submitted asynchronously (202 Accepted). Poll GET /query-runs/{id} to track progress. Once status is \"succeeded\", retrieve results via GET /results/{result_id}.
29
+ """ # noqa: E501
30
+ query_run_id: StrictStr = Field(description="Unique identifier for the query run.")
31
+ reason: Optional[StrictStr] = Field(default=None, description="Human-readable reason why the query went async (e.g., caching tables for the first time).")
32
+ status: StrictStr = Field(description="Current status of the query run.")
33
+ status_url: StrictStr = Field(description="URL to poll for query run status.")
34
+ __properties: ClassVar[List[str]] = ["query_run_id", "reason", "status", "status_url"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of AsyncQueryResponse from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # set to None if reason (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.reason is None and "reason" in self.model_fields_set:
78
+ _dict['reason'] = None
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of AsyncQueryResponse from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "query_run_id": obj.get("query_run_id"),
93
+ "reason": obj.get("reason"),
94
+ "status": obj.get("status"),
95
+ "status_url": obj.get("status_url")
96
+ })
97
+ return _obj
98
+
99
+