wds-client 0.6.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- wds_client/__init__.py +8 -10
- wds_client/api/__init__.py +1 -2
- wds_client/api/capabilities_api.py +237 -102
- wds_client/api/cloning_api.py +782 -329
- wds_client/api/general_wds_information_api.py +463 -191
- wds_client/api/import_api.py +288 -127
- wds_client/api/instances_api.py +783 -333
- wds_client/api/job_api.py +518 -215
- wds_client/api/records_api.py +2512 -1089
- wds_client/api/schema_api.py +1450 -626
- wds_client/api_client.py +414 -310
- wds_client/api_response.py +21 -0
- wds_client/configuration.py +110 -53
- wds_client/exceptions.py +99 -20
- wds_client/models/__init__.py +4 -8
- wds_client/models/app.py +68 -125
- wds_client/models/attribute_data_type.py +31 -94
- wds_client/models/attribute_schema.py +71 -157
- wds_client/models/attribute_schema_update.py +69 -127
- wds_client/models/backup_job.py +96 -298
- wds_client/models/backup_response.py +70 -157
- wds_client/models/backup_restore_request.py +68 -129
- wds_client/models/batch_operation.py +83 -137
- wds_client/models/batch_record_request.py +70 -160
- wds_client/models/batch_response.py +68 -127
- wds_client/models/build.py +79 -207
- wds_client/models/capabilities.py +83 -103
- wds_client/models/clone_job.py +96 -298
- wds_client/models/clone_response.py +68 -129
- wds_client/models/commit.py +69 -125
- wds_client/models/error_response.py +78 -222
- wds_client/models/generic_job.py +102 -334
- wds_client/models/git.py +76 -129
- wds_client/models/import_request.py +77 -165
- wds_client/models/job.py +87 -243
- wds_client/models/job_v1.py +97 -277
- wds_client/models/record_query_response.py +86 -162
- wds_client/models/record_request.py +60 -96
- wds_client/models/record_response.py +70 -160
- wds_client/models/record_type_schema.py +84 -191
- wds_client/models/search_filter.py +60 -95
- wds_client/models/search_request.py +84 -220
- wds_client/models/search_sort_direction.py +17 -80
- wds_client/models/status_response.py +68 -125
- wds_client/models/tsv_upload_response.py +68 -127
- wds_client/models/version_response.py +86 -155
- wds_client/py.typed +0 -0
- wds_client/rest.py +136 -170
- wds_client-0.8.0.dist-info/METADATA +17 -0
- wds_client-0.8.0.dist-info/RECORD +52 -0
- wds_client/models/backup_job_all_of.py +0 -148
- wds_client/models/clone_job_all_of.py +0 -148
- wds_client/models/generic_job_all_of.py +0 -150
- wds_client/models/inline_object.py +0 -123
- wds_client-0.6.0.dist-info/METADATA +0 -16
- wds_client-0.6.0.dist-info/RECORD +0 -54
- {wds_client-0.6.0.dist-info → wds_client-0.8.0.dist-info}/WHEEL +0 -0
- {wds_client-0.6.0.dist-info → wds_client-0.8.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
"""API response object."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from typing import Optional, Generic, Mapping, TypeVar
|
5
|
+
from pydantic import Field, StrictInt, StrictBytes, BaseModel
|
6
|
+
|
7
|
+
T = TypeVar("T")
|
8
|
+
|
9
|
+
class ApiResponse(BaseModel, Generic[T]):
|
10
|
+
"""
|
11
|
+
API response object
|
12
|
+
"""
|
13
|
+
|
14
|
+
status_code: StrictInt = Field(description="HTTP status code")
|
15
|
+
headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
|
16
|
+
data: T = Field(description="Deserialized data given the data type")
|
17
|
+
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
|
18
|
+
|
19
|
+
model_config = {
|
20
|
+
"arbitrary_types_allowed": True
|
21
|
+
}
|
wds_client/configuration.py
CHANGED
@@ -3,68 +3,84 @@
|
|
3
3
|
"""
|
4
4
|
Workspace Data Service
|
5
5
|
|
6
|
-
This page lists current APIs.
|
6
|
+
This page lists current APIs. All v0.2 APIs are subject to change without notice. Changelog at [https://github.com/DataBiosphere/terra-workspace-data-service/releases](https://github.com/DataBiosphere/terra-workspace-data-service/releases)
|
7
7
|
|
8
8
|
The version of the OpenAPI document: v0.2
|
9
|
-
Generated by
|
10
|
-
"""
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
10
|
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
12
13
|
|
13
|
-
from __future__ import absolute_import
|
14
14
|
|
15
15
|
import copy
|
16
16
|
import logging
|
17
|
+
from logging import FileHandler
|
17
18
|
import multiprocessing
|
18
19
|
import sys
|
20
|
+
from typing import Optional
|
19
21
|
import urllib3
|
20
22
|
|
21
|
-
import
|
22
|
-
from six.moves import http_client as httplib
|
23
|
-
|
23
|
+
import http.client as httplib
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
26
|
+
'multipleOf', 'maximum', 'exclusiveMaximum',
|
27
|
+
'minimum', 'exclusiveMinimum', 'maxLength',
|
28
|
+
'minLength', 'pattern', 'maxItems', 'minItems'
|
29
|
+
}
|
27
30
|
|
28
|
-
|
29
|
-
|
31
|
+
class Configuration:
|
32
|
+
"""This class contains various settings of the API client.
|
30
33
|
|
31
|
-
:param host: Base url
|
34
|
+
:param host: Base url.
|
32
35
|
:param api_key: Dict to store API key(s).
|
33
36
|
Each entry in the dict specifies an API key.
|
34
37
|
The dict key is the name of the security scheme in the OAS specification.
|
35
38
|
The dict value is the API key secret.
|
36
|
-
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
|
39
|
+
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
37
40
|
The dict key is the name of the security scheme in the OAS specification.
|
38
41
|
The dict value is an API key prefix when generating the auth data.
|
39
|
-
:param username: Username for HTTP basic authentication
|
40
|
-
:param password: Password for HTTP basic authentication
|
41
|
-
:param
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
:param username: Username for HTTP basic authentication.
|
43
|
+
:param password: Password for HTTP basic authentication.
|
44
|
+
:param access_token: Access token.
|
45
|
+
:param server_index: Index to servers configuration.
|
46
|
+
:param server_variables: Mapping with string values to replace variables in
|
47
|
+
templated server configuration. The validation of enums is performed for
|
48
|
+
variables with defined enum values before.
|
49
|
+
:param server_operation_index: Mapping from operation ID to an index to server
|
50
|
+
configuration.
|
51
|
+
:param server_operation_variables: Mapping from operation ID to a mapping with
|
52
|
+
string values to replace variables in templated server configuration.
|
53
|
+
The validation of enums is performed for variables with defined enum
|
54
|
+
values before.
|
55
|
+
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
56
|
+
in PEM format.
|
52
57
|
|
53
58
|
:Example:
|
54
59
|
"""
|
55
60
|
|
56
61
|
_default = None
|
57
62
|
|
58
|
-
def __init__(self, host=
|
63
|
+
def __init__(self, host=None,
|
59
64
|
api_key=None, api_key_prefix=None,
|
60
65
|
username=None, password=None,
|
61
|
-
|
62
|
-
|
66
|
+
access_token=None,
|
67
|
+
server_index=None, server_variables=None,
|
68
|
+
server_operation_index=None, server_operation_variables=None,
|
69
|
+
ssl_ca_cert=None,
|
70
|
+
) -> None:
|
63
71
|
"""Constructor
|
64
72
|
"""
|
65
|
-
self.
|
73
|
+
self._base_path = "http://localhost" if host is None else host
|
66
74
|
"""Default Base url
|
67
75
|
"""
|
76
|
+
self.server_index = 0 if server_index is None and host is None else server_index
|
77
|
+
self.server_operation_index = server_operation_index or {}
|
78
|
+
"""Default server index
|
79
|
+
"""
|
80
|
+
self.server_variables = server_variables or {}
|
81
|
+
self.server_operation_variables = server_operation_variables or {}
|
82
|
+
"""Default server variables
|
83
|
+
"""
|
68
84
|
self.temp_folder_path = None
|
69
85
|
"""Temp file folder for downloading files
|
70
86
|
"""
|
@@ -88,9 +104,8 @@ class Configuration(object):
|
|
88
104
|
self.password = password
|
89
105
|
"""Password for HTTP basic authentication
|
90
106
|
"""
|
91
|
-
self.
|
92
|
-
|
93
|
-
"""access token for OAuth/Bearer
|
107
|
+
self.access_token = access_token
|
108
|
+
"""Access token
|
94
109
|
"""
|
95
110
|
self.logger = {}
|
96
111
|
"""Logging Settings
|
@@ -103,7 +118,7 @@ class Configuration(object):
|
|
103
118
|
self.logger_stream_handler = None
|
104
119
|
"""Log stream handler
|
105
120
|
"""
|
106
|
-
self.logger_file_handler = None
|
121
|
+
self.logger_file_handler: Optional[FileHandler] = None
|
107
122
|
"""Log file handler
|
108
123
|
"""
|
109
124
|
self.logger_file = None
|
@@ -118,7 +133,7 @@ class Configuration(object):
|
|
118
133
|
Set this to false to skip verifying SSL certificate when calling API
|
119
134
|
from https server.
|
120
135
|
"""
|
121
|
-
self.ssl_ca_cert =
|
136
|
+
self.ssl_ca_cert = ssl_ca_cert
|
122
137
|
"""Set this to customize the certificate file to verify the peer.
|
123
138
|
"""
|
124
139
|
self.cert_file = None
|
@@ -130,6 +145,10 @@ class Configuration(object):
|
|
130
145
|
self.assert_hostname = None
|
131
146
|
"""Set this to True/False to enable/disable SSL hostname verification.
|
132
147
|
"""
|
148
|
+
self.tls_server_name = None
|
149
|
+
"""SSL/TLS Server Name Indication (SNI)
|
150
|
+
Set this to the SNI value expected by the server.
|
151
|
+
"""
|
133
152
|
|
134
153
|
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
135
154
|
"""urllib3 connection pool's maximum number of connections saved
|
@@ -139,7 +158,7 @@ class Configuration(object):
|
|
139
158
|
cpu_count * 5 is used as default value to increase performance.
|
140
159
|
"""
|
141
160
|
|
142
|
-
self.proxy = None
|
161
|
+
self.proxy: Optional[str] = None
|
143
162
|
"""Proxy URL
|
144
163
|
"""
|
145
164
|
self.proxy_headers = None
|
@@ -151,9 +170,21 @@ class Configuration(object):
|
|
151
170
|
self.retries = None
|
152
171
|
"""Adding retries to override urllib3 default value 3
|
153
172
|
"""
|
154
|
-
#
|
173
|
+
# Enable client side validation
|
155
174
|
self.client_side_validation = True
|
156
175
|
|
176
|
+
self.socket_options = None
|
177
|
+
"""Options to pass down to the underlying urllib3 socket
|
178
|
+
"""
|
179
|
+
|
180
|
+
self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
|
181
|
+
"""datetime format
|
182
|
+
"""
|
183
|
+
|
184
|
+
self.date_format = "%Y-%m-%d"
|
185
|
+
"""date format
|
186
|
+
"""
|
187
|
+
|
157
188
|
def __deepcopy__(self, memo):
|
158
189
|
cls = self.__class__
|
159
190
|
result = cls.__new__(cls)
|
@@ -180,21 +211,31 @@ class Configuration(object):
|
|
180
211
|
|
181
212
|
:param default: object of Configuration
|
182
213
|
"""
|
183
|
-
cls._default =
|
214
|
+
cls._default = default
|
184
215
|
|
185
216
|
@classmethod
|
186
217
|
def get_default_copy(cls):
|
187
|
-
"""
|
218
|
+
"""Deprecated. Please use `get_default` instead.
|
219
|
+
|
220
|
+
Deprecated. Please use `get_default` instead.
|
221
|
+
|
222
|
+
:return: The configuration object.
|
223
|
+
"""
|
224
|
+
return cls.get_default()
|
225
|
+
|
226
|
+
@classmethod
|
227
|
+
def get_default(cls):
|
228
|
+
"""Return the default configuration.
|
188
229
|
|
189
230
|
This method returns newly created, based on default constructor,
|
190
231
|
object of Configuration class or returns a copy of default
|
191
|
-
configuration
|
232
|
+
configuration.
|
192
233
|
|
193
234
|
:return: The configuration object.
|
194
235
|
"""
|
195
|
-
if cls._default is
|
196
|
-
|
197
|
-
return
|
236
|
+
if cls._default is None:
|
237
|
+
cls._default = Configuration()
|
238
|
+
return cls._default
|
198
239
|
|
199
240
|
@property
|
200
241
|
def logger_file(self):
|
@@ -224,7 +265,7 @@ class Configuration(object):
|
|
224
265
|
# then add file handler and remove stream handler.
|
225
266
|
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
226
267
|
self.logger_file_handler.setFormatter(self.logger_formatter)
|
227
|
-
for _, logger in
|
268
|
+
for _, logger in self.logger.items():
|
228
269
|
logger.addHandler(self.logger_file_handler)
|
229
270
|
|
230
271
|
@property
|
@@ -246,14 +287,14 @@ class Configuration(object):
|
|
246
287
|
self.__debug = value
|
247
288
|
if self.__debug:
|
248
289
|
# if debug status is True, turn on debug logging
|
249
|
-
for _, logger in
|
290
|
+
for _, logger in self.logger.items():
|
250
291
|
logger.setLevel(logging.DEBUG)
|
251
292
|
# turn on httplib debug
|
252
293
|
httplib.HTTPConnection.debuglevel = 1
|
253
294
|
else:
|
254
295
|
# if debug status is False, turn off debug logging,
|
255
296
|
# setting log level to default `logging.WARNING`
|
256
|
-
for _, logger in
|
297
|
+
for _, logger in self.logger.items():
|
257
298
|
logger.setLevel(logging.WARNING)
|
258
299
|
# turn off httplib debug
|
259
300
|
httplib.HTTPConnection.debuglevel = 0
|
@@ -281,15 +322,16 @@ class Configuration(object):
|
|
281
322
|
self.__logger_format = value
|
282
323
|
self.logger_formatter = logging.Formatter(self.__logger_format)
|
283
324
|
|
284
|
-
def get_api_key_with_prefix(self, identifier):
|
325
|
+
def get_api_key_with_prefix(self, identifier, alias=None):
|
285
326
|
"""Gets API key (with prefix if set).
|
286
327
|
|
287
328
|
:param identifier: The identifier of apiKey.
|
329
|
+
:param alias: The alternative identifier of apiKey.
|
288
330
|
:return: The token for api key authentication.
|
289
331
|
"""
|
290
332
|
if self.refresh_api_key_hook is not None:
|
291
333
|
self.refresh_api_key_hook(self)
|
292
|
-
key = self.api_key.get(identifier)
|
334
|
+
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
|
293
335
|
if key:
|
294
336
|
prefix = self.api_key_prefix.get(identifier)
|
295
337
|
if prefix:
|
@@ -336,7 +378,7 @@ class Configuration(object):
|
|
336
378
|
"OS: {env}\n"\
|
337
379
|
"Python Version: {pyversion}\n"\
|
338
380
|
"Version of the API: v0.2\n"\
|
339
|
-
"SDK Package Version: 0.
|
381
|
+
"SDK Package Version: 0.8.0".\
|
340
382
|
format(env=sys.platform, pyversion=sys.version)
|
341
383
|
|
342
384
|
def get_host_settings(self):
|
@@ -346,19 +388,23 @@ class Configuration(object):
|
|
346
388
|
"""
|
347
389
|
return [
|
348
390
|
{
|
349
|
-
'url': "
|
391
|
+
'url': "",
|
350
392
|
'description': "No description provided",
|
351
393
|
}
|
352
394
|
]
|
353
395
|
|
354
|
-
def get_host_from_settings(self, index, variables=None):
|
396
|
+
def get_host_from_settings(self, index, variables=None, servers=None):
|
355
397
|
"""Gets host URL based on the index and variables
|
356
398
|
:param index: array index of the host settings
|
357
399
|
:param variables: hash of variable and the corresponding value
|
400
|
+
:param servers: an array of host settings or None
|
358
401
|
:return: URL based on host settings
|
359
402
|
"""
|
403
|
+
if index is None:
|
404
|
+
return self._base_path
|
405
|
+
|
360
406
|
variables = {} if variables is None else variables
|
361
|
-
servers = self.get_host_settings()
|
407
|
+
servers = self.get_host_settings() if servers is None else servers
|
362
408
|
|
363
409
|
try:
|
364
410
|
server = servers[index]
|
@@ -370,7 +416,7 @@ class Configuration(object):
|
|
370
416
|
url = server['url']
|
371
417
|
|
372
418
|
# go through variables and replace placeholders
|
373
|
-
for variable_name, variable in server
|
419
|
+
for variable_name, variable in server.get('variables', {}).items():
|
374
420
|
used_value = variables.get(
|
375
421
|
variable_name, variable['default_value'])
|
376
422
|
|
@@ -385,3 +431,14 @@ class Configuration(object):
|
|
385
431
|
url = url.replace("{" + variable_name + "}", used_value)
|
386
432
|
|
387
433
|
return url
|
434
|
+
|
435
|
+
@property
|
436
|
+
def host(self):
|
437
|
+
"""Return generated host."""
|
438
|
+
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
439
|
+
|
440
|
+
@host.setter
|
441
|
+
def host(self, value):
|
442
|
+
"""Fix base path."""
|
443
|
+
self._base_path = value
|
444
|
+
self.server_index = None
|
wds_client/exceptions.py
CHANGED
@@ -3,15 +3,16 @@
|
|
3
3
|
"""
|
4
4
|
Workspace Data Service
|
5
5
|
|
6
|
-
This page lists current APIs.
|
6
|
+
This page lists current APIs. All v0.2 APIs are subject to change without notice. Changelog at [https://github.com/DataBiosphere/terra-workspace-data-service/releases](https://github.com/DataBiosphere/terra-workspace-data-service/releases)
|
7
7
|
|
8
8
|
The version of the OpenAPI document: v0.2
|
9
|
-
Generated by
|
10
|
-
"""
|
11
|
-
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
12
10
|
|
13
|
-
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
14
13
|
|
14
|
+
from typing import Any, Optional
|
15
|
+
from typing_extensions import Self
|
15
16
|
|
16
17
|
class OpenApiException(Exception):
|
17
18
|
"""The base exception class for all OpenAPIExceptions"""
|
@@ -19,7 +20,7 @@ class OpenApiException(Exception):
|
|
19
20
|
|
20
21
|
class ApiTypeError(OpenApiException, TypeError):
|
21
22
|
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
22
|
-
key_type=None):
|
23
|
+
key_type=None) -> None:
|
23
24
|
""" Raises an exception for TypeErrors
|
24
25
|
|
25
26
|
Args:
|
@@ -47,7 +48,7 @@ class ApiTypeError(OpenApiException, TypeError):
|
|
47
48
|
|
48
49
|
|
49
50
|
class ApiValueError(OpenApiException, ValueError):
|
50
|
-
def __init__(self, msg, path_to_item=None):
|
51
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
51
52
|
"""
|
52
53
|
Args:
|
53
54
|
msg (str): the exception message
|
@@ -64,8 +65,27 @@ class ApiValueError(OpenApiException, ValueError):
|
|
64
65
|
super(ApiValueError, self).__init__(full_msg)
|
65
66
|
|
66
67
|
|
68
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
69
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
70
|
+
"""
|
71
|
+
Raised when an attribute reference or assignment fails.
|
72
|
+
|
73
|
+
Args:
|
74
|
+
msg (str): the exception message
|
75
|
+
|
76
|
+
Keyword Args:
|
77
|
+
path_to_item (None/list) the path to the exception in the
|
78
|
+
received_data dict
|
79
|
+
"""
|
80
|
+
self.path_to_item = path_to_item
|
81
|
+
full_msg = msg
|
82
|
+
if path_to_item:
|
83
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
84
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
85
|
+
|
86
|
+
|
67
87
|
class ApiKeyError(OpenApiException, KeyError):
|
68
|
-
def __init__(self, msg, path_to_item=None):
|
88
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
69
89
|
"""
|
70
90
|
Args:
|
71
91
|
msg (str): the exception message
|
@@ -83,17 +103,56 @@ class ApiKeyError(OpenApiException, KeyError):
|
|
83
103
|
|
84
104
|
class ApiException(OpenApiException):
|
85
105
|
|
86
|
-
def __init__(
|
106
|
+
def __init__(
|
107
|
+
self,
|
108
|
+
status=None,
|
109
|
+
reason=None,
|
110
|
+
http_resp=None,
|
111
|
+
*,
|
112
|
+
body: Optional[str] = None,
|
113
|
+
data: Optional[Any] = None,
|
114
|
+
) -> None:
|
115
|
+
self.status = status
|
116
|
+
self.reason = reason
|
117
|
+
self.body = body
|
118
|
+
self.data = data
|
119
|
+
self.headers = None
|
120
|
+
|
87
121
|
if http_resp:
|
88
|
-
self.status
|
89
|
-
|
90
|
-
self.
|
122
|
+
if self.status is None:
|
123
|
+
self.status = http_resp.status
|
124
|
+
if self.reason is None:
|
125
|
+
self.reason = http_resp.reason
|
126
|
+
if self.body is None:
|
127
|
+
try:
|
128
|
+
self.body = http_resp.data.decode('utf-8')
|
129
|
+
except Exception:
|
130
|
+
pass
|
91
131
|
self.headers = http_resp.getheaders()
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
132
|
+
|
133
|
+
@classmethod
|
134
|
+
def from_response(
|
135
|
+
cls,
|
136
|
+
*,
|
137
|
+
http_resp,
|
138
|
+
body: Optional[str],
|
139
|
+
data: Optional[Any],
|
140
|
+
) -> Self:
|
141
|
+
if http_resp.status == 400:
|
142
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
143
|
+
|
144
|
+
if http_resp.status == 401:
|
145
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
146
|
+
|
147
|
+
if http_resp.status == 403:
|
148
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
149
|
+
|
150
|
+
if http_resp.status == 404:
|
151
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
152
|
+
|
153
|
+
if 500 <= http_resp.status <= 599:
|
154
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
155
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
97
156
|
|
98
157
|
def __str__(self):
|
99
158
|
"""Custom error messages for exception"""
|
@@ -103,17 +162,37 @@ class ApiException(OpenApiException):
|
|
103
162
|
error_message += "HTTP response headers: {0}\n".format(
|
104
163
|
self.headers)
|
105
164
|
|
106
|
-
if self.body:
|
107
|
-
error_message += "HTTP response body: {0}\n".format(self.body)
|
165
|
+
if self.data or self.body:
|
166
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
108
167
|
|
109
168
|
return error_message
|
110
169
|
|
111
170
|
|
171
|
+
class BadRequestException(ApiException):
|
172
|
+
pass
|
173
|
+
|
174
|
+
|
175
|
+
class NotFoundException(ApiException):
|
176
|
+
pass
|
177
|
+
|
178
|
+
|
179
|
+
class UnauthorizedException(ApiException):
|
180
|
+
pass
|
181
|
+
|
182
|
+
|
183
|
+
class ForbiddenException(ApiException):
|
184
|
+
pass
|
185
|
+
|
186
|
+
|
187
|
+
class ServiceException(ApiException):
|
188
|
+
pass
|
189
|
+
|
190
|
+
|
112
191
|
def render_path(path_to_item):
|
113
192
|
"""Returns a string representation of a path"""
|
114
193
|
result = ""
|
115
194
|
for pth in path_to_item:
|
116
|
-
if isinstance(pth,
|
195
|
+
if isinstance(pth, int):
|
117
196
|
result += "[{0}]".format(pth)
|
118
197
|
else:
|
119
198
|
result += "['{0}']".format(pth)
|
wds_client/models/__init__.py
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
"""
|
5
5
|
Workspace Data Service
|
6
6
|
|
7
|
-
This page lists current APIs.
|
7
|
+
This page lists current APIs. All v0.2 APIs are subject to change without notice. Changelog at [https://github.com/DataBiosphere/terra-workspace-data-service/releases](https://github.com/DataBiosphere/terra-workspace-data-service/releases)
|
8
8
|
|
9
9
|
The version of the OpenAPI document: v0.2
|
10
|
-
Generated by
|
11
|
-
"""
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
12
11
|
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
13
14
|
|
14
|
-
from __future__ import absolute_import
|
15
15
|
|
16
16
|
# import models into model package
|
17
17
|
from wds_client.models.app import App
|
@@ -19,7 +19,6 @@ from wds_client.models.attribute_data_type import AttributeDataType
|
|
19
19
|
from wds_client.models.attribute_schema import AttributeSchema
|
20
20
|
from wds_client.models.attribute_schema_update import AttributeSchemaUpdate
|
21
21
|
from wds_client.models.backup_job import BackupJob
|
22
|
-
from wds_client.models.backup_job_all_of import BackupJobAllOf
|
23
22
|
from wds_client.models.backup_response import BackupResponse
|
24
23
|
from wds_client.models.backup_restore_request import BackupRestoreRequest
|
25
24
|
from wds_client.models.batch_operation import BatchOperation
|
@@ -28,15 +27,12 @@ from wds_client.models.batch_response import BatchResponse
|
|
28
27
|
from wds_client.models.build import Build
|
29
28
|
from wds_client.models.capabilities import Capabilities
|
30
29
|
from wds_client.models.clone_job import CloneJob
|
31
|
-
from wds_client.models.clone_job_all_of import CloneJobAllOf
|
32
30
|
from wds_client.models.clone_response import CloneResponse
|
33
31
|
from wds_client.models.commit import Commit
|
34
32
|
from wds_client.models.error_response import ErrorResponse
|
35
33
|
from wds_client.models.generic_job import GenericJob
|
36
|
-
from wds_client.models.generic_job_all_of import GenericJobAllOf
|
37
34
|
from wds_client.models.git import Git
|
38
35
|
from wds_client.models.import_request import ImportRequest
|
39
|
-
from wds_client.models.inline_object import InlineObject
|
40
36
|
from wds_client.models.job import Job
|
41
37
|
from wds_client.models.job_v1 import JobV1
|
42
38
|
from wds_client.models.record_query_response import RecordQueryResponse
|