cosmotech-api 3.1.1__py3-none-any.whl → 3.2.0__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 +134 -9
- cosmotech_api/api/__init__.py +14 -3
- cosmotech_api/api/connector_api.py +1313 -641
- cosmotech_api/api/dataset_api.py +8974 -4465
- cosmotech_api/api/organization_api.py +4633 -2269
- cosmotech_api/api/run_api.py +2174 -778
- cosmotech_api/api/runner_api.py +4483 -2280
- cosmotech_api/api/scenario_api.py +6544 -3265
- cosmotech_api/api/scenariorun_api.py +4007 -1960
- cosmotech_api/api/scenariorunresult_api.py +659 -341
- cosmotech_api/api/solution_api.py +6341 -3140
- cosmotech_api/api/twingraph_api.py +4134 -2077
- cosmotech_api/api/validator_api.py +2501 -1249
- cosmotech_api/api/workspace_api.py +5999 -2977
- cosmotech_api/api_client.py +529 -637
- cosmotech_api/configuration.py +63 -73
- cosmotech_api/exceptions.py +71 -31
- 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_import.py +1 -1
- cosmotech_api/model/twin_graph_import_info.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 +124 -114
- cosmotech_api/models/component_role_permissions.py +1 -1
- 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/dataset.py +1 -1
- 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_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/delete_historical_data.py +1 -1
- 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/organization.py +1 -1
- cosmotech_api/models/organization_access_control.py +1 -1
- cosmotech_api/models/organization_role.py +1 -1
- cosmotech_api/models/organization_security.py +1 -1
- cosmotech_api/models/organization_service.py +1 -1
- cosmotech_api/models/organization_services.py +1 -1
- cosmotech_api/models/query_result.py +88 -0
- cosmotech_api/models/resource_size_info.py +1 -1
- cosmotech_api/models/run.py +1 -1
- cosmotech_api/models/run_container.py +1 -1
- cosmotech_api/models/run_container_artifact.py +1 -1
- cosmotech_api/models/run_container_logs.py +1 -1
- cosmotech_api/models/run_data.py +92 -0
- cosmotech_api/models/run_data_query.py +88 -0
- cosmotech_api/models/run_logs.py +1 -1
- cosmotech_api/models/run_resource_requested.py +1 -1
- cosmotech_api/models/run_search.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 +1 -1
- cosmotech_api/models/run_status_node.py +1 -1
- cosmotech_api/models/run_template.py +1 -1
- 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 +1 -1
- cosmotech_api/models/run_template_parameter_group.py +1 -1
- cosmotech_api/models/run_template_parameter_value.py +1 -1
- cosmotech_api/models/run_template_resource_sizing.py +1 -1
- cosmotech_api/models/run_template_step_source.py +1 -1
- cosmotech_api/models/runner.py +1 -1
- cosmotech_api/models/runner_access_control.py +1 -1
- 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_job_state.py +1 -1
- cosmotech_api/models/runner_last_run.py +1 -1
- cosmotech_api/models/runner_parent_last_run.py +1 -1
- 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 +1 -1
- cosmotech_api/models/runner_run_template_parameter_value.py +1 -1
- cosmotech_api/models/runner_security.py +1 -1
- cosmotech_api/models/runner_validation_status.py +1 -1
- cosmotech_api/models/scenario.py +1 -1
- 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_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 +90 -0
- cosmotech_api/models/solution.py +1 -1
- cosmotech_api/models/solution_access_control.py +1 -1
- cosmotech_api/models/solution_role.py +1 -1
- cosmotech_api/models/solution_security.py +1 -1
- 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 +1 -1
- cosmotech_api/models/twin_graph_query.py +1 -1
- cosmotech_api/models/validator.py +1 -1
- cosmotech_api/models/validator_run.py +1 -1
- cosmotech_api/models/workspace.py +1 -1
- cosmotech_api/models/workspace_access_control.py +1 -1
- cosmotech_api/models/workspace_file.py +1 -1
- cosmotech_api/models/workspace_role.py +1 -1
- cosmotech_api/models/workspace_secret.py +1 -1
- cosmotech_api/models/workspace_security.py +1 -1
- cosmotech_api/models/workspace_solution.py +1 -1
- cosmotech_api/models/workspace_web_app.py +1 -1
- cosmotech_api/rest.py +139 -230
- {cosmotech_api-3.1.1.dist-info → cosmotech_api-3.2.0.dist-info}/METADATA +6 -4
- cosmotech_api-3.2.0.dist-info/RECORD +255 -0
- cosmotech_api-3.1.1.dist-info/RECORD +0 -251
- {cosmotech_api-3.1.1.dist-info → cosmotech_api-3.2.0.dist-info}/LICENSE +0 -0
- {cosmotech_api-3.1.1.dist-info → cosmotech_api-3.2.0.dist-info}/WHEEL +0 -0
- {cosmotech_api-3.1.1.dist-info → cosmotech_api-3.2.0.dist-info}/top_level.txt +0 -0
cosmotech_api/configuration.py
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
1
3
|
"""
|
|
2
4
|
Cosmo Tech Platform API
|
|
3
5
|
|
|
4
|
-
Cosmo Tech Platform API
|
|
6
|
+
Cosmo Tech Platform API
|
|
5
7
|
|
|
6
|
-
The version of the OpenAPI document: 3.
|
|
8
|
+
The version of the OpenAPI document: 3.2.0
|
|
7
9
|
Contact: platform@cosmotech.com
|
|
8
|
-
Generated by
|
|
9
|
-
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
10
14
|
|
|
11
15
|
|
|
12
16
|
import copy
|
|
13
17
|
import logging
|
|
18
|
+
from logging import FileHandler
|
|
14
19
|
import multiprocessing
|
|
15
20
|
import sys
|
|
21
|
+
from typing import Optional
|
|
16
22
|
import urllib3
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
from cosmotech_api.exceptions import ApiValueError
|
|
20
|
-
|
|
24
|
+
import http.client as httplib
|
|
21
25
|
|
|
22
26
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
23
27
|
'multipleOf', 'maximum', 'exclusiveMaximum',
|
|
@@ -25,46 +29,20 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
|
25
29
|
'minLength', 'pattern', 'maxItems', 'minItems'
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
class Configuration
|
|
29
|
-
"""
|
|
32
|
+
class Configuration:
|
|
33
|
+
"""This class contains various settings of the API client.
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
Do not edit the class manually.
|
|
33
|
-
|
|
34
|
-
:param host: Base url
|
|
35
|
+
:param host: Base url.
|
|
35
36
|
:param api_key: Dict to store API key(s).
|
|
36
37
|
Each entry in the dict specifies an API key.
|
|
37
38
|
The dict key is the name of the security scheme in the OAS specification.
|
|
38
39
|
The dict value is the API key secret.
|
|
39
|
-
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
|
|
40
|
+
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
|
40
41
|
The dict key is the name of the security scheme in the OAS specification.
|
|
41
42
|
The dict value is an API key prefix when generating the auth data.
|
|
42
|
-
:param username: Username for HTTP basic authentication
|
|
43
|
-
:param password: Password for HTTP basic authentication
|
|
44
|
-
:param
|
|
45
|
-
unknown properties. A server may send a response that includes additional
|
|
46
|
-
properties that are not known by the client in the following scenarios:
|
|
47
|
-
1. The OpenAPI document is incomplete, i.e. it does not match the server
|
|
48
|
-
implementation.
|
|
49
|
-
2. The client was generated using an older version of the OpenAPI document
|
|
50
|
-
and the server has been upgraded since then.
|
|
51
|
-
If a schema in the OpenAPI document defines the additionalProperties attribute,
|
|
52
|
-
then all undeclared properties received by the server are injected into the
|
|
53
|
-
additional properties map. In that case, there are undeclared properties, and
|
|
54
|
-
nothing to discard.
|
|
55
|
-
:param disabled_client_side_validations (string): Comma-separated list of
|
|
56
|
-
JSON schema validation keywords to disable JSON schema structural validation
|
|
57
|
-
rules. The following keywords may be specified: multipleOf, maximum,
|
|
58
|
-
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
|
|
59
|
-
maxItems, minItems.
|
|
60
|
-
By default, the validation is performed for data generated locally by the client
|
|
61
|
-
and data received from the server, independent of any validation performed by
|
|
62
|
-
the server side. If the input data does not satisfy the JSON schema validation
|
|
63
|
-
rules specified in the OpenAPI document, an exception is raised.
|
|
64
|
-
If disabled_client_side_validations is set, structural validation is
|
|
65
|
-
disabled. This can be useful to troubleshoot data validation problem, such as
|
|
66
|
-
when the OpenAPI document validation rules do not match the actual API data
|
|
67
|
-
received by the server.
|
|
43
|
+
:param username: Username for HTTP basic authentication.
|
|
44
|
+
:param password: Password for HTTP basic authentication.
|
|
45
|
+
:param access_token: Access token.
|
|
68
46
|
:param server_index: Index to servers configuration.
|
|
69
47
|
:param server_variables: Mapping with string values to replace variables in
|
|
70
48
|
templated server configuration. The validation of enums is performed for
|
|
@@ -73,9 +51,10 @@ class Configuration(object):
|
|
|
73
51
|
configuration.
|
|
74
52
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
|
75
53
|
string values to replace variables in templated server configuration.
|
|
76
|
-
The validation of enums is performed for variables with defined enum
|
|
54
|
+
The validation of enums is performed for variables with defined enum
|
|
55
|
+
values before.
|
|
77
56
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
78
|
-
in PEM format
|
|
57
|
+
in PEM format.
|
|
79
58
|
|
|
80
59
|
:Example:
|
|
81
60
|
"""
|
|
@@ -84,14 +63,12 @@ class Configuration(object):
|
|
|
84
63
|
|
|
85
64
|
def __init__(self, host=None,
|
|
86
65
|
api_key=None, api_key_prefix=None,
|
|
87
|
-
access_token=None,
|
|
88
66
|
username=None, password=None,
|
|
89
|
-
|
|
90
|
-
disabled_client_side_validations="",
|
|
67
|
+
access_token=None,
|
|
91
68
|
server_index=None, server_variables=None,
|
|
92
69
|
server_operation_index=None, server_operation_variables=None,
|
|
93
70
|
ssl_ca_cert=None,
|
|
94
|
-
):
|
|
71
|
+
) -> None:
|
|
95
72
|
"""Constructor
|
|
96
73
|
"""
|
|
97
74
|
self._base_path = "https://dev.api.cosmotech.com" if host is None else host
|
|
@@ -109,7 +86,6 @@ class Configuration(object):
|
|
|
109
86
|
"""Temp file folder for downloading files
|
|
110
87
|
"""
|
|
111
88
|
# Authentication Settings
|
|
112
|
-
self.access_token = access_token
|
|
113
89
|
self.api_key = {}
|
|
114
90
|
if api_key:
|
|
115
91
|
self.api_key = api_key
|
|
@@ -129,8 +105,9 @@ class Configuration(object):
|
|
|
129
105
|
self.password = password
|
|
130
106
|
"""Password for HTTP basic authentication
|
|
131
107
|
"""
|
|
132
|
-
self.
|
|
133
|
-
|
|
108
|
+
self.access_token = access_token
|
|
109
|
+
"""Access token
|
|
110
|
+
"""
|
|
134
111
|
self.logger = {}
|
|
135
112
|
"""Logging Settings
|
|
136
113
|
"""
|
|
@@ -142,7 +119,7 @@ class Configuration(object):
|
|
|
142
119
|
self.logger_stream_handler = None
|
|
143
120
|
"""Log stream handler
|
|
144
121
|
"""
|
|
145
|
-
self.logger_file_handler = None
|
|
122
|
+
self.logger_file_handler: Optional[FileHandler] = None
|
|
146
123
|
"""Log file handler
|
|
147
124
|
"""
|
|
148
125
|
self.logger_file = None
|
|
@@ -169,6 +146,10 @@ class Configuration(object):
|
|
|
169
146
|
self.assert_hostname = None
|
|
170
147
|
"""Set this to True/False to enable/disable SSL hostname verification.
|
|
171
148
|
"""
|
|
149
|
+
self.tls_server_name = None
|
|
150
|
+
"""SSL/TLS Server Name Indication (SNI)
|
|
151
|
+
Set this to the SNI value expected by the server.
|
|
152
|
+
"""
|
|
172
153
|
|
|
173
154
|
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
|
174
155
|
"""urllib3 connection pool's maximum number of connections saved
|
|
@@ -178,12 +159,9 @@ class Configuration(object):
|
|
|
178
159
|
cpu_count * 5 is used as default value to increase performance.
|
|
179
160
|
"""
|
|
180
161
|
|
|
181
|
-
self.proxy = None
|
|
162
|
+
self.proxy: Optional[str] = None
|
|
182
163
|
"""Proxy URL
|
|
183
164
|
"""
|
|
184
|
-
self.no_proxy = None
|
|
185
|
-
"""bypass proxy for host in the no_proxy list.
|
|
186
|
-
"""
|
|
187
165
|
self.proxy_headers = None
|
|
188
166
|
"""Proxy headers
|
|
189
167
|
"""
|
|
@@ -196,8 +174,17 @@ class Configuration(object):
|
|
|
196
174
|
# Enable client side validation
|
|
197
175
|
self.client_side_validation = True
|
|
198
176
|
|
|
199
|
-
# Options to pass down to the underlying urllib3 socket
|
|
200
177
|
self.socket_options = None
|
|
178
|
+
"""Options to pass down to the underlying urllib3 socket
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
|
|
182
|
+
"""datetime format
|
|
183
|
+
"""
|
|
184
|
+
|
|
185
|
+
self.date_format = "%Y-%m-%d"
|
|
186
|
+
"""date format
|
|
187
|
+
"""
|
|
201
188
|
|
|
202
189
|
def __deepcopy__(self, memo):
|
|
203
190
|
cls = self.__class__
|
|
@@ -215,13 +202,6 @@ class Configuration(object):
|
|
|
215
202
|
|
|
216
203
|
def __setattr__(self, name, value):
|
|
217
204
|
object.__setattr__(self, name, value)
|
|
218
|
-
if name == 'disabled_client_side_validations':
|
|
219
|
-
s = set(filter(None, value.split(',')))
|
|
220
|
-
for v in s:
|
|
221
|
-
if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
|
|
222
|
-
raise ApiValueError(
|
|
223
|
-
"Invalid keyword: '{0}''".format(v))
|
|
224
|
-
self._disabled_client_side_validations = s
|
|
225
205
|
|
|
226
206
|
@classmethod
|
|
227
207
|
def set_default(cls, default):
|
|
@@ -232,21 +212,31 @@ class Configuration(object):
|
|
|
232
212
|
|
|
233
213
|
:param default: object of Configuration
|
|
234
214
|
"""
|
|
235
|
-
cls._default =
|
|
215
|
+
cls._default = default
|
|
236
216
|
|
|
237
217
|
@classmethod
|
|
238
218
|
def get_default_copy(cls):
|
|
239
|
-
"""
|
|
219
|
+
"""Deprecated. Please use `get_default` instead.
|
|
220
|
+
|
|
221
|
+
Deprecated. Please use `get_default` instead.
|
|
222
|
+
|
|
223
|
+
:return: The configuration object.
|
|
224
|
+
"""
|
|
225
|
+
return cls.get_default()
|
|
226
|
+
|
|
227
|
+
@classmethod
|
|
228
|
+
def get_default(cls):
|
|
229
|
+
"""Return the default configuration.
|
|
240
230
|
|
|
241
231
|
This method returns newly created, based on default constructor,
|
|
242
232
|
object of Configuration class or returns a copy of default
|
|
243
|
-
configuration
|
|
233
|
+
configuration.
|
|
244
234
|
|
|
245
235
|
:return: The configuration object.
|
|
246
236
|
"""
|
|
247
|
-
if cls._default is
|
|
248
|
-
|
|
249
|
-
return
|
|
237
|
+
if cls._default is None:
|
|
238
|
+
cls._default = Configuration()
|
|
239
|
+
return cls._default
|
|
250
240
|
|
|
251
241
|
@property
|
|
252
242
|
def logger_file(self):
|
|
@@ -300,15 +290,15 @@ class Configuration(object):
|
|
|
300
290
|
# if debug status is True, turn on debug logging
|
|
301
291
|
for _, logger in self.logger.items():
|
|
302
292
|
logger.setLevel(logging.DEBUG)
|
|
303
|
-
# turn on
|
|
304
|
-
|
|
293
|
+
# turn on httplib debug
|
|
294
|
+
httplib.HTTPConnection.debuglevel = 1
|
|
305
295
|
else:
|
|
306
296
|
# if debug status is False, turn off debug logging,
|
|
307
297
|
# setting log level to default `logging.WARNING`
|
|
308
298
|
for _, logger in self.logger.items():
|
|
309
299
|
logger.setLevel(logging.WARNING)
|
|
310
|
-
# turn off
|
|
311
|
-
|
|
300
|
+
# turn off httplib debug
|
|
301
|
+
httplib.HTTPConnection.debuglevel = 0
|
|
312
302
|
|
|
313
303
|
@property
|
|
314
304
|
def logger_format(self):
|
|
@@ -388,7 +378,7 @@ class Configuration(object):
|
|
|
388
378
|
return "Python SDK Debug Report:\n"\
|
|
389
379
|
"OS: {env}\n"\
|
|
390
380
|
"Python Version: {pyversion}\n"\
|
|
391
|
-
"Version of the API: 3.
|
|
381
|
+
"Version of the API: 3.2.0\n"\
|
|
392
382
|
"SDK Package Version: 1.0.0".\
|
|
393
383
|
format(env=sys.platform, pyversion=sys.version)
|
|
394
384
|
|
cosmotech_api/exceptions.py
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
1
3
|
"""
|
|
2
4
|
Cosmo Tech Platform API
|
|
3
5
|
|
|
4
|
-
Cosmo Tech Platform API
|
|
6
|
+
Cosmo Tech Platform API
|
|
5
7
|
|
|
6
|
-
The version of the OpenAPI document: 3.
|
|
8
|
+
The version of the OpenAPI document: 3.2.0
|
|
7
9
|
Contact: platform@cosmotech.com
|
|
8
|
-
Generated by
|
|
9
|
-
"""
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
11
|
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
11
14
|
|
|
15
|
+
from typing import Any, Optional
|
|
16
|
+
from typing_extensions import Self
|
|
12
17
|
|
|
13
18
|
class OpenApiException(Exception):
|
|
14
19
|
"""The base exception class for all OpenAPIExceptions"""
|
|
@@ -16,7 +21,7 @@ class OpenApiException(Exception):
|
|
|
16
21
|
|
|
17
22
|
class ApiTypeError(OpenApiException, TypeError):
|
|
18
23
|
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
19
|
-
key_type=None):
|
|
24
|
+
key_type=None) -> None:
|
|
20
25
|
""" Raises an exception for TypeErrors
|
|
21
26
|
|
|
22
27
|
Args:
|
|
@@ -44,7 +49,7 @@ class ApiTypeError(OpenApiException, TypeError):
|
|
|
44
49
|
|
|
45
50
|
|
|
46
51
|
class ApiValueError(OpenApiException, ValueError):
|
|
47
|
-
def __init__(self, msg, path_to_item=None):
|
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
48
53
|
"""
|
|
49
54
|
Args:
|
|
50
55
|
msg (str): the exception message
|
|
@@ -62,7 +67,7 @@ class ApiValueError(OpenApiException, ValueError):
|
|
|
62
67
|
|
|
63
68
|
|
|
64
69
|
class ApiAttributeError(OpenApiException, AttributeError):
|
|
65
|
-
def __init__(self, msg, path_to_item=None):
|
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
66
71
|
"""
|
|
67
72
|
Raised when an attribute reference or assignment fails.
|
|
68
73
|
|
|
@@ -81,7 +86,7 @@ class ApiAttributeError(OpenApiException, AttributeError):
|
|
|
81
86
|
|
|
82
87
|
|
|
83
88
|
class ApiKeyError(OpenApiException, KeyError):
|
|
84
|
-
def __init__(self, msg, path_to_item=None):
|
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
85
90
|
"""
|
|
86
91
|
Args:
|
|
87
92
|
msg (str): the exception message
|
|
@@ -99,17 +104,56 @@ class ApiKeyError(OpenApiException, KeyError):
|
|
|
99
104
|
|
|
100
105
|
class ApiException(OpenApiException):
|
|
101
106
|
|
|
102
|
-
def __init__(
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
status=None,
|
|
110
|
+
reason=None,
|
|
111
|
+
http_resp=None,
|
|
112
|
+
*,
|
|
113
|
+
body: Optional[str] = None,
|
|
114
|
+
data: Optional[Any] = None,
|
|
115
|
+
) -> None:
|
|
116
|
+
self.status = status
|
|
117
|
+
self.reason = reason
|
|
118
|
+
self.body = body
|
|
119
|
+
self.data = data
|
|
120
|
+
self.headers = None
|
|
121
|
+
|
|
103
122
|
if http_resp:
|
|
104
|
-
self.status
|
|
105
|
-
|
|
106
|
-
self.
|
|
123
|
+
if self.status is None:
|
|
124
|
+
self.status = http_resp.status
|
|
125
|
+
if self.reason is None:
|
|
126
|
+
self.reason = http_resp.reason
|
|
127
|
+
if self.body is None:
|
|
128
|
+
try:
|
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
|
130
|
+
except Exception:
|
|
131
|
+
pass
|
|
107
132
|
self.headers = http_resp.getheaders()
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def from_response(
|
|
136
|
+
cls,
|
|
137
|
+
*,
|
|
138
|
+
http_resp,
|
|
139
|
+
body: Optional[str],
|
|
140
|
+
data: Optional[Any],
|
|
141
|
+
) -> Self:
|
|
142
|
+
if http_resp.status == 400:
|
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
144
|
+
|
|
145
|
+
if http_resp.status == 401:
|
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
147
|
+
|
|
148
|
+
if http_resp.status == 403:
|
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
150
|
+
|
|
151
|
+
if http_resp.status == 404:
|
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
|
+
|
|
154
|
+
if 500 <= http_resp.status <= 599:
|
|
155
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
156
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
113
157
|
|
|
114
158
|
def __str__(self):
|
|
115
159
|
"""Custom error messages for exception"""
|
|
@@ -119,34 +163,30 @@ class ApiException(OpenApiException):
|
|
|
119
163
|
error_message += "HTTP response headers: {0}\n".format(
|
|
120
164
|
self.headers)
|
|
121
165
|
|
|
122
|
-
if self.body:
|
|
123
|
-
error_message += "HTTP response body: {0}\n".format(self.body)
|
|
166
|
+
if self.data or self.body:
|
|
167
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
124
168
|
|
|
125
169
|
return error_message
|
|
126
170
|
|
|
127
171
|
|
|
128
|
-
class
|
|
172
|
+
class BadRequestException(ApiException):
|
|
173
|
+
pass
|
|
174
|
+
|
|
129
175
|
|
|
130
|
-
|
|
131
|
-
|
|
176
|
+
class NotFoundException(ApiException):
|
|
177
|
+
pass
|
|
132
178
|
|
|
133
179
|
|
|
134
180
|
class UnauthorizedException(ApiException):
|
|
135
|
-
|
|
136
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
|
137
|
-
super(UnauthorizedException, self).__init__(status, reason, http_resp)
|
|
181
|
+
pass
|
|
138
182
|
|
|
139
183
|
|
|
140
184
|
class ForbiddenException(ApiException):
|
|
141
|
-
|
|
142
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
|
143
|
-
super(ForbiddenException, self).__init__(status, reason, http_resp)
|
|
185
|
+
pass
|
|
144
186
|
|
|
145
187
|
|
|
146
188
|
class ServiceException(ApiException):
|
|
147
|
-
|
|
148
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
|
149
|
-
super(ServiceException, self).__init__(status, reason, http_resp)
|
|
189
|
+
pass
|
|
150
190
|
|
|
151
191
|
|
|
152
192
|
def render_path(path_to_item):
|
cosmotech_api/model/connector.py
CHANGED
cosmotech_api/model/dataset.py
CHANGED