wds-client 0.7.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. wds_client/__init__.py +8 -10
  2. wds_client/api/__init__.py +1 -2
  3. wds_client/api/capabilities_api.py +237 -102
  4. wds_client/api/cloning_api.py +782 -329
  5. wds_client/api/general_wds_information_api.py +463 -191
  6. wds_client/api/import_api.py +288 -127
  7. wds_client/api/instances_api.py +783 -333
  8. wds_client/api/job_api.py +518 -215
  9. wds_client/api/records_api.py +2512 -1089
  10. wds_client/api/schema_api.py +1450 -626
  11. wds_client/api_client.py +414 -310
  12. wds_client/api_response.py +21 -0
  13. wds_client/configuration.py +110 -53
  14. wds_client/exceptions.py +99 -20
  15. wds_client/models/__init__.py +4 -8
  16. wds_client/models/app.py +68 -125
  17. wds_client/models/attribute_data_type.py +31 -94
  18. wds_client/models/attribute_schema.py +71 -157
  19. wds_client/models/attribute_schema_update.py +69 -127
  20. wds_client/models/backup_job.py +96 -298
  21. wds_client/models/backup_response.py +70 -157
  22. wds_client/models/backup_restore_request.py +68 -129
  23. wds_client/models/batch_operation.py +83 -137
  24. wds_client/models/batch_record_request.py +70 -160
  25. wds_client/models/batch_response.py +68 -127
  26. wds_client/models/build.py +79 -207
  27. wds_client/models/capabilities.py +83 -103
  28. wds_client/models/clone_job.py +96 -298
  29. wds_client/models/clone_response.py +68 -129
  30. wds_client/models/commit.py +69 -125
  31. wds_client/models/error_response.py +78 -222
  32. wds_client/models/generic_job.py +102 -334
  33. wds_client/models/git.py +76 -129
  34. wds_client/models/import_request.py +77 -165
  35. wds_client/models/job.py +87 -243
  36. wds_client/models/job_v1.py +97 -277
  37. wds_client/models/record_query_response.py +86 -162
  38. wds_client/models/record_request.py +60 -96
  39. wds_client/models/record_response.py +70 -160
  40. wds_client/models/record_type_schema.py +84 -191
  41. wds_client/models/search_filter.py +60 -95
  42. wds_client/models/search_request.py +84 -220
  43. wds_client/models/search_sort_direction.py +17 -80
  44. wds_client/models/status_response.py +68 -125
  45. wds_client/models/tsv_upload_response.py +68 -127
  46. wds_client/models/version_response.py +86 -155
  47. wds_client/py.typed +0 -0
  48. wds_client/rest.py +136 -170
  49. wds_client-0.9.0.dist-info/METADATA +17 -0
  50. wds_client-0.9.0.dist-info/RECORD +52 -0
  51. {wds_client-0.7.0.dist-info → wds_client-0.9.0.dist-info}/WHEEL +1 -1
  52. wds_client/models/backup_job_all_of.py +0 -148
  53. wds_client/models/clone_job_all_of.py +0 -148
  54. wds_client/models/generic_job_all_of.py +0 -150
  55. wds_client/models/inline_object.py +0 -123
  56. wds_client-0.7.0.dist-info/METADATA +0 -16
  57. wds_client-0.7.0.dist-info/RECORD +0 -54
  58. {wds_client-0.7.0.dist-info → wds_client-0.9.0.dist-info}/top_level.txt +0 -0
@@ -3,162 +3,323 @@
3
3
  """
4
4
  Workspace Data Service
5
5
 
6
- This page lists current APIs. As of v0.2, all APIs are subject to change without notice. # noqa: E501
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: https://openapi-generator.tech
10
- """
11
-
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
10
 
13
- from __future__ import absolute_import
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
14
13
 
15
- import re # noqa: F401
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
16
18
 
17
- # python 2 and python 3 compatibility library
18
- import six
19
+ from pydantic import Field, StrictStr
20
+ from typing_extensions import Annotated
21
+ from wds_client.models.generic_job import GenericJob
22
+ from wds_client.models.import_request import ImportRequest
19
23
 
20
- from wds_client.api_client import ApiClient
21
- from wds_client.exceptions import ( # noqa: F401
22
- ApiTypeError,
23
- ApiValueError
24
- )
24
+ from wds_client.api_client import ApiClient, RequestSerialized
25
+ from wds_client.api_response import ApiResponse
26
+ from wds_client.rest import RESTResponseType
25
27
 
26
28
 
27
- class ImportApi(object):
29
+ class ImportApi:
28
30
  """NOTE: This class is auto generated by OpenAPI Generator
29
31
  Ref: https://openapi-generator.tech
30
32
 
31
33
  Do not edit the class manually.
32
34
  """
33
35
 
34
- def __init__(self, api_client=None):
36
+ def __init__(self, api_client=None) -> None:
35
37
  if api_client is None:
36
- api_client = ApiClient()
38
+ api_client = ApiClient.get_default()
37
39
  self.api_client = api_client
38
40
 
39
- def import_v1(self, instance_uuid, import_request, **kwargs): # noqa: E501
40
- """Import from a file # noqa: E501
41
-
42
- Imports records from the specified URL. # noqa: E501
43
- This method makes a synchronous HTTP request by default. To make an
44
- asynchronous HTTP request, please pass async_req=True
45
- >>> thread = api.import_v1(instance_uuid, import_request, async_req=True)
46
- >>> result = thread.get()
47
-
48
- :param async_req bool: execute request asynchronously
49
- :param str instance_uuid: WDS instance id; by convention equal to workspace id (required)
50
- :param ImportRequest import_request: (required)
51
- :param _preload_content: if False, the urllib3.HTTPResponse object will
52
- be returned without reading/decoding response
53
- data. Default is True.
41
+
42
+ @validate_call
43
+ def import_v1(
44
+ self,
45
+ instance_uuid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
46
+ import_request: Annotated[ImportRequest, Field(description="A request to import records from a file")],
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Annotated[StrictFloat, Field(gt=0)]
53
+ ]
54
+ ] = None,
55
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
+ _content_type: Optional[StrictStr] = None,
57
+ _headers: Optional[Dict[StrictStr, Any]] = None,
58
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
+ ) -> GenericJob:
60
+ """Import from a file
61
+
62
+ Imports records from the specified URL.
63
+
64
+ :param instance_uuid: WDS instance id; by convention equal to workspace id (required)
65
+ :type instance_uuid: str
66
+ :param import_request: A request to import records from a file (required)
67
+ :type import_request: ImportRequest
54
68
  :param _request_timeout: timeout setting for this request. If one
55
69
  number provided, it will be total request
56
70
  timeout. It can also be a pair (tuple) of
57
71
  (connection, read) timeouts.
58
- :return: GenericJob
59
- If the method is called asynchronously,
60
- returns the request thread.
61
- """
62
- kwargs['_return_http_data_only'] = True
63
- return self.import_v1_with_http_info(instance_uuid, import_request, **kwargs) # noqa: E501
64
-
65
- def import_v1_with_http_info(self, instance_uuid, import_request, **kwargs): # noqa: E501
66
- """Import from a file # noqa: E501
67
-
68
- Imports records from the specified URL. # noqa: E501
69
- This method makes a synchronous HTTP request by default. To make an
70
- asynchronous HTTP request, please pass async_req=True
71
- >>> thread = api.import_v1_with_http_info(instance_uuid, import_request, async_req=True)
72
- >>> result = thread.get()
73
-
74
- :param async_req bool: execute request asynchronously
75
- :param str instance_uuid: WDS instance id; by convention equal to workspace id (required)
76
- :param ImportRequest import_request: (required)
77
- :param _return_http_data_only: response data without head status code
78
- and headers
79
- :param _preload_content: if False, the urllib3.HTTPResponse object will
80
- be returned without reading/decoding response
81
- data. Default is True.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._import_v1_serialize(
91
+ instance_uuid=instance_uuid,
92
+ import_request=import_request,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '202': "GenericJob",
101
+ }
102
+ response_data = self.api_client.call_api(
103
+ *_param,
104
+ _request_timeout=_request_timeout
105
+ )
106
+ response_data.read()
107
+ return self.api_client.response_deserialize(
108
+ response_data=response_data,
109
+ response_types_map=_response_types_map,
110
+ ).data
111
+
112
+
113
+ @validate_call
114
+ def import_v1_with_http_info(
115
+ self,
116
+ instance_uuid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
117
+ import_request: Annotated[ImportRequest, Field(description="A request to import records from a file")],
118
+ _request_timeout: Union[
119
+ None,
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Tuple[
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Annotated[StrictFloat, Field(gt=0)]
124
+ ]
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[GenericJob]:
131
+ """Import from a file
132
+
133
+ Imports records from the specified URL.
134
+
135
+ :param instance_uuid: WDS instance id; by convention equal to workspace id (required)
136
+ :type instance_uuid: str
137
+ :param import_request: A request to import records from a file (required)
138
+ :type import_request: ImportRequest
82
139
  :param _request_timeout: timeout setting for this request. If one
83
140
  number provided, it will be total request
84
141
  timeout. It can also be a pair (tuple) of
85
142
  (connection, read) timeouts.
86
- :return: tuple(GenericJob, status_code(int), headers(HTTPHeaderDict))
87
- If the method is called asynchronously,
88
- returns the request thread.
89
- """
143
+ :type _request_timeout: int, tuple(int, int), optional
144
+ :param _request_auth: set to override the auth_settings for an a single
145
+ request; this effectively ignores the
146
+ authentication in the spec for a single request.
147
+ :type _request_auth: dict, optional
148
+ :param _content_type: force content-type for the request.
149
+ :type _content_type: str, Optional
150
+ :param _headers: set to override the headers for a single
151
+ request; this effectively ignores the headers
152
+ in the spec for a single request.
153
+ :type _headers: dict, optional
154
+ :param _host_index: set to override the host_index for a single
155
+ request; this effectively ignores the host_index
156
+ in the spec for a single request.
157
+ :type _host_index: int, optional
158
+ :return: Returns the result object.
159
+ """ # noqa: E501
90
160
 
91
- local_var_params = locals()
161
+ _param = self._import_v1_serialize(
162
+ instance_uuid=instance_uuid,
163
+ import_request=import_request,
164
+ _request_auth=_request_auth,
165
+ _content_type=_content_type,
166
+ _headers=_headers,
167
+ _host_index=_host_index
168
+ )
92
169
 
93
- all_params = [
94
- 'instance_uuid',
95
- 'import_request'
96
- ]
97
- all_params.extend(
170
+ _response_types_map: Dict[str, Optional[str]] = {
171
+ '202': "GenericJob",
172
+ }
173
+ response_data = self.api_client.call_api(
174
+ *_param,
175
+ _request_timeout=_request_timeout
176
+ )
177
+ response_data.read()
178
+ return self.api_client.response_deserialize(
179
+ response_data=response_data,
180
+ response_types_map=_response_types_map,
181
+ )
182
+
183
+
184
+ @validate_call
185
+ def import_v1_without_preload_content(
186
+ self,
187
+ instance_uuid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
188
+ import_request: Annotated[ImportRequest, Field(description="A request to import records from a file")],
189
+ _request_timeout: Union[
190
+ None,
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Tuple[
193
+ Annotated[StrictFloat, Field(gt=0)],
194
+ Annotated[StrictFloat, Field(gt=0)]
195
+ ]
196
+ ] = None,
197
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
198
+ _content_type: Optional[StrictStr] = None,
199
+ _headers: Optional[Dict[StrictStr, Any]] = None,
200
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
201
+ ) -> RESTResponseType:
202
+ """Import from a file
203
+
204
+ Imports records from the specified URL.
205
+
206
+ :param instance_uuid: WDS instance id; by convention equal to workspace id (required)
207
+ :type instance_uuid: str
208
+ :param import_request: A request to import records from a file (required)
209
+ :type import_request: ImportRequest
210
+ :param _request_timeout: timeout setting for this request. If one
211
+ number provided, it will be total request
212
+ timeout. It can also be a pair (tuple) of
213
+ (connection, read) timeouts.
214
+ :type _request_timeout: int, tuple(int, int), optional
215
+ :param _request_auth: set to override the auth_settings for an a single
216
+ request; this effectively ignores the
217
+ authentication in the spec for a single request.
218
+ :type _request_auth: dict, optional
219
+ :param _content_type: force content-type for the request.
220
+ :type _content_type: str, Optional
221
+ :param _headers: set to override the headers for a single
222
+ request; this effectively ignores the headers
223
+ in the spec for a single request.
224
+ :type _headers: dict, optional
225
+ :param _host_index: set to override the host_index for a single
226
+ request; this effectively ignores the host_index
227
+ in the spec for a single request.
228
+ :type _host_index: int, optional
229
+ :return: Returns the result object.
230
+ """ # noqa: E501
231
+
232
+ _param = self._import_v1_serialize(
233
+ instance_uuid=instance_uuid,
234
+ import_request=import_request,
235
+ _request_auth=_request_auth,
236
+ _content_type=_content_type,
237
+ _headers=_headers,
238
+ _host_index=_host_index
239
+ )
240
+
241
+ _response_types_map: Dict[str, Optional[str]] = {
242
+ '202': "GenericJob",
243
+ }
244
+ response_data = self.api_client.call_api(
245
+ *_param,
246
+ _request_timeout=_request_timeout
247
+ )
248
+ return response_data.response
249
+
250
+
251
+ def _import_v1_serialize(
252
+ self,
253
+ instance_uuid,
254
+ import_request,
255
+ _request_auth,
256
+ _content_type,
257
+ _headers,
258
+ _host_index,
259
+ ) -> RequestSerialized:
260
+
261
+ _host = None
262
+
263
+ _collection_formats: Dict[str, str] = {
264
+ }
265
+
266
+ _path_params: Dict[str, str] = {}
267
+ _query_params: List[Tuple[str, str]] = []
268
+ _header_params: Dict[str, Optional[str]] = _headers or {}
269
+ _form_params: List[Tuple[str, str]] = []
270
+ _files: Dict[str, Union[str, bytes]] = {}
271
+ _body_params: Optional[bytes] = None
272
+
273
+ # process the path parameters
274
+ if instance_uuid is not None:
275
+ _path_params['instanceUuid'] = instance_uuid
276
+ # process the query parameters
277
+ # process the header parameters
278
+ # process the form parameters
279
+ # process the body parameter
280
+ if import_request is not None:
281
+ _body_params = import_request
282
+
283
+
284
+ # set the HTTP header `Accept`
285
+ _header_params['Accept'] = self.api_client.select_header_accept(
98
286
  [
99
- 'async_req',
100
- '_return_http_data_only',
101
- '_preload_content',
102
- '_request_timeout'
287
+ 'application/json'
103
288
  ]
104
289
  )
105
290
 
106
- for key, val in six.iteritems(local_var_params['kwargs']):
107
- if key not in all_params:
108
- raise ApiTypeError(
109
- "Got an unexpected keyword argument '%s'"
110
- " to method import_v1" % key
291
+ # set the HTTP header `Content-Type`
292
+ if _content_type:
293
+ _header_params['Content-Type'] = _content_type
294
+ else:
295
+ _default_content_type = (
296
+ self.api_client.select_header_content_type(
297
+ [
298
+ 'application/json'
299
+ ]
111
300
  )
112
- local_var_params[key] = val
113
- del local_var_params['kwargs']
114
- # verify the required parameter 'instance_uuid' is set
115
- if self.api_client.client_side_validation and ('instance_uuid' not in local_var_params or # noqa: E501
116
- local_var_params['instance_uuid'] is None): # noqa: E501
117
- raise ApiValueError("Missing the required parameter `instance_uuid` when calling `import_v1`") # noqa: E501
118
- # verify the required parameter 'import_request' is set
119
- if self.api_client.client_side_validation and ('import_request' not in local_var_params or # noqa: E501
120
- local_var_params['import_request'] is None): # noqa: E501
121
- raise ApiValueError("Missing the required parameter `import_request` when calling `import_v1`") # noqa: E501
122
-
123
- collection_formats = {}
124
-
125
- path_params = {}
126
- if 'instance_uuid' in local_var_params:
127
- path_params['instanceUuid'] = local_var_params['instance_uuid'] # noqa: E501
128
-
129
- query_params = []
130
-
131
- header_params = {}
132
-
133
- form_params = []
134
- local_var_files = {}
135
-
136
- body_params = None
137
- if 'import_request' in local_var_params:
138
- body_params = local_var_params['import_request']
139
- # HTTP header `Accept`
140
- header_params['Accept'] = self.api_client.select_header_accept(
141
- ['application/json']) # noqa: E501
142
-
143
- # HTTP header `Content-Type`
144
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
145
- ['application/json']) # noqa: E501
146
-
147
- # Authentication setting
148
- auth_settings = ['bearerAuth'] # noqa: E501
149
-
150
- return self.api_client.call_api(
151
- '/{instanceUuid}/import/v1', 'POST',
152
- path_params,
153
- query_params,
154
- header_params,
155
- body=body_params,
156
- post_params=form_params,
157
- files=local_var_files,
158
- response_type='GenericJob', # noqa: E501
159
- auth_settings=auth_settings,
160
- async_req=local_var_params.get('async_req'),
161
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
162
- _preload_content=local_var_params.get('_preload_content', True),
163
- _request_timeout=local_var_params.get('_request_timeout'),
164
- collection_formats=collection_formats)
301
+ )
302
+ if _default_content_type is not None:
303
+ _header_params['Content-Type'] = _default_content_type
304
+
305
+ # authentication setting
306
+ _auth_settings: List[str] = [
307
+ 'bearerAuth'
308
+ ]
309
+
310
+ return self.api_client.param_serialize(
311
+ method='POST',
312
+ resource_path='/{instanceUuid}/import/v1',
313
+ path_params=_path_params,
314
+ query_params=_query_params,
315
+ header_params=_header_params,
316
+ body=_body_params,
317
+ post_params=_form_params,
318
+ files=_files,
319
+ auth_settings=_auth_settings,
320
+ collection_formats=_collection_formats,
321
+ _host=_host,
322
+ _request_auth=_request_auth
323
+ )
324
+
325
+