cosmotech-api 4.0.0.dev9__py3-none-any.whl → 5.0.0b4__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 +33 -27
- cosmotech_api/api/__init__.py +1 -1
- cosmotech_api/api/connector_api.py +19 -8
- cosmotech_api/api/dataset_api.py +1496 -4126
- cosmotech_api/api/meta_api.py +281 -0
- cosmotech_api/api/organization_api.py +605 -562
- cosmotech_api/api/run_api.py +42 -22
- cosmotech_api/api/runner_api.py +512 -467
- cosmotech_api/api/scenario_api.py +141 -121
- cosmotech_api/api/scenariorun_api.py +76 -66
- cosmotech_api/api/scenariorunresult_api.py +1 -1
- cosmotech_api/api/solution_api.py +4265 -619
- cosmotech_api/api/twingraph_api.py +83 -72
- cosmotech_api/api/validator_api.py +1 -1
- cosmotech_api/api/workspace_api.py +795 -1331
- cosmotech_api/api_client.py +14 -5
- cosmotech_api/configuration.py +167 -40
- cosmotech_api/exceptions.py +18 -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 +1 -1
- 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 +1 -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 +32 -26
- cosmotech_api/models/about_info.py +92 -0
- cosmotech_api/models/about_info_version.py +100 -0
- cosmotech_api/models/component_role_permissions.py +5 -5
- cosmotech_api/models/connector.py +1 -1
- cosmotech_api/models/connector_parameter.py +1 -1
- cosmotech_api/models/connector_parameter_group.py +1 -1
- cosmotech_api/models/container_resource_size_info.py +1 -1
- cosmotech_api/models/container_resource_sizing.py +1 -1
- cosmotech_api/models/create_info.py +103 -0
- cosmotech_api/models/created_run.py +2 -2
- cosmotech_api/models/dataset.py +42 -81
- cosmotech_api/models/dataset_access_control.py +1 -1
- cosmotech_api/models/dataset_compatibility.py +1 -1
- cosmotech_api/models/dataset_connector.py +1 -1
- cosmotech_api/models/dataset_copy_parameters.py +1 -1
- cosmotech_api/models/dataset_create_request.py +121 -0
- cosmotech_api/models/dataset_part.py +130 -0
- cosmotech_api/models/dataset_part_create_request.py +98 -0
- cosmotech_api/models/dataset_part_type_enum.py +38 -0
- cosmotech_api/models/dataset_part_update_request.py +93 -0
- cosmotech_api/models/dataset_role.py +1 -1
- cosmotech_api/models/dataset_search.py +1 -1
- cosmotech_api/models/dataset_security.py +1 -1
- cosmotech_api/models/dataset_source_type.py +1 -1
- cosmotech_api/models/dataset_twin_graph_hash.py +1 -1
- cosmotech_api/models/dataset_twin_graph_info.py +1 -1
- cosmotech_api/models/dataset_twin_graph_query.py +1 -1
- cosmotech_api/models/dataset_update_request.py +109 -0
- cosmotech_api/models/delete_historical_data.py +1 -1
- cosmotech_api/models/edit_info.py +90 -0
- cosmotech_api/models/file_upload_metadata.py +1 -1
- cosmotech_api/models/file_upload_validation.py +1 -1
- cosmotech_api/models/graph_properties.py +1 -1
- cosmotech_api/models/ingestion_status_enum.py +1 -1
- cosmotech_api/models/io_types_enum.py +1 -1
- cosmotech_api/models/last_run_info.py +100 -0
- cosmotech_api/models/organization.py +18 -11
- cosmotech_api/models/organization_access_control.py +4 -4
- cosmotech_api/models/organization_create_request.py +95 -0
- cosmotech_api/models/organization_edit_info.py +90 -0
- cosmotech_api/models/organization_role.py +3 -3
- cosmotech_api/models/organization_security.py +4 -4
- cosmotech_api/models/organization_service.py +7 -7
- cosmotech_api/models/organization_services.py +7 -7
- cosmotech_api/models/organization_update_request.py +89 -0
- cosmotech_api/models/query_result.py +1 -1
- cosmotech_api/models/resource_size_info.py +1 -1
- cosmotech_api/models/run.py +8 -10
- cosmotech_api/models/run_container.py +1 -1
- cosmotech_api/models/run_container_artifact.py +7 -7
- cosmotech_api/models/run_container_logs.py +7 -7
- cosmotech_api/models/run_data.py +2 -2
- cosmotech_api/models/run_data_query.py +1 -1
- cosmotech_api/models/run_edit_info.py +90 -0
- cosmotech_api/models/run_logs.py +1 -1
- cosmotech_api/models/run_logs_entry.py +1 -1
- cosmotech_api/models/run_resource_requested.py +1 -1
- cosmotech_api/models/run_search.py +7 -7
- cosmotech_api/models/run_search_state.py +1 -1
- cosmotech_api/models/run_start_containers.py +10 -10
- cosmotech_api/models/run_state.py +2 -1
- cosmotech_api/models/run_status.py +8 -2
- cosmotech_api/models/run_status_node.py +1 -1
- cosmotech_api/models/run_template.py +14 -69
- cosmotech_api/models/run_template_create_request.py +109 -0
- 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 +14 -11
- cosmotech_api/models/run_template_parameter_create_request.py +105 -0
- cosmotech_api/models/run_template_parameter_group.py +12 -9
- cosmotech_api/models/run_template_parameter_group_create_request.py +101 -0
- cosmotech_api/models/run_template_parameter_group_update_request.py +98 -0
- cosmotech_api/models/run_template_parameter_update_request.py +103 -0
- cosmotech_api/models/run_template_parameter_value.py +1 -1
- cosmotech_api/models/run_template_resource_sizing.py +2 -2
- cosmotech_api/models/run_template_step_source.py +1 -1
- cosmotech_api/models/run_template_update_request.py +107 -0
- cosmotech_api/models/runner.py +31 -28
- cosmotech_api/models/runner_access_control.py +1 -1
- cosmotech_api/models/runner_changed_parameter_value.py +7 -7
- cosmotech_api/models/runner_comparison_result.py +10 -10
- cosmotech_api/models/runner_create_request.py +154 -0
- cosmotech_api/models/runner_data_download_info.py +12 -9
- cosmotech_api/models/runner_data_download_job.py +7 -7
- cosmotech_api/models/runner_edit_info.py +90 -0
- cosmotech_api/models/runner_job_state.py +1 -1
- cosmotech_api/models/runner_last_run.py +7 -7
- cosmotech_api/models/runner_parent_last_run.py +7 -7
- cosmotech_api/models/runner_resource_sizing.py +1 -1
- cosmotech_api/models/runner_role.py +1 -1
- cosmotech_api/models/runner_root_last_run.py +7 -7
- cosmotech_api/models/runner_run_template_parameter_value.py +1 -1
- cosmotech_api/models/runner_security.py +1 -1
- cosmotech_api/models/runner_update_request.py +123 -0
- cosmotech_api/models/runner_validation_status.py +1 -1
- cosmotech_api/models/scenario.py +10 -10
- cosmotech_api/models/scenario_access_control.py +7 -7
- cosmotech_api/models/scenario_changed_parameter_value.py +7 -7
- cosmotech_api/models/scenario_comparison_result.py +10 -10
- cosmotech_api/models/scenario_data_download_info.py +7 -7
- cosmotech_api/models/scenario_data_download_job.py +7 -7
- cosmotech_api/models/scenario_job_state.py +1 -1
- cosmotech_api/models/scenario_last_run.py +7 -7
- cosmotech_api/models/scenario_resource_sizing.py +7 -7
- cosmotech_api/models/scenario_role.py +7 -7
- cosmotech_api/models/scenario_run.py +13 -13
- cosmotech_api/models/scenario_run_container.py +10 -10
- cosmotech_api/models/scenario_run_container_artifact.py +7 -7
- cosmotech_api/models/scenario_run_container_logs.py +7 -7
- cosmotech_api/models/scenario_run_logs.py +10 -10
- cosmotech_api/models/scenario_run_resource_requested.py +7 -7
- cosmotech_api/models/scenario_run_search.py +7 -7
- cosmotech_api/models/scenario_run_search_state.py +1 -1
- cosmotech_api/models/scenario_run_start_containers.py +10 -10
- cosmotech_api/models/scenario_run_state.py +1 -1
- cosmotech_api/models/scenario_run_status.py +10 -10
- cosmotech_api/models/scenario_run_status_node.py +7 -7
- cosmotech_api/models/scenario_run_template_parameter_value.py +7 -7
- cosmotech_api/models/scenario_security.py +10 -10
- cosmotech_api/models/scenario_validation_status.py +1 -1
- cosmotech_api/models/send_run_data_request.py +5 -5
- cosmotech_api/models/solution.py +45 -29
- cosmotech_api/models/solution_access_control.py +4 -4
- cosmotech_api/models/solution_create_request.py +139 -0
- cosmotech_api/models/solution_edit_info.py +90 -0
- cosmotech_api/models/solution_file.py +88 -0
- cosmotech_api/models/solution_role.py +3 -3
- cosmotech_api/models/solution_security.py +4 -4
- cosmotech_api/models/solution_update_request.py +133 -0
- cosmotech_api/models/source_info.py +1 -1
- cosmotech_api/models/sub_dataset_graph_query.py +1 -1
- cosmotech_api/models/twin_graph_batch_result.py +1 -1
- cosmotech_api/models/twin_graph_hash.py +7 -7
- cosmotech_api/models/twin_graph_query.py +7 -7
- cosmotech_api/models/twincache_status_enum.py +1 -1
- cosmotech_api/models/validator.py +7 -7
- cosmotech_api/models/workspace.py +38 -30
- cosmotech_api/models/workspace_access_control.py +4 -4
- cosmotech_api/models/workspace_create_request.py +117 -0
- cosmotech_api/models/workspace_edit_info.py +90 -0
- cosmotech_api/models/workspace_file.py +4 -4
- cosmotech_api/models/workspace_role.py +3 -3
- cosmotech_api/models/workspace_secret.py +7 -7
- cosmotech_api/models/workspace_security.py +4 -4
- cosmotech_api/models/workspace_solution.py +14 -6
- cosmotech_api/models/workspace_update_request.py +109 -0
- cosmotech_api/models/workspace_web_app.py +4 -4
- cosmotech_api/rest.py +3 -2
- cosmotech_api-5.0.0b4.dist-info/METADATA +27 -0
- cosmotech_api-5.0.0b4.dist-info/RECORD +294 -0
- {cosmotech_api-4.0.0.dev9.dist-info → cosmotech_api-5.0.0b4.dist-info}/WHEEL +1 -1
- {cosmotech_api-4.0.0.dev9.dist-info → cosmotech_api-5.0.0b4.dist-info/licenses}/LICENSE +1 -1
- cosmotech_api-4.0.0.dev9.dist-info/METADATA +0 -18
- cosmotech_api-4.0.0.dev9.dist-info/RECORD +0 -262
- {cosmotech_api-4.0.0.dev9.dist-info → cosmotech_api-5.0.0b4.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: 5.0.0-beta4
|
|
9
9
|
Contact: platform@cosmotech.com
|
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
|
|
@@ -405,12 +405,12 @@ class ApiClient:
|
|
|
405
405
|
data = json.loads(response_text)
|
|
406
406
|
except ValueError:
|
|
407
407
|
data = response_text
|
|
408
|
-
elif
|
|
408
|
+
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
|
409
409
|
if response_text == "":
|
|
410
410
|
data = ""
|
|
411
411
|
else:
|
|
412
412
|
data = json.loads(response_text)
|
|
413
|
-
elif
|
|
413
|
+
elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
|
|
414
414
|
data = response_text
|
|
415
415
|
else:
|
|
416
416
|
raise ApiException(
|
|
@@ -518,7 +518,7 @@ class ApiClient:
|
|
|
518
518
|
if k in collection_formats:
|
|
519
519
|
collection_format = collection_formats[k]
|
|
520
520
|
if collection_format == 'multi':
|
|
521
|
-
new_params.extend((k, str(value)) for value in v)
|
|
521
|
+
new_params.extend((k, quote(str(value))) for value in v)
|
|
522
522
|
else:
|
|
523
523
|
if collection_format == 'ssv':
|
|
524
524
|
delimiter = ' '
|
|
@@ -536,7 +536,10 @@ class ApiClient:
|
|
|
536
536
|
|
|
537
537
|
return "&".join(["=".join(map(str, item)) for item in new_params])
|
|
538
538
|
|
|
539
|
-
def files_parameters(
|
|
539
|
+
def files_parameters(
|
|
540
|
+
self,
|
|
541
|
+
files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
|
|
542
|
+
):
|
|
540
543
|
"""Builds form parameters.
|
|
541
544
|
|
|
542
545
|
:param files: File parameters.
|
|
@@ -551,6 +554,12 @@ class ApiClient:
|
|
|
551
554
|
elif isinstance(v, bytes):
|
|
552
555
|
filename = k
|
|
553
556
|
filedata = v
|
|
557
|
+
elif isinstance(v, tuple):
|
|
558
|
+
filename, filedata = v
|
|
559
|
+
elif isinstance(v, list):
|
|
560
|
+
for file_param in v:
|
|
561
|
+
params.extend(self.files_parameters({k: file_param}))
|
|
562
|
+
continue
|
|
554
563
|
else:
|
|
555
564
|
raise ValueError("Unsupported file value")
|
|
556
565
|
mimetype = (
|
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: 5.0.0-beta4
|
|
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,6 +31,107 @@ 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
|
|
|
@@ -59,27 +162,36 @@ class Configuration:
|
|
|
59
162
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
60
163
|
in PEM format.
|
|
61
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.
|
|
62
167
|
|
|
63
168
|
:Example:
|
|
64
169
|
"""
|
|
65
170
|
|
|
66
|
-
_default = None
|
|
67
|
-
|
|
68
|
-
def __init__(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
171
|
+
_default: ClassVar[Optional[Self]] = None
|
|
172
|
+
|
|
173
|
+
def __init__(
|
|
174
|
+
self,
|
|
175
|
+
host: Optional[str]=None,
|
|
176
|
+
api_key: Optional[Dict[str, str]]=None,
|
|
177
|
+
api_key_prefix: Optional[Dict[str, str]]=None,
|
|
178
|
+
username: Optional[str]=None,
|
|
179
|
+
password: Optional[str]=None,
|
|
180
|
+
access_token: Optional[str]=None,
|
|
181
|
+
server_index: Optional[int]=None,
|
|
182
|
+
server_variables: Optional[ServerVariablesT]=None,
|
|
183
|
+
server_operation_index: Optional[Dict[int, int]]=None,
|
|
184
|
+
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
|
185
|
+
ignore_operation_servers: bool=False,
|
|
186
|
+
ssl_ca_cert: Optional[str]=None,
|
|
187
|
+
retries: Optional[int] = None,
|
|
188
|
+
ca_cert_data: Optional[Union[str, bytes]] = None,
|
|
189
|
+
*,
|
|
190
|
+
debug: Optional[bool] = None,
|
|
191
|
+
) -> None:
|
|
80
192
|
"""Constructor
|
|
81
193
|
"""
|
|
82
|
-
self._base_path = "http://localhost" if host is None else host
|
|
194
|
+
self._base_path = "http://localhost:8080" if host is None else host
|
|
83
195
|
"""Default Base url
|
|
84
196
|
"""
|
|
85
197
|
self.server_index = 0 if server_index is None and host is None else server_index
|
|
@@ -151,6 +263,10 @@ class Configuration:
|
|
|
151
263
|
self.ssl_ca_cert = ssl_ca_cert
|
|
152
264
|
"""Set this to customize the certificate file to verify the peer.
|
|
153
265
|
"""
|
|
266
|
+
self.ca_cert_data = ca_cert_data
|
|
267
|
+
"""Set this to verify the peer using PEM (str) or DER (bytes)
|
|
268
|
+
certificate data.
|
|
269
|
+
"""
|
|
154
270
|
self.cert_file = None
|
|
155
271
|
"""client certificate file
|
|
156
272
|
"""
|
|
@@ -200,7 +316,7 @@ class Configuration:
|
|
|
200
316
|
"""date format
|
|
201
317
|
"""
|
|
202
318
|
|
|
203
|
-
def __deepcopy__(self, memo):
|
|
319
|
+
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
|
204
320
|
cls = self.__class__
|
|
205
321
|
result = cls.__new__(cls)
|
|
206
322
|
memo[id(self)] = result
|
|
@@ -214,11 +330,11 @@ class Configuration:
|
|
|
214
330
|
result.debug = self.debug
|
|
215
331
|
return result
|
|
216
332
|
|
|
217
|
-
def __setattr__(self, name, value):
|
|
333
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
|
218
334
|
object.__setattr__(self, name, value)
|
|
219
335
|
|
|
220
336
|
@classmethod
|
|
221
|
-
def set_default(cls, default):
|
|
337
|
+
def set_default(cls, default: Optional[Self]) -> None:
|
|
222
338
|
"""Set default instance of configuration.
|
|
223
339
|
|
|
224
340
|
It stores default configuration, which can be
|
|
@@ -229,7 +345,7 @@ class Configuration:
|
|
|
229
345
|
cls._default = default
|
|
230
346
|
|
|
231
347
|
@classmethod
|
|
232
|
-
def get_default_copy(cls):
|
|
348
|
+
def get_default_copy(cls) -> Self:
|
|
233
349
|
"""Deprecated. Please use `get_default` instead.
|
|
234
350
|
|
|
235
351
|
Deprecated. Please use `get_default` instead.
|
|
@@ -239,7 +355,7 @@ class Configuration:
|
|
|
239
355
|
return cls.get_default()
|
|
240
356
|
|
|
241
357
|
@classmethod
|
|
242
|
-
def get_default(cls):
|
|
358
|
+
def get_default(cls) -> Self:
|
|
243
359
|
"""Return the default configuration.
|
|
244
360
|
|
|
245
361
|
This method returns newly created, based on default constructor,
|
|
@@ -249,11 +365,11 @@ class Configuration:
|
|
|
249
365
|
:return: The configuration object.
|
|
250
366
|
"""
|
|
251
367
|
if cls._default is None:
|
|
252
|
-
cls._default =
|
|
368
|
+
cls._default = cls()
|
|
253
369
|
return cls._default
|
|
254
370
|
|
|
255
371
|
@property
|
|
256
|
-
def logger_file(self):
|
|
372
|
+
def logger_file(self) -> Optional[str]:
|
|
257
373
|
"""The logger file.
|
|
258
374
|
|
|
259
375
|
If the logger_file is None, then add stream handler and remove file
|
|
@@ -265,7 +381,7 @@ class Configuration:
|
|
|
265
381
|
return self.__logger_file
|
|
266
382
|
|
|
267
383
|
@logger_file.setter
|
|
268
|
-
def logger_file(self, value):
|
|
384
|
+
def logger_file(self, value: Optional[str]) -> None:
|
|
269
385
|
"""The logger file.
|
|
270
386
|
|
|
271
387
|
If the logger_file is None, then add stream handler and remove file
|
|
@@ -284,7 +400,7 @@ class Configuration:
|
|
|
284
400
|
logger.addHandler(self.logger_file_handler)
|
|
285
401
|
|
|
286
402
|
@property
|
|
287
|
-
def debug(self):
|
|
403
|
+
def debug(self) -> bool:
|
|
288
404
|
"""Debug status
|
|
289
405
|
|
|
290
406
|
:param value: The debug status, True or False.
|
|
@@ -293,7 +409,7 @@ class Configuration:
|
|
|
293
409
|
return self.__debug
|
|
294
410
|
|
|
295
411
|
@debug.setter
|
|
296
|
-
def debug(self, value):
|
|
412
|
+
def debug(self, value: bool) -> None:
|
|
297
413
|
"""Debug status
|
|
298
414
|
|
|
299
415
|
:param value: The debug status, True or False.
|
|
@@ -315,7 +431,7 @@ class Configuration:
|
|
|
315
431
|
httplib.HTTPConnection.debuglevel = 0
|
|
316
432
|
|
|
317
433
|
@property
|
|
318
|
-
def logger_format(self):
|
|
434
|
+
def logger_format(self) -> str:
|
|
319
435
|
"""The logger format.
|
|
320
436
|
|
|
321
437
|
The logger_formatter will be updated when sets logger_format.
|
|
@@ -326,7 +442,7 @@ class Configuration:
|
|
|
326
442
|
return self.__logger_format
|
|
327
443
|
|
|
328
444
|
@logger_format.setter
|
|
329
|
-
def logger_format(self, value):
|
|
445
|
+
def logger_format(self, value: str) -> None:
|
|
330
446
|
"""The logger format.
|
|
331
447
|
|
|
332
448
|
The logger_formatter will be updated when sets logger_format.
|
|
@@ -337,7 +453,7 @@ class Configuration:
|
|
|
337
453
|
self.__logger_format = value
|
|
338
454
|
self.logger_formatter = logging.Formatter(self.__logger_format)
|
|
339
455
|
|
|
340
|
-
def get_api_key_with_prefix(self, identifier, alias=None):
|
|
456
|
+
def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
|
|
341
457
|
"""Gets API key (with prefix if set).
|
|
342
458
|
|
|
343
459
|
:param identifier: The identifier of apiKey.
|
|
@@ -354,7 +470,9 @@ class Configuration:
|
|
|
354
470
|
else:
|
|
355
471
|
return key
|
|
356
472
|
|
|
357
|
-
|
|
473
|
+
return None
|
|
474
|
+
|
|
475
|
+
def get_basic_auth_token(self) -> Optional[str]:
|
|
358
476
|
"""Gets HTTP basic authentication header (string).
|
|
359
477
|
|
|
360
478
|
:return: The token for basic HTTP authentication.
|
|
@@ -369,12 +487,12 @@ class Configuration:
|
|
|
369
487
|
basic_auth=username + ':' + password
|
|
370
488
|
).get('authorization')
|
|
371
489
|
|
|
372
|
-
def auth_settings(self):
|
|
490
|
+
def auth_settings(self)-> AuthSettings:
|
|
373
491
|
"""Gets Auth Settings dict for api client.
|
|
374
492
|
|
|
375
493
|
:return: The Auth Settings information dict.
|
|
376
494
|
"""
|
|
377
|
-
auth = {}
|
|
495
|
+
auth: AuthSettings = {}
|
|
378
496
|
if self.access_token is not None:
|
|
379
497
|
auth['oAuth2AuthCode'] = {
|
|
380
498
|
'type': 'oauth2',
|
|
@@ -384,7 +502,7 @@ class Configuration:
|
|
|
384
502
|
}
|
|
385
503
|
return auth
|
|
386
504
|
|
|
387
|
-
def to_debug_report(self):
|
|
505
|
+
def to_debug_report(self) -> str:
|
|
388
506
|
"""Gets the essential information for debugging.
|
|
389
507
|
|
|
390
508
|
:return: The report for debugging.
|
|
@@ -392,23 +510,32 @@ class Configuration:
|
|
|
392
510
|
return "Python SDK Debug Report:\n"\
|
|
393
511
|
"OS: {env}\n"\
|
|
394
512
|
"Python Version: {pyversion}\n"\
|
|
395
|
-
"Version of the API:
|
|
513
|
+
"Version of the API: 5.0.0-beta4\n"\
|
|
396
514
|
"SDK Package Version: 1.0.0".\
|
|
397
515
|
format(env=sys.platform, pyversion=sys.version)
|
|
398
516
|
|
|
399
|
-
def get_host_settings(self):
|
|
517
|
+
def get_host_settings(self) -> List[HostSetting]:
|
|
400
518
|
"""Gets an array of host settings
|
|
401
519
|
|
|
402
520
|
:return: An array of host settings
|
|
403
521
|
"""
|
|
404
522
|
return [
|
|
523
|
+
{
|
|
524
|
+
'url': "http://localhost:8080",
|
|
525
|
+
'description': "No description provided",
|
|
526
|
+
},
|
|
405
527
|
{
|
|
406
528
|
'url': "",
|
|
407
529
|
'description': "No description provided",
|
|
408
530
|
}
|
|
409
531
|
]
|
|
410
532
|
|
|
411
|
-
def get_host_from_settings(
|
|
533
|
+
def get_host_from_settings(
|
|
534
|
+
self,
|
|
535
|
+
index: Optional[int],
|
|
536
|
+
variables: Optional[ServerVariablesT]=None,
|
|
537
|
+
servers: Optional[List[HostSetting]]=None,
|
|
538
|
+
) -> str:
|
|
412
539
|
"""Gets host URL based on the index and variables
|
|
413
540
|
:param index: array index of the host settings
|
|
414
541
|
:param variables: hash of variable and the corresponding value
|
|
@@ -448,12 +575,12 @@ class Configuration:
|
|
|
448
575
|
return url
|
|
449
576
|
|
|
450
577
|
@property
|
|
451
|
-
def host(self):
|
|
578
|
+
def host(self) -> str:
|
|
452
579
|
"""Return generated host."""
|
|
453
580
|
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
|
454
581
|
|
|
455
582
|
@host.setter
|
|
456
|
-
def host(self, value):
|
|
583
|
+
def host(self, value: str) -> None:
|
|
457
584
|
"""Fix base path."""
|
|
458
585
|
self._base_path = value
|
|
459
586
|
self.server_index = None
|
cosmotech_api/exceptions.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: 5.0.0-beta4
|
|
9
9
|
Contact: platform@cosmotech.com
|
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
|
|
@@ -151,6 +151,13 @@ class ApiException(OpenApiException):
|
|
|
151
151
|
if http_resp.status == 404:
|
|
152
152
|
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
153
|
|
|
154
|
+
# Added new conditions for 409 and 422
|
|
155
|
+
if http_resp.status == 409:
|
|
156
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
157
|
+
|
|
158
|
+
if http_resp.status == 422:
|
|
159
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
160
|
+
|
|
154
161
|
if 500 <= http_resp.status <= 599:
|
|
155
162
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
156
163
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
@@ -189,6 +196,16 @@ class ServiceException(ApiException):
|
|
|
189
196
|
pass
|
|
190
197
|
|
|
191
198
|
|
|
199
|
+
class ConflictException(ApiException):
|
|
200
|
+
"""Exception for HTTP 409 Conflict."""
|
|
201
|
+
pass
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class UnprocessableEntityException(ApiException):
|
|
205
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
|
|
192
209
|
def render_path(path_to_item):
|
|
193
210
|
"""Returns a string representation of a path"""
|
|
194
211
|
result = ""
|
cosmotech_api/model/connector.py
CHANGED
cosmotech_api/model/dataset.py
CHANGED