cosmotech-api 3.2.0.post1__py3-none-any.whl → 5.0.0rc3__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 (284) hide show
  1. cosmotech_api/__init__.py +180 -130
  2. cosmotech_api/api/__init__.py +1 -4
  3. cosmotech_api/api/connector_api.py +31 -27
  4. cosmotech_api/api/dataset_api.py +1762 -3918
  5. cosmotech_api/api/meta_api.py +281 -0
  6. cosmotech_api/api/organization_api.py +654 -1460
  7. cosmotech_api/api/run_api.py +170 -817
  8. cosmotech_api/api/runner_api.py +688 -631
  9. cosmotech_api/api/scenario_api.py +141 -121
  10. cosmotech_api/api/scenariorun_api.py +76 -66
  11. cosmotech_api/api/scenariorunresult_api.py +341 -659
  12. cosmotech_api/api/solution_api.py +2504 -956
  13. cosmotech_api/api/twingraph_api.py +83 -72
  14. cosmotech_api/api/validator_api.py +1249 -2501
  15. cosmotech_api/api/workspace_api.py +835 -1658
  16. cosmotech_api/api_client.py +79 -33
  17. cosmotech_api/configuration.py +185 -48
  18. cosmotech_api/exceptions.py +18 -1
  19. cosmotech_api/model/component_role_permissions.py +1 -1
  20. cosmotech_api/model/connector.py +1 -1
  21. cosmotech_api/model/connector_parameter.py +1 -1
  22. cosmotech_api/model/connector_parameter_group.py +1 -1
  23. cosmotech_api/model/container_resource_size_info.py +1 -1
  24. cosmotech_api/model/container_resource_sizing.py +1 -1
  25. cosmotech_api/model/dataset.py +1 -1
  26. cosmotech_api/model/dataset_access_control.py +1 -1
  27. cosmotech_api/model/dataset_compatibility.py +1 -1
  28. cosmotech_api/model/dataset_connector.py +1 -1
  29. cosmotech_api/model/dataset_copy_parameters.py +1 -1
  30. cosmotech_api/model/dataset_role.py +1 -1
  31. cosmotech_api/model/dataset_search.py +1 -1
  32. cosmotech_api/model/dataset_security.py +1 -1
  33. cosmotech_api/model/dataset_source_type.py +1 -1
  34. cosmotech_api/model/dataset_twin_graph_hash.py +1 -1
  35. cosmotech_api/model/dataset_twin_graph_info.py +1 -1
  36. cosmotech_api/model/dataset_twin_graph_query.py +1 -1
  37. cosmotech_api/model/delete_historical_data.py +1 -1
  38. cosmotech_api/model/file_upload_metadata.py +1 -1
  39. cosmotech_api/model/file_upload_validation.py +1 -1
  40. cosmotech_api/model/graph_properties.py +1 -1
  41. cosmotech_api/model/organization.py +1 -1
  42. cosmotech_api/model/organization_access_control.py +1 -1
  43. cosmotech_api/model/organization_role.py +1 -1
  44. cosmotech_api/model/organization_security.py +1 -1
  45. cosmotech_api/model/organization_service.py +1 -1
  46. cosmotech_api/model/organization_services.py +1 -1
  47. cosmotech_api/model/resource_size_info.py +1 -1
  48. cosmotech_api/model/run.py +1 -1
  49. cosmotech_api/model/run_container.py +1 -1
  50. cosmotech_api/model/run_container_artifact.py +1 -1
  51. cosmotech_api/model/run_container_logs.py +1 -1
  52. cosmotech_api/model/run_logs.py +1 -1
  53. cosmotech_api/model/run_resource_requested.py +1 -1
  54. cosmotech_api/model/run_search.py +1 -1
  55. cosmotech_api/model/run_start_containers.py +1 -1
  56. cosmotech_api/model/run_state.py +1 -1
  57. cosmotech_api/model/run_status.py +1 -1
  58. cosmotech_api/model/run_status_node.py +1 -1
  59. cosmotech_api/model/run_template.py +1 -1
  60. cosmotech_api/model/run_template_handler_id.py +1 -1
  61. cosmotech_api/model/run_template_orchestrator.py +1 -1
  62. cosmotech_api/model/run_template_parameter.py +1 -1
  63. cosmotech_api/model/run_template_parameter_group.py +1 -1
  64. cosmotech_api/model/run_template_parameter_value.py +1 -1
  65. cosmotech_api/model/run_template_resource_sizing.py +1 -1
  66. cosmotech_api/model/run_template_step_source.py +1 -1
  67. cosmotech_api/model/runner.py +1 -1
  68. cosmotech_api/model/runner_access_control.py +1 -1
  69. cosmotech_api/model/runner_changed_parameter_value.py +1 -1
  70. cosmotech_api/model/runner_comparison_result.py +1 -1
  71. cosmotech_api/model/runner_data_download_info.py +1 -1
  72. cosmotech_api/model/runner_data_download_job.py +1 -1
  73. cosmotech_api/model/runner_job_state.py +1 -1
  74. cosmotech_api/model/runner_last_run.py +1 -1
  75. cosmotech_api/model/runner_resource_sizing.py +1 -1
  76. cosmotech_api/model/runner_role.py +1 -1
  77. cosmotech_api/model/runner_run_template_parameter_value.py +1 -1
  78. cosmotech_api/model/runner_security.py +1 -1
  79. cosmotech_api/model/runner_validation_status.py +1 -1
  80. cosmotech_api/model/scenario.py +1 -1
  81. cosmotech_api/model/scenario_access_control.py +1 -1
  82. cosmotech_api/model/scenario_changed_parameter_value.py +1 -1
  83. cosmotech_api/model/scenario_comparison_result.py +1 -1
  84. cosmotech_api/model/scenario_data_download_info.py +1 -1
  85. cosmotech_api/model/scenario_data_download_job.py +1 -1
  86. cosmotech_api/model/scenario_job_state.py +1 -1
  87. cosmotech_api/model/scenario_last_run.py +1 -1
  88. cosmotech_api/model/scenario_resource_sizing.py +1 -1
  89. cosmotech_api/model/scenario_role.py +1 -1
  90. cosmotech_api/model/scenario_run.py +1 -1
  91. cosmotech_api/model/scenario_run_container.py +1 -1
  92. cosmotech_api/model/scenario_run_container_artifact.py +1 -1
  93. cosmotech_api/model/scenario_run_container_logs.py +1 -1
  94. cosmotech_api/model/scenario_run_logs.py +1 -1
  95. cosmotech_api/model/scenario_run_resource_requested.py +1 -1
  96. cosmotech_api/model/scenario_run_result.py +1 -1
  97. cosmotech_api/model/scenario_run_search.py +1 -1
  98. cosmotech_api/model/scenario_run_start_containers.py +1 -1
  99. cosmotech_api/model/scenario_run_state.py +1 -1
  100. cosmotech_api/model/scenario_run_status.py +1 -1
  101. cosmotech_api/model/scenario_run_status_node.py +1 -1
  102. cosmotech_api/model/scenario_run_template_parameter_value.py +1 -1
  103. cosmotech_api/model/scenario_security.py +1 -1
  104. cosmotech_api/model/scenario_validation_status.py +1 -1
  105. cosmotech_api/model/solution.py +1 -1
  106. cosmotech_api/model/solution_access_control.py +1 -1
  107. cosmotech_api/model/solution_role.py +1 -1
  108. cosmotech_api/model/solution_security.py +1 -1
  109. cosmotech_api/model/source_info.py +1 -1
  110. cosmotech_api/model/sub_dataset_graph_query.py +1 -1
  111. cosmotech_api/model/translated_labels.py +1 -1
  112. cosmotech_api/model/twin_graph_batch_result.py +1 -1
  113. cosmotech_api/model/twin_graph_hash.py +1 -1
  114. cosmotech_api/model/twin_graph_query.py +1 -1
  115. cosmotech_api/model/validator.py +1 -1
  116. cosmotech_api/model/validator_run.py +1 -1
  117. cosmotech_api/model/workspace.py +1 -1
  118. cosmotech_api/model/workspace_access_control.py +1 -1
  119. cosmotech_api/model/workspace_file.py +1 -1
  120. cosmotech_api/model/workspace_role.py +1 -1
  121. cosmotech_api/model/workspace_secret.py +1 -1
  122. cosmotech_api/model/workspace_security.py +1 -1
  123. cosmotech_api/model/workspace_solution.py +1 -1
  124. cosmotech_api/model/workspace_web_app.py +1 -1
  125. cosmotech_api/model_utils.py +1 -1
  126. cosmotech_api/models/__init__.py +33 -72
  127. cosmotech_api/models/about_info.py +92 -0
  128. cosmotech_api/models/about_info_version.py +100 -0
  129. cosmotech_api/models/component_role_permissions.py +11 -11
  130. cosmotech_api/models/connector.py +12 -22
  131. cosmotech_api/models/connector_parameter.py +7 -7
  132. cosmotech_api/models/connector_parameter_group.py +10 -10
  133. cosmotech_api/models/container_resource_size_info.py +7 -7
  134. cosmotech_api/models/container_resource_sizing.py +7 -7
  135. cosmotech_api/models/create_info.py +103 -0
  136. cosmotech_api/models/created_run.py +88 -0
  137. cosmotech_api/models/dataset.py +47 -103
  138. cosmotech_api/models/dataset_access_control.py +7 -7
  139. cosmotech_api/models/dataset_compatibility.py +7 -7
  140. cosmotech_api/models/dataset_connector.py +7 -7
  141. cosmotech_api/models/dataset_copy_parameters.py +7 -7
  142. cosmotech_api/models/dataset_create_info.py +103 -0
  143. cosmotech_api/models/dataset_create_request.py +111 -0
  144. cosmotech_api/models/dataset_edit_info.py +90 -0
  145. cosmotech_api/models/dataset_part.py +132 -0
  146. cosmotech_api/models/dataset_part_create_request.py +100 -0
  147. cosmotech_api/models/dataset_part_type_enum.py +38 -0
  148. cosmotech_api/models/dataset_part_update_request.py +95 -0
  149. cosmotech_api/models/dataset_role.py +7 -7
  150. cosmotech_api/models/dataset_search.py +7 -7
  151. cosmotech_api/models/dataset_security.py +10 -10
  152. cosmotech_api/models/dataset_source_type.py +1 -1
  153. cosmotech_api/models/dataset_twin_graph_hash.py +7 -7
  154. cosmotech_api/models/dataset_twin_graph_info.py +7 -7
  155. cosmotech_api/models/dataset_twin_graph_query.py +7 -7
  156. cosmotech_api/models/dataset_update_request.py +105 -0
  157. cosmotech_api/models/delete_historical_data.py +7 -7
  158. cosmotech_api/models/edit_info.py +90 -0
  159. cosmotech_api/models/file_upload_metadata.py +7 -7
  160. cosmotech_api/models/file_upload_validation.py +13 -13
  161. cosmotech_api/models/graph_properties.py +7 -7
  162. cosmotech_api/models/ingestion_status_enum.py +40 -0
  163. cosmotech_api/models/io_types_enum.py +38 -0
  164. cosmotech_api/models/last_run_info.py +100 -0
  165. cosmotech_api/models/organization.py +24 -23
  166. cosmotech_api/models/organization_access_control.py +10 -10
  167. cosmotech_api/models/organization_create_request.py +95 -0
  168. cosmotech_api/models/organization_edit_info.py +90 -0
  169. cosmotech_api/models/organization_role.py +9 -9
  170. cosmotech_api/models/organization_security.py +13 -13
  171. cosmotech_api/models/organization_service.py +7 -7
  172. cosmotech_api/models/organization_services.py +7 -7
  173. cosmotech_api/models/organization_update_request.py +89 -0
  174. cosmotech_api/models/query_result.py +7 -7
  175. cosmotech_api/models/resource_size_info.py +7 -7
  176. cosmotech_api/models/run.py +20 -22
  177. cosmotech_api/models/run_container.py +9 -19
  178. cosmotech_api/models/run_container_artifact.py +7 -7
  179. cosmotech_api/models/run_container_logs.py +7 -7
  180. cosmotech_api/models/run_data.py +7 -7
  181. cosmotech_api/models/run_data_query.py +7 -7
  182. cosmotech_api/models/run_edit_info.py +90 -0
  183. cosmotech_api/models/run_logs.py +10 -10
  184. cosmotech_api/models/run_logs_entry.py +88 -0
  185. cosmotech_api/models/run_resource_requested.py +7 -7
  186. cosmotech_api/models/run_search.py +9 -18
  187. cosmotech_api/models/run_search_state.py +46 -0
  188. cosmotech_api/models/run_start_containers.py +10 -10
  189. cosmotech_api/models/run_state.py +2 -1
  190. cosmotech_api/models/run_status.py +17 -11
  191. cosmotech_api/models/run_status_node.py +7 -7
  192. cosmotech_api/models/run_template.py +20 -75
  193. cosmotech_api/models/run_template_create_request.py +109 -0
  194. cosmotech_api/models/run_template_handler_id.py +1 -1
  195. cosmotech_api/models/run_template_orchestrator.py +1 -1
  196. cosmotech_api/models/run_template_parameter.py +21 -20
  197. cosmotech_api/models/run_template_parameter_create_request.py +103 -0
  198. cosmotech_api/models/run_template_parameter_group.py +17 -18
  199. cosmotech_api/models/run_template_parameter_group_create_request.py +97 -0
  200. cosmotech_api/models/run_template_parameter_group_update_request.py +94 -0
  201. cosmotech_api/models/run_template_parameter_update_request.py +101 -0
  202. cosmotech_api/models/run_template_parameter_value.py +7 -7
  203. cosmotech_api/models/run_template_resource_sizing.py +8 -8
  204. cosmotech_api/models/run_template_step_source.py +1 -1
  205. cosmotech_api/models/run_template_update_request.py +107 -0
  206. cosmotech_api/models/runner.py +48 -62
  207. cosmotech_api/models/runner_access_control.py +7 -7
  208. cosmotech_api/models/runner_changed_parameter_value.py +7 -7
  209. cosmotech_api/models/runner_comparison_result.py +10 -10
  210. cosmotech_api/models/runner_create_request.py +146 -0
  211. cosmotech_api/models/runner_data_download_info.py +7 -7
  212. cosmotech_api/models/runner_data_download_job.py +7 -7
  213. cosmotech_api/models/runner_datasets.py +92 -0
  214. cosmotech_api/models/runner_edit_info.py +90 -0
  215. cosmotech_api/models/runner_job_state.py +1 -1
  216. cosmotech_api/models/runner_last_run.py +7 -7
  217. cosmotech_api/models/runner_parent_last_run.py +7 -7
  218. cosmotech_api/models/runner_resource_sizing.py +7 -7
  219. cosmotech_api/models/runner_role.py +7 -7
  220. cosmotech_api/models/runner_root_last_run.py +7 -7
  221. cosmotech_api/models/runner_run_template_parameter_value.py +7 -9
  222. cosmotech_api/models/runner_security.py +10 -10
  223. cosmotech_api/models/runner_update_request.py +119 -0
  224. cosmotech_api/models/runner_validation_status.py +1 -1
  225. cosmotech_api/models/scenario.py +10 -10
  226. cosmotech_api/models/scenario_access_control.py +7 -7
  227. cosmotech_api/models/scenario_changed_parameter_value.py +7 -7
  228. cosmotech_api/models/scenario_comparison_result.py +10 -10
  229. cosmotech_api/models/scenario_data_download_info.py +7 -7
  230. cosmotech_api/models/scenario_data_download_job.py +7 -7
  231. cosmotech_api/models/scenario_job_state.py +1 -1
  232. cosmotech_api/models/scenario_last_run.py +7 -7
  233. cosmotech_api/models/scenario_resource_sizing.py +7 -7
  234. cosmotech_api/models/scenario_role.py +7 -7
  235. cosmotech_api/models/scenario_run.py +13 -13
  236. cosmotech_api/models/scenario_run_container.py +10 -10
  237. cosmotech_api/models/scenario_run_container_artifact.py +7 -7
  238. cosmotech_api/models/scenario_run_container_logs.py +7 -7
  239. cosmotech_api/models/scenario_run_logs.py +10 -10
  240. cosmotech_api/models/scenario_run_resource_requested.py +7 -7
  241. cosmotech_api/models/scenario_run_search.py +9 -18
  242. cosmotech_api/models/scenario_run_search_state.py +46 -0
  243. cosmotech_api/models/scenario_run_start_containers.py +10 -10
  244. cosmotech_api/models/scenario_run_state.py +1 -1
  245. cosmotech_api/models/scenario_run_status.py +10 -10
  246. cosmotech_api/models/scenario_run_status_node.py +7 -7
  247. cosmotech_api/models/scenario_run_template_parameter_value.py +7 -7
  248. cosmotech_api/models/scenario_security.py +10 -10
  249. cosmotech_api/models/scenario_validation_status.py +1 -1
  250. cosmotech_api/models/send_run_data_request.py +7 -7
  251. cosmotech_api/models/solution.py +60 -44
  252. cosmotech_api/models/solution_access_control.py +10 -10
  253. cosmotech_api/models/solution_create_request.py +139 -0
  254. cosmotech_api/models/solution_edit_info.py +90 -0
  255. cosmotech_api/models/solution_file.py +88 -0
  256. cosmotech_api/models/solution_role.py +9 -9
  257. cosmotech_api/models/solution_security.py +13 -13
  258. cosmotech_api/models/solution_update_request.py +133 -0
  259. cosmotech_api/models/source_info.py +7 -7
  260. cosmotech_api/models/sub_dataset_graph_query.py +7 -7
  261. cosmotech_api/models/twin_graph_batch_result.py +7 -7
  262. cosmotech_api/models/twin_graph_hash.py +7 -7
  263. cosmotech_api/models/twin_graph_query.py +7 -7
  264. cosmotech_api/models/twincache_status_enum.py +38 -0
  265. cosmotech_api/models/validator.py +7 -7
  266. cosmotech_api/models/workspace.py +46 -42
  267. cosmotech_api/models/workspace_access_control.py +10 -10
  268. cosmotech_api/models/workspace_create_request.py +113 -0
  269. cosmotech_api/models/workspace_edit_info.py +90 -0
  270. cosmotech_api/models/workspace_file.py +10 -10
  271. cosmotech_api/models/workspace_role.py +9 -9
  272. cosmotech_api/models/workspace_secret.py +7 -7
  273. cosmotech_api/models/workspace_security.py +13 -13
  274. cosmotech_api/models/workspace_solution.py +33 -15
  275. cosmotech_api/models/workspace_update_request.py +105 -0
  276. cosmotech_api/models/workspace_web_app.py +7 -7
  277. cosmotech_api/rest.py +5 -2
  278. cosmotech_api-5.0.0rc3.dist-info/METADATA +314 -0
  279. cosmotech_api-5.0.0rc3.dist-info/RECORD +297 -0
  280. {cosmotech_api-3.2.0.post1.dist-info → cosmotech_api-5.0.0rc3.dist-info}/WHEEL +1 -1
  281. {cosmotech_api-3.2.0.post1.dist-info → cosmotech_api-5.0.0rc3.dist-info/licenses}/LICENSE +1 -1
  282. cosmotech_api-3.2.0.post1.dist-info/METADATA +0 -18
  283. cosmotech_api-3.2.0.post1.dist-info/RECORD +0 -255
  284. {cosmotech_api-3.2.0.post1.dist-info → cosmotech_api-5.0.0rc3.dist-info}/top_level.txt +0 -0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Cosmo Tech Platform API
7
7
 
8
- The version of the OpenAPI document: 3.2.0
8
+ The version of the OpenAPI document: 5.0.0-rc3
9
9
  Contact: platform@cosmotech.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -16,14 +16,17 @@
16
16
  import datetime
17
17
  from dateutil.parser import parse
18
18
  from enum import Enum
19
+ import decimal
19
20
  import json
20
21
  import mimetypes
21
22
  import os
22
23
  import re
23
24
  import tempfile
25
+ import uuid
24
26
 
25
27
  from urllib.parse import quote
26
- from typing import Tuple, Optional, List, Dict
28
+ from typing import Tuple, Optional, List, Dict, Union
29
+ from pydantic import SecretStr
27
30
 
28
31
  from cosmotech_api.configuration import Configuration
29
32
  from cosmotech_api.api_response import ApiResponse, T as ApiResponseT
@@ -66,6 +69,7 @@ class ApiClient:
66
69
  'bool': bool,
67
70
  'date': datetime.date,
68
71
  'datetime': datetime.datetime,
72
+ 'decimal': decimal.Decimal,
69
73
  'object': object,
70
74
  }
71
75
  _pool = None
@@ -208,7 +212,8 @@ class ApiClient:
208
212
  post_params,
209
213
  collection_formats
210
214
  )
211
- post_params.extend(self.files_parameters(files))
215
+ if files:
216
+ post_params.extend(self.files_parameters(files))
212
217
 
213
218
  # auth setting
214
219
  self.update_params_for_auth(
@@ -226,7 +231,7 @@ class ApiClient:
226
231
  body = self.sanitize_for_serialization(body)
227
232
 
228
233
  # request url
229
- if _host is None:
234
+ if _host is None or self.configuration.ignore_operation_servers:
230
235
  url = self.configuration.host + resource_path
231
236
  else:
232
237
  # use server/host defined in path or operation instead
@@ -313,7 +318,7 @@ class ApiClient:
313
318
  match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
314
319
  encoding = match.group(1) if match else "utf-8"
315
320
  response_text = response_data.data.decode(encoding)
316
- return_data = self.deserialize(response_text, response_type)
321
+ return_data = self.deserialize(response_text, response_type, content_type)
317
322
  finally:
318
323
  if not 200 <= response_data.status <= 299:
319
324
  raise ApiException.from_response(
@@ -333,9 +338,11 @@ class ApiClient:
333
338
  """Builds a JSON POST object.
334
339
 
335
340
  If obj is None, return None.
341
+ If obj is SecretStr, return obj.get_secret_value()
336
342
  If obj is str, int, long, float, bool, return directly.
337
343
  If obj is datetime.datetime, datetime.date
338
344
  convert to string in iso8601 format.
345
+ If obj is decimal.Decimal return string representation.
339
346
  If obj is list, sanitize each element in the list.
340
347
  If obj is dict, return the dict.
341
348
  If obj is OpenAPI model, return the properties dict.
@@ -345,8 +352,14 @@ class ApiClient:
345
352
  """
346
353
  if obj is None:
347
354
  return None
355
+ elif isinstance(obj, Enum):
356
+ return obj.value
357
+ elif isinstance(obj, SecretStr):
358
+ return obj.get_secret_value()
348
359
  elif isinstance(obj, self.PRIMITIVE_TYPES):
349
360
  return obj
361
+ elif isinstance(obj, uuid.UUID):
362
+ return str(obj)
350
363
  elif isinstance(obj, list):
351
364
  return [
352
365
  self.sanitize_for_serialization(sub_obj) for sub_obj in obj
@@ -357,6 +370,8 @@ class ApiClient:
357
370
  )
358
371
  elif isinstance(obj, (datetime.datetime, datetime.date)):
359
372
  return obj.isoformat()
373
+ elif isinstance(obj, decimal.Decimal):
374
+ return str(obj)
360
375
 
361
376
  elif isinstance(obj, dict):
362
377
  obj_dict = obj
@@ -366,28 +381,49 @@ class ApiClient:
366
381
  # and attributes which value is not None.
367
382
  # Convert attribute name to json key in
368
383
  # model definition for request.
369
- obj_dict = obj.to_dict()
384
+ if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
385
+ obj_dict = obj.to_dict()
386
+ else:
387
+ obj_dict = obj.__dict__
388
+
389
+ if isinstance(obj_dict, list):
390
+ # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
391
+ return self.sanitize_for_serialization(obj_dict)
370
392
 
371
393
  return {
372
394
  key: self.sanitize_for_serialization(val)
373
395
  for key, val in obj_dict.items()
374
396
  }
375
397
 
376
- def deserialize(self, response_text, response_type):
398
+ def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
377
399
  """Deserializes response into an object.
378
400
 
379
401
  :param response: RESTResponse object to be deserialized.
380
402
  :param response_type: class literal for
381
403
  deserialized object, or string of class name.
404
+ :param content_type: content type of response.
382
405
 
383
406
  :return: deserialized object.
384
407
  """
385
408
 
386
409
  # fetch data from response object
387
- try:
388
- data = json.loads(response_text)
389
- except ValueError:
410
+ if content_type is None:
411
+ try:
412
+ data = json.loads(response_text)
413
+ except ValueError:
414
+ data = response_text
415
+ elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
416
+ if response_text == "":
417
+ data = ""
418
+ else:
419
+ data = json.loads(response_text)
420
+ elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
390
421
  data = response_text
422
+ else:
423
+ raise ApiException(
424
+ status=0,
425
+ reason="Unsupported content type: {0}".format(content_type)
426
+ )
391
427
 
392
428
  return self.__deserialize(data, response_type)
393
429
 
@@ -425,12 +461,14 @@ class ApiClient:
425
461
 
426
462
  if klass in self.PRIMITIVE_TYPES:
427
463
  return self.__deserialize_primitive(data, klass)
428
- elif klass == object:
464
+ elif klass is object:
429
465
  return self.__deserialize_object(data)
430
- elif klass == datetime.date:
466
+ elif klass is datetime.date:
431
467
  return self.__deserialize_date(data)
432
- elif klass == datetime.datetime:
468
+ elif klass is datetime.datetime:
433
469
  return self.__deserialize_datetime(data)
470
+ elif klass is decimal.Decimal:
471
+ return decimal.Decimal(data)
434
472
  elif issubclass(klass, Enum):
435
473
  return self.__deserialize_enum(data, klass)
436
474
  else:
@@ -487,7 +525,7 @@ class ApiClient:
487
525
  if k in collection_formats:
488
526
  collection_format = collection_formats[k]
489
527
  if collection_format == 'multi':
490
- new_params.extend((k, str(value)) for value in v)
528
+ new_params.extend((k, quote(str(value))) for value in v)
491
529
  else:
492
530
  if collection_format == 'ssv':
493
531
  delimiter = ' '
@@ -505,31 +543,39 @@ class ApiClient:
505
543
 
506
544
  return "&".join(["=".join(map(str, item)) for item in new_params])
507
545
 
508
- def files_parameters(self, files=None):
546
+ def files_parameters(
547
+ self,
548
+ files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
549
+ ):
509
550
  """Builds form parameters.
510
551
 
511
552
  :param files: File parameters.
512
553
  :return: Form parameters with files.
513
554
  """
514
555
  params = []
515
-
516
- if files:
517
- for k, v in files.items():
518
- if not v:
519
- continue
520
- file_names = v if type(v) is list else [v]
521
- for n in file_names:
522
- with open(n, 'rb') as f:
523
- filename = os.path.basename(f.name)
524
- filedata = f.read()
525
- mimetype = (
526
- mimetypes.guess_type(filename)[0]
527
- or 'application/octet-stream'
528
- )
529
- params.append(
530
- tuple([k, tuple([filename, filedata, mimetype])])
531
- )
532
-
556
+ for k, v in files.items():
557
+ if isinstance(v, str):
558
+ with open(v, 'rb') as f:
559
+ filename = os.path.basename(f.name)
560
+ filedata = f.read()
561
+ elif isinstance(v, bytes):
562
+ filename = k
563
+ filedata = v
564
+ elif isinstance(v, tuple):
565
+ filename, filedata = v
566
+ elif isinstance(v, list):
567
+ for file_param in v:
568
+ params.extend(self.files_parameters({k: file_param}))
569
+ continue
570
+ else:
571
+ raise ValueError("Unsupported file value")
572
+ mimetype = (
573
+ mimetypes.guess_type(filename)[0]
574
+ or 'application/octet-stream'
575
+ )
576
+ params.append(
577
+ tuple([k, tuple([filename, filedata, mimetype])])
578
+ )
533
579
  return params
534
580
 
535
581
  def select_header_accept(self, accepts: List[str]) -> Optional[str]:
@@ -5,7 +5,7 @@
5
5
 
6
6
  Cosmo Tech Platform API
7
7
 
8
- The version of the OpenAPI document: 3.2.0
8
+ The version of the OpenAPI document: 5.0.0-rc3
9
9
  Contact: platform@cosmotech.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -14,14 +14,16 @@
14
14
 
15
15
 
16
16
  import copy
17
+ import http.client as httplib
17
18
  import logging
18
19
  from logging import FileHandler
19
20
  import multiprocessing
20
21
  import sys
21
- from typing import Optional
22
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
23
+ from typing_extensions import NotRequired, Self
24
+
22
25
  import urllib3
23
26
 
24
- import http.client as httplib
25
27
 
26
28
  JSON_SCHEMA_VALIDATION_KEYWORDS = {
27
29
  'multipleOf', 'maximum', 'exclusiveMaximum',
@@ -29,10 +31,114 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
29
31
  'minLength', 'pattern', 'maxItems', 'minItems'
30
32
  }
31
33
 
34
+ ServerVariablesT = Dict[str, str]
35
+
36
+ GenericAuthSetting = TypedDict(
37
+ "GenericAuthSetting",
38
+ {
39
+ "type": str,
40
+ "in": str,
41
+ "key": str,
42
+ "value": str,
43
+ },
44
+ )
45
+
46
+
47
+ OAuth2AuthSetting = TypedDict(
48
+ "OAuth2AuthSetting",
49
+ {
50
+ "type": Literal["oauth2"],
51
+ "in": Literal["header"],
52
+ "key": Literal["Authorization"],
53
+ "value": str,
54
+ },
55
+ )
56
+
57
+
58
+ APIKeyAuthSetting = TypedDict(
59
+ "APIKeyAuthSetting",
60
+ {
61
+ "type": Literal["api_key"],
62
+ "in": str,
63
+ "key": str,
64
+ "value": Optional[str],
65
+ },
66
+ )
67
+
68
+
69
+ BasicAuthSetting = TypedDict(
70
+ "BasicAuthSetting",
71
+ {
72
+ "type": Literal["basic"],
73
+ "in": Literal["header"],
74
+ "key": Literal["Authorization"],
75
+ "value": Optional[str],
76
+ },
77
+ )
78
+
79
+
80
+ BearerFormatAuthSetting = TypedDict(
81
+ "BearerFormatAuthSetting",
82
+ {
83
+ "type": Literal["bearer"],
84
+ "in": Literal["header"],
85
+ "format": Literal["JWT"],
86
+ "key": Literal["Authorization"],
87
+ "value": str,
88
+ },
89
+ )
90
+
91
+
92
+ BearerAuthSetting = TypedDict(
93
+ "BearerAuthSetting",
94
+ {
95
+ "type": Literal["bearer"],
96
+ "in": Literal["header"],
97
+ "key": Literal["Authorization"],
98
+ "value": str,
99
+ },
100
+ )
101
+
102
+
103
+ HTTPSignatureAuthSetting = TypedDict(
104
+ "HTTPSignatureAuthSetting",
105
+ {
106
+ "type": Literal["http-signature"],
107
+ "in": Literal["header"],
108
+ "key": Literal["Authorization"],
109
+ "value": None,
110
+ },
111
+ )
112
+
113
+
114
+ AuthSettings = TypedDict(
115
+ "AuthSettings",
116
+ {
117
+ "oAuth2AuthCode": OAuth2AuthSetting,
118
+ },
119
+ total=False,
120
+ )
121
+
122
+
123
+ class HostSettingVariable(TypedDict):
124
+ description: str
125
+ default_value: str
126
+ enum_values: List[str]
127
+
128
+
129
+ class HostSetting(TypedDict):
130
+ url: str
131
+ description: str
132
+ variables: NotRequired[Dict[str, HostSettingVariable]]
133
+
134
+
32
135
  class Configuration:
33
136
  """This class contains various settings of the API client.
34
137
 
35
138
  :param host: Base url.
139
+ :param ignore_operation_servers
140
+ Boolean to ignore operation servers for the API client.
141
+ Config will use `host` as the base url regardless of the operation servers.
36
142
  :param api_key: Dict to store API key(s).
37
143
  Each entry in the dict specifies an API key.
38
144
  The dict key is the name of the security scheme in the OAS specification.
@@ -55,23 +161,41 @@ class Configuration:
55
161
  values before.
56
162
  :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
57
163
  in PEM format.
164
+ :param retries: Number of retries for API requests.
165
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
166
+ in PEM (str) or DER (bytes) format.
167
+ :param cert_file: the path to a client certificate file, for mTLS.
168
+ :param key_file: the path to a client key file, for mTLS.
58
169
 
59
170
  :Example:
60
171
  """
61
172
 
62
- _default = None
63
-
64
- def __init__(self, host=None,
65
- api_key=None, api_key_prefix=None,
66
- username=None, password=None,
67
- access_token=None,
68
- server_index=None, server_variables=None,
69
- server_operation_index=None, server_operation_variables=None,
70
- ssl_ca_cert=None,
71
- ) -> None:
173
+ _default: ClassVar[Optional[Self]] = None
174
+
175
+ def __init__(
176
+ self,
177
+ host: Optional[str]=None,
178
+ api_key: Optional[Dict[str, str]]=None,
179
+ api_key_prefix: Optional[Dict[str, str]]=None,
180
+ username: Optional[str]=None,
181
+ password: Optional[str]=None,
182
+ access_token: Optional[str]=None,
183
+ server_index: Optional[int]=None,
184
+ server_variables: Optional[ServerVariablesT]=None,
185
+ server_operation_index: Optional[Dict[int, int]]=None,
186
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
187
+ ignore_operation_servers: bool=False,
188
+ ssl_ca_cert: Optional[str]=None,
189
+ retries: Optional[int] = None,
190
+ ca_cert_data: Optional[Union[str, bytes]] = None,
191
+ cert_file: Optional[str]=None,
192
+ key_file: Optional[str]=None,
193
+ *,
194
+ debug: Optional[bool] = None,
195
+ ) -> None:
72
196
  """Constructor
73
197
  """
74
- self._base_path = "https://dev.api.cosmotech.com" if host is None else host
198
+ self._base_path = "http://localhost:8080" if host is None else host
75
199
  """Default Base url
76
200
  """
77
201
  self.server_index = 0 if server_index is None and host is None else server_index
@@ -82,6 +206,9 @@ class Configuration:
82
206
  self.server_operation_variables = server_operation_variables or {}
83
207
  """Default server variables
84
208
  """
209
+ self.ignore_operation_servers = ignore_operation_servers
210
+ """Ignore operation servers
211
+ """
85
212
  self.temp_folder_path = None
86
213
  """Temp file folder for downloading files
87
214
  """
@@ -125,7 +252,10 @@ class Configuration:
125
252
  self.logger_file = None
126
253
  """Debug file location
127
254
  """
128
- self.debug = False
255
+ if debug is not None:
256
+ self.debug = debug
257
+ else:
258
+ self.__debug = False
129
259
  """Debug switch
130
260
  """
131
261
 
@@ -137,10 +267,14 @@ class Configuration:
137
267
  self.ssl_ca_cert = ssl_ca_cert
138
268
  """Set this to customize the certificate file to verify the peer.
139
269
  """
140
- self.cert_file = None
270
+ self.ca_cert_data = ca_cert_data
271
+ """Set this to verify the peer using PEM (str) or DER (bytes)
272
+ certificate data.
273
+ """
274
+ self.cert_file = cert_file
141
275
  """client certificate file
142
276
  """
143
- self.key_file = None
277
+ self.key_file = key_file
144
278
  """client key file
145
279
  """
146
280
  self.assert_hostname = None
@@ -168,7 +302,7 @@ class Configuration:
168
302
  self.safe_chars_for_path_param = ''
169
303
  """Safe chars for path_param
170
304
  """
171
- self.retries = None
305
+ self.retries = retries
172
306
  """Adding retries to override urllib3 default value 3
173
307
  """
174
308
  # Enable client side validation
@@ -186,7 +320,7 @@ class Configuration:
186
320
  """date format
187
321
  """
188
322
 
189
- def __deepcopy__(self, memo):
323
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
190
324
  cls = self.__class__
191
325
  result = cls.__new__(cls)
192
326
  memo[id(self)] = result
@@ -200,11 +334,11 @@ class Configuration:
200
334
  result.debug = self.debug
201
335
  return result
202
336
 
203
- def __setattr__(self, name, value):
337
+ def __setattr__(self, name: str, value: Any) -> None:
204
338
  object.__setattr__(self, name, value)
205
339
 
206
340
  @classmethod
207
- def set_default(cls, default):
341
+ def set_default(cls, default: Optional[Self]) -> None:
208
342
  """Set default instance of configuration.
209
343
 
210
344
  It stores default configuration, which can be
@@ -215,7 +349,7 @@ class Configuration:
215
349
  cls._default = default
216
350
 
217
351
  @classmethod
218
- def get_default_copy(cls):
352
+ def get_default_copy(cls) -> Self:
219
353
  """Deprecated. Please use `get_default` instead.
220
354
 
221
355
  Deprecated. Please use `get_default` instead.
@@ -225,7 +359,7 @@ class Configuration:
225
359
  return cls.get_default()
226
360
 
227
361
  @classmethod
228
- def get_default(cls):
362
+ def get_default(cls) -> Self:
229
363
  """Return the default configuration.
230
364
 
231
365
  This method returns newly created, based on default constructor,
@@ -235,11 +369,11 @@ class Configuration:
235
369
  :return: The configuration object.
236
370
  """
237
371
  if cls._default is None:
238
- cls._default = Configuration()
372
+ cls._default = cls()
239
373
  return cls._default
240
374
 
241
375
  @property
242
- def logger_file(self):
376
+ def logger_file(self) -> Optional[str]:
243
377
  """The logger file.
244
378
 
245
379
  If the logger_file is None, then add stream handler and remove file
@@ -251,7 +385,7 @@ class Configuration:
251
385
  return self.__logger_file
252
386
 
253
387
  @logger_file.setter
254
- def logger_file(self, value):
388
+ def logger_file(self, value: Optional[str]) -> None:
255
389
  """The logger file.
256
390
 
257
391
  If the logger_file is None, then add stream handler and remove file
@@ -270,7 +404,7 @@ class Configuration:
270
404
  logger.addHandler(self.logger_file_handler)
271
405
 
272
406
  @property
273
- def debug(self):
407
+ def debug(self) -> bool:
274
408
  """Debug status
275
409
 
276
410
  :param value: The debug status, True or False.
@@ -279,7 +413,7 @@ class Configuration:
279
413
  return self.__debug
280
414
 
281
415
  @debug.setter
282
- def debug(self, value):
416
+ def debug(self, value: bool) -> None:
283
417
  """Debug status
284
418
 
285
419
  :param value: The debug status, True or False.
@@ -301,7 +435,7 @@ class Configuration:
301
435
  httplib.HTTPConnection.debuglevel = 0
302
436
 
303
437
  @property
304
- def logger_format(self):
438
+ def logger_format(self) -> str:
305
439
  """The logger format.
306
440
 
307
441
  The logger_formatter will be updated when sets logger_format.
@@ -312,7 +446,7 @@ class Configuration:
312
446
  return self.__logger_format
313
447
 
314
448
  @logger_format.setter
315
- def logger_format(self, value):
449
+ def logger_format(self, value: str) -> None:
316
450
  """The logger format.
317
451
 
318
452
  The logger_formatter will be updated when sets logger_format.
@@ -323,7 +457,7 @@ class Configuration:
323
457
  self.__logger_format = value
324
458
  self.logger_formatter = logging.Formatter(self.__logger_format)
325
459
 
326
- def get_api_key_with_prefix(self, identifier, alias=None):
460
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
327
461
  """Gets API key (with prefix if set).
328
462
 
329
463
  :param identifier: The identifier of apiKey.
@@ -340,7 +474,9 @@ class Configuration:
340
474
  else:
341
475
  return key
342
476
 
343
- def get_basic_auth_token(self):
477
+ return None
478
+
479
+ def get_basic_auth_token(self) -> Optional[str]:
344
480
  """Gets HTTP basic authentication header (string).
345
481
 
346
482
  :return: The token for basic HTTP authentication.
@@ -355,12 +491,12 @@ class Configuration:
355
491
  basic_auth=username + ':' + password
356
492
  ).get('authorization')
357
493
 
358
- def auth_settings(self):
494
+ def auth_settings(self)-> AuthSettings:
359
495
  """Gets Auth Settings dict for api client.
360
496
 
361
497
  :return: The Auth Settings information dict.
362
498
  """
363
- auth = {}
499
+ auth: AuthSettings = {}
364
500
  if self.access_token is not None:
365
501
  auth['oAuth2AuthCode'] = {
366
502
  'type': 'oauth2',
@@ -370,7 +506,7 @@ class Configuration:
370
506
  }
371
507
  return auth
372
508
 
373
- def to_debug_report(self):
509
+ def to_debug_report(self) -> str:
374
510
  """Gets the essential information for debugging.
375
511
 
376
512
  :return: The report for debugging.
@@ -378,31 +514,32 @@ class Configuration:
378
514
  return "Python SDK Debug Report:\n"\
379
515
  "OS: {env}\n"\
380
516
  "Python Version: {pyversion}\n"\
381
- "Version of the API: 3.2.0\n"\
517
+ "Version of the API: 5.0.0-rc3\n"\
382
518
  "SDK Package Version: 1.0.0".\
383
519
  format(env=sys.platform, pyversion=sys.version)
384
520
 
385
- def get_host_settings(self):
521
+ def get_host_settings(self) -> List[HostSetting]:
386
522
  """Gets an array of host settings
387
523
 
388
524
  :return: An array of host settings
389
525
  """
390
526
  return [
391
527
  {
392
- 'url': "https://dev.api.cosmotech.com",
393
- 'description': "Development",
394
- },
395
- {
396
- 'url': "https://api.cosmotech.com",
397
- 'description': "Production",
528
+ 'url': "http://localhost:8080",
529
+ 'description': "No description provided",
398
530
  },
399
531
  {
400
- 'url': "https://staging.api.cosmotech.com",
401
- 'description': "Staging",
532
+ 'url': "",
533
+ 'description': "No description provided",
402
534
  }
403
535
  ]
404
536
 
405
- def get_host_from_settings(self, index, variables=None, servers=None):
537
+ def get_host_from_settings(
538
+ self,
539
+ index: Optional[int],
540
+ variables: Optional[ServerVariablesT]=None,
541
+ servers: Optional[List[HostSetting]]=None,
542
+ ) -> str:
406
543
  """Gets host URL based on the index and variables
407
544
  :param index: array index of the host settings
408
545
  :param variables: hash of variable and the corresponding value
@@ -442,12 +579,12 @@ class Configuration:
442
579
  return url
443
580
 
444
581
  @property
445
- def host(self):
582
+ def host(self) -> str:
446
583
  """Return generated host."""
447
584
  return self.get_host_from_settings(self.server_index, variables=self.server_variables)
448
585
 
449
586
  @host.setter
450
- def host(self, value):
587
+ def host(self, value: str) -> None:
451
588
  """Fix base path."""
452
589
  self._base_path = value
453
590
  self.server_index = None