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,100 @@
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 datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class ResultInfo(BaseModel):
28
+ """
29
+ Summary of a persisted query result for listing
30
+ """ # noqa: E501
31
+ created_at: datetime
32
+ error_message: Optional[StrictStr] = None
33
+ id: StrictStr
34
+ status: StrictStr
35
+ __properties: ClassVar[List[str]] = ["created_at", "error_message", "id", "status"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of ResultInfo from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # set to None if error_message (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.error_message is None and "error_message" in self.model_fields_set:
79
+ _dict['error_message'] = None
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ResultInfo from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "created_at": obj.get("created_at"),
94
+ "error_message": obj.get("error_message"),
95
+ "id": obj.get("id"),
96
+ "status": obj.get("status")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,95 @@
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, StrictInt, 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 SavedQueryDatasetSource(BaseModel):
27
+ """
28
+ Create dataset from a saved query result
29
+ """ # noqa: E501
30
+ saved_query_id: StrictStr
31
+ version: Optional[StrictInt] = None
32
+ __properties: ClassVar[List[str]] = ["saved_query_id", "version"]
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 SavedQueryDatasetSource 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
+ # set to None if version (nullable) is None
74
+ # and model_fields_set contains the field
75
+ if self.version is None and "version" in self.model_fields_set:
76
+ _dict['version'] = None
77
+
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of SavedQueryDatasetSource from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "saved_query_id": obj.get("saved_query_id"),
91
+ "version": obj.get("version")
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,168 @@
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 datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class SavedQueryDetail(BaseModel):
28
+ """
29
+ Saved query detail (includes latest version's SQL)
30
+ """ # noqa: E501
31
+ category: Optional[StrictStr] = None
32
+ created_at: datetime
33
+ description: StrictStr
34
+ has_aggregation: Optional[StrictBool] = None
35
+ has_group_by: Optional[StrictBool] = None
36
+ has_join: Optional[StrictBool] = None
37
+ has_limit: Optional[StrictBool] = None
38
+ has_order_by: Optional[StrictBool] = None
39
+ has_predicate: Optional[StrictBool] = None
40
+ id: StrictStr
41
+ latest_version: StrictInt
42
+ name: StrictStr
43
+ num_tables: Optional[StrictInt] = None
44
+ sql: StrictStr
45
+ sql_hash: StrictStr
46
+ table_size: Optional[StrictStr] = None
47
+ tags: List[StrictStr]
48
+ updated_at: datetime
49
+ __properties: ClassVar[List[str]] = ["category", "created_at", "description", "has_aggregation", "has_group_by", "has_join", "has_limit", "has_order_by", "has_predicate", "id", "latest_version", "name", "num_tables", "sql", "sql_hash", "table_size", "tags", "updated_at"]
50
+
51
+ model_config = ConfigDict(
52
+ populate_by_name=True,
53
+ validate_assignment=True,
54
+ protected_namespaces=(),
55
+ )
56
+
57
+
58
+ def to_str(self) -> str:
59
+ """Returns the string representation of the model using alias"""
60
+ return pprint.pformat(self.model_dump(by_alias=True))
61
+
62
+ def to_json(self) -> str:
63
+ """Returns the JSON representation of the model using alias"""
64
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
+ return json.dumps(self.to_dict())
66
+
67
+ @classmethod
68
+ def from_json(cls, json_str: str) -> Optional[Self]:
69
+ """Create an instance of SavedQueryDetail from a JSON string"""
70
+ return cls.from_dict(json.loads(json_str))
71
+
72
+ def to_dict(self) -> Dict[str, Any]:
73
+ """Return the dictionary representation of the model using alias.
74
+
75
+ This has the following differences from calling pydantic's
76
+ `self.model_dump(by_alias=True)`:
77
+
78
+ * `None` is only added to the output dict for nullable fields that
79
+ were set at model initialization. Other fields with value `None`
80
+ are ignored.
81
+ """
82
+ excluded_fields: Set[str] = set([
83
+ ])
84
+
85
+ _dict = self.model_dump(
86
+ by_alias=True,
87
+ exclude=excluded_fields,
88
+ exclude_none=True,
89
+ )
90
+ # set to None if category (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.category is None and "category" in self.model_fields_set:
93
+ _dict['category'] = None
94
+
95
+ # set to None if has_aggregation (nullable) is None
96
+ # and model_fields_set contains the field
97
+ if self.has_aggregation is None and "has_aggregation" in self.model_fields_set:
98
+ _dict['has_aggregation'] = None
99
+
100
+ # set to None if has_group_by (nullable) is None
101
+ # and model_fields_set contains the field
102
+ if self.has_group_by is None and "has_group_by" in self.model_fields_set:
103
+ _dict['has_group_by'] = None
104
+
105
+ # set to None if has_join (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.has_join is None and "has_join" in self.model_fields_set:
108
+ _dict['has_join'] = None
109
+
110
+ # set to None if has_limit (nullable) is None
111
+ # and model_fields_set contains the field
112
+ if self.has_limit is None and "has_limit" in self.model_fields_set:
113
+ _dict['has_limit'] = None
114
+
115
+ # set to None if has_order_by (nullable) is None
116
+ # and model_fields_set contains the field
117
+ if self.has_order_by is None and "has_order_by" in self.model_fields_set:
118
+ _dict['has_order_by'] = None
119
+
120
+ # set to None if has_predicate (nullable) is None
121
+ # and model_fields_set contains the field
122
+ if self.has_predicate is None and "has_predicate" in self.model_fields_set:
123
+ _dict['has_predicate'] = None
124
+
125
+ # set to None if num_tables (nullable) is None
126
+ # and model_fields_set contains the field
127
+ if self.num_tables is None and "num_tables" in self.model_fields_set:
128
+ _dict['num_tables'] = None
129
+
130
+ # set to None if table_size (nullable) is None
131
+ # and model_fields_set contains the field
132
+ if self.table_size is None and "table_size" in self.model_fields_set:
133
+ _dict['table_size'] = None
134
+
135
+ return _dict
136
+
137
+ @classmethod
138
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
139
+ """Create an instance of SavedQueryDetail from a dict"""
140
+ if obj is None:
141
+ return None
142
+
143
+ if not isinstance(obj, dict):
144
+ return cls.model_validate(obj)
145
+
146
+ _obj = cls.model_validate({
147
+ "category": obj.get("category"),
148
+ "created_at": obj.get("created_at"),
149
+ "description": obj.get("description"),
150
+ "has_aggregation": obj.get("has_aggregation"),
151
+ "has_group_by": obj.get("has_group_by"),
152
+ "has_join": obj.get("has_join"),
153
+ "has_limit": obj.get("has_limit"),
154
+ "has_order_by": obj.get("has_order_by"),
155
+ "has_predicate": obj.get("has_predicate"),
156
+ "id": obj.get("id"),
157
+ "latest_version": obj.get("latest_version"),
158
+ "name": obj.get("name"),
159
+ "num_tables": obj.get("num_tables"),
160
+ "sql": obj.get("sql"),
161
+ "sql_hash": obj.get("sql_hash"),
162
+ "table_size": obj.get("table_size"),
163
+ "tags": obj.get("tags"),
164
+ "updated_at": obj.get("updated_at")
165
+ })
166
+ return _obj
167
+
168
+
@@ -0,0 +1,101 @@
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 datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
23
+ from typing import Any, ClassVar, Dict, List
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class SavedQuerySummary(BaseModel):
28
+ """
29
+ Saved query summary for listing
30
+ """ # noqa: E501
31
+ created_at: datetime
32
+ description: StrictStr
33
+ id: StrictStr
34
+ latest_version: StrictInt
35
+ name: StrictStr
36
+ tags: List[StrictStr]
37
+ updated_at: datetime
38
+ __properties: ClassVar[List[str]] = ["created_at", "description", "id", "latest_version", "name", "tags", "updated_at"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SavedQuerySummary from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of SavedQuerySummary from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "created_at": obj.get("created_at"),
92
+ "description": obj.get("description"),
93
+ "id": obj.get("id"),
94
+ "latest_version": obj.get("latest_version"),
95
+ "name": obj.get("name"),
96
+ "tags": obj.get("tags"),
97
+ "updated_at": obj.get("updated_at")
98
+ })
99
+ return _obj
100
+
101
+
@@ -0,0 +1,158 @@
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 datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class SavedQueryVersionInfo(BaseModel):
28
+ """
29
+ Single saved query version
30
+ """ # noqa: E501
31
+ category: Optional[StrictStr] = None
32
+ created_at: datetime
33
+ has_aggregation: Optional[StrictBool] = None
34
+ has_group_by: Optional[StrictBool] = None
35
+ has_join: Optional[StrictBool] = None
36
+ has_limit: Optional[StrictBool] = None
37
+ has_order_by: Optional[StrictBool] = None
38
+ has_predicate: Optional[StrictBool] = None
39
+ num_tables: Optional[StrictInt] = None
40
+ sql: StrictStr
41
+ sql_hash: StrictStr
42
+ table_size: Optional[StrictStr] = None
43
+ version: StrictInt
44
+ __properties: ClassVar[List[str]] = ["category", "created_at", "has_aggregation", "has_group_by", "has_join", "has_limit", "has_order_by", "has_predicate", "num_tables", "sql", "sql_hash", "table_size", "version"]
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of SavedQueryVersionInfo from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # set to None if category (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.category is None and "category" in self.model_fields_set:
88
+ _dict['category'] = None
89
+
90
+ # set to None if has_aggregation (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.has_aggregation is None and "has_aggregation" in self.model_fields_set:
93
+ _dict['has_aggregation'] = None
94
+
95
+ # set to None if has_group_by (nullable) is None
96
+ # and model_fields_set contains the field
97
+ if self.has_group_by is None and "has_group_by" in self.model_fields_set:
98
+ _dict['has_group_by'] = None
99
+
100
+ # set to None if has_join (nullable) is None
101
+ # and model_fields_set contains the field
102
+ if self.has_join is None and "has_join" in self.model_fields_set:
103
+ _dict['has_join'] = None
104
+
105
+ # set to None if has_limit (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.has_limit is None and "has_limit" in self.model_fields_set:
108
+ _dict['has_limit'] = None
109
+
110
+ # set to None if has_order_by (nullable) is None
111
+ # and model_fields_set contains the field
112
+ if self.has_order_by is None and "has_order_by" in self.model_fields_set:
113
+ _dict['has_order_by'] = None
114
+
115
+ # set to None if has_predicate (nullable) is None
116
+ # and model_fields_set contains the field
117
+ if self.has_predicate is None and "has_predicate" in self.model_fields_set:
118
+ _dict['has_predicate'] = None
119
+
120
+ # set to None if num_tables (nullable) is None
121
+ # and model_fields_set contains the field
122
+ if self.num_tables is None and "num_tables" in self.model_fields_set:
123
+ _dict['num_tables'] = None
124
+
125
+ # set to None if table_size (nullable) is None
126
+ # and model_fields_set contains the field
127
+ if self.table_size is None and "table_size" in self.model_fields_set:
128
+ _dict['table_size'] = None
129
+
130
+ return _dict
131
+
132
+ @classmethod
133
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
134
+ """Create an instance of SavedQueryVersionInfo from a dict"""
135
+ if obj is None:
136
+ return None
137
+
138
+ if not isinstance(obj, dict):
139
+ return cls.model_validate(obj)
140
+
141
+ _obj = cls.model_validate({
142
+ "category": obj.get("category"),
143
+ "created_at": obj.get("created_at"),
144
+ "has_aggregation": obj.get("has_aggregation"),
145
+ "has_group_by": obj.get("has_group_by"),
146
+ "has_join": obj.get("has_join"),
147
+ "has_limit": obj.get("has_limit"),
148
+ "has_order_by": obj.get("has_order_by"),
149
+ "has_predicate": obj.get("has_predicate"),
150
+ "num_tables": obj.get("num_tables"),
151
+ "sql": obj.get("sql"),
152
+ "sql_hash": obj.get("sql_hash"),
153
+ "table_size": obj.get("table_size"),
154
+ "version": obj.get("version")
155
+ })
156
+ return _obj
157
+
158
+