cosmotech-api 3.2.6.dev2__py3-none-any.whl → 4.0.0.dev8__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.
Potentially problematic release.
This version of cosmotech-api might be problematic. Click here for more details.
- cosmotech_api/__init__.py +3 -45
- cosmotech_api/api/__init__.py +0 -3
- cosmotech_api/api/connector_api.py +30 -282
- cosmotech_api/api/dataset_api.py +214 -187
- cosmotech_api/api/organization_api.py +94 -943
- cosmotech_api/api/run_api.py +51 -45
- cosmotech_api/api/runner_api.py +101 -88
- cosmotech_api/api/scenario_api.py +1 -1
- cosmotech_api/api/scenariorun_api.py +1 -1
- cosmotech_api/api/scenariorunresult_api.py +1 -1
- cosmotech_api/api/solution_api.py +487 -1124
- cosmotech_api/api/twingraph_api.py +1 -1
- cosmotech_api/api/validator_api.py +1 -1
- cosmotech_api/api/workspace_api.py +129 -416
- cosmotech_api/api_client.py +59 -29
- cosmotech_api/configuration.py +21 -15
- cosmotech_api/exceptions.py +1 -1
- cosmotech_api/model/component_role_permissions.py +1 -1
- cosmotech_api/model/connector.py +1 -1
- cosmotech_api/model/connector_parameter.py +1 -1
- cosmotech_api/model/connector_parameter_group.py +1 -1
- cosmotech_api/model/container_resource_size_info.py +1 -1
- cosmotech_api/model/container_resource_sizing.py +1 -1
- cosmotech_api/model/dataset.py +1 -1
- cosmotech_api/model/dataset_access_control.py +1 -1
- cosmotech_api/model/dataset_compatibility.py +1 -1
- cosmotech_api/model/dataset_connector.py +1 -1
- cosmotech_api/model/dataset_copy_parameters.py +1 -1
- cosmotech_api/model/dataset_role.py +1 -1
- cosmotech_api/model/dataset_search.py +1 -1
- cosmotech_api/model/dataset_security.py +1 -1
- cosmotech_api/model/dataset_source_type.py +1 -1
- cosmotech_api/model/dataset_twin_graph_hash.py +1 -1
- cosmotech_api/model/dataset_twin_graph_info.py +1 -1
- cosmotech_api/model/dataset_twin_graph_query.py +1 -1
- cosmotech_api/model/delete_historical_data.py +1 -1
- cosmotech_api/model/file_upload_metadata.py +1 -1
- cosmotech_api/model/file_upload_validation.py +1 -1
- cosmotech_api/model/graph_properties.py +1 -1
- cosmotech_api/model/organization.py +1 -1
- cosmotech_api/model/organization_access_control.py +1 -1
- cosmotech_api/model/organization_role.py +1 -1
- cosmotech_api/model/organization_security.py +1 -1
- cosmotech_api/model/organization_service.py +1 -1
- cosmotech_api/model/organization_services.py +1 -1
- cosmotech_api/model/resource_size_info.py +1 -1
- cosmotech_api/model/run.py +1 -1
- cosmotech_api/model/run_container.py +1 -1
- cosmotech_api/model/run_container_artifact.py +1 -1
- cosmotech_api/model/run_container_logs.py +1 -1
- cosmotech_api/model/run_logs.py +1 -1
- cosmotech_api/model/run_resource_requested.py +1 -1
- cosmotech_api/model/run_search.py +1 -1
- cosmotech_api/model/run_start_containers.py +1 -1
- cosmotech_api/model/run_state.py +1 -1
- cosmotech_api/model/run_status.py +1 -1
- cosmotech_api/model/run_status_node.py +1 -1
- cosmotech_api/model/run_template.py +1 -1
- cosmotech_api/model/run_template_handler_id.py +1 -1
- cosmotech_api/model/run_template_orchestrator.py +1 -1
- cosmotech_api/model/run_template_parameter.py +1 -1
- cosmotech_api/model/run_template_parameter_group.py +1 -1
- cosmotech_api/model/run_template_parameter_value.py +1 -1
- cosmotech_api/model/run_template_resource_sizing.py +1 -1
- cosmotech_api/model/run_template_step_source.py +1 -1
- cosmotech_api/model/runner.py +21 -5
- cosmotech_api/model/runner_access_control.py +1 -1
- cosmotech_api/model/runner_changed_parameter_value.py +1 -1
- cosmotech_api/model/runner_comparison_result.py +1 -1
- cosmotech_api/model/runner_data_download_info.py +11 -1
- cosmotech_api/model/runner_data_download_job.py +1 -1
- cosmotech_api/model/runner_job_state.py +1 -1
- cosmotech_api/model/runner_last_run.py +1 -1
- cosmotech_api/model/runner_resource_sizing.py +1 -1
- cosmotech_api/model/runner_role.py +1 -1
- cosmotech_api/model/runner_run_template_parameter_value.py +1 -1
- cosmotech_api/model/runner_security.py +1 -1
- cosmotech_api/model/runner_validation_status.py +1 -1
- cosmotech_api/model/scenario.py +1 -1
- cosmotech_api/model/scenario_access_control.py +1 -1
- cosmotech_api/model/scenario_changed_parameter_value.py +1 -1
- cosmotech_api/model/scenario_comparison_result.py +1 -1
- cosmotech_api/model/scenario_data_download_info.py +1 -1
- cosmotech_api/model/scenario_data_download_job.py +1 -1
- cosmotech_api/model/scenario_job_state.py +1 -1
- cosmotech_api/model/scenario_last_run.py +1 -1
- cosmotech_api/model/scenario_resource_sizing.py +1 -1
- cosmotech_api/model/scenario_role.py +1 -1
- cosmotech_api/model/scenario_run.py +1 -1
- cosmotech_api/model/scenario_run_container.py +1 -1
- cosmotech_api/model/scenario_run_container_artifact.py +1 -1
- cosmotech_api/model/scenario_run_container_logs.py +1 -1
- cosmotech_api/model/scenario_run_logs.py +1 -1
- cosmotech_api/model/scenario_run_resource_requested.py +1 -1
- cosmotech_api/model/scenario_run_result.py +1 -1
- cosmotech_api/model/scenario_run_search.py +1 -1
- cosmotech_api/model/scenario_run_start_containers.py +1 -1
- cosmotech_api/model/scenario_run_state.py +1 -1
- cosmotech_api/model/scenario_run_status.py +1 -1
- cosmotech_api/model/scenario_run_status_node.py +1 -1
- cosmotech_api/model/scenario_run_template_parameter_value.py +1 -1
- cosmotech_api/model/scenario_security.py +1 -1
- cosmotech_api/model/scenario_validation_status.py +1 -1
- cosmotech_api/model/solution.py +1 -1
- cosmotech_api/model/solution_access_control.py +1 -1
- cosmotech_api/model/solution_role.py +1 -1
- cosmotech_api/model/solution_security.py +1 -1
- cosmotech_api/model/source_info.py +1 -1
- cosmotech_api/model/sub_dataset_graph_query.py +1 -1
- cosmotech_api/model/translated_labels.py +1 -1
- cosmotech_api/model/twin_graph_batch_result.py +1 -1
- cosmotech_api/model/twin_graph_hash.py +1 -1
- cosmotech_api/model/twin_graph_query.py +1 -1
- cosmotech_api/model/validator.py +1 -1
- cosmotech_api/model/validator_run.py +1 -1
- cosmotech_api/model/workspace.py +1 -1
- cosmotech_api/model/workspace_access_control.py +1 -1
- cosmotech_api/model/workspace_file.py +1 -1
- cosmotech_api/model/workspace_role.py +1 -1
- cosmotech_api/model/workspace_secret.py +1 -1
- cosmotech_api/model/workspace_security.py +1 -1
- cosmotech_api/model/workspace_solution.py +1 -1
- cosmotech_api/model/workspace_web_app.py +1 -1
- cosmotech_api/model_utils.py +1 -1
- cosmotech_api/models/__init__.py +3 -42
- cosmotech_api/models/component_role_permissions.py +7 -7
- cosmotech_api/models/connector.py +11 -15
- cosmotech_api/models/connector_parameter.py +7 -7
- cosmotech_api/models/connector_parameter_group.py +10 -10
- cosmotech_api/models/container_resource_size_info.py +7 -7
- cosmotech_api/models/container_resource_sizing.py +7 -7
- cosmotech_api/models/created_run.py +88 -0
- cosmotech_api/models/dataset.py +10 -10
- cosmotech_api/models/dataset_access_control.py +7 -7
- cosmotech_api/models/dataset_compatibility.py +7 -7
- cosmotech_api/models/dataset_connector.py +7 -7
- cosmotech_api/models/dataset_copy_parameters.py +7 -7
- cosmotech_api/models/dataset_role.py +7 -7
- cosmotech_api/models/dataset_search.py +7 -7
- cosmotech_api/models/dataset_security.py +10 -10
- cosmotech_api/models/dataset_source_type.py +1 -1
- cosmotech_api/models/dataset_twin_graph_hash.py +7 -7
- cosmotech_api/models/dataset_twin_graph_info.py +7 -7
- cosmotech_api/models/dataset_twin_graph_query.py +7 -7
- cosmotech_api/models/delete_historical_data.py +7 -7
- cosmotech_api/models/file_upload_metadata.py +7 -7
- cosmotech_api/models/file_upload_validation.py +13 -13
- cosmotech_api/models/graph_properties.py +7 -7
- cosmotech_api/models/ingestion_status_enum.py +1 -1
- cosmotech_api/models/io_types_enum.py +1 -1
- cosmotech_api/models/organization.py +8 -14
- cosmotech_api/models/organization_access_control.py +7 -7
- cosmotech_api/models/organization_role.py +7 -7
- cosmotech_api/models/organization_security.py +10 -10
- cosmotech_api/models/organization_service.py +1 -1
- cosmotech_api/models/organization_services.py +1 -1
- cosmotech_api/models/query_result.py +7 -7
- cosmotech_api/models/resource_size_info.py +7 -7
- cosmotech_api/models/run.py +13 -13
- cosmotech_api/models/run_container.py +9 -19
- cosmotech_api/models/run_container_artifact.py +1 -1
- cosmotech_api/models/run_container_logs.py +1 -1
- cosmotech_api/models/run_data.py +7 -7
- cosmotech_api/models/run_data_query.py +7 -7
- cosmotech_api/models/run_logs.py +22 -27
- cosmotech_api/models/run_logs_entry.py +88 -0
- cosmotech_api/models/run_resource_requested.py +7 -7
- cosmotech_api/models/run_search.py +1 -1
- cosmotech_api/models/run_search_state.py +1 -1
- cosmotech_api/models/run_start_containers.py +1 -1
- cosmotech_api/models/run_state.py +1 -1
- cosmotech_api/models/run_status.py +10 -10
- cosmotech_api/models/run_status_node.py +7 -7
- cosmotech_api/models/run_template.py +7 -7
- cosmotech_api/models/run_template_handler_id.py +1 -1
- cosmotech_api/models/run_template_orchestrator.py +1 -1
- cosmotech_api/models/run_template_parameter.py +7 -7
- cosmotech_api/models/run_template_parameter_group.py +7 -7
- cosmotech_api/models/run_template_parameter_value.py +7 -7
- cosmotech_api/models/run_template_resource_sizing.py +7 -7
- cosmotech_api/models/run_template_step_source.py +1 -1
- cosmotech_api/models/runner.py +11 -11
- cosmotech_api/models/runner_access_control.py +7 -7
- cosmotech_api/models/runner_changed_parameter_value.py +1 -1
- cosmotech_api/models/runner_comparison_result.py +1 -1
- cosmotech_api/models/runner_data_download_info.py +1 -1
- cosmotech_api/models/runner_data_download_job.py +1 -1
- cosmotech_api/models/runner_resource_sizing.py +7 -7
- cosmotech_api/models/runner_role.py +7 -7
- cosmotech_api/models/runner_run_template_parameter_value.py +7 -7
- cosmotech_api/models/runner_security.py +10 -10
- cosmotech_api/models/runner_validation_status.py +1 -1
- cosmotech_api/models/scenario.py +2 -2
- cosmotech_api/models/scenario_access_control.py +1 -1
- cosmotech_api/models/scenario_changed_parameter_value.py +1 -1
- cosmotech_api/models/scenario_comparison_result.py +1 -1
- cosmotech_api/models/scenario_data_download_info.py +1 -1
- cosmotech_api/models/scenario_data_download_job.py +1 -1
- cosmotech_api/models/scenario_job_state.py +1 -1
- cosmotech_api/models/scenario_last_run.py +1 -1
- cosmotech_api/models/scenario_resource_sizing.py +1 -1
- cosmotech_api/models/scenario_role.py +1 -1
- cosmotech_api/models/scenario_run.py +1 -1
- cosmotech_api/models/scenario_run_container.py +1 -1
- cosmotech_api/models/scenario_run_container_artifact.py +1 -1
- cosmotech_api/models/scenario_run_container_logs.py +1 -1
- cosmotech_api/models/scenario_run_logs.py +1 -1
- cosmotech_api/models/scenario_run_resource_requested.py +1 -1
- cosmotech_api/models/scenario_run_search.py +1 -1
- cosmotech_api/models/scenario_run_search_state.py +1 -1
- cosmotech_api/models/scenario_run_start_containers.py +1 -1
- cosmotech_api/models/scenario_run_state.py +1 -1
- cosmotech_api/models/scenario_run_status.py +1 -1
- cosmotech_api/models/scenario_run_status_node.py +1 -1
- cosmotech_api/models/scenario_run_template_parameter_value.py +1 -1
- cosmotech_api/models/scenario_security.py +1 -1
- cosmotech_api/models/scenario_validation_status.py +1 -1
- cosmotech_api/models/send_run_data_request.py +7 -7
- cosmotech_api/models/solution.py +17 -17
- cosmotech_api/models/solution_access_control.py +7 -7
- cosmotech_api/models/solution_role.py +7 -7
- cosmotech_api/models/solution_security.py +10 -10
- cosmotech_api/models/source_info.py +7 -7
- cosmotech_api/models/sub_dataset_graph_query.py +7 -7
- cosmotech_api/models/twin_graph_batch_result.py +7 -7
- cosmotech_api/models/twin_graph_hash.py +1 -1
- cosmotech_api/models/twin_graph_query.py +1 -1
- cosmotech_api/models/twincache_status_enum.py +1 -1
- cosmotech_api/models/validator.py +1 -1
- cosmotech_api/models/workspace.py +8 -8
- cosmotech_api/models/workspace_access_control.py +7 -7
- cosmotech_api/models/workspace_file.py +7 -7
- cosmotech_api/models/workspace_role.py +7 -7
- cosmotech_api/models/workspace_secret.py +1 -1
- cosmotech_api/models/workspace_security.py +10 -10
- cosmotech_api/models/workspace_solution.py +7 -7
- cosmotech_api/models/workspace_web_app.py +7 -7
- cosmotech_api/rest.py +3 -1
- {cosmotech_api-3.2.6.dev2.dist-info → cosmotech_api-4.0.0.dev8.dist-info}/METADATA +1 -1
- cosmotech_api-4.0.0.dev8.dist-info/RECORD +262 -0
- {cosmotech_api-3.2.6.dev2.dist-info → cosmotech_api-4.0.0.dev8.dist-info}/WHEEL +1 -1
- cosmotech_api-3.2.6.dev2.dist-info/RECORD +0 -260
- {cosmotech_api-3.2.6.dev2.dist-info → cosmotech_api-4.0.0.dev8.dist-info}/LICENSE +0 -0
- {cosmotech_api-3.2.6.dev2.dist-info → cosmotech_api-4.0.0.dev8.dist-info}/top_level.txt +0 -0
cosmotech_api/api_client.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Cosmo Tech Platform API
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 4.0.0-onprem.8
|
|
9
9
|
Contact: platform@cosmotech.com
|
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
|
|
@@ -16,6 +16,7 @@
|
|
|
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
|
|
@@ -23,7 +24,8 @@ import re
|
|
|
23
24
|
import tempfile
|
|
24
25
|
|
|
25
26
|
from urllib.parse import quote
|
|
26
|
-
from typing import Tuple, Optional, List, Dict
|
|
27
|
+
from typing import Tuple, Optional, List, Dict, Union
|
|
28
|
+
from pydantic import SecretStr
|
|
27
29
|
|
|
28
30
|
from cosmotech_api.configuration import Configuration
|
|
29
31
|
from cosmotech_api.api_response import ApiResponse, T as ApiResponseT
|
|
@@ -66,6 +68,7 @@ class ApiClient:
|
|
|
66
68
|
'bool': bool,
|
|
67
69
|
'date': datetime.date,
|
|
68
70
|
'datetime': datetime.datetime,
|
|
71
|
+
'decimal': decimal.Decimal,
|
|
69
72
|
'object': object,
|
|
70
73
|
}
|
|
71
74
|
_pool = None
|
|
@@ -208,7 +211,8 @@ class ApiClient:
|
|
|
208
211
|
post_params,
|
|
209
212
|
collection_formats
|
|
210
213
|
)
|
|
211
|
-
|
|
214
|
+
if files:
|
|
215
|
+
post_params.extend(self.files_parameters(files))
|
|
212
216
|
|
|
213
217
|
# auth setting
|
|
214
218
|
self.update_params_for_auth(
|
|
@@ -226,7 +230,7 @@ class ApiClient:
|
|
|
226
230
|
body = self.sanitize_for_serialization(body)
|
|
227
231
|
|
|
228
232
|
# request url
|
|
229
|
-
if _host is None:
|
|
233
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
|
230
234
|
url = self.configuration.host + resource_path
|
|
231
235
|
else:
|
|
232
236
|
# use server/host defined in path or operation instead
|
|
@@ -313,7 +317,7 @@ class ApiClient:
|
|
|
313
317
|
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
|
314
318
|
encoding = match.group(1) if match else "utf-8"
|
|
315
319
|
response_text = response_data.data.decode(encoding)
|
|
316
|
-
return_data = self.deserialize(response_text, response_type)
|
|
320
|
+
return_data = self.deserialize(response_text, response_type, content_type)
|
|
317
321
|
finally:
|
|
318
322
|
if not 200 <= response_data.status <= 299:
|
|
319
323
|
raise ApiException.from_response(
|
|
@@ -333,9 +337,11 @@ class ApiClient:
|
|
|
333
337
|
"""Builds a JSON POST object.
|
|
334
338
|
|
|
335
339
|
If obj is None, return None.
|
|
340
|
+
If obj is SecretStr, return obj.get_secret_value()
|
|
336
341
|
If obj is str, int, long, float, bool, return directly.
|
|
337
342
|
If obj is datetime.datetime, datetime.date
|
|
338
343
|
convert to string in iso8601 format.
|
|
344
|
+
If obj is decimal.Decimal return string representation.
|
|
339
345
|
If obj is list, sanitize each element in the list.
|
|
340
346
|
If obj is dict, return the dict.
|
|
341
347
|
If obj is OpenAPI model, return the properties dict.
|
|
@@ -345,6 +351,10 @@ class ApiClient:
|
|
|
345
351
|
"""
|
|
346
352
|
if obj is None:
|
|
347
353
|
return None
|
|
354
|
+
elif isinstance(obj, Enum):
|
|
355
|
+
return obj.value
|
|
356
|
+
elif isinstance(obj, SecretStr):
|
|
357
|
+
return obj.get_secret_value()
|
|
348
358
|
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
|
349
359
|
return obj
|
|
350
360
|
elif isinstance(obj, list):
|
|
@@ -357,6 +367,8 @@ class ApiClient:
|
|
|
357
367
|
)
|
|
358
368
|
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
|
359
369
|
return obj.isoformat()
|
|
370
|
+
elif isinstance(obj, decimal.Decimal):
|
|
371
|
+
return str(obj)
|
|
360
372
|
|
|
361
373
|
elif isinstance(obj, dict):
|
|
362
374
|
obj_dict = obj
|
|
@@ -366,28 +378,45 @@ class ApiClient:
|
|
|
366
378
|
# and attributes which value is not None.
|
|
367
379
|
# Convert attribute name to json key in
|
|
368
380
|
# model definition for request.
|
|
369
|
-
|
|
381
|
+
if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
|
|
382
|
+
obj_dict = obj.to_dict()
|
|
383
|
+
else:
|
|
384
|
+
obj_dict = obj.__dict__
|
|
370
385
|
|
|
371
386
|
return {
|
|
372
387
|
key: self.sanitize_for_serialization(val)
|
|
373
388
|
for key, val in obj_dict.items()
|
|
374
389
|
}
|
|
375
390
|
|
|
376
|
-
def deserialize(self, response_text, response_type):
|
|
391
|
+
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
|
|
377
392
|
"""Deserializes response into an object.
|
|
378
393
|
|
|
379
394
|
:param response: RESTResponse object to be deserialized.
|
|
380
395
|
:param response_type: class literal for
|
|
381
396
|
deserialized object, or string of class name.
|
|
397
|
+
:param content_type: content type of response.
|
|
382
398
|
|
|
383
399
|
:return: deserialized object.
|
|
384
400
|
"""
|
|
385
401
|
|
|
386
402
|
# fetch data from response object
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
403
|
+
if content_type is None:
|
|
404
|
+
try:
|
|
405
|
+
data = json.loads(response_text)
|
|
406
|
+
except ValueError:
|
|
407
|
+
data = response_text
|
|
408
|
+
elif content_type.startswith("application/json"):
|
|
409
|
+
if response_text == "":
|
|
410
|
+
data = ""
|
|
411
|
+
else:
|
|
412
|
+
data = json.loads(response_text)
|
|
413
|
+
elif content_type.startswith("text/plain"):
|
|
390
414
|
data = response_text
|
|
415
|
+
else:
|
|
416
|
+
raise ApiException(
|
|
417
|
+
status=0,
|
|
418
|
+
reason="Unsupported content type: {0}".format(content_type)
|
|
419
|
+
)
|
|
391
420
|
|
|
392
421
|
return self.__deserialize(data, response_type)
|
|
393
422
|
|
|
@@ -431,6 +460,8 @@ class ApiClient:
|
|
|
431
460
|
return self.__deserialize_date(data)
|
|
432
461
|
elif klass == datetime.datetime:
|
|
433
462
|
return self.__deserialize_datetime(data)
|
|
463
|
+
elif klass == decimal.Decimal:
|
|
464
|
+
return decimal.Decimal(data)
|
|
434
465
|
elif issubclass(klass, Enum):
|
|
435
466
|
return self.__deserialize_enum(data, klass)
|
|
436
467
|
else:
|
|
@@ -505,31 +536,30 @@ class ApiClient:
|
|
|
505
536
|
|
|
506
537
|
return "&".join(["=".join(map(str, item)) for item in new_params])
|
|
507
538
|
|
|
508
|
-
def files_parameters(self, files
|
|
539
|
+
def files_parameters(self, files: Dict[str, Union[str, bytes]]):
|
|
509
540
|
"""Builds form parameters.
|
|
510
541
|
|
|
511
542
|
:param files: File parameters.
|
|
512
543
|
:return: Form parameters with files.
|
|
513
544
|
"""
|
|
514
545
|
params = []
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
546
|
+
for k, v in files.items():
|
|
547
|
+
if isinstance(v, str):
|
|
548
|
+
with open(v, 'rb') as f:
|
|
549
|
+
filename = os.path.basename(f.name)
|
|
550
|
+
filedata = f.read()
|
|
551
|
+
elif isinstance(v, bytes):
|
|
552
|
+
filename = k
|
|
553
|
+
filedata = v
|
|
554
|
+
else:
|
|
555
|
+
raise ValueError("Unsupported file value")
|
|
556
|
+
mimetype = (
|
|
557
|
+
mimetypes.guess_type(filename)[0]
|
|
558
|
+
or 'application/octet-stream'
|
|
559
|
+
)
|
|
560
|
+
params.append(
|
|
561
|
+
tuple([k, tuple([filename, filedata, mimetype])])
|
|
562
|
+
)
|
|
533
563
|
return params
|
|
534
564
|
|
|
535
565
|
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
|
cosmotech_api/configuration.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Cosmo Tech Platform API
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 4.0.0-onprem.8
|
|
9
9
|
Contact: platform@cosmotech.com
|
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
|
|
@@ -33,6 +33,9 @@ class Configuration:
|
|
|
33
33
|
"""This class contains various settings of the API client.
|
|
34
34
|
|
|
35
35
|
:param host: Base url.
|
|
36
|
+
:param ignore_operation_servers
|
|
37
|
+
Boolean to ignore operation servers for the API client.
|
|
38
|
+
Config will use `host` as the base url regardless of the operation servers.
|
|
36
39
|
:param api_key: Dict to store API key(s).
|
|
37
40
|
Each entry in the dict specifies an API key.
|
|
38
41
|
The dict key is the name of the security scheme in the OAS specification.
|
|
@@ -55,6 +58,7 @@ class Configuration:
|
|
|
55
58
|
values before.
|
|
56
59
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
57
60
|
in PEM format.
|
|
61
|
+
:param retries: Number of retries for API requests.
|
|
58
62
|
|
|
59
63
|
:Example:
|
|
60
64
|
"""
|
|
@@ -67,11 +71,15 @@ class Configuration:
|
|
|
67
71
|
access_token=None,
|
|
68
72
|
server_index=None, server_variables=None,
|
|
69
73
|
server_operation_index=None, server_operation_variables=None,
|
|
74
|
+
ignore_operation_servers=False,
|
|
70
75
|
ssl_ca_cert=None,
|
|
76
|
+
retries=None,
|
|
77
|
+
*,
|
|
78
|
+
debug: Optional[bool] = None
|
|
71
79
|
) -> None:
|
|
72
80
|
"""Constructor
|
|
73
81
|
"""
|
|
74
|
-
self._base_path = "
|
|
82
|
+
self._base_path = "http://localhost" if host is None else host
|
|
75
83
|
"""Default Base url
|
|
76
84
|
"""
|
|
77
85
|
self.server_index = 0 if server_index is None and host is None else server_index
|
|
@@ -82,6 +90,9 @@ class Configuration:
|
|
|
82
90
|
self.server_operation_variables = server_operation_variables or {}
|
|
83
91
|
"""Default server variables
|
|
84
92
|
"""
|
|
93
|
+
self.ignore_operation_servers = ignore_operation_servers
|
|
94
|
+
"""Ignore operation servers
|
|
95
|
+
"""
|
|
85
96
|
self.temp_folder_path = None
|
|
86
97
|
"""Temp file folder for downloading files
|
|
87
98
|
"""
|
|
@@ -125,7 +136,10 @@ class Configuration:
|
|
|
125
136
|
self.logger_file = None
|
|
126
137
|
"""Debug file location
|
|
127
138
|
"""
|
|
128
|
-
|
|
139
|
+
if debug is not None:
|
|
140
|
+
self.debug = debug
|
|
141
|
+
else:
|
|
142
|
+
self.__debug = False
|
|
129
143
|
"""Debug switch
|
|
130
144
|
"""
|
|
131
145
|
|
|
@@ -168,7 +182,7 @@ class Configuration:
|
|
|
168
182
|
self.safe_chars_for_path_param = ''
|
|
169
183
|
"""Safe chars for path_param
|
|
170
184
|
"""
|
|
171
|
-
self.retries =
|
|
185
|
+
self.retries = retries
|
|
172
186
|
"""Adding retries to override urllib3 default value 3
|
|
173
187
|
"""
|
|
174
188
|
# Enable client side validation
|
|
@@ -378,7 +392,7 @@ class Configuration:
|
|
|
378
392
|
return "Python SDK Debug Report:\n"\
|
|
379
393
|
"OS: {env}\n"\
|
|
380
394
|
"Python Version: {pyversion}\n"\
|
|
381
|
-
"Version of the API:
|
|
395
|
+
"Version of the API: 4.0.0-onprem.8\n"\
|
|
382
396
|
"SDK Package Version: 1.0.0".\
|
|
383
397
|
format(env=sys.platform, pyversion=sys.version)
|
|
384
398
|
|
|
@@ -389,16 +403,8 @@ class Configuration:
|
|
|
389
403
|
"""
|
|
390
404
|
return [
|
|
391
405
|
{
|
|
392
|
-
'url': "
|
|
393
|
-
'description': "
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
'url': "https://api.cosmotech.com",
|
|
397
|
-
'description': "Production",
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
'url': "https://staging.api.cosmotech.com",
|
|
401
|
-
'description': "Staging",
|
|
406
|
+
'url': "",
|
|
407
|
+
'description': "No description provided",
|
|
402
408
|
}
|
|
403
409
|
]
|
|
404
410
|
|
cosmotech_api/exceptions.py
CHANGED
cosmotech_api/model/connector.py
CHANGED
cosmotech_api/model/dataset.py
CHANGED
cosmotech_api/model/run.py
CHANGED