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,1207 +3,2630 @@
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
-
12
-
13
- from __future__ import absolute_import
14
-
15
- import re # noqa: F401
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
16
10
 
17
- # python 2 and python 3 compatibility library
18
- import six
19
-
20
- from wds_client.api_client import ApiClient
21
- from wds_client.exceptions import ( # noqa: F401
22
- ApiTypeError,
23
- ApiValueError
24
- )
25
-
26
-
27
- class RecordsApi(object):
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
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
18
+
19
+ from pydantic import Field, StrictBytes, StrictStr
20
+ from typing import List, Optional, Union
21
+ from typing_extensions import Annotated
22
+ from wds_client.models.batch_operation import BatchOperation
23
+ from wds_client.models.batch_response import BatchResponse
24
+ from wds_client.models.record_query_response import RecordQueryResponse
25
+ from wds_client.models.record_request import RecordRequest
26
+ from wds_client.models.record_response import RecordResponse
27
+ from wds_client.models.search_request import SearchRequest
28
+ from wds_client.models.tsv_upload_response import TsvUploadResponse
29
+
30
+ from wds_client.api_client import ApiClient, RequestSerialized
31
+ from wds_client.api_response import ApiResponse
32
+ from wds_client.rest import RESTResponseType
33
+
34
+
35
+ class RecordsApi:
28
36
  """NOTE: This class is auto generated by OpenAPI Generator
29
37
  Ref: https://openapi-generator.tech
30
38
 
31
39
  Do not edit the class manually.
32
40
  """
33
41
 
34
- def __init__(self, api_client=None):
42
+ def __init__(self, api_client=None) -> None:
35
43
  if api_client is None:
36
- api_client = ApiClient()
44
+ api_client = ApiClient.get_default()
37
45
  self.api_client = api_client
38
46
 
39
- def batch_write_records(self, instanceid, v, type, batch_operation, **kwargs): # noqa: E501
40
- """Batch write records # noqa: E501
41
-
42
- Perform a batch of upsert / delete operations on multiple records # 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.batch_write_records(instanceid, v, type, batch_operation, async_req=True)
46
- >>> result = thread.get()
47
-
48
- :param async_req bool: execute request asynchronously
49
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
50
- :param str v: API version (required)
51
- :param str type: Record type (required)
52
- :param list[BatchOperation] batch_operation: A list of batch operations to perform on records (required)
53
- :param str primary_key: the column to uniquely identify a record
54
- :param _preload_content: if False, the urllib3.HTTPResponse object will
55
- be returned without reading/decoding response
56
- data. Default is True.
47
+
48
+ @validate_call
49
+ def batch_write_records(
50
+ self,
51
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
52
+ v: Annotated[StrictStr, Field(description="API version")],
53
+ type: Annotated[StrictStr, Field(description="Record type")],
54
+ batch_operation: Annotated[List[BatchOperation], Field(description="A list of batch operations to perform on records")],
55
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
56
+ _request_timeout: Union[
57
+ None,
58
+ Annotated[StrictFloat, Field(gt=0)],
59
+ Tuple[
60
+ Annotated[StrictFloat, Field(gt=0)],
61
+ Annotated[StrictFloat, Field(gt=0)]
62
+ ]
63
+ ] = None,
64
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
65
+ _content_type: Optional[StrictStr] = None,
66
+ _headers: Optional[Dict[StrictStr, Any]] = None,
67
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
68
+ ) -> BatchResponse:
69
+ """Batch write records
70
+
71
+ Perform a batch of upsert / delete operations on multiple records
72
+
73
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
74
+ :type instanceid: str
75
+ :param v: API version (required)
76
+ :type v: str
77
+ :param type: Record type (required)
78
+ :type type: str
79
+ :param batch_operation: A list of batch operations to perform on records (required)
80
+ :type batch_operation: List[BatchOperation]
81
+ :param primary_key: the column to uniquely identify a record
82
+ :type primary_key: str
57
83
  :param _request_timeout: timeout setting for this request. If one
58
84
  number provided, it will be total request
59
85
  timeout. It can also be a pair (tuple) of
60
86
  (connection, read) timeouts.
61
- :return: BatchResponse
62
- If the method is called asynchronously,
63
- returns the request thread.
64
- """
65
- kwargs['_return_http_data_only'] = True
66
- return self.batch_write_records_with_http_info(instanceid, v, type, batch_operation, **kwargs) # noqa: E501
67
-
68
- def batch_write_records_with_http_info(self, instanceid, v, type, batch_operation, **kwargs): # noqa: E501
69
- """Batch write records # noqa: E501
70
-
71
- Perform a batch of upsert / delete operations on multiple records # noqa: E501
72
- This method makes a synchronous HTTP request by default. To make an
73
- asynchronous HTTP request, please pass async_req=True
74
- >>> thread = api.batch_write_records_with_http_info(instanceid, v, type, batch_operation, async_req=True)
75
- >>> result = thread.get()
76
-
77
- :param async_req bool: execute request asynchronously
78
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
79
- :param str v: API version (required)
80
- :param str type: Record type (required)
81
- :param list[BatchOperation] batch_operation: A list of batch operations to perform on records (required)
82
- :param str primary_key: the column to uniquely identify a record
83
- :param _return_http_data_only: response data without head status code
84
- and headers
85
- :param _preload_content: if False, the urllib3.HTTPResponse object will
86
- be returned without reading/decoding response
87
- data. Default is True.
87
+ :type _request_timeout: int, tuple(int, int), optional
88
+ :param _request_auth: set to override the auth_settings for an a single
89
+ request; this effectively ignores the
90
+ authentication in the spec for a single request.
91
+ :type _request_auth: dict, optional
92
+ :param _content_type: force content-type for the request.
93
+ :type _content_type: str, Optional
94
+ :param _headers: set to override the headers for a single
95
+ request; this effectively ignores the headers
96
+ in the spec for a single request.
97
+ :type _headers: dict, optional
98
+ :param _host_index: set to override the host_index for a single
99
+ request; this effectively ignores the host_index
100
+ in the spec for a single request.
101
+ :type _host_index: int, optional
102
+ :return: Returns the result object.
103
+ """ # noqa: E501
104
+
105
+ _param = self._batch_write_records_serialize(
106
+ instanceid=instanceid,
107
+ v=v,
108
+ type=type,
109
+ batch_operation=batch_operation,
110
+ primary_key=primary_key,
111
+ _request_auth=_request_auth,
112
+ _content_type=_content_type,
113
+ _headers=_headers,
114
+ _host_index=_host_index
115
+ )
116
+
117
+ _response_types_map: Dict[str, Optional[str]] = {
118
+ '200': "BatchResponse",
119
+ }
120
+ response_data = self.api_client.call_api(
121
+ *_param,
122
+ _request_timeout=_request_timeout
123
+ )
124
+ response_data.read()
125
+ return self.api_client.response_deserialize(
126
+ response_data=response_data,
127
+ response_types_map=_response_types_map,
128
+ ).data
129
+
130
+
131
+ @validate_call
132
+ def batch_write_records_with_http_info(
133
+ self,
134
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
135
+ v: Annotated[StrictStr, Field(description="API version")],
136
+ type: Annotated[StrictStr, Field(description="Record type")],
137
+ batch_operation: Annotated[List[BatchOperation], Field(description="A list of batch operations to perform on records")],
138
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
139
+ _request_timeout: Union[
140
+ None,
141
+ Annotated[StrictFloat, Field(gt=0)],
142
+ Tuple[
143
+ Annotated[StrictFloat, Field(gt=0)],
144
+ Annotated[StrictFloat, Field(gt=0)]
145
+ ]
146
+ ] = None,
147
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
148
+ _content_type: Optional[StrictStr] = None,
149
+ _headers: Optional[Dict[StrictStr, Any]] = None,
150
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
151
+ ) -> ApiResponse[BatchResponse]:
152
+ """Batch write records
153
+
154
+ Perform a batch of upsert / delete operations on multiple records
155
+
156
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
157
+ :type instanceid: str
158
+ :param v: API version (required)
159
+ :type v: str
160
+ :param type: Record type (required)
161
+ :type type: str
162
+ :param batch_operation: A list of batch operations to perform on records (required)
163
+ :type batch_operation: List[BatchOperation]
164
+ :param primary_key: the column to uniquely identify a record
165
+ :type primary_key: str
88
166
  :param _request_timeout: timeout setting for this request. If one
89
167
  number provided, it will be total request
90
168
  timeout. It can also be a pair (tuple) of
91
169
  (connection, read) timeouts.
92
- :return: tuple(BatchResponse, status_code(int), headers(HTTPHeaderDict))
93
- If the method is called asynchronously,
94
- returns the request thread.
95
- """
96
-
97
- local_var_params = locals()
98
-
99
- all_params = [
100
- 'instanceid',
101
- 'v',
102
- 'type',
103
- 'batch_operation',
104
- 'primary_key'
105
- ]
106
- all_params.extend(
170
+ :type _request_timeout: int, tuple(int, int), optional
171
+ :param _request_auth: set to override the auth_settings for an a single
172
+ request; this effectively ignores the
173
+ authentication in the spec for a single request.
174
+ :type _request_auth: dict, optional
175
+ :param _content_type: force content-type for the request.
176
+ :type _content_type: str, Optional
177
+ :param _headers: set to override the headers for a single
178
+ request; this effectively ignores the headers
179
+ in the spec for a single request.
180
+ :type _headers: dict, optional
181
+ :param _host_index: set to override the host_index for a single
182
+ request; this effectively ignores the host_index
183
+ in the spec for a single request.
184
+ :type _host_index: int, optional
185
+ :return: Returns the result object.
186
+ """ # noqa: E501
187
+
188
+ _param = self._batch_write_records_serialize(
189
+ instanceid=instanceid,
190
+ v=v,
191
+ type=type,
192
+ batch_operation=batch_operation,
193
+ primary_key=primary_key,
194
+ _request_auth=_request_auth,
195
+ _content_type=_content_type,
196
+ _headers=_headers,
197
+ _host_index=_host_index
198
+ )
199
+
200
+ _response_types_map: Dict[str, Optional[str]] = {
201
+ '200': "BatchResponse",
202
+ }
203
+ response_data = self.api_client.call_api(
204
+ *_param,
205
+ _request_timeout=_request_timeout
206
+ )
207
+ response_data.read()
208
+ return self.api_client.response_deserialize(
209
+ response_data=response_data,
210
+ response_types_map=_response_types_map,
211
+ )
212
+
213
+
214
+ @validate_call
215
+ def batch_write_records_without_preload_content(
216
+ self,
217
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
218
+ v: Annotated[StrictStr, Field(description="API version")],
219
+ type: Annotated[StrictStr, Field(description="Record type")],
220
+ batch_operation: Annotated[List[BatchOperation], Field(description="A list of batch operations to perform on records")],
221
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
222
+ _request_timeout: Union[
223
+ None,
224
+ Annotated[StrictFloat, Field(gt=0)],
225
+ Tuple[
226
+ Annotated[StrictFloat, Field(gt=0)],
227
+ Annotated[StrictFloat, Field(gt=0)]
228
+ ]
229
+ ] = None,
230
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
231
+ _content_type: Optional[StrictStr] = None,
232
+ _headers: Optional[Dict[StrictStr, Any]] = None,
233
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
234
+ ) -> RESTResponseType:
235
+ """Batch write records
236
+
237
+ Perform a batch of upsert / delete operations on multiple records
238
+
239
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
240
+ :type instanceid: str
241
+ :param v: API version (required)
242
+ :type v: str
243
+ :param type: Record type (required)
244
+ :type type: str
245
+ :param batch_operation: A list of batch operations to perform on records (required)
246
+ :type batch_operation: List[BatchOperation]
247
+ :param primary_key: the column to uniquely identify a record
248
+ :type primary_key: str
249
+ :param _request_timeout: timeout setting for this request. If one
250
+ number provided, it will be total request
251
+ timeout. It can also be a pair (tuple) of
252
+ (connection, read) timeouts.
253
+ :type _request_timeout: int, tuple(int, int), optional
254
+ :param _request_auth: set to override the auth_settings for an a single
255
+ request; this effectively ignores the
256
+ authentication in the spec for a single request.
257
+ :type _request_auth: dict, optional
258
+ :param _content_type: force content-type for the request.
259
+ :type _content_type: str, Optional
260
+ :param _headers: set to override the headers for a single
261
+ request; this effectively ignores the headers
262
+ in the spec for a single request.
263
+ :type _headers: dict, optional
264
+ :param _host_index: set to override the host_index for a single
265
+ request; this effectively ignores the host_index
266
+ in the spec for a single request.
267
+ :type _host_index: int, optional
268
+ :return: Returns the result object.
269
+ """ # noqa: E501
270
+
271
+ _param = self._batch_write_records_serialize(
272
+ instanceid=instanceid,
273
+ v=v,
274
+ type=type,
275
+ batch_operation=batch_operation,
276
+ primary_key=primary_key,
277
+ _request_auth=_request_auth,
278
+ _content_type=_content_type,
279
+ _headers=_headers,
280
+ _host_index=_host_index
281
+ )
282
+
283
+ _response_types_map: Dict[str, Optional[str]] = {
284
+ '200': "BatchResponse",
285
+ }
286
+ response_data = self.api_client.call_api(
287
+ *_param,
288
+ _request_timeout=_request_timeout
289
+ )
290
+ return response_data.response
291
+
292
+
293
+ def _batch_write_records_serialize(
294
+ self,
295
+ instanceid,
296
+ v,
297
+ type,
298
+ batch_operation,
299
+ primary_key,
300
+ _request_auth,
301
+ _content_type,
302
+ _headers,
303
+ _host_index,
304
+ ) -> RequestSerialized:
305
+
306
+ _host = None
307
+
308
+ _collection_formats: Dict[str, str] = {
309
+ 'BatchOperation': '',
310
+ }
311
+
312
+ _path_params: Dict[str, str] = {}
313
+ _query_params: List[Tuple[str, str]] = []
314
+ _header_params: Dict[str, Optional[str]] = _headers or {}
315
+ _form_params: List[Tuple[str, str]] = []
316
+ _files: Dict[str, Union[str, bytes]] = {}
317
+ _body_params: Optional[bytes] = None
318
+
319
+ # process the path parameters
320
+ if instanceid is not None:
321
+ _path_params['instanceid'] = instanceid
322
+ if v is not None:
323
+ _path_params['v'] = v
324
+ if type is not None:
325
+ _path_params['type'] = type
326
+ # process the query parameters
327
+ if primary_key is not None:
328
+
329
+ _query_params.append(('primaryKey', primary_key))
330
+
331
+ # process the header parameters
332
+ # process the form parameters
333
+ # process the body parameter
334
+ if batch_operation is not None:
335
+ _body_params = batch_operation
336
+
337
+
338
+ # set the HTTP header `Accept`
339
+ _header_params['Accept'] = self.api_client.select_header_accept(
107
340
  [
108
- 'async_req',
109
- '_return_http_data_only',
110
- '_preload_content',
111
- '_request_timeout'
341
+ 'application/json'
112
342
  ]
113
343
  )
114
344
 
115
- for key, val in six.iteritems(local_var_params['kwargs']):
116
- if key not in all_params:
117
- raise ApiTypeError(
118
- "Got an unexpected keyword argument '%s'"
119
- " to method batch_write_records" % key
345
+ # set the HTTP header `Content-Type`
346
+ if _content_type:
347
+ _header_params['Content-Type'] = _content_type
348
+ else:
349
+ _default_content_type = (
350
+ self.api_client.select_header_content_type(
351
+ [
352
+ 'application/json'
353
+ ]
120
354
  )
121
- local_var_params[key] = val
122
- del local_var_params['kwargs']
123
- # verify the required parameter 'instanceid' is set
124
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
125
- local_var_params['instanceid'] is None): # noqa: E501
126
- raise ApiValueError("Missing the required parameter `instanceid` when calling `batch_write_records`") # noqa: E501
127
- # verify the required parameter 'v' is set
128
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
129
- local_var_params['v'] is None): # noqa: E501
130
- raise ApiValueError("Missing the required parameter `v` when calling `batch_write_records`") # noqa: E501
131
- # verify the required parameter 'type' is set
132
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
133
- local_var_params['type'] is None): # noqa: E501
134
- raise ApiValueError("Missing the required parameter `type` when calling `batch_write_records`") # noqa: E501
135
- # verify the required parameter 'batch_operation' is set
136
- if self.api_client.client_side_validation and ('batch_operation' not in local_var_params or # noqa: E501
137
- local_var_params['batch_operation'] is None): # noqa: E501
138
- raise ApiValueError("Missing the required parameter `batch_operation` when calling `batch_write_records`") # noqa: E501
139
-
140
- collection_formats = {}
141
-
142
- path_params = {}
143
- if 'instanceid' in local_var_params:
144
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
145
- if 'v' in local_var_params:
146
- path_params['v'] = local_var_params['v'] # noqa: E501
147
- if 'type' in local_var_params:
148
- path_params['type'] = local_var_params['type'] # noqa: E501
149
-
150
- query_params = []
151
- if 'primary_key' in local_var_params and local_var_params['primary_key'] is not None: # noqa: E501
152
- query_params.append(('primaryKey', local_var_params['primary_key'])) # noqa: E501
153
-
154
- header_params = {}
155
-
156
- form_params = []
157
- local_var_files = {}
158
-
159
- body_params = None
160
- if 'batch_operation' in local_var_params:
161
- body_params = local_var_params['batch_operation']
162
- # HTTP header `Accept`
163
- header_params['Accept'] = self.api_client.select_header_accept(
164
- ['application/json']) # noqa: E501
165
-
166
- # HTTP header `Content-Type`
167
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
168
- ['application/json']) # noqa: E501
169
-
170
- # Authentication setting
171
- auth_settings = ['bearerAuth'] # noqa: E501
172
-
173
- return self.api_client.call_api(
174
- '/{instanceid}/batch/{v}/{type}', 'POST',
175
- path_params,
176
- query_params,
177
- header_params,
178
- body=body_params,
179
- post_params=form_params,
180
- files=local_var_files,
181
- response_type='BatchResponse', # noqa: E501
182
- auth_settings=auth_settings,
183
- async_req=local_var_params.get('async_req'),
184
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
185
- _preload_content=local_var_params.get('_preload_content', True),
186
- _request_timeout=local_var_params.get('_request_timeout'),
187
- collection_formats=collection_formats)
188
-
189
- def create_or_replace_record(self, instanceid, v, type, id, record_request, **kwargs): # noqa: E501
190
- """Create or replace record # noqa: E501
191
-
192
- Creates or replaces the record using the specified type and id. If the record already exists, its entire set of attributes will be overwritten by the attributes in the request body. TODO: add a query parameter to allow/disallow overwriting existing records? # noqa: E501
193
- This method makes a synchronous HTTP request by default. To make an
194
- asynchronous HTTP request, please pass async_req=True
195
- >>> thread = api.create_or_replace_record(instanceid, v, type, id, record_request, async_req=True)
196
- >>> result = thread.get()
197
-
198
- :param async_req bool: execute request asynchronously
199
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
200
- :param str v: API version (required)
201
- :param str type: Record type (required)
202
- :param str id: Record id (required)
203
- :param RecordRequest record_request: A record's attributes to upload (required)
204
- :param str primary_key: the column to uniquely identify a record
205
- :param _preload_content: if False, the urllib3.HTTPResponse object will
206
- be returned without reading/decoding response
207
- data. Default is True.
355
+ )
356
+ if _default_content_type is not None:
357
+ _header_params['Content-Type'] = _default_content_type
358
+
359
+ # authentication setting
360
+ _auth_settings: List[str] = [
361
+ 'bearerAuth'
362
+ ]
363
+
364
+ return self.api_client.param_serialize(
365
+ method='POST',
366
+ resource_path='/{instanceid}/batch/{v}/{type}',
367
+ path_params=_path_params,
368
+ query_params=_query_params,
369
+ header_params=_header_params,
370
+ body=_body_params,
371
+ post_params=_form_params,
372
+ files=_files,
373
+ auth_settings=_auth_settings,
374
+ collection_formats=_collection_formats,
375
+ _host=_host,
376
+ _request_auth=_request_auth
377
+ )
378
+
379
+
380
+
381
+
382
+ @validate_call
383
+ def create_or_replace_record(
384
+ self,
385
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
386
+ v: Annotated[StrictStr, Field(description="API version")],
387
+ type: Annotated[StrictStr, Field(description="Record type")],
388
+ id: Annotated[StrictStr, Field(description="Record id")],
389
+ record_request: Annotated[RecordRequest, Field(description="A record's attributes to upload")],
390
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
391
+ _request_timeout: Union[
392
+ None,
393
+ Annotated[StrictFloat, Field(gt=0)],
394
+ Tuple[
395
+ Annotated[StrictFloat, Field(gt=0)],
396
+ Annotated[StrictFloat, Field(gt=0)]
397
+ ]
398
+ ] = None,
399
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
400
+ _content_type: Optional[StrictStr] = None,
401
+ _headers: Optional[Dict[StrictStr, Any]] = None,
402
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
403
+ ) -> RecordResponse:
404
+ """Create or replace record
405
+
406
+ Creates or replaces the record using the specified type and id. If the record already exists, its entire set of attributes will be overwritten by the attributes in the request body. TODO: add a query parameter to allow/disallow overwriting existing records?
407
+
408
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
409
+ :type instanceid: str
410
+ :param v: API version (required)
411
+ :type v: str
412
+ :param type: Record type (required)
413
+ :type type: str
414
+ :param id: Record id (required)
415
+ :type id: str
416
+ :param record_request: A record's attributes to upload (required)
417
+ :type record_request: RecordRequest
418
+ :param primary_key: the column to uniquely identify a record
419
+ :type primary_key: str
208
420
  :param _request_timeout: timeout setting for this request. If one
209
421
  number provided, it will be total request
210
422
  timeout. It can also be a pair (tuple) of
211
423
  (connection, read) timeouts.
212
- :return: RecordResponse
213
- If the method is called asynchronously,
214
- returns the request thread.
215
- """
216
- kwargs['_return_http_data_only'] = True
217
- return self.create_or_replace_record_with_http_info(instanceid, v, type, id, record_request, **kwargs) # noqa: E501
218
-
219
- def create_or_replace_record_with_http_info(self, instanceid, v, type, id, record_request, **kwargs): # noqa: E501
220
- """Create or replace record # noqa: E501
221
-
222
- Creates or replaces the record using the specified type and id. If the record already exists, its entire set of attributes will be overwritten by the attributes in the request body. TODO: add a query parameter to allow/disallow overwriting existing records? # noqa: E501
223
- This method makes a synchronous HTTP request by default. To make an
224
- asynchronous HTTP request, please pass async_req=True
225
- >>> thread = api.create_or_replace_record_with_http_info(instanceid, v, type, id, record_request, async_req=True)
226
- >>> result = thread.get()
227
-
228
- :param async_req bool: execute request asynchronously
229
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
230
- :param str v: API version (required)
231
- :param str type: Record type (required)
232
- :param str id: Record id (required)
233
- :param RecordRequest record_request: A record's attributes to upload (required)
234
- :param str primary_key: the column to uniquely identify a record
235
- :param _return_http_data_only: response data without head status code
236
- and headers
237
- :param _preload_content: if False, the urllib3.HTTPResponse object will
238
- be returned without reading/decoding response
239
- data. Default is True.
424
+ :type _request_timeout: int, tuple(int, int), optional
425
+ :param _request_auth: set to override the auth_settings for an a single
426
+ request; this effectively ignores the
427
+ authentication in the spec for a single request.
428
+ :type _request_auth: dict, optional
429
+ :param _content_type: force content-type for the request.
430
+ :type _content_type: str, Optional
431
+ :param _headers: set to override the headers for a single
432
+ request; this effectively ignores the headers
433
+ in the spec for a single request.
434
+ :type _headers: dict, optional
435
+ :param _host_index: set to override the host_index for a single
436
+ request; this effectively ignores the host_index
437
+ in the spec for a single request.
438
+ :type _host_index: int, optional
439
+ :return: Returns the result object.
440
+ """ # noqa: E501
441
+
442
+ _param = self._create_or_replace_record_serialize(
443
+ instanceid=instanceid,
444
+ v=v,
445
+ type=type,
446
+ id=id,
447
+ record_request=record_request,
448
+ primary_key=primary_key,
449
+ _request_auth=_request_auth,
450
+ _content_type=_content_type,
451
+ _headers=_headers,
452
+ _host_index=_host_index
453
+ )
454
+
455
+ _response_types_map: Dict[str, Optional[str]] = {
456
+ '200': "RecordResponse",
457
+ '201': "RecordResponse",
458
+ '400': "ErrorResponse",
459
+ }
460
+ response_data = self.api_client.call_api(
461
+ *_param,
462
+ _request_timeout=_request_timeout
463
+ )
464
+ response_data.read()
465
+ return self.api_client.response_deserialize(
466
+ response_data=response_data,
467
+ response_types_map=_response_types_map,
468
+ ).data
469
+
470
+
471
+ @validate_call
472
+ def create_or_replace_record_with_http_info(
473
+ self,
474
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
475
+ v: Annotated[StrictStr, Field(description="API version")],
476
+ type: Annotated[StrictStr, Field(description="Record type")],
477
+ id: Annotated[StrictStr, Field(description="Record id")],
478
+ record_request: Annotated[RecordRequest, Field(description="A record's attributes to upload")],
479
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
480
+ _request_timeout: Union[
481
+ None,
482
+ Annotated[StrictFloat, Field(gt=0)],
483
+ Tuple[
484
+ Annotated[StrictFloat, Field(gt=0)],
485
+ Annotated[StrictFloat, Field(gt=0)]
486
+ ]
487
+ ] = None,
488
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
489
+ _content_type: Optional[StrictStr] = None,
490
+ _headers: Optional[Dict[StrictStr, Any]] = None,
491
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
492
+ ) -> ApiResponse[RecordResponse]:
493
+ """Create or replace record
494
+
495
+ Creates or replaces the record using the specified type and id. If the record already exists, its entire set of attributes will be overwritten by the attributes in the request body. TODO: add a query parameter to allow/disallow overwriting existing records?
496
+
497
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
498
+ :type instanceid: str
499
+ :param v: API version (required)
500
+ :type v: str
501
+ :param type: Record type (required)
502
+ :type type: str
503
+ :param id: Record id (required)
504
+ :type id: str
505
+ :param record_request: A record's attributes to upload (required)
506
+ :type record_request: RecordRequest
507
+ :param primary_key: the column to uniquely identify a record
508
+ :type primary_key: str
240
509
  :param _request_timeout: timeout setting for this request. If one
241
510
  number provided, it will be total request
242
511
  timeout. It can also be a pair (tuple) of
243
512
  (connection, read) timeouts.
244
- :return: tuple(RecordResponse, status_code(int), headers(HTTPHeaderDict))
245
- If the method is called asynchronously,
246
- returns the request thread.
247
- """
248
-
249
- local_var_params = locals()
250
-
251
- all_params = [
252
- 'instanceid',
253
- 'v',
254
- 'type',
255
- 'id',
256
- 'record_request',
257
- 'primary_key'
258
- ]
259
- all_params.extend(
513
+ :type _request_timeout: int, tuple(int, int), optional
514
+ :param _request_auth: set to override the auth_settings for an a single
515
+ request; this effectively ignores the
516
+ authentication in the spec for a single request.
517
+ :type _request_auth: dict, optional
518
+ :param _content_type: force content-type for the request.
519
+ :type _content_type: str, Optional
520
+ :param _headers: set to override the headers for a single
521
+ request; this effectively ignores the headers
522
+ in the spec for a single request.
523
+ :type _headers: dict, optional
524
+ :param _host_index: set to override the host_index for a single
525
+ request; this effectively ignores the host_index
526
+ in the spec for a single request.
527
+ :type _host_index: int, optional
528
+ :return: Returns the result object.
529
+ """ # noqa: E501
530
+
531
+ _param = self._create_or_replace_record_serialize(
532
+ instanceid=instanceid,
533
+ v=v,
534
+ type=type,
535
+ id=id,
536
+ record_request=record_request,
537
+ primary_key=primary_key,
538
+ _request_auth=_request_auth,
539
+ _content_type=_content_type,
540
+ _headers=_headers,
541
+ _host_index=_host_index
542
+ )
543
+
544
+ _response_types_map: Dict[str, Optional[str]] = {
545
+ '200': "RecordResponse",
546
+ '201': "RecordResponse",
547
+ '400': "ErrorResponse",
548
+ }
549
+ response_data = self.api_client.call_api(
550
+ *_param,
551
+ _request_timeout=_request_timeout
552
+ )
553
+ response_data.read()
554
+ return self.api_client.response_deserialize(
555
+ response_data=response_data,
556
+ response_types_map=_response_types_map,
557
+ )
558
+
559
+
560
+ @validate_call
561
+ def create_or_replace_record_without_preload_content(
562
+ self,
563
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
564
+ v: Annotated[StrictStr, Field(description="API version")],
565
+ type: Annotated[StrictStr, Field(description="Record type")],
566
+ id: Annotated[StrictStr, Field(description="Record id")],
567
+ record_request: Annotated[RecordRequest, Field(description="A record's attributes to upload")],
568
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
569
+ _request_timeout: Union[
570
+ None,
571
+ Annotated[StrictFloat, Field(gt=0)],
572
+ Tuple[
573
+ Annotated[StrictFloat, Field(gt=0)],
574
+ Annotated[StrictFloat, Field(gt=0)]
575
+ ]
576
+ ] = None,
577
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
578
+ _content_type: Optional[StrictStr] = None,
579
+ _headers: Optional[Dict[StrictStr, Any]] = None,
580
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
581
+ ) -> RESTResponseType:
582
+ """Create or replace record
583
+
584
+ Creates or replaces the record using the specified type and id. If the record already exists, its entire set of attributes will be overwritten by the attributes in the request body. TODO: add a query parameter to allow/disallow overwriting existing records?
585
+
586
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
587
+ :type instanceid: str
588
+ :param v: API version (required)
589
+ :type v: str
590
+ :param type: Record type (required)
591
+ :type type: str
592
+ :param id: Record id (required)
593
+ :type id: str
594
+ :param record_request: A record's attributes to upload (required)
595
+ :type record_request: RecordRequest
596
+ :param primary_key: the column to uniquely identify a record
597
+ :type primary_key: str
598
+ :param _request_timeout: timeout setting for this request. If one
599
+ number provided, it will be total request
600
+ timeout. It can also be a pair (tuple) of
601
+ (connection, read) timeouts.
602
+ :type _request_timeout: int, tuple(int, int), optional
603
+ :param _request_auth: set to override the auth_settings for an a single
604
+ request; this effectively ignores the
605
+ authentication in the spec for a single request.
606
+ :type _request_auth: dict, optional
607
+ :param _content_type: force content-type for the request.
608
+ :type _content_type: str, Optional
609
+ :param _headers: set to override the headers for a single
610
+ request; this effectively ignores the headers
611
+ in the spec for a single request.
612
+ :type _headers: dict, optional
613
+ :param _host_index: set to override the host_index for a single
614
+ request; this effectively ignores the host_index
615
+ in the spec for a single request.
616
+ :type _host_index: int, optional
617
+ :return: Returns the result object.
618
+ """ # noqa: E501
619
+
620
+ _param = self._create_or_replace_record_serialize(
621
+ instanceid=instanceid,
622
+ v=v,
623
+ type=type,
624
+ id=id,
625
+ record_request=record_request,
626
+ primary_key=primary_key,
627
+ _request_auth=_request_auth,
628
+ _content_type=_content_type,
629
+ _headers=_headers,
630
+ _host_index=_host_index
631
+ )
632
+
633
+ _response_types_map: Dict[str, Optional[str]] = {
634
+ '200': "RecordResponse",
635
+ '201': "RecordResponse",
636
+ '400': "ErrorResponse",
637
+ }
638
+ response_data = self.api_client.call_api(
639
+ *_param,
640
+ _request_timeout=_request_timeout
641
+ )
642
+ return response_data.response
643
+
644
+
645
+ def _create_or_replace_record_serialize(
646
+ self,
647
+ instanceid,
648
+ v,
649
+ type,
650
+ id,
651
+ record_request,
652
+ primary_key,
653
+ _request_auth,
654
+ _content_type,
655
+ _headers,
656
+ _host_index,
657
+ ) -> RequestSerialized:
658
+
659
+ _host = None
660
+
661
+ _collection_formats: Dict[str, str] = {
662
+ }
663
+
664
+ _path_params: Dict[str, str] = {}
665
+ _query_params: List[Tuple[str, str]] = []
666
+ _header_params: Dict[str, Optional[str]] = _headers or {}
667
+ _form_params: List[Tuple[str, str]] = []
668
+ _files: Dict[str, Union[str, bytes]] = {}
669
+ _body_params: Optional[bytes] = None
670
+
671
+ # process the path parameters
672
+ if instanceid is not None:
673
+ _path_params['instanceid'] = instanceid
674
+ if v is not None:
675
+ _path_params['v'] = v
676
+ if type is not None:
677
+ _path_params['type'] = type
678
+ if id is not None:
679
+ _path_params['id'] = id
680
+ # process the query parameters
681
+ if primary_key is not None:
682
+
683
+ _query_params.append(('primaryKey', primary_key))
684
+
685
+ # process the header parameters
686
+ # process the form parameters
687
+ # process the body parameter
688
+ if record_request is not None:
689
+ _body_params = record_request
690
+
691
+
692
+ # set the HTTP header `Accept`
693
+ _header_params['Accept'] = self.api_client.select_header_accept(
260
694
  [
261
- 'async_req',
262
- '_return_http_data_only',
263
- '_preload_content',
264
- '_request_timeout'
695
+ 'application/json'
265
696
  ]
266
697
  )
267
698
 
268
- for key, val in six.iteritems(local_var_params['kwargs']):
269
- if key not in all_params:
270
- raise ApiTypeError(
271
- "Got an unexpected keyword argument '%s'"
272
- " to method create_or_replace_record" % key
699
+ # set the HTTP header `Content-Type`
700
+ if _content_type:
701
+ _header_params['Content-Type'] = _content_type
702
+ else:
703
+ _default_content_type = (
704
+ self.api_client.select_header_content_type(
705
+ [
706
+ 'application/json'
707
+ ]
273
708
  )
274
- local_var_params[key] = val
275
- del local_var_params['kwargs']
276
- # verify the required parameter 'instanceid' is set
277
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
278
- local_var_params['instanceid'] is None): # noqa: E501
279
- raise ApiValueError("Missing the required parameter `instanceid` when calling `create_or_replace_record`") # noqa: E501
280
- # verify the required parameter 'v' is set
281
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
282
- local_var_params['v'] is None): # noqa: E501
283
- raise ApiValueError("Missing the required parameter `v` when calling `create_or_replace_record`") # noqa: E501
284
- # verify the required parameter 'type' is set
285
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
286
- local_var_params['type'] is None): # noqa: E501
287
- raise ApiValueError("Missing the required parameter `type` when calling `create_or_replace_record`") # noqa: E501
288
- # verify the required parameter 'id' is set
289
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
290
- local_var_params['id'] is None): # noqa: E501
291
- raise ApiValueError("Missing the required parameter `id` when calling `create_or_replace_record`") # noqa: E501
292
- # verify the required parameter 'record_request' is set
293
- if self.api_client.client_side_validation and ('record_request' not in local_var_params or # noqa: E501
294
- local_var_params['record_request'] is None): # noqa: E501
295
- raise ApiValueError("Missing the required parameter `record_request` when calling `create_or_replace_record`") # noqa: E501
296
-
297
- collection_formats = {}
298
-
299
- path_params = {}
300
- if 'instanceid' in local_var_params:
301
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
302
- if 'v' in local_var_params:
303
- path_params['v'] = local_var_params['v'] # noqa: E501
304
- if 'type' in local_var_params:
305
- path_params['type'] = local_var_params['type'] # noqa: E501
306
- if 'id' in local_var_params:
307
- path_params['id'] = local_var_params['id'] # noqa: E501
308
-
309
- query_params = []
310
- if 'primary_key' in local_var_params and local_var_params['primary_key'] is not None: # noqa: E501
311
- query_params.append(('primaryKey', local_var_params['primary_key'])) # noqa: E501
312
-
313
- header_params = {}
314
-
315
- form_params = []
316
- local_var_files = {}
317
-
318
- body_params = None
319
- if 'record_request' in local_var_params:
320
- body_params = local_var_params['record_request']
321
- # HTTP header `Accept`
322
- header_params['Accept'] = self.api_client.select_header_accept(
323
- ['application/json']) # noqa: E501
324
-
325
- # HTTP header `Content-Type`
326
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
327
- ['application/json']) # noqa: E501
328
-
329
- # Authentication setting
330
- auth_settings = ['bearerAuth'] # noqa: E501
331
-
332
- return self.api_client.call_api(
333
- '/{instanceid}/records/{v}/{type}/{id}', 'PUT',
334
- path_params,
335
- query_params,
336
- header_params,
337
- body=body_params,
338
- post_params=form_params,
339
- files=local_var_files,
340
- response_type='RecordResponse', # noqa: E501
341
- auth_settings=auth_settings,
342
- async_req=local_var_params.get('async_req'),
343
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
344
- _preload_content=local_var_params.get('_preload_content', True),
345
- _request_timeout=local_var_params.get('_request_timeout'),
346
- collection_formats=collection_formats)
347
-
348
- def delete_record(self, instanceid, v, type, id, **kwargs): # noqa: E501
349
- """Delete record # noqa: E501
350
-
351
- Deletes the record at the specified type and id. # noqa: E501
352
- This method makes a synchronous HTTP request by default. To make an
353
- asynchronous HTTP request, please pass async_req=True
354
- >>> thread = api.delete_record(instanceid, v, type, id, async_req=True)
355
- >>> result = thread.get()
356
-
357
- :param async_req bool: execute request asynchronously
358
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
359
- :param str v: API version (required)
360
- :param str type: Record type (required)
361
- :param str id: Record id (required)
362
- :param _preload_content: if False, the urllib3.HTTPResponse object will
363
- be returned without reading/decoding response
364
- data. Default is True.
709
+ )
710
+ if _default_content_type is not None:
711
+ _header_params['Content-Type'] = _default_content_type
712
+
713
+ # authentication setting
714
+ _auth_settings: List[str] = [
715
+ 'bearerAuth'
716
+ ]
717
+
718
+ return self.api_client.param_serialize(
719
+ method='PUT',
720
+ resource_path='/{instanceid}/records/{v}/{type}/{id}',
721
+ path_params=_path_params,
722
+ query_params=_query_params,
723
+ header_params=_header_params,
724
+ body=_body_params,
725
+ post_params=_form_params,
726
+ files=_files,
727
+ auth_settings=_auth_settings,
728
+ collection_formats=_collection_formats,
729
+ _host=_host,
730
+ _request_auth=_request_auth
731
+ )
732
+
733
+
734
+
735
+
736
+ @validate_call
737
+ def delete_record(
738
+ self,
739
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
740
+ v: Annotated[StrictStr, Field(description="API version")],
741
+ type: Annotated[StrictStr, Field(description="Record type")],
742
+ id: Annotated[StrictStr, Field(description="Record id")],
743
+ _request_timeout: Union[
744
+ None,
745
+ Annotated[StrictFloat, Field(gt=0)],
746
+ Tuple[
747
+ Annotated[StrictFloat, Field(gt=0)],
748
+ Annotated[StrictFloat, Field(gt=0)]
749
+ ]
750
+ ] = None,
751
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
752
+ _content_type: Optional[StrictStr] = None,
753
+ _headers: Optional[Dict[StrictStr, Any]] = None,
754
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
755
+ ) -> None:
756
+ """Delete record
757
+
758
+ Deletes the record at the specified type and id.
759
+
760
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
761
+ :type instanceid: str
762
+ :param v: API version (required)
763
+ :type v: str
764
+ :param type: Record type (required)
765
+ :type type: str
766
+ :param id: Record id (required)
767
+ :type id: str
365
768
  :param _request_timeout: timeout setting for this request. If one
366
769
  number provided, it will be total request
367
770
  timeout. It can also be a pair (tuple) of
368
771
  (connection, read) timeouts.
369
- :return: None
370
- If the method is called asynchronously,
371
- returns the request thread.
372
- """
373
- kwargs['_return_http_data_only'] = True
374
- return self.delete_record_with_http_info(instanceid, v, type, id, **kwargs) # noqa: E501
375
-
376
- def delete_record_with_http_info(self, instanceid, v, type, id, **kwargs): # noqa: E501
377
- """Delete record # noqa: E501
378
-
379
- Deletes the record at the specified type and id. # noqa: E501
380
- This method makes a synchronous HTTP request by default. To make an
381
- asynchronous HTTP request, please pass async_req=True
382
- >>> thread = api.delete_record_with_http_info(instanceid, v, type, id, async_req=True)
383
- >>> result = thread.get()
384
-
385
- :param async_req bool: execute request asynchronously
386
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
387
- :param str v: API version (required)
388
- :param str type: Record type (required)
389
- :param str id: Record id (required)
390
- :param _return_http_data_only: response data without head status code
391
- and headers
392
- :param _preload_content: if False, the urllib3.HTTPResponse object will
393
- be returned without reading/decoding response
394
- data. Default is True.
772
+ :type _request_timeout: int, tuple(int, int), optional
773
+ :param _request_auth: set to override the auth_settings for an a single
774
+ request; this effectively ignores the
775
+ authentication in the spec for a single request.
776
+ :type _request_auth: dict, optional
777
+ :param _content_type: force content-type for the request.
778
+ :type _content_type: str, Optional
779
+ :param _headers: set to override the headers for a single
780
+ request; this effectively ignores the headers
781
+ in the spec for a single request.
782
+ :type _headers: dict, optional
783
+ :param _host_index: set to override the host_index for a single
784
+ request; this effectively ignores the host_index
785
+ in the spec for a single request.
786
+ :type _host_index: int, optional
787
+ :return: Returns the result object.
788
+ """ # noqa: E501
789
+
790
+ _param = self._delete_record_serialize(
791
+ instanceid=instanceid,
792
+ v=v,
793
+ type=type,
794
+ id=id,
795
+ _request_auth=_request_auth,
796
+ _content_type=_content_type,
797
+ _headers=_headers,
798
+ _host_index=_host_index
799
+ )
800
+
801
+ _response_types_map: Dict[str, Optional[str]] = {
802
+ '204': None,
803
+ '404': "ErrorResponse",
804
+ '400': "ErrorResponse",
805
+ }
806
+ response_data = self.api_client.call_api(
807
+ *_param,
808
+ _request_timeout=_request_timeout
809
+ )
810
+ response_data.read()
811
+ return self.api_client.response_deserialize(
812
+ response_data=response_data,
813
+ response_types_map=_response_types_map,
814
+ ).data
815
+
816
+
817
+ @validate_call
818
+ def delete_record_with_http_info(
819
+ self,
820
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
821
+ v: Annotated[StrictStr, Field(description="API version")],
822
+ type: Annotated[StrictStr, Field(description="Record type")],
823
+ id: Annotated[StrictStr, Field(description="Record id")],
824
+ _request_timeout: Union[
825
+ None,
826
+ Annotated[StrictFloat, Field(gt=0)],
827
+ Tuple[
828
+ Annotated[StrictFloat, Field(gt=0)],
829
+ Annotated[StrictFloat, Field(gt=0)]
830
+ ]
831
+ ] = None,
832
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
833
+ _content_type: Optional[StrictStr] = None,
834
+ _headers: Optional[Dict[StrictStr, Any]] = None,
835
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
836
+ ) -> ApiResponse[None]:
837
+ """Delete record
838
+
839
+ Deletes the record at the specified type and id.
840
+
841
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
842
+ :type instanceid: str
843
+ :param v: API version (required)
844
+ :type v: str
845
+ :param type: Record type (required)
846
+ :type type: str
847
+ :param id: Record id (required)
848
+ :type id: str
395
849
  :param _request_timeout: timeout setting for this request. If one
396
850
  number provided, it will be total request
397
851
  timeout. It can also be a pair (tuple) of
398
852
  (connection, read) timeouts.
399
- :return: None
400
- If the method is called asynchronously,
401
- returns the request thread.
402
- """
403
-
404
- local_var_params = locals()
405
-
406
- all_params = [
407
- 'instanceid',
408
- 'v',
409
- 'type',
410
- 'id'
411
- ]
412
- all_params.extend(
853
+ :type _request_timeout: int, tuple(int, int), optional
854
+ :param _request_auth: set to override the auth_settings for an a single
855
+ request; this effectively ignores the
856
+ authentication in the spec for a single request.
857
+ :type _request_auth: dict, optional
858
+ :param _content_type: force content-type for the request.
859
+ :type _content_type: str, Optional
860
+ :param _headers: set to override the headers for a single
861
+ request; this effectively ignores the headers
862
+ in the spec for a single request.
863
+ :type _headers: dict, optional
864
+ :param _host_index: set to override the host_index for a single
865
+ request; this effectively ignores the host_index
866
+ in the spec for a single request.
867
+ :type _host_index: int, optional
868
+ :return: Returns the result object.
869
+ """ # noqa: E501
870
+
871
+ _param = self._delete_record_serialize(
872
+ instanceid=instanceid,
873
+ v=v,
874
+ type=type,
875
+ id=id,
876
+ _request_auth=_request_auth,
877
+ _content_type=_content_type,
878
+ _headers=_headers,
879
+ _host_index=_host_index
880
+ )
881
+
882
+ _response_types_map: Dict[str, Optional[str]] = {
883
+ '204': None,
884
+ '404': "ErrorResponse",
885
+ '400': "ErrorResponse",
886
+ }
887
+ response_data = self.api_client.call_api(
888
+ *_param,
889
+ _request_timeout=_request_timeout
890
+ )
891
+ response_data.read()
892
+ return self.api_client.response_deserialize(
893
+ response_data=response_data,
894
+ response_types_map=_response_types_map,
895
+ )
896
+
897
+
898
+ @validate_call
899
+ def delete_record_without_preload_content(
900
+ self,
901
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
902
+ v: Annotated[StrictStr, Field(description="API version")],
903
+ type: Annotated[StrictStr, Field(description="Record type")],
904
+ id: Annotated[StrictStr, Field(description="Record id")],
905
+ _request_timeout: Union[
906
+ None,
907
+ Annotated[StrictFloat, Field(gt=0)],
908
+ Tuple[
909
+ Annotated[StrictFloat, Field(gt=0)],
910
+ Annotated[StrictFloat, Field(gt=0)]
911
+ ]
912
+ ] = None,
913
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
914
+ _content_type: Optional[StrictStr] = None,
915
+ _headers: Optional[Dict[StrictStr, Any]] = None,
916
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
917
+ ) -> RESTResponseType:
918
+ """Delete record
919
+
920
+ Deletes the record at the specified type and id.
921
+
922
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
923
+ :type instanceid: str
924
+ :param v: API version (required)
925
+ :type v: str
926
+ :param type: Record type (required)
927
+ :type type: str
928
+ :param id: Record id (required)
929
+ :type id: str
930
+ :param _request_timeout: timeout setting for this request. If one
931
+ number provided, it will be total request
932
+ timeout. It can also be a pair (tuple) of
933
+ (connection, read) timeouts.
934
+ :type _request_timeout: int, tuple(int, int), optional
935
+ :param _request_auth: set to override the auth_settings for an a single
936
+ request; this effectively ignores the
937
+ authentication in the spec for a single request.
938
+ :type _request_auth: dict, optional
939
+ :param _content_type: force content-type for the request.
940
+ :type _content_type: str, Optional
941
+ :param _headers: set to override the headers for a single
942
+ request; this effectively ignores the headers
943
+ in the spec for a single request.
944
+ :type _headers: dict, optional
945
+ :param _host_index: set to override the host_index for a single
946
+ request; this effectively ignores the host_index
947
+ in the spec for a single request.
948
+ :type _host_index: int, optional
949
+ :return: Returns the result object.
950
+ """ # noqa: E501
951
+
952
+ _param = self._delete_record_serialize(
953
+ instanceid=instanceid,
954
+ v=v,
955
+ type=type,
956
+ id=id,
957
+ _request_auth=_request_auth,
958
+ _content_type=_content_type,
959
+ _headers=_headers,
960
+ _host_index=_host_index
961
+ )
962
+
963
+ _response_types_map: Dict[str, Optional[str]] = {
964
+ '204': None,
965
+ '404': "ErrorResponse",
966
+ '400': "ErrorResponse",
967
+ }
968
+ response_data = self.api_client.call_api(
969
+ *_param,
970
+ _request_timeout=_request_timeout
971
+ )
972
+ return response_data.response
973
+
974
+
975
+ def _delete_record_serialize(
976
+ self,
977
+ instanceid,
978
+ v,
979
+ type,
980
+ id,
981
+ _request_auth,
982
+ _content_type,
983
+ _headers,
984
+ _host_index,
985
+ ) -> RequestSerialized:
986
+
987
+ _host = None
988
+
989
+ _collection_formats: Dict[str, str] = {
990
+ }
991
+
992
+ _path_params: Dict[str, str] = {}
993
+ _query_params: List[Tuple[str, str]] = []
994
+ _header_params: Dict[str, Optional[str]] = _headers or {}
995
+ _form_params: List[Tuple[str, str]] = []
996
+ _files: Dict[str, Union[str, bytes]] = {}
997
+ _body_params: Optional[bytes] = None
998
+
999
+ # process the path parameters
1000
+ if instanceid is not None:
1001
+ _path_params['instanceid'] = instanceid
1002
+ if v is not None:
1003
+ _path_params['v'] = v
1004
+ if type is not None:
1005
+ _path_params['type'] = type
1006
+ if id is not None:
1007
+ _path_params['id'] = id
1008
+ # process the query parameters
1009
+ # process the header parameters
1010
+ # process the form parameters
1011
+ # process the body parameter
1012
+
1013
+
1014
+ # set the HTTP header `Accept`
1015
+ _header_params['Accept'] = self.api_client.select_header_accept(
413
1016
  [
414
- 'async_req',
415
- '_return_http_data_only',
416
- '_preload_content',
417
- '_request_timeout'
1017
+ 'application/json'
418
1018
  ]
419
1019
  )
420
1020
 
421
- for key, val in six.iteritems(local_var_params['kwargs']):
422
- if key not in all_params:
423
- raise ApiTypeError(
424
- "Got an unexpected keyword argument '%s'"
425
- " to method delete_record" % key
426
- )
427
- local_var_params[key] = val
428
- del local_var_params['kwargs']
429
- # verify the required parameter 'instanceid' is set
430
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
431
- local_var_params['instanceid'] is None): # noqa: E501
432
- raise ApiValueError("Missing the required parameter `instanceid` when calling `delete_record`") # noqa: E501
433
- # verify the required parameter 'v' is set
434
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
435
- local_var_params['v'] is None): # noqa: E501
436
- raise ApiValueError("Missing the required parameter `v` when calling `delete_record`") # noqa: E501
437
- # verify the required parameter 'type' is set
438
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
439
- local_var_params['type'] is None): # noqa: E501
440
- raise ApiValueError("Missing the required parameter `type` when calling `delete_record`") # noqa: E501
441
- # verify the required parameter 'id' is set
442
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
443
- local_var_params['id'] is None): # noqa: E501
444
- raise ApiValueError("Missing the required parameter `id` when calling `delete_record`") # noqa: E501
445
-
446
- collection_formats = {}
447
-
448
- path_params = {}
449
- if 'instanceid' in local_var_params:
450
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
451
- if 'v' in local_var_params:
452
- path_params['v'] = local_var_params['v'] # noqa: E501
453
- if 'type' in local_var_params:
454
- path_params['type'] = local_var_params['type'] # noqa: E501
455
- if 'id' in local_var_params:
456
- path_params['id'] = local_var_params['id'] # noqa: E501
457
-
458
- query_params = []
459
-
460
- header_params = {}
461
-
462
- form_params = []
463
- local_var_files = {}
464
-
465
- body_params = None
466
- # HTTP header `Accept`
467
- header_params['Accept'] = self.api_client.select_header_accept(
468
- ['application/json']) # noqa: E501
469
-
470
- # Authentication setting
471
- auth_settings = ['bearerAuth'] # noqa: E501
472
-
473
- return self.api_client.call_api(
474
- '/{instanceid}/records/{v}/{type}/{id}', 'DELETE',
475
- path_params,
476
- query_params,
477
- header_params,
478
- body=body_params,
479
- post_params=form_params,
480
- files=local_var_files,
481
- response_type=None, # noqa: E501
482
- auth_settings=auth_settings,
483
- async_req=local_var_params.get('async_req'),
484
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
485
- _preload_content=local_var_params.get('_preload_content', True),
486
- _request_timeout=local_var_params.get('_request_timeout'),
487
- collection_formats=collection_formats)
488
-
489
- def get_record(self, instanceid, v, type, id, **kwargs): # noqa: E501
490
- """Get record # noqa: E501
491
-
492
- Retrieves a single record by its type and id # noqa: E501
493
- This method makes a synchronous HTTP request by default. To make an
494
- asynchronous HTTP request, please pass async_req=True
495
- >>> thread = api.get_record(instanceid, v, type, id, async_req=True)
496
- >>> result = thread.get()
497
-
498
- :param async_req bool: execute request asynchronously
499
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
500
- :param str v: API version (required)
501
- :param str type: Record type (required)
502
- :param str id: Record id (required)
503
- :param _preload_content: if False, the urllib3.HTTPResponse object will
504
- be returned without reading/decoding response
505
- data. Default is True.
1021
+
1022
+ # authentication setting
1023
+ _auth_settings: List[str] = [
1024
+ 'bearerAuth'
1025
+ ]
1026
+
1027
+ return self.api_client.param_serialize(
1028
+ method='DELETE',
1029
+ resource_path='/{instanceid}/records/{v}/{type}/{id}',
1030
+ path_params=_path_params,
1031
+ query_params=_query_params,
1032
+ header_params=_header_params,
1033
+ body=_body_params,
1034
+ post_params=_form_params,
1035
+ files=_files,
1036
+ auth_settings=_auth_settings,
1037
+ collection_formats=_collection_formats,
1038
+ _host=_host,
1039
+ _request_auth=_request_auth
1040
+ )
1041
+
1042
+
1043
+
1044
+
1045
+ @validate_call
1046
+ def get_record(
1047
+ self,
1048
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1049
+ v: Annotated[StrictStr, Field(description="API version")],
1050
+ type: Annotated[StrictStr, Field(description="Record type")],
1051
+ id: Annotated[StrictStr, Field(description="Record id")],
1052
+ _request_timeout: Union[
1053
+ None,
1054
+ Annotated[StrictFloat, Field(gt=0)],
1055
+ Tuple[
1056
+ Annotated[StrictFloat, Field(gt=0)],
1057
+ Annotated[StrictFloat, Field(gt=0)]
1058
+ ]
1059
+ ] = None,
1060
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1061
+ _content_type: Optional[StrictStr] = None,
1062
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1063
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1064
+ ) -> RecordResponse:
1065
+ """Get record
1066
+
1067
+ Retrieves a single record by its type and id
1068
+
1069
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1070
+ :type instanceid: str
1071
+ :param v: API version (required)
1072
+ :type v: str
1073
+ :param type: Record type (required)
1074
+ :type type: str
1075
+ :param id: Record id (required)
1076
+ :type id: str
506
1077
  :param _request_timeout: timeout setting for this request. If one
507
1078
  number provided, it will be total request
508
1079
  timeout. It can also be a pair (tuple) of
509
1080
  (connection, read) timeouts.
510
- :return: RecordResponse
511
- If the method is called asynchronously,
512
- returns the request thread.
513
- """
514
- kwargs['_return_http_data_only'] = True
515
- return self.get_record_with_http_info(instanceid, v, type, id, **kwargs) # noqa: E501
516
-
517
- def get_record_with_http_info(self, instanceid, v, type, id, **kwargs): # noqa: E501
518
- """Get record # noqa: E501
519
-
520
- Retrieves a single record by its type and id # noqa: E501
521
- This method makes a synchronous HTTP request by default. To make an
522
- asynchronous HTTP request, please pass async_req=True
523
- >>> thread = api.get_record_with_http_info(instanceid, v, type, id, async_req=True)
524
- >>> result = thread.get()
525
-
526
- :param async_req bool: execute request asynchronously
527
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
528
- :param str v: API version (required)
529
- :param str type: Record type (required)
530
- :param str id: Record id (required)
531
- :param _return_http_data_only: response data without head status code
532
- and headers
533
- :param _preload_content: if False, the urllib3.HTTPResponse object will
534
- be returned without reading/decoding response
535
- data. Default is True.
1081
+ :type _request_timeout: int, tuple(int, int), optional
1082
+ :param _request_auth: set to override the auth_settings for an a single
1083
+ request; this effectively ignores the
1084
+ authentication in the spec for a single request.
1085
+ :type _request_auth: dict, optional
1086
+ :param _content_type: force content-type for the request.
1087
+ :type _content_type: str, Optional
1088
+ :param _headers: set to override the headers for a single
1089
+ request; this effectively ignores the headers
1090
+ in the spec for a single request.
1091
+ :type _headers: dict, optional
1092
+ :param _host_index: set to override the host_index for a single
1093
+ request; this effectively ignores the host_index
1094
+ in the spec for a single request.
1095
+ :type _host_index: int, optional
1096
+ :return: Returns the result object.
1097
+ """ # noqa: E501
1098
+
1099
+ _param = self._get_record_serialize(
1100
+ instanceid=instanceid,
1101
+ v=v,
1102
+ type=type,
1103
+ id=id,
1104
+ _request_auth=_request_auth,
1105
+ _content_type=_content_type,
1106
+ _headers=_headers,
1107
+ _host_index=_host_index
1108
+ )
1109
+
1110
+ _response_types_map: Dict[str, Optional[str]] = {
1111
+ '200': "RecordResponse",
1112
+ '404': "ErrorResponse",
1113
+ }
1114
+ response_data = self.api_client.call_api(
1115
+ *_param,
1116
+ _request_timeout=_request_timeout
1117
+ )
1118
+ response_data.read()
1119
+ return self.api_client.response_deserialize(
1120
+ response_data=response_data,
1121
+ response_types_map=_response_types_map,
1122
+ ).data
1123
+
1124
+
1125
+ @validate_call
1126
+ def get_record_with_http_info(
1127
+ self,
1128
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1129
+ v: Annotated[StrictStr, Field(description="API version")],
1130
+ type: Annotated[StrictStr, Field(description="Record type")],
1131
+ id: Annotated[StrictStr, Field(description="Record id")],
1132
+ _request_timeout: Union[
1133
+ None,
1134
+ Annotated[StrictFloat, Field(gt=0)],
1135
+ Tuple[
1136
+ Annotated[StrictFloat, Field(gt=0)],
1137
+ Annotated[StrictFloat, Field(gt=0)]
1138
+ ]
1139
+ ] = None,
1140
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1141
+ _content_type: Optional[StrictStr] = None,
1142
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1143
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1144
+ ) -> ApiResponse[RecordResponse]:
1145
+ """Get record
1146
+
1147
+ Retrieves a single record by its type and id
1148
+
1149
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1150
+ :type instanceid: str
1151
+ :param v: API version (required)
1152
+ :type v: str
1153
+ :param type: Record type (required)
1154
+ :type type: str
1155
+ :param id: Record id (required)
1156
+ :type id: str
536
1157
  :param _request_timeout: timeout setting for this request. If one
537
1158
  number provided, it will be total request
538
1159
  timeout. It can also be a pair (tuple) of
539
1160
  (connection, read) timeouts.
540
- :return: tuple(RecordResponse, status_code(int), headers(HTTPHeaderDict))
541
- If the method is called asynchronously,
542
- returns the request thread.
543
- """
544
-
545
- local_var_params = locals()
546
-
547
- all_params = [
548
- 'instanceid',
549
- 'v',
550
- 'type',
551
- 'id'
552
- ]
553
- all_params.extend(
1161
+ :type _request_timeout: int, tuple(int, int), optional
1162
+ :param _request_auth: set to override the auth_settings for an a single
1163
+ request; this effectively ignores the
1164
+ authentication in the spec for a single request.
1165
+ :type _request_auth: dict, optional
1166
+ :param _content_type: force content-type for the request.
1167
+ :type _content_type: str, Optional
1168
+ :param _headers: set to override the headers for a single
1169
+ request; this effectively ignores the headers
1170
+ in the spec for a single request.
1171
+ :type _headers: dict, optional
1172
+ :param _host_index: set to override the host_index for a single
1173
+ request; this effectively ignores the host_index
1174
+ in the spec for a single request.
1175
+ :type _host_index: int, optional
1176
+ :return: Returns the result object.
1177
+ """ # noqa: E501
1178
+
1179
+ _param = self._get_record_serialize(
1180
+ instanceid=instanceid,
1181
+ v=v,
1182
+ type=type,
1183
+ id=id,
1184
+ _request_auth=_request_auth,
1185
+ _content_type=_content_type,
1186
+ _headers=_headers,
1187
+ _host_index=_host_index
1188
+ )
1189
+
1190
+ _response_types_map: Dict[str, Optional[str]] = {
1191
+ '200': "RecordResponse",
1192
+ '404': "ErrorResponse",
1193
+ }
1194
+ response_data = self.api_client.call_api(
1195
+ *_param,
1196
+ _request_timeout=_request_timeout
1197
+ )
1198
+ response_data.read()
1199
+ return self.api_client.response_deserialize(
1200
+ response_data=response_data,
1201
+ response_types_map=_response_types_map,
1202
+ )
1203
+
1204
+
1205
+ @validate_call
1206
+ def get_record_without_preload_content(
1207
+ self,
1208
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1209
+ v: Annotated[StrictStr, Field(description="API version")],
1210
+ type: Annotated[StrictStr, Field(description="Record type")],
1211
+ id: Annotated[StrictStr, Field(description="Record id")],
1212
+ _request_timeout: Union[
1213
+ None,
1214
+ Annotated[StrictFloat, Field(gt=0)],
1215
+ Tuple[
1216
+ Annotated[StrictFloat, Field(gt=0)],
1217
+ Annotated[StrictFloat, Field(gt=0)]
1218
+ ]
1219
+ ] = None,
1220
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1221
+ _content_type: Optional[StrictStr] = None,
1222
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1223
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1224
+ ) -> RESTResponseType:
1225
+ """Get record
1226
+
1227
+ Retrieves a single record by its type and id
1228
+
1229
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1230
+ :type instanceid: str
1231
+ :param v: API version (required)
1232
+ :type v: str
1233
+ :param type: Record type (required)
1234
+ :type type: str
1235
+ :param id: Record id (required)
1236
+ :type id: str
1237
+ :param _request_timeout: timeout setting for this request. If one
1238
+ number provided, it will be total request
1239
+ timeout. It can also be a pair (tuple) of
1240
+ (connection, read) timeouts.
1241
+ :type _request_timeout: int, tuple(int, int), optional
1242
+ :param _request_auth: set to override the auth_settings for an a single
1243
+ request; this effectively ignores the
1244
+ authentication in the spec for a single request.
1245
+ :type _request_auth: dict, optional
1246
+ :param _content_type: force content-type for the request.
1247
+ :type _content_type: str, Optional
1248
+ :param _headers: set to override the headers for a single
1249
+ request; this effectively ignores the headers
1250
+ in the spec for a single request.
1251
+ :type _headers: dict, optional
1252
+ :param _host_index: set to override the host_index for a single
1253
+ request; this effectively ignores the host_index
1254
+ in the spec for a single request.
1255
+ :type _host_index: int, optional
1256
+ :return: Returns the result object.
1257
+ """ # noqa: E501
1258
+
1259
+ _param = self._get_record_serialize(
1260
+ instanceid=instanceid,
1261
+ v=v,
1262
+ type=type,
1263
+ id=id,
1264
+ _request_auth=_request_auth,
1265
+ _content_type=_content_type,
1266
+ _headers=_headers,
1267
+ _host_index=_host_index
1268
+ )
1269
+
1270
+ _response_types_map: Dict[str, Optional[str]] = {
1271
+ '200': "RecordResponse",
1272
+ '404': "ErrorResponse",
1273
+ }
1274
+ response_data = self.api_client.call_api(
1275
+ *_param,
1276
+ _request_timeout=_request_timeout
1277
+ )
1278
+ return response_data.response
1279
+
1280
+
1281
+ def _get_record_serialize(
1282
+ self,
1283
+ instanceid,
1284
+ v,
1285
+ type,
1286
+ id,
1287
+ _request_auth,
1288
+ _content_type,
1289
+ _headers,
1290
+ _host_index,
1291
+ ) -> RequestSerialized:
1292
+
1293
+ _host = None
1294
+
1295
+ _collection_formats: Dict[str, str] = {
1296
+ }
1297
+
1298
+ _path_params: Dict[str, str] = {}
1299
+ _query_params: List[Tuple[str, str]] = []
1300
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1301
+ _form_params: List[Tuple[str, str]] = []
1302
+ _files: Dict[str, Union[str, bytes]] = {}
1303
+ _body_params: Optional[bytes] = None
1304
+
1305
+ # process the path parameters
1306
+ if instanceid is not None:
1307
+ _path_params['instanceid'] = instanceid
1308
+ if v is not None:
1309
+ _path_params['v'] = v
1310
+ if type is not None:
1311
+ _path_params['type'] = type
1312
+ if id is not None:
1313
+ _path_params['id'] = id
1314
+ # process the query parameters
1315
+ # process the header parameters
1316
+ # process the form parameters
1317
+ # process the body parameter
1318
+
1319
+
1320
+ # set the HTTP header `Accept`
1321
+ _header_params['Accept'] = self.api_client.select_header_accept(
554
1322
  [
555
- 'async_req',
556
- '_return_http_data_only',
557
- '_preload_content',
558
- '_request_timeout'
1323
+ 'application/json'
559
1324
  ]
560
1325
  )
561
1326
 
562
- for key, val in six.iteritems(local_var_params['kwargs']):
563
- if key not in all_params:
564
- raise ApiTypeError(
565
- "Got an unexpected keyword argument '%s'"
566
- " to method get_record" % key
567
- )
568
- local_var_params[key] = val
569
- del local_var_params['kwargs']
570
- # verify the required parameter 'instanceid' is set
571
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
572
- local_var_params['instanceid'] is None): # noqa: E501
573
- raise ApiValueError("Missing the required parameter `instanceid` when calling `get_record`") # noqa: E501
574
- # verify the required parameter 'v' is set
575
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
576
- local_var_params['v'] is None): # noqa: E501
577
- raise ApiValueError("Missing the required parameter `v` when calling `get_record`") # noqa: E501
578
- # verify the required parameter 'type' is set
579
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
580
- local_var_params['type'] is None): # noqa: E501
581
- raise ApiValueError("Missing the required parameter `type` when calling `get_record`") # noqa: E501
582
- # verify the required parameter 'id' is set
583
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
584
- local_var_params['id'] is None): # noqa: E501
585
- raise ApiValueError("Missing the required parameter `id` when calling `get_record`") # noqa: E501
586
-
587
- collection_formats = {}
588
-
589
- path_params = {}
590
- if 'instanceid' in local_var_params:
591
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
592
- if 'v' in local_var_params:
593
- path_params['v'] = local_var_params['v'] # noqa: E501
594
- if 'type' in local_var_params:
595
- path_params['type'] = local_var_params['type'] # noqa: E501
596
- if 'id' in local_var_params:
597
- path_params['id'] = local_var_params['id'] # noqa: E501
598
-
599
- query_params = []
600
-
601
- header_params = {}
602
-
603
- form_params = []
604
- local_var_files = {}
605
-
606
- body_params = None
607
- # HTTP header `Accept`
608
- header_params['Accept'] = self.api_client.select_header_accept(
609
- ['application/json']) # noqa: E501
610
-
611
- # Authentication setting
612
- auth_settings = [] # noqa: E501
613
-
614
- return self.api_client.call_api(
615
- '/{instanceid}/records/{v}/{type}/{id}', 'GET',
616
- path_params,
617
- query_params,
618
- header_params,
619
- body=body_params,
620
- post_params=form_params,
621
- files=local_var_files,
622
- response_type='RecordResponse', # noqa: E501
623
- auth_settings=auth_settings,
624
- async_req=local_var_params.get('async_req'),
625
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
626
- _preload_content=local_var_params.get('_preload_content', True),
627
- _request_timeout=local_var_params.get('_request_timeout'),
628
- collection_formats=collection_formats)
629
-
630
- def get_records_as_tsv(self, instanceid, v, type, **kwargs): # noqa: E501
631
- """Retrieve all records in record type as tsv. # noqa: E501
632
-
633
- Streams all records in a record type to a tsv format. # noqa: E501
634
- This method makes a synchronous HTTP request by default. To make an
635
- asynchronous HTTP request, please pass async_req=True
636
- >>> thread = api.get_records_as_tsv(instanceid, v, type, async_req=True)
637
- >>> result = thread.get()
638
-
639
- :param async_req bool: execute request asynchronously
640
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
641
- :param str v: API version (required)
642
- :param str type: Record type (required)
643
- :param _preload_content: if False, the urllib3.HTTPResponse object will
644
- be returned without reading/decoding response
645
- data. Default is True.
1327
+
1328
+ # authentication setting
1329
+ _auth_settings: List[str] = [
1330
+ ]
1331
+
1332
+ return self.api_client.param_serialize(
1333
+ method='GET',
1334
+ resource_path='/{instanceid}/records/{v}/{type}/{id}',
1335
+ path_params=_path_params,
1336
+ query_params=_query_params,
1337
+ header_params=_header_params,
1338
+ body=_body_params,
1339
+ post_params=_form_params,
1340
+ files=_files,
1341
+ auth_settings=_auth_settings,
1342
+ collection_formats=_collection_formats,
1343
+ _host=_host,
1344
+ _request_auth=_request_auth
1345
+ )
1346
+
1347
+
1348
+
1349
+
1350
+ @validate_call
1351
+ def get_records_as_tsv(
1352
+ self,
1353
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1354
+ v: Annotated[StrictStr, Field(description="API version")],
1355
+ type: Annotated[StrictStr, Field(description="Record type")],
1356
+ _request_timeout: Union[
1357
+ None,
1358
+ Annotated[StrictFloat, Field(gt=0)],
1359
+ Tuple[
1360
+ Annotated[StrictFloat, Field(gt=0)],
1361
+ Annotated[StrictFloat, Field(gt=0)]
1362
+ ]
1363
+ ] = None,
1364
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1365
+ _content_type: Optional[StrictStr] = None,
1366
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1367
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1368
+ ) -> bytearray:
1369
+ """Retrieve all records in record type as tsv.
1370
+
1371
+ Streams all records in a record type to a tsv format.
1372
+
1373
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1374
+ :type instanceid: str
1375
+ :param v: API version (required)
1376
+ :type v: str
1377
+ :param type: Record type (required)
1378
+ :type type: str
646
1379
  :param _request_timeout: timeout setting for this request. If one
647
1380
  number provided, it will be total request
648
1381
  timeout. It can also be a pair (tuple) of
649
1382
  (connection, read) timeouts.
650
- :return: file
651
- If the method is called asynchronously,
652
- returns the request thread.
653
- """
654
- kwargs['_return_http_data_only'] = True
655
- return self.get_records_as_tsv_with_http_info(instanceid, v, type, **kwargs) # noqa: E501
656
-
657
- def get_records_as_tsv_with_http_info(self, instanceid, v, type, **kwargs): # noqa: E501
658
- """Retrieve all records in record type as tsv. # noqa: E501
659
-
660
- Streams all records in a record type to a tsv format. # noqa: E501
661
- This method makes a synchronous HTTP request by default. To make an
662
- asynchronous HTTP request, please pass async_req=True
663
- >>> thread = api.get_records_as_tsv_with_http_info(instanceid, v, type, async_req=True)
664
- >>> result = thread.get()
665
-
666
- :param async_req bool: execute request asynchronously
667
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
668
- :param str v: API version (required)
669
- :param str type: Record type (required)
670
- :param _return_http_data_only: response data without head status code
671
- and headers
672
- :param _preload_content: if False, the urllib3.HTTPResponse object will
673
- be returned without reading/decoding response
674
- data. Default is True.
1383
+ :type _request_timeout: int, tuple(int, int), optional
1384
+ :param _request_auth: set to override the auth_settings for an a single
1385
+ request; this effectively ignores the
1386
+ authentication in the spec for a single request.
1387
+ :type _request_auth: dict, optional
1388
+ :param _content_type: force content-type for the request.
1389
+ :type _content_type: str, Optional
1390
+ :param _headers: set to override the headers for a single
1391
+ request; this effectively ignores the headers
1392
+ in the spec for a single request.
1393
+ :type _headers: dict, optional
1394
+ :param _host_index: set to override the host_index for a single
1395
+ request; this effectively ignores the host_index
1396
+ in the spec for a single request.
1397
+ :type _host_index: int, optional
1398
+ :return: Returns the result object.
1399
+ """ # noqa: E501
1400
+
1401
+ _param = self._get_records_as_tsv_serialize(
1402
+ instanceid=instanceid,
1403
+ v=v,
1404
+ type=type,
1405
+ _request_auth=_request_auth,
1406
+ _content_type=_content_type,
1407
+ _headers=_headers,
1408
+ _host_index=_host_index
1409
+ )
1410
+
1411
+ _response_types_map: Dict[str, Optional[str]] = {
1412
+ '200': "bytearray",
1413
+ '404': "ErrorResponse",
1414
+ }
1415
+ response_data = self.api_client.call_api(
1416
+ *_param,
1417
+ _request_timeout=_request_timeout
1418
+ )
1419
+ response_data.read()
1420
+ return self.api_client.response_deserialize(
1421
+ response_data=response_data,
1422
+ response_types_map=_response_types_map,
1423
+ ).data
1424
+
1425
+
1426
+ @validate_call
1427
+ def get_records_as_tsv_with_http_info(
1428
+ self,
1429
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1430
+ v: Annotated[StrictStr, Field(description="API version")],
1431
+ type: Annotated[StrictStr, Field(description="Record type")],
1432
+ _request_timeout: Union[
1433
+ None,
1434
+ Annotated[StrictFloat, Field(gt=0)],
1435
+ Tuple[
1436
+ Annotated[StrictFloat, Field(gt=0)],
1437
+ Annotated[StrictFloat, Field(gt=0)]
1438
+ ]
1439
+ ] = None,
1440
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1441
+ _content_type: Optional[StrictStr] = None,
1442
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1443
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1444
+ ) -> ApiResponse[bytearray]:
1445
+ """Retrieve all records in record type as tsv.
1446
+
1447
+ Streams all records in a record type to a tsv format.
1448
+
1449
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1450
+ :type instanceid: str
1451
+ :param v: API version (required)
1452
+ :type v: str
1453
+ :param type: Record type (required)
1454
+ :type type: str
675
1455
  :param _request_timeout: timeout setting for this request. If one
676
1456
  number provided, it will be total request
677
1457
  timeout. It can also be a pair (tuple) of
678
1458
  (connection, read) timeouts.
679
- :return: tuple(file, status_code(int), headers(HTTPHeaderDict))
680
- If the method is called asynchronously,
681
- returns the request thread.
682
- """
1459
+ :type _request_timeout: int, tuple(int, int), optional
1460
+ :param _request_auth: set to override the auth_settings for an a single
1461
+ request; this effectively ignores the
1462
+ authentication in the spec for a single request.
1463
+ :type _request_auth: dict, optional
1464
+ :param _content_type: force content-type for the request.
1465
+ :type _content_type: str, Optional
1466
+ :param _headers: set to override the headers for a single
1467
+ request; this effectively ignores the headers
1468
+ in the spec for a single request.
1469
+ :type _headers: dict, optional
1470
+ :param _host_index: set to override the host_index for a single
1471
+ request; this effectively ignores the host_index
1472
+ in the spec for a single request.
1473
+ :type _host_index: int, optional
1474
+ :return: Returns the result object.
1475
+ """ # noqa: E501
1476
+
1477
+ _param = self._get_records_as_tsv_serialize(
1478
+ instanceid=instanceid,
1479
+ v=v,
1480
+ type=type,
1481
+ _request_auth=_request_auth,
1482
+ _content_type=_content_type,
1483
+ _headers=_headers,
1484
+ _host_index=_host_index
1485
+ )
683
1486
 
684
- local_var_params = locals()
1487
+ _response_types_map: Dict[str, Optional[str]] = {
1488
+ '200': "bytearray",
1489
+ '404': "ErrorResponse",
1490
+ }
1491
+ response_data = self.api_client.call_api(
1492
+ *_param,
1493
+ _request_timeout=_request_timeout
1494
+ )
1495
+ response_data.read()
1496
+ return self.api_client.response_deserialize(
1497
+ response_data=response_data,
1498
+ response_types_map=_response_types_map,
1499
+ )
685
1500
 
686
- all_params = [
687
- 'instanceid',
688
- 'v',
689
- 'type'
690
- ]
691
- all_params.extend(
1501
+
1502
+ @validate_call
1503
+ def get_records_as_tsv_without_preload_content(
1504
+ self,
1505
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1506
+ v: Annotated[StrictStr, Field(description="API version")],
1507
+ type: Annotated[StrictStr, Field(description="Record type")],
1508
+ _request_timeout: Union[
1509
+ None,
1510
+ Annotated[StrictFloat, Field(gt=0)],
1511
+ Tuple[
1512
+ Annotated[StrictFloat, Field(gt=0)],
1513
+ Annotated[StrictFloat, Field(gt=0)]
1514
+ ]
1515
+ ] = None,
1516
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1517
+ _content_type: Optional[StrictStr] = None,
1518
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1519
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1520
+ ) -> RESTResponseType:
1521
+ """Retrieve all records in record type as tsv.
1522
+
1523
+ Streams all records in a record type to a tsv format.
1524
+
1525
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1526
+ :type instanceid: str
1527
+ :param v: API version (required)
1528
+ :type v: str
1529
+ :param type: Record type (required)
1530
+ :type type: str
1531
+ :param _request_timeout: timeout setting for this request. If one
1532
+ number provided, it will be total request
1533
+ timeout. It can also be a pair (tuple) of
1534
+ (connection, read) timeouts.
1535
+ :type _request_timeout: int, tuple(int, int), optional
1536
+ :param _request_auth: set to override the auth_settings for an a single
1537
+ request; this effectively ignores the
1538
+ authentication in the spec for a single request.
1539
+ :type _request_auth: dict, optional
1540
+ :param _content_type: force content-type for the request.
1541
+ :type _content_type: str, Optional
1542
+ :param _headers: set to override the headers for a single
1543
+ request; this effectively ignores the headers
1544
+ in the spec for a single request.
1545
+ :type _headers: dict, optional
1546
+ :param _host_index: set to override the host_index for a single
1547
+ request; this effectively ignores the host_index
1548
+ in the spec for a single request.
1549
+ :type _host_index: int, optional
1550
+ :return: Returns the result object.
1551
+ """ # noqa: E501
1552
+
1553
+ _param = self._get_records_as_tsv_serialize(
1554
+ instanceid=instanceid,
1555
+ v=v,
1556
+ type=type,
1557
+ _request_auth=_request_auth,
1558
+ _content_type=_content_type,
1559
+ _headers=_headers,
1560
+ _host_index=_host_index
1561
+ )
1562
+
1563
+ _response_types_map: Dict[str, Optional[str]] = {
1564
+ '200': "bytearray",
1565
+ '404': "ErrorResponse",
1566
+ }
1567
+ response_data = self.api_client.call_api(
1568
+ *_param,
1569
+ _request_timeout=_request_timeout
1570
+ )
1571
+ return response_data.response
1572
+
1573
+
1574
+ def _get_records_as_tsv_serialize(
1575
+ self,
1576
+ instanceid,
1577
+ v,
1578
+ type,
1579
+ _request_auth,
1580
+ _content_type,
1581
+ _headers,
1582
+ _host_index,
1583
+ ) -> RequestSerialized:
1584
+
1585
+ _host = None
1586
+
1587
+ _collection_formats: Dict[str, str] = {
1588
+ }
1589
+
1590
+ _path_params: Dict[str, str] = {}
1591
+ _query_params: List[Tuple[str, str]] = []
1592
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1593
+ _form_params: List[Tuple[str, str]] = []
1594
+ _files: Dict[str, Union[str, bytes]] = {}
1595
+ _body_params: Optional[bytes] = None
1596
+
1597
+ # process the path parameters
1598
+ if instanceid is not None:
1599
+ _path_params['instanceid'] = instanceid
1600
+ if v is not None:
1601
+ _path_params['v'] = v
1602
+ if type is not None:
1603
+ _path_params['type'] = type
1604
+ # process the query parameters
1605
+ # process the header parameters
1606
+ # process the form parameters
1607
+ # process the body parameter
1608
+
1609
+
1610
+ # set the HTTP header `Accept`
1611
+ _header_params['Accept'] = self.api_client.select_header_accept(
692
1612
  [
693
- 'async_req',
694
- '_return_http_data_only',
695
- '_preload_content',
696
- '_request_timeout'
1613
+ 'text/tab-separated-values',
1614
+ 'application/json'
697
1615
  ]
698
1616
  )
699
1617
 
700
- for key, val in six.iteritems(local_var_params['kwargs']):
701
- if key not in all_params:
702
- raise ApiTypeError(
703
- "Got an unexpected keyword argument '%s'"
704
- " to method get_records_as_tsv" % key
705
- )
706
- local_var_params[key] = val
707
- del local_var_params['kwargs']
708
- # verify the required parameter 'instanceid' is set
709
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
710
- local_var_params['instanceid'] is None): # noqa: E501
711
- raise ApiValueError("Missing the required parameter `instanceid` when calling `get_records_as_tsv`") # noqa: E501
712
- # verify the required parameter 'v' is set
713
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
714
- local_var_params['v'] is None): # noqa: E501
715
- raise ApiValueError("Missing the required parameter `v` when calling `get_records_as_tsv`") # noqa: E501
716
- # verify the required parameter 'type' is set
717
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
718
- local_var_params['type'] is None): # noqa: E501
719
- raise ApiValueError("Missing the required parameter `type` when calling `get_records_as_tsv`") # noqa: E501
720
-
721
- collection_formats = {}
722
-
723
- path_params = {}
724
- if 'instanceid' in local_var_params:
725
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
726
- if 'v' in local_var_params:
727
- path_params['v'] = local_var_params['v'] # noqa: E501
728
- if 'type' in local_var_params:
729
- path_params['type'] = local_var_params['type'] # noqa: E501
730
-
731
- query_params = []
732
-
733
- header_params = {}
734
-
735
- form_params = []
736
- local_var_files = {}
737
-
738
- body_params = None
739
- # HTTP header `Accept`
740
- header_params['Accept'] = self.api_client.select_header_accept(
741
- ['text/tab-separated-values', 'application/json']) # noqa: E501
742
-
743
- # Authentication setting
744
- auth_settings = [] # noqa: E501
745
-
746
- return self.api_client.call_api(
747
- '/{instanceid}/tsv/{v}/{type}', 'GET',
748
- path_params,
749
- query_params,
750
- header_params,
751
- body=body_params,
752
- post_params=form_params,
753
- files=local_var_files,
754
- response_type='file', # noqa: E501
755
- auth_settings=auth_settings,
756
- async_req=local_var_params.get('async_req'),
757
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
758
- _preload_content=local_var_params.get('_preload_content', True),
759
- _request_timeout=local_var_params.get('_request_timeout'),
760
- collection_formats=collection_formats)
761
-
762
- def query_records(self, instanceid, v, type, search_request, **kwargs): # noqa: E501
763
- """Query records # noqa: E501
764
-
765
- Paginated list of records matching the criteria supplied in the request body # noqa: E501
766
- This method makes a synchronous HTTP request by default. To make an
767
- asynchronous HTTP request, please pass async_req=True
768
- >>> thread = api.query_records(instanceid, v, type, search_request, async_req=True)
769
- >>> result = thread.get()
770
-
771
- :param async_req bool: execute request asynchronously
772
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
773
- :param str v: API version (required)
774
- :param str type: Record type (required)
775
- :param SearchRequest search_request: A paginated search request (required)
776
- :param _preload_content: if False, the urllib3.HTTPResponse object will
777
- be returned without reading/decoding response
778
- data. Default is True.
1618
+
1619
+ # authentication setting
1620
+ _auth_settings: List[str] = [
1621
+ ]
1622
+
1623
+ return self.api_client.param_serialize(
1624
+ method='GET',
1625
+ resource_path='/{instanceid}/tsv/{v}/{type}',
1626
+ path_params=_path_params,
1627
+ query_params=_query_params,
1628
+ header_params=_header_params,
1629
+ body=_body_params,
1630
+ post_params=_form_params,
1631
+ files=_files,
1632
+ auth_settings=_auth_settings,
1633
+ collection_formats=_collection_formats,
1634
+ _host=_host,
1635
+ _request_auth=_request_auth
1636
+ )
1637
+
1638
+
1639
+
1640
+
1641
+ @validate_call
1642
+ def query_records(
1643
+ self,
1644
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1645
+ v: Annotated[StrictStr, Field(description="API version")],
1646
+ type: Annotated[StrictStr, Field(description="Record type")],
1647
+ search_request: Annotated[SearchRequest, Field(description="A paginated search request")],
1648
+ _request_timeout: Union[
1649
+ None,
1650
+ Annotated[StrictFloat, Field(gt=0)],
1651
+ Tuple[
1652
+ Annotated[StrictFloat, Field(gt=0)],
1653
+ Annotated[StrictFloat, Field(gt=0)]
1654
+ ]
1655
+ ] = None,
1656
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1657
+ _content_type: Optional[StrictStr] = None,
1658
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1659
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1660
+ ) -> RecordQueryResponse:
1661
+ """Query records
1662
+
1663
+ Paginated list of records matching the criteria supplied in the request body
1664
+
1665
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1666
+ :type instanceid: str
1667
+ :param v: API version (required)
1668
+ :type v: str
1669
+ :param type: Record type (required)
1670
+ :type type: str
1671
+ :param search_request: A paginated search request (required)
1672
+ :type search_request: SearchRequest
779
1673
  :param _request_timeout: timeout setting for this request. If one
780
1674
  number provided, it will be total request
781
1675
  timeout. It can also be a pair (tuple) of
782
1676
  (connection, read) timeouts.
783
- :return: RecordQueryResponse
784
- If the method is called asynchronously,
785
- returns the request thread.
786
- """
787
- kwargs['_return_http_data_only'] = True
788
- return self.query_records_with_http_info(instanceid, v, type, search_request, **kwargs) # noqa: E501
789
-
790
- def query_records_with_http_info(self, instanceid, v, type, search_request, **kwargs): # noqa: E501
791
- """Query records # noqa: E501
792
-
793
- Paginated list of records matching the criteria supplied in the request body # noqa: E501
794
- This method makes a synchronous HTTP request by default. To make an
795
- asynchronous HTTP request, please pass async_req=True
796
- >>> thread = api.query_records_with_http_info(instanceid, v, type, search_request, async_req=True)
797
- >>> result = thread.get()
798
-
799
- :param async_req bool: execute request asynchronously
800
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
801
- :param str v: API version (required)
802
- :param str type: Record type (required)
803
- :param SearchRequest search_request: A paginated search request (required)
804
- :param _return_http_data_only: response data without head status code
805
- and headers
806
- :param _preload_content: if False, the urllib3.HTTPResponse object will
807
- be returned without reading/decoding response
808
- data. Default is True.
1677
+ :type _request_timeout: int, tuple(int, int), optional
1678
+ :param _request_auth: set to override the auth_settings for an a single
1679
+ request; this effectively ignores the
1680
+ authentication in the spec for a single request.
1681
+ :type _request_auth: dict, optional
1682
+ :param _content_type: force content-type for the request.
1683
+ :type _content_type: str, Optional
1684
+ :param _headers: set to override the headers for a single
1685
+ request; this effectively ignores the headers
1686
+ in the spec for a single request.
1687
+ :type _headers: dict, optional
1688
+ :param _host_index: set to override the host_index for a single
1689
+ request; this effectively ignores the host_index
1690
+ in the spec for a single request.
1691
+ :type _host_index: int, optional
1692
+ :return: Returns the result object.
1693
+ """ # noqa: E501
1694
+
1695
+ _param = self._query_records_serialize(
1696
+ instanceid=instanceid,
1697
+ v=v,
1698
+ type=type,
1699
+ search_request=search_request,
1700
+ _request_auth=_request_auth,
1701
+ _content_type=_content_type,
1702
+ _headers=_headers,
1703
+ _host_index=_host_index
1704
+ )
1705
+
1706
+ _response_types_map: Dict[str, Optional[str]] = {
1707
+ '200': "RecordQueryResponse",
1708
+ '404': "ErrorResponse",
1709
+ }
1710
+ response_data = self.api_client.call_api(
1711
+ *_param,
1712
+ _request_timeout=_request_timeout
1713
+ )
1714
+ response_data.read()
1715
+ return self.api_client.response_deserialize(
1716
+ response_data=response_data,
1717
+ response_types_map=_response_types_map,
1718
+ ).data
1719
+
1720
+
1721
+ @validate_call
1722
+ def query_records_with_http_info(
1723
+ self,
1724
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1725
+ v: Annotated[StrictStr, Field(description="API version")],
1726
+ type: Annotated[StrictStr, Field(description="Record type")],
1727
+ search_request: Annotated[SearchRequest, Field(description="A paginated search request")],
1728
+ _request_timeout: Union[
1729
+ None,
1730
+ Annotated[StrictFloat, Field(gt=0)],
1731
+ Tuple[
1732
+ Annotated[StrictFloat, Field(gt=0)],
1733
+ Annotated[StrictFloat, Field(gt=0)]
1734
+ ]
1735
+ ] = None,
1736
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1737
+ _content_type: Optional[StrictStr] = None,
1738
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1739
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1740
+ ) -> ApiResponse[RecordQueryResponse]:
1741
+ """Query records
1742
+
1743
+ Paginated list of records matching the criteria supplied in the request body
1744
+
1745
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1746
+ :type instanceid: str
1747
+ :param v: API version (required)
1748
+ :type v: str
1749
+ :param type: Record type (required)
1750
+ :type type: str
1751
+ :param search_request: A paginated search request (required)
1752
+ :type search_request: SearchRequest
809
1753
  :param _request_timeout: timeout setting for this request. If one
810
1754
  number provided, it will be total request
811
1755
  timeout. It can also be a pair (tuple) of
812
1756
  (connection, read) timeouts.
813
- :return: tuple(RecordQueryResponse, status_code(int), headers(HTTPHeaderDict))
814
- If the method is called asynchronously,
815
- returns the request thread.
816
- """
817
-
818
- local_var_params = locals()
819
-
820
- all_params = [
821
- 'instanceid',
822
- 'v',
823
- 'type',
824
- 'search_request'
825
- ]
826
- all_params.extend(
1757
+ :type _request_timeout: int, tuple(int, int), optional
1758
+ :param _request_auth: set to override the auth_settings for an a single
1759
+ request; this effectively ignores the
1760
+ authentication in the spec for a single request.
1761
+ :type _request_auth: dict, optional
1762
+ :param _content_type: force content-type for the request.
1763
+ :type _content_type: str, Optional
1764
+ :param _headers: set to override the headers for a single
1765
+ request; this effectively ignores the headers
1766
+ in the spec for a single request.
1767
+ :type _headers: dict, optional
1768
+ :param _host_index: set to override the host_index for a single
1769
+ request; this effectively ignores the host_index
1770
+ in the spec for a single request.
1771
+ :type _host_index: int, optional
1772
+ :return: Returns the result object.
1773
+ """ # noqa: E501
1774
+
1775
+ _param = self._query_records_serialize(
1776
+ instanceid=instanceid,
1777
+ v=v,
1778
+ type=type,
1779
+ search_request=search_request,
1780
+ _request_auth=_request_auth,
1781
+ _content_type=_content_type,
1782
+ _headers=_headers,
1783
+ _host_index=_host_index
1784
+ )
1785
+
1786
+ _response_types_map: Dict[str, Optional[str]] = {
1787
+ '200': "RecordQueryResponse",
1788
+ '404': "ErrorResponse",
1789
+ }
1790
+ response_data = self.api_client.call_api(
1791
+ *_param,
1792
+ _request_timeout=_request_timeout
1793
+ )
1794
+ response_data.read()
1795
+ return self.api_client.response_deserialize(
1796
+ response_data=response_data,
1797
+ response_types_map=_response_types_map,
1798
+ )
1799
+
1800
+
1801
+ @validate_call
1802
+ def query_records_without_preload_content(
1803
+ self,
1804
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1805
+ v: Annotated[StrictStr, Field(description="API version")],
1806
+ type: Annotated[StrictStr, Field(description="Record type")],
1807
+ search_request: Annotated[SearchRequest, Field(description="A paginated search request")],
1808
+ _request_timeout: Union[
1809
+ None,
1810
+ Annotated[StrictFloat, Field(gt=0)],
1811
+ Tuple[
1812
+ Annotated[StrictFloat, Field(gt=0)],
1813
+ Annotated[StrictFloat, Field(gt=0)]
1814
+ ]
1815
+ ] = None,
1816
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1817
+ _content_type: Optional[StrictStr] = None,
1818
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1819
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1820
+ ) -> RESTResponseType:
1821
+ """Query records
1822
+
1823
+ Paginated list of records matching the criteria supplied in the request body
1824
+
1825
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1826
+ :type instanceid: str
1827
+ :param v: API version (required)
1828
+ :type v: str
1829
+ :param type: Record type (required)
1830
+ :type type: str
1831
+ :param search_request: A paginated search request (required)
1832
+ :type search_request: SearchRequest
1833
+ :param _request_timeout: timeout setting for this request. If one
1834
+ number provided, it will be total request
1835
+ timeout. It can also be a pair (tuple) of
1836
+ (connection, read) timeouts.
1837
+ :type _request_timeout: int, tuple(int, int), optional
1838
+ :param _request_auth: set to override the auth_settings for an a single
1839
+ request; this effectively ignores the
1840
+ authentication in the spec for a single request.
1841
+ :type _request_auth: dict, optional
1842
+ :param _content_type: force content-type for the request.
1843
+ :type _content_type: str, Optional
1844
+ :param _headers: set to override the headers for a single
1845
+ request; this effectively ignores the headers
1846
+ in the spec for a single request.
1847
+ :type _headers: dict, optional
1848
+ :param _host_index: set to override the host_index for a single
1849
+ request; this effectively ignores the host_index
1850
+ in the spec for a single request.
1851
+ :type _host_index: int, optional
1852
+ :return: Returns the result object.
1853
+ """ # noqa: E501
1854
+
1855
+ _param = self._query_records_serialize(
1856
+ instanceid=instanceid,
1857
+ v=v,
1858
+ type=type,
1859
+ search_request=search_request,
1860
+ _request_auth=_request_auth,
1861
+ _content_type=_content_type,
1862
+ _headers=_headers,
1863
+ _host_index=_host_index
1864
+ )
1865
+
1866
+ _response_types_map: Dict[str, Optional[str]] = {
1867
+ '200': "RecordQueryResponse",
1868
+ '404': "ErrorResponse",
1869
+ }
1870
+ response_data = self.api_client.call_api(
1871
+ *_param,
1872
+ _request_timeout=_request_timeout
1873
+ )
1874
+ return response_data.response
1875
+
1876
+
1877
+ def _query_records_serialize(
1878
+ self,
1879
+ instanceid,
1880
+ v,
1881
+ type,
1882
+ search_request,
1883
+ _request_auth,
1884
+ _content_type,
1885
+ _headers,
1886
+ _host_index,
1887
+ ) -> RequestSerialized:
1888
+
1889
+ _host = None
1890
+
1891
+ _collection_formats: Dict[str, str] = {
1892
+ }
1893
+
1894
+ _path_params: Dict[str, str] = {}
1895
+ _query_params: List[Tuple[str, str]] = []
1896
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1897
+ _form_params: List[Tuple[str, str]] = []
1898
+ _files: Dict[str, Union[str, bytes]] = {}
1899
+ _body_params: Optional[bytes] = None
1900
+
1901
+ # process the path parameters
1902
+ if instanceid is not None:
1903
+ _path_params['instanceid'] = instanceid
1904
+ if v is not None:
1905
+ _path_params['v'] = v
1906
+ if type is not None:
1907
+ _path_params['type'] = type
1908
+ # process the query parameters
1909
+ # process the header parameters
1910
+ # process the form parameters
1911
+ # process the body parameter
1912
+ if search_request is not None:
1913
+ _body_params = search_request
1914
+
1915
+
1916
+ # set the HTTP header `Accept`
1917
+ _header_params['Accept'] = self.api_client.select_header_accept(
827
1918
  [
828
- 'async_req',
829
- '_return_http_data_only',
830
- '_preload_content',
831
- '_request_timeout'
1919
+ 'application/json'
832
1920
  ]
833
1921
  )
834
1922
 
835
- for key, val in six.iteritems(local_var_params['kwargs']):
836
- if key not in all_params:
837
- raise ApiTypeError(
838
- "Got an unexpected keyword argument '%s'"
839
- " to method query_records" % key
1923
+ # set the HTTP header `Content-Type`
1924
+ if _content_type:
1925
+ _header_params['Content-Type'] = _content_type
1926
+ else:
1927
+ _default_content_type = (
1928
+ self.api_client.select_header_content_type(
1929
+ [
1930
+ 'application/json'
1931
+ ]
840
1932
  )
841
- local_var_params[key] = val
842
- del local_var_params['kwargs']
843
- # verify the required parameter 'instanceid' is set
844
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
845
- local_var_params['instanceid'] is None): # noqa: E501
846
- raise ApiValueError("Missing the required parameter `instanceid` when calling `query_records`") # noqa: E501
847
- # verify the required parameter 'v' is set
848
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
849
- local_var_params['v'] is None): # noqa: E501
850
- raise ApiValueError("Missing the required parameter `v` when calling `query_records`") # noqa: E501
851
- # verify the required parameter 'type' is set
852
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
853
- local_var_params['type'] is None): # noqa: E501
854
- raise ApiValueError("Missing the required parameter `type` when calling `query_records`") # noqa: E501
855
- # verify the required parameter 'search_request' is set
856
- if self.api_client.client_side_validation and ('search_request' not in local_var_params or # noqa: E501
857
- local_var_params['search_request'] is None): # noqa: E501
858
- raise ApiValueError("Missing the required parameter `search_request` when calling `query_records`") # noqa: E501
859
-
860
- collection_formats = {}
861
-
862
- path_params = {}
863
- if 'instanceid' in local_var_params:
864
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
865
- if 'v' in local_var_params:
866
- path_params['v'] = local_var_params['v'] # noqa: E501
867
- if 'type' in local_var_params:
868
- path_params['type'] = local_var_params['type'] # noqa: E501
869
-
870
- query_params = []
871
-
872
- header_params = {}
873
-
874
- form_params = []
875
- local_var_files = {}
876
-
877
- body_params = None
878
- if 'search_request' in local_var_params:
879
- body_params = local_var_params['search_request']
880
- # HTTP header `Accept`
881
- header_params['Accept'] = self.api_client.select_header_accept(
882
- ['application/json']) # noqa: E501
883
-
884
- # HTTP header `Content-Type`
885
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
886
- ['application/json']) # noqa: E501
887
-
888
- # Authentication setting
889
- auth_settings = [] # noqa: E501
890
-
891
- return self.api_client.call_api(
892
- '/{instanceid}/search/{v}/{type}', 'POST',
893
- path_params,
894
- query_params,
895
- header_params,
896
- body=body_params,
897
- post_params=form_params,
898
- files=local_var_files,
899
- response_type='RecordQueryResponse', # noqa: E501
900
- auth_settings=auth_settings,
901
- async_req=local_var_params.get('async_req'),
902
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
903
- _preload_content=local_var_params.get('_preload_content', True),
904
- _request_timeout=local_var_params.get('_request_timeout'),
905
- collection_formats=collection_formats)
906
-
907
- def update_record(self, instanceid, v, type, id, record_request, **kwargs): # noqa: E501
908
- """Update record # noqa: E501
909
-
910
- Updates the record of the specified type and id. Any attributes included in the request body will be created or overwritten. Attributes not included in the request body will be untouched in the database. No attributes will be deleted. To delete attributes, use the PUT api instead. # noqa: E501
911
- This method makes a synchronous HTTP request by default. To make an
912
- asynchronous HTTP request, please pass async_req=True
913
- >>> thread = api.update_record(instanceid, v, type, id, record_request, async_req=True)
914
- >>> result = thread.get()
915
-
916
- :param async_req bool: execute request asynchronously
917
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
918
- :param str v: API version (required)
919
- :param str type: Record type (required)
920
- :param str id: Record id (required)
921
- :param RecordRequest record_request: A record's attributes to upload (required)
922
- :param _preload_content: if False, the urllib3.HTTPResponse object will
923
- be returned without reading/decoding response
924
- data. Default is True.
1933
+ )
1934
+ if _default_content_type is not None:
1935
+ _header_params['Content-Type'] = _default_content_type
1936
+
1937
+ # authentication setting
1938
+ _auth_settings: List[str] = [
1939
+ ]
1940
+
1941
+ return self.api_client.param_serialize(
1942
+ method='POST',
1943
+ resource_path='/{instanceid}/search/{v}/{type}',
1944
+ path_params=_path_params,
1945
+ query_params=_query_params,
1946
+ header_params=_header_params,
1947
+ body=_body_params,
1948
+ post_params=_form_params,
1949
+ files=_files,
1950
+ auth_settings=_auth_settings,
1951
+ collection_formats=_collection_formats,
1952
+ _host=_host,
1953
+ _request_auth=_request_auth
1954
+ )
1955
+
1956
+
1957
+
1958
+
1959
+ @validate_call
1960
+ def update_record(
1961
+ self,
1962
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
1963
+ v: Annotated[StrictStr, Field(description="API version")],
1964
+ type: Annotated[StrictStr, Field(description="Record type")],
1965
+ id: Annotated[StrictStr, Field(description="Record id")],
1966
+ record_request: Annotated[RecordRequest, Field(description="A record's attributes to upload")],
1967
+ _request_timeout: Union[
1968
+ None,
1969
+ Annotated[StrictFloat, Field(gt=0)],
1970
+ Tuple[
1971
+ Annotated[StrictFloat, Field(gt=0)],
1972
+ Annotated[StrictFloat, Field(gt=0)]
1973
+ ]
1974
+ ] = None,
1975
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1976
+ _content_type: Optional[StrictStr] = None,
1977
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1978
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1979
+ ) -> RecordResponse:
1980
+ """Update record
1981
+
1982
+ Updates the record of the specified type and id. Any attributes included in the request body will be created or overwritten. Attributes not included in the request body will be untouched in the database. No attributes will be deleted. To delete attributes, use the PUT api instead.
1983
+
1984
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
1985
+ :type instanceid: str
1986
+ :param v: API version (required)
1987
+ :type v: str
1988
+ :param type: Record type (required)
1989
+ :type type: str
1990
+ :param id: Record id (required)
1991
+ :type id: str
1992
+ :param record_request: A record's attributes to upload (required)
1993
+ :type record_request: RecordRequest
925
1994
  :param _request_timeout: timeout setting for this request. If one
926
1995
  number provided, it will be total request
927
1996
  timeout. It can also be a pair (tuple) of
928
1997
  (connection, read) timeouts.
929
- :return: RecordResponse
930
- If the method is called asynchronously,
931
- returns the request thread.
932
- """
933
- kwargs['_return_http_data_only'] = True
934
- return self.update_record_with_http_info(instanceid, v, type, id, record_request, **kwargs) # noqa: E501
935
-
936
- def update_record_with_http_info(self, instanceid, v, type, id, record_request, **kwargs): # noqa: E501
937
- """Update record # noqa: E501
938
-
939
- Updates the record of the specified type and id. Any attributes included in the request body will be created or overwritten. Attributes not included in the request body will be untouched in the database. No attributes will be deleted. To delete attributes, use the PUT api instead. # noqa: E501
940
- This method makes a synchronous HTTP request by default. To make an
941
- asynchronous HTTP request, please pass async_req=True
942
- >>> thread = api.update_record_with_http_info(instanceid, v, type, id, record_request, async_req=True)
943
- >>> result = thread.get()
944
-
945
- :param async_req bool: execute request asynchronously
946
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
947
- :param str v: API version (required)
948
- :param str type: Record type (required)
949
- :param str id: Record id (required)
950
- :param RecordRequest record_request: A record's attributes to upload (required)
951
- :param _return_http_data_only: response data without head status code
952
- and headers
953
- :param _preload_content: if False, the urllib3.HTTPResponse object will
954
- be returned without reading/decoding response
955
- data. Default is True.
1998
+ :type _request_timeout: int, tuple(int, int), optional
1999
+ :param _request_auth: set to override the auth_settings for an a single
2000
+ request; this effectively ignores the
2001
+ authentication in the spec for a single request.
2002
+ :type _request_auth: dict, optional
2003
+ :param _content_type: force content-type for the request.
2004
+ :type _content_type: str, Optional
2005
+ :param _headers: set to override the headers for a single
2006
+ request; this effectively ignores the headers
2007
+ in the spec for a single request.
2008
+ :type _headers: dict, optional
2009
+ :param _host_index: set to override the host_index for a single
2010
+ request; this effectively ignores the host_index
2011
+ in the spec for a single request.
2012
+ :type _host_index: int, optional
2013
+ :return: Returns the result object.
2014
+ """ # noqa: E501
2015
+
2016
+ _param = self._update_record_serialize(
2017
+ instanceid=instanceid,
2018
+ v=v,
2019
+ type=type,
2020
+ id=id,
2021
+ record_request=record_request,
2022
+ _request_auth=_request_auth,
2023
+ _content_type=_content_type,
2024
+ _headers=_headers,
2025
+ _host_index=_host_index
2026
+ )
2027
+
2028
+ _response_types_map: Dict[str, Optional[str]] = {
2029
+ '200': "RecordResponse",
2030
+ '404': "ErrorResponse",
2031
+ '400': "ErrorResponse",
2032
+ }
2033
+ response_data = self.api_client.call_api(
2034
+ *_param,
2035
+ _request_timeout=_request_timeout
2036
+ )
2037
+ response_data.read()
2038
+ return self.api_client.response_deserialize(
2039
+ response_data=response_data,
2040
+ response_types_map=_response_types_map,
2041
+ ).data
2042
+
2043
+
2044
+ @validate_call
2045
+ def update_record_with_http_info(
2046
+ self,
2047
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
2048
+ v: Annotated[StrictStr, Field(description="API version")],
2049
+ type: Annotated[StrictStr, Field(description="Record type")],
2050
+ id: Annotated[StrictStr, Field(description="Record id")],
2051
+ record_request: Annotated[RecordRequest, Field(description="A record's attributes to upload")],
2052
+ _request_timeout: Union[
2053
+ None,
2054
+ Annotated[StrictFloat, Field(gt=0)],
2055
+ Tuple[
2056
+ Annotated[StrictFloat, Field(gt=0)],
2057
+ Annotated[StrictFloat, Field(gt=0)]
2058
+ ]
2059
+ ] = None,
2060
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2061
+ _content_type: Optional[StrictStr] = None,
2062
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2063
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2064
+ ) -> ApiResponse[RecordResponse]:
2065
+ """Update record
2066
+
2067
+ Updates the record of the specified type and id. Any attributes included in the request body will be created or overwritten. Attributes not included in the request body will be untouched in the database. No attributes will be deleted. To delete attributes, use the PUT api instead.
2068
+
2069
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
2070
+ :type instanceid: str
2071
+ :param v: API version (required)
2072
+ :type v: str
2073
+ :param type: Record type (required)
2074
+ :type type: str
2075
+ :param id: Record id (required)
2076
+ :type id: str
2077
+ :param record_request: A record's attributes to upload (required)
2078
+ :type record_request: RecordRequest
956
2079
  :param _request_timeout: timeout setting for this request. If one
957
2080
  number provided, it will be total request
958
2081
  timeout. It can also be a pair (tuple) of
959
2082
  (connection, read) timeouts.
960
- :return: tuple(RecordResponse, status_code(int), headers(HTTPHeaderDict))
961
- If the method is called asynchronously,
962
- returns the request thread.
963
- """
964
-
965
- local_var_params = locals()
966
-
967
- all_params = [
968
- 'instanceid',
969
- 'v',
970
- 'type',
971
- 'id',
972
- 'record_request'
973
- ]
974
- all_params.extend(
2083
+ :type _request_timeout: int, tuple(int, int), optional
2084
+ :param _request_auth: set to override the auth_settings for an a single
2085
+ request; this effectively ignores the
2086
+ authentication in the spec for a single request.
2087
+ :type _request_auth: dict, optional
2088
+ :param _content_type: force content-type for the request.
2089
+ :type _content_type: str, Optional
2090
+ :param _headers: set to override the headers for a single
2091
+ request; this effectively ignores the headers
2092
+ in the spec for a single request.
2093
+ :type _headers: dict, optional
2094
+ :param _host_index: set to override the host_index for a single
2095
+ request; this effectively ignores the host_index
2096
+ in the spec for a single request.
2097
+ :type _host_index: int, optional
2098
+ :return: Returns the result object.
2099
+ """ # noqa: E501
2100
+
2101
+ _param = self._update_record_serialize(
2102
+ instanceid=instanceid,
2103
+ v=v,
2104
+ type=type,
2105
+ id=id,
2106
+ record_request=record_request,
2107
+ _request_auth=_request_auth,
2108
+ _content_type=_content_type,
2109
+ _headers=_headers,
2110
+ _host_index=_host_index
2111
+ )
2112
+
2113
+ _response_types_map: Dict[str, Optional[str]] = {
2114
+ '200': "RecordResponse",
2115
+ '404': "ErrorResponse",
2116
+ '400': "ErrorResponse",
2117
+ }
2118
+ response_data = self.api_client.call_api(
2119
+ *_param,
2120
+ _request_timeout=_request_timeout
2121
+ )
2122
+ response_data.read()
2123
+ return self.api_client.response_deserialize(
2124
+ response_data=response_data,
2125
+ response_types_map=_response_types_map,
2126
+ )
2127
+
2128
+
2129
+ @validate_call
2130
+ def update_record_without_preload_content(
2131
+ self,
2132
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
2133
+ v: Annotated[StrictStr, Field(description="API version")],
2134
+ type: Annotated[StrictStr, Field(description="Record type")],
2135
+ id: Annotated[StrictStr, Field(description="Record id")],
2136
+ record_request: Annotated[RecordRequest, Field(description="A record's attributes to upload")],
2137
+ _request_timeout: Union[
2138
+ None,
2139
+ Annotated[StrictFloat, Field(gt=0)],
2140
+ Tuple[
2141
+ Annotated[StrictFloat, Field(gt=0)],
2142
+ Annotated[StrictFloat, Field(gt=0)]
2143
+ ]
2144
+ ] = None,
2145
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2146
+ _content_type: Optional[StrictStr] = None,
2147
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2148
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2149
+ ) -> RESTResponseType:
2150
+ """Update record
2151
+
2152
+ Updates the record of the specified type and id. Any attributes included in the request body will be created or overwritten. Attributes not included in the request body will be untouched in the database. No attributes will be deleted. To delete attributes, use the PUT api instead.
2153
+
2154
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
2155
+ :type instanceid: str
2156
+ :param v: API version (required)
2157
+ :type v: str
2158
+ :param type: Record type (required)
2159
+ :type type: str
2160
+ :param id: Record id (required)
2161
+ :type id: str
2162
+ :param record_request: A record's attributes to upload (required)
2163
+ :type record_request: RecordRequest
2164
+ :param _request_timeout: timeout setting for this request. If one
2165
+ number provided, it will be total request
2166
+ timeout. It can also be a pair (tuple) of
2167
+ (connection, read) timeouts.
2168
+ :type _request_timeout: int, tuple(int, int), optional
2169
+ :param _request_auth: set to override the auth_settings for an a single
2170
+ request; this effectively ignores the
2171
+ authentication in the spec for a single request.
2172
+ :type _request_auth: dict, optional
2173
+ :param _content_type: force content-type for the request.
2174
+ :type _content_type: str, Optional
2175
+ :param _headers: set to override the headers for a single
2176
+ request; this effectively ignores the headers
2177
+ in the spec for a single request.
2178
+ :type _headers: dict, optional
2179
+ :param _host_index: set to override the host_index for a single
2180
+ request; this effectively ignores the host_index
2181
+ in the spec for a single request.
2182
+ :type _host_index: int, optional
2183
+ :return: Returns the result object.
2184
+ """ # noqa: E501
2185
+
2186
+ _param = self._update_record_serialize(
2187
+ instanceid=instanceid,
2188
+ v=v,
2189
+ type=type,
2190
+ id=id,
2191
+ record_request=record_request,
2192
+ _request_auth=_request_auth,
2193
+ _content_type=_content_type,
2194
+ _headers=_headers,
2195
+ _host_index=_host_index
2196
+ )
2197
+
2198
+ _response_types_map: Dict[str, Optional[str]] = {
2199
+ '200': "RecordResponse",
2200
+ '404': "ErrorResponse",
2201
+ '400': "ErrorResponse",
2202
+ }
2203
+ response_data = self.api_client.call_api(
2204
+ *_param,
2205
+ _request_timeout=_request_timeout
2206
+ )
2207
+ return response_data.response
2208
+
2209
+
2210
+ def _update_record_serialize(
2211
+ self,
2212
+ instanceid,
2213
+ v,
2214
+ type,
2215
+ id,
2216
+ record_request,
2217
+ _request_auth,
2218
+ _content_type,
2219
+ _headers,
2220
+ _host_index,
2221
+ ) -> RequestSerialized:
2222
+
2223
+ _host = None
2224
+
2225
+ _collection_formats: Dict[str, str] = {
2226
+ }
2227
+
2228
+ _path_params: Dict[str, str] = {}
2229
+ _query_params: List[Tuple[str, str]] = []
2230
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2231
+ _form_params: List[Tuple[str, str]] = []
2232
+ _files: Dict[str, Union[str, bytes]] = {}
2233
+ _body_params: Optional[bytes] = None
2234
+
2235
+ # process the path parameters
2236
+ if instanceid is not None:
2237
+ _path_params['instanceid'] = instanceid
2238
+ if v is not None:
2239
+ _path_params['v'] = v
2240
+ if type is not None:
2241
+ _path_params['type'] = type
2242
+ if id is not None:
2243
+ _path_params['id'] = id
2244
+ # process the query parameters
2245
+ # process the header parameters
2246
+ # process the form parameters
2247
+ # process the body parameter
2248
+ if record_request is not None:
2249
+ _body_params = record_request
2250
+
2251
+
2252
+ # set the HTTP header `Accept`
2253
+ _header_params['Accept'] = self.api_client.select_header_accept(
975
2254
  [
976
- 'async_req',
977
- '_return_http_data_only',
978
- '_preload_content',
979
- '_request_timeout'
2255
+ 'application/json'
980
2256
  ]
981
2257
  )
982
2258
 
983
- for key, val in six.iteritems(local_var_params['kwargs']):
984
- if key not in all_params:
985
- raise ApiTypeError(
986
- "Got an unexpected keyword argument '%s'"
987
- " to method update_record" % key
2259
+ # set the HTTP header `Content-Type`
2260
+ if _content_type:
2261
+ _header_params['Content-Type'] = _content_type
2262
+ else:
2263
+ _default_content_type = (
2264
+ self.api_client.select_header_content_type(
2265
+ [
2266
+ 'application/json'
2267
+ ]
988
2268
  )
989
- local_var_params[key] = val
990
- del local_var_params['kwargs']
991
- # verify the required parameter 'instanceid' is set
992
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
993
- local_var_params['instanceid'] is None): # noqa: E501
994
- raise ApiValueError("Missing the required parameter `instanceid` when calling `update_record`") # noqa: E501
995
- # verify the required parameter 'v' is set
996
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
997
- local_var_params['v'] is None): # noqa: E501
998
- raise ApiValueError("Missing the required parameter `v` when calling `update_record`") # noqa: E501
999
- # verify the required parameter 'type' is set
1000
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
1001
- local_var_params['type'] is None): # noqa: E501
1002
- raise ApiValueError("Missing the required parameter `type` when calling `update_record`") # noqa: E501
1003
- # verify the required parameter 'id' is set
1004
- if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
1005
- local_var_params['id'] is None): # noqa: E501
1006
- raise ApiValueError("Missing the required parameter `id` when calling `update_record`") # noqa: E501
1007
- # verify the required parameter 'record_request' is set
1008
- if self.api_client.client_side_validation and ('record_request' not in local_var_params or # noqa: E501
1009
- local_var_params['record_request'] is None): # noqa: E501
1010
- raise ApiValueError("Missing the required parameter `record_request` when calling `update_record`") # noqa: E501
1011
-
1012
- collection_formats = {}
1013
-
1014
- path_params = {}
1015
- if 'instanceid' in local_var_params:
1016
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
1017
- if 'v' in local_var_params:
1018
- path_params['v'] = local_var_params['v'] # noqa: E501
1019
- if 'type' in local_var_params:
1020
- path_params['type'] = local_var_params['type'] # noqa: E501
1021
- if 'id' in local_var_params:
1022
- path_params['id'] = local_var_params['id'] # noqa: E501
1023
-
1024
- query_params = []
1025
-
1026
- header_params = {}
1027
-
1028
- form_params = []
1029
- local_var_files = {}
1030
-
1031
- body_params = None
1032
- if 'record_request' in local_var_params:
1033
- body_params = local_var_params['record_request']
1034
- # HTTP header `Accept`
1035
- header_params['Accept'] = self.api_client.select_header_accept(
1036
- ['application/json']) # noqa: E501
1037
-
1038
- # HTTP header `Content-Type`
1039
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
1040
- ['application/json']) # noqa: E501
1041
-
1042
- # Authentication setting
1043
- auth_settings = ['bearerAuth'] # noqa: E501
1044
-
1045
- return self.api_client.call_api(
1046
- '/{instanceid}/records/{v}/{type}/{id}', 'PATCH',
1047
- path_params,
1048
- query_params,
1049
- header_params,
1050
- body=body_params,
1051
- post_params=form_params,
1052
- files=local_var_files,
1053
- response_type='RecordResponse', # noqa: E501
1054
- auth_settings=auth_settings,
1055
- async_req=local_var_params.get('async_req'),
1056
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
1057
- _preload_content=local_var_params.get('_preload_content', True),
1058
- _request_timeout=local_var_params.get('_request_timeout'),
1059
- collection_formats=collection_formats)
1060
-
1061
- def upload_tsv(self, instanceid, v, type, records, **kwargs): # noqa: E501
1062
- """Import records to a record type from a tsv file # noqa: E501
1063
-
1064
- Upload a tsv to modify or create records in a record type. This operation will insert or update records. # noqa: E501
1065
- This method makes a synchronous HTTP request by default. To make an
1066
- asynchronous HTTP request, please pass async_req=True
1067
- >>> thread = api.upload_tsv(instanceid, v, type, records, async_req=True)
1068
- >>> result = thread.get()
1069
-
1070
- :param async_req bool: execute request asynchronously
1071
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
1072
- :param str v: API version (required)
1073
- :param str type: Record type (required)
1074
- :param file records: A valid TSV import file (required)
1075
- :param str primary_key: the column to uniquely identify a record
1076
- :param _preload_content: if False, the urllib3.HTTPResponse object will
1077
- be returned without reading/decoding response
1078
- data. Default is True.
2269
+ )
2270
+ if _default_content_type is not None:
2271
+ _header_params['Content-Type'] = _default_content_type
2272
+
2273
+ # authentication setting
2274
+ _auth_settings: List[str] = [
2275
+ 'bearerAuth'
2276
+ ]
2277
+
2278
+ return self.api_client.param_serialize(
2279
+ method='PATCH',
2280
+ resource_path='/{instanceid}/records/{v}/{type}/{id}',
2281
+ path_params=_path_params,
2282
+ query_params=_query_params,
2283
+ header_params=_header_params,
2284
+ body=_body_params,
2285
+ post_params=_form_params,
2286
+ files=_files,
2287
+ auth_settings=_auth_settings,
2288
+ collection_formats=_collection_formats,
2289
+ _host=_host,
2290
+ _request_auth=_request_auth
2291
+ )
2292
+
2293
+
2294
+
2295
+
2296
+ @validate_call
2297
+ def upload_tsv(
2298
+ self,
2299
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
2300
+ v: Annotated[StrictStr, Field(description="API version")],
2301
+ type: Annotated[StrictStr, Field(description="Record type")],
2302
+ records: Annotated[Union[StrictBytes, StrictStr], Field(description="A valid TSV import file")],
2303
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
2304
+ _request_timeout: Union[
2305
+ None,
2306
+ Annotated[StrictFloat, Field(gt=0)],
2307
+ Tuple[
2308
+ Annotated[StrictFloat, Field(gt=0)],
2309
+ Annotated[StrictFloat, Field(gt=0)]
2310
+ ]
2311
+ ] = None,
2312
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2313
+ _content_type: Optional[StrictStr] = None,
2314
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2315
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2316
+ ) -> TsvUploadResponse:
2317
+ """Import records to a record type from a tsv file
2318
+
2319
+ Upload a tsv to modify or create records in a record type. This operation will insert or update records.
2320
+
2321
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
2322
+ :type instanceid: str
2323
+ :param v: API version (required)
2324
+ :type v: str
2325
+ :param type: Record type (required)
2326
+ :type type: str
2327
+ :param records: A valid TSV import file (required)
2328
+ :type records: bytearray
2329
+ :param primary_key: the column to uniquely identify a record
2330
+ :type primary_key: str
1079
2331
  :param _request_timeout: timeout setting for this request. If one
1080
2332
  number provided, it will be total request
1081
2333
  timeout. It can also be a pair (tuple) of
1082
2334
  (connection, read) timeouts.
1083
- :return: TsvUploadResponse
1084
- If the method is called asynchronously,
1085
- returns the request thread.
1086
- """
1087
- kwargs['_return_http_data_only'] = True
1088
- return self.upload_tsv_with_http_info(instanceid, v, type, records, **kwargs) # noqa: E501
1089
-
1090
- def upload_tsv_with_http_info(self, instanceid, v, type, records, **kwargs): # noqa: E501
1091
- """Import records to a record type from a tsv file # noqa: E501
1092
-
1093
- Upload a tsv to modify or create records in a record type. This operation will insert or update records. # noqa: E501
1094
- This method makes a synchronous HTTP request by default. To make an
1095
- asynchronous HTTP request, please pass async_req=True
1096
- >>> thread = api.upload_tsv_with_http_info(instanceid, v, type, records, async_req=True)
1097
- >>> result = thread.get()
1098
-
1099
- :param async_req bool: execute request asynchronously
1100
- :param str instanceid: WDS instance id; by convention equal to workspace id (required)
1101
- :param str v: API version (required)
1102
- :param str type: Record type (required)
1103
- :param file records: A valid TSV import file (required)
1104
- :param str primary_key: the column to uniquely identify a record
1105
- :param _return_http_data_only: response data without head status code
1106
- and headers
1107
- :param _preload_content: if False, the urllib3.HTTPResponse object will
1108
- be returned without reading/decoding response
1109
- data. Default is True.
2335
+ :type _request_timeout: int, tuple(int, int), optional
2336
+ :param _request_auth: set to override the auth_settings for an a single
2337
+ request; this effectively ignores the
2338
+ authentication in the spec for a single request.
2339
+ :type _request_auth: dict, optional
2340
+ :param _content_type: force content-type for the request.
2341
+ :type _content_type: str, Optional
2342
+ :param _headers: set to override the headers for a single
2343
+ request; this effectively ignores the headers
2344
+ in the spec for a single request.
2345
+ :type _headers: dict, optional
2346
+ :param _host_index: set to override the host_index for a single
2347
+ request; this effectively ignores the host_index
2348
+ in the spec for a single request.
2349
+ :type _host_index: int, optional
2350
+ :return: Returns the result object.
2351
+ """ # noqa: E501
2352
+
2353
+ _param = self._upload_tsv_serialize(
2354
+ instanceid=instanceid,
2355
+ v=v,
2356
+ type=type,
2357
+ records=records,
2358
+ primary_key=primary_key,
2359
+ _request_auth=_request_auth,
2360
+ _content_type=_content_type,
2361
+ _headers=_headers,
2362
+ _host_index=_host_index
2363
+ )
2364
+
2365
+ _response_types_map: Dict[str, Optional[str]] = {
2366
+ '200': "TsvUploadResponse",
2367
+ '400': "ErrorResponse",
2368
+ '404': "ErrorResponse",
2369
+ }
2370
+ response_data = self.api_client.call_api(
2371
+ *_param,
2372
+ _request_timeout=_request_timeout
2373
+ )
2374
+ response_data.read()
2375
+ return self.api_client.response_deserialize(
2376
+ response_data=response_data,
2377
+ response_types_map=_response_types_map,
2378
+ ).data
2379
+
2380
+
2381
+ @validate_call
2382
+ def upload_tsv_with_http_info(
2383
+ self,
2384
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
2385
+ v: Annotated[StrictStr, Field(description="API version")],
2386
+ type: Annotated[StrictStr, Field(description="Record type")],
2387
+ records: Annotated[Union[StrictBytes, StrictStr], Field(description="A valid TSV import file")],
2388
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
2389
+ _request_timeout: Union[
2390
+ None,
2391
+ Annotated[StrictFloat, Field(gt=0)],
2392
+ Tuple[
2393
+ Annotated[StrictFloat, Field(gt=0)],
2394
+ Annotated[StrictFloat, Field(gt=0)]
2395
+ ]
2396
+ ] = None,
2397
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2398
+ _content_type: Optional[StrictStr] = None,
2399
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2400
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2401
+ ) -> ApiResponse[TsvUploadResponse]:
2402
+ """Import records to a record type from a tsv file
2403
+
2404
+ Upload a tsv to modify or create records in a record type. This operation will insert or update records.
2405
+
2406
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
2407
+ :type instanceid: str
2408
+ :param v: API version (required)
2409
+ :type v: str
2410
+ :param type: Record type (required)
2411
+ :type type: str
2412
+ :param records: A valid TSV import file (required)
2413
+ :type records: bytearray
2414
+ :param primary_key: the column to uniquely identify a record
2415
+ :type primary_key: str
1110
2416
  :param _request_timeout: timeout setting for this request. If one
1111
2417
  number provided, it will be total request
1112
2418
  timeout. It can also be a pair (tuple) of
1113
2419
  (connection, read) timeouts.
1114
- :return: tuple(TsvUploadResponse, status_code(int), headers(HTTPHeaderDict))
1115
- If the method is called asynchronously,
1116
- returns the request thread.
1117
- """
1118
-
1119
- local_var_params = locals()
1120
-
1121
- all_params = [
1122
- 'instanceid',
1123
- 'v',
1124
- 'type',
1125
- 'records',
1126
- 'primary_key'
1127
- ]
1128
- all_params.extend(
2420
+ :type _request_timeout: int, tuple(int, int), optional
2421
+ :param _request_auth: set to override the auth_settings for an a single
2422
+ request; this effectively ignores the
2423
+ authentication in the spec for a single request.
2424
+ :type _request_auth: dict, optional
2425
+ :param _content_type: force content-type for the request.
2426
+ :type _content_type: str, Optional
2427
+ :param _headers: set to override the headers for a single
2428
+ request; this effectively ignores the headers
2429
+ in the spec for a single request.
2430
+ :type _headers: dict, optional
2431
+ :param _host_index: set to override the host_index for a single
2432
+ request; this effectively ignores the host_index
2433
+ in the spec for a single request.
2434
+ :type _host_index: int, optional
2435
+ :return: Returns the result object.
2436
+ """ # noqa: E501
2437
+
2438
+ _param = self._upload_tsv_serialize(
2439
+ instanceid=instanceid,
2440
+ v=v,
2441
+ type=type,
2442
+ records=records,
2443
+ primary_key=primary_key,
2444
+ _request_auth=_request_auth,
2445
+ _content_type=_content_type,
2446
+ _headers=_headers,
2447
+ _host_index=_host_index
2448
+ )
2449
+
2450
+ _response_types_map: Dict[str, Optional[str]] = {
2451
+ '200': "TsvUploadResponse",
2452
+ '400': "ErrorResponse",
2453
+ '404': "ErrorResponse",
2454
+ }
2455
+ response_data = self.api_client.call_api(
2456
+ *_param,
2457
+ _request_timeout=_request_timeout
2458
+ )
2459
+ response_data.read()
2460
+ return self.api_client.response_deserialize(
2461
+ response_data=response_data,
2462
+ response_types_map=_response_types_map,
2463
+ )
2464
+
2465
+
2466
+ @validate_call
2467
+ def upload_tsv_without_preload_content(
2468
+ self,
2469
+ instanceid: Annotated[StrictStr, Field(description="WDS instance id; by convention equal to workspace id")],
2470
+ v: Annotated[StrictStr, Field(description="API version")],
2471
+ type: Annotated[StrictStr, Field(description="Record type")],
2472
+ records: Annotated[Union[StrictBytes, StrictStr], Field(description="A valid TSV import file")],
2473
+ primary_key: Annotated[Optional[StrictStr], Field(description="the column to uniquely identify a record")] = None,
2474
+ _request_timeout: Union[
2475
+ None,
2476
+ Annotated[StrictFloat, Field(gt=0)],
2477
+ Tuple[
2478
+ Annotated[StrictFloat, Field(gt=0)],
2479
+ Annotated[StrictFloat, Field(gt=0)]
2480
+ ]
2481
+ ] = None,
2482
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2483
+ _content_type: Optional[StrictStr] = None,
2484
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2485
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2486
+ ) -> RESTResponseType:
2487
+ """Import records to a record type from a tsv file
2488
+
2489
+ Upload a tsv to modify or create records in a record type. This operation will insert or update records.
2490
+
2491
+ :param instanceid: WDS instance id; by convention equal to workspace id (required)
2492
+ :type instanceid: str
2493
+ :param v: API version (required)
2494
+ :type v: str
2495
+ :param type: Record type (required)
2496
+ :type type: str
2497
+ :param records: A valid TSV import file (required)
2498
+ :type records: bytearray
2499
+ :param primary_key: the column to uniquely identify a record
2500
+ :type primary_key: str
2501
+ :param _request_timeout: timeout setting for this request. If one
2502
+ number provided, it will be total request
2503
+ timeout. It can also be a pair (tuple) of
2504
+ (connection, read) timeouts.
2505
+ :type _request_timeout: int, tuple(int, int), optional
2506
+ :param _request_auth: set to override the auth_settings for an a single
2507
+ request; this effectively ignores the
2508
+ authentication in the spec for a single request.
2509
+ :type _request_auth: dict, optional
2510
+ :param _content_type: force content-type for the request.
2511
+ :type _content_type: str, Optional
2512
+ :param _headers: set to override the headers for a single
2513
+ request; this effectively ignores the headers
2514
+ in the spec for a single request.
2515
+ :type _headers: dict, optional
2516
+ :param _host_index: set to override the host_index for a single
2517
+ request; this effectively ignores the host_index
2518
+ in the spec for a single request.
2519
+ :type _host_index: int, optional
2520
+ :return: Returns the result object.
2521
+ """ # noqa: E501
2522
+
2523
+ _param = self._upload_tsv_serialize(
2524
+ instanceid=instanceid,
2525
+ v=v,
2526
+ type=type,
2527
+ records=records,
2528
+ primary_key=primary_key,
2529
+ _request_auth=_request_auth,
2530
+ _content_type=_content_type,
2531
+ _headers=_headers,
2532
+ _host_index=_host_index
2533
+ )
2534
+
2535
+ _response_types_map: Dict[str, Optional[str]] = {
2536
+ '200': "TsvUploadResponse",
2537
+ '400': "ErrorResponse",
2538
+ '404': "ErrorResponse",
2539
+ }
2540
+ response_data = self.api_client.call_api(
2541
+ *_param,
2542
+ _request_timeout=_request_timeout
2543
+ )
2544
+ return response_data.response
2545
+
2546
+
2547
+ def _upload_tsv_serialize(
2548
+ self,
2549
+ instanceid,
2550
+ v,
2551
+ type,
2552
+ records,
2553
+ primary_key,
2554
+ _request_auth,
2555
+ _content_type,
2556
+ _headers,
2557
+ _host_index,
2558
+ ) -> RequestSerialized:
2559
+
2560
+ _host = None
2561
+
2562
+ _collection_formats: Dict[str, str] = {
2563
+ }
2564
+
2565
+ _path_params: Dict[str, str] = {}
2566
+ _query_params: List[Tuple[str, str]] = []
2567
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2568
+ _form_params: List[Tuple[str, str]] = []
2569
+ _files: Dict[str, Union[str, bytes]] = {}
2570
+ _body_params: Optional[bytes] = None
2571
+
2572
+ # process the path parameters
2573
+ if instanceid is not None:
2574
+ _path_params['instanceid'] = instanceid
2575
+ if v is not None:
2576
+ _path_params['v'] = v
2577
+ if type is not None:
2578
+ _path_params['type'] = type
2579
+ # process the query parameters
2580
+ if primary_key is not None:
2581
+
2582
+ _query_params.append(('primaryKey', primary_key))
2583
+
2584
+ # process the header parameters
2585
+ # process the form parameters
2586
+ if records is not None:
2587
+ _files['records'] = records
2588
+ # process the body parameter
2589
+
2590
+
2591
+ # set the HTTP header `Accept`
2592
+ _header_params['Accept'] = self.api_client.select_header_accept(
1129
2593
  [
1130
- 'async_req',
1131
- '_return_http_data_only',
1132
- '_preload_content',
1133
- '_request_timeout'
2594
+ 'application/json'
1134
2595
  ]
1135
2596
  )
1136
2597
 
1137
- for key, val in six.iteritems(local_var_params['kwargs']):
1138
- if key not in all_params:
1139
- raise ApiTypeError(
1140
- "Got an unexpected keyword argument '%s'"
1141
- " to method upload_tsv" % key
2598
+ # set the HTTP header `Content-Type`
2599
+ if _content_type:
2600
+ _header_params['Content-Type'] = _content_type
2601
+ else:
2602
+ _default_content_type = (
2603
+ self.api_client.select_header_content_type(
2604
+ [
2605
+ 'multipart/form-data'
2606
+ ]
1142
2607
  )
1143
- local_var_params[key] = val
1144
- del local_var_params['kwargs']
1145
- # verify the required parameter 'instanceid' is set
1146
- if self.api_client.client_side_validation and ('instanceid' not in local_var_params or # noqa: E501
1147
- local_var_params['instanceid'] is None): # noqa: E501
1148
- raise ApiValueError("Missing the required parameter `instanceid` when calling `upload_tsv`") # noqa: E501
1149
- # verify the required parameter 'v' is set
1150
- if self.api_client.client_side_validation and ('v' not in local_var_params or # noqa: E501
1151
- local_var_params['v'] is None): # noqa: E501
1152
- raise ApiValueError("Missing the required parameter `v` when calling `upload_tsv`") # noqa: E501
1153
- # verify the required parameter 'type' is set
1154
- if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501
1155
- local_var_params['type'] is None): # noqa: E501
1156
- raise ApiValueError("Missing the required parameter `type` when calling `upload_tsv`") # noqa: E501
1157
- # verify the required parameter 'records' is set
1158
- if self.api_client.client_side_validation and ('records' not in local_var_params or # noqa: E501
1159
- local_var_params['records'] is None): # noqa: E501
1160
- raise ApiValueError("Missing the required parameter `records` when calling `upload_tsv`") # noqa: E501
1161
-
1162
- collection_formats = {}
1163
-
1164
- path_params = {}
1165
- if 'instanceid' in local_var_params:
1166
- path_params['instanceid'] = local_var_params['instanceid'] # noqa: E501
1167
- if 'v' in local_var_params:
1168
- path_params['v'] = local_var_params['v'] # noqa: E501
1169
- if 'type' in local_var_params:
1170
- path_params['type'] = local_var_params['type'] # noqa: E501
1171
-
1172
- query_params = []
1173
- if 'primary_key' in local_var_params and local_var_params['primary_key'] is not None: # noqa: E501
1174
- query_params.append(('primaryKey', local_var_params['primary_key'])) # noqa: E501
1175
-
1176
- header_params = {}
1177
-
1178
- form_params = []
1179
- local_var_files = {}
1180
- if 'records' in local_var_params:
1181
- local_var_files['records'] = local_var_params['records'] # noqa: E501
1182
-
1183
- body_params = None
1184
- # HTTP header `Accept`
1185
- header_params['Accept'] = self.api_client.select_header_accept(
1186
- ['application/json']) # noqa: E501
1187
-
1188
- # HTTP header `Content-Type`
1189
- header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
1190
- ['multipart/form-data']) # noqa: E501
1191
-
1192
- # Authentication setting
1193
- auth_settings = ['bearerAuth'] # noqa: E501
1194
-
1195
- return self.api_client.call_api(
1196
- '/{instanceid}/tsv/{v}/{type}', 'POST',
1197
- path_params,
1198
- query_params,
1199
- header_params,
1200
- body=body_params,
1201
- post_params=form_params,
1202
- files=local_var_files,
1203
- response_type='TsvUploadResponse', # noqa: E501
1204
- auth_settings=auth_settings,
1205
- async_req=local_var_params.get('async_req'),
1206
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
1207
- _preload_content=local_var_params.get('_preload_content', True),
1208
- _request_timeout=local_var_params.get('_request_timeout'),
1209
- collection_formats=collection_formats)
2608
+ )
2609
+ if _default_content_type is not None:
2610
+ _header_params['Content-Type'] = _default_content_type
2611
+
2612
+ # authentication setting
2613
+ _auth_settings: List[str] = [
2614
+ 'bearerAuth'
2615
+ ]
2616
+
2617
+ return self.api_client.param_serialize(
2618
+ method='POST',
2619
+ resource_path='/{instanceid}/tsv/{v}/{type}',
2620
+ path_params=_path_params,
2621
+ query_params=_query_params,
2622
+ header_params=_header_params,
2623
+ body=_body_params,
2624
+ post_params=_form_params,
2625
+ files=_files,
2626
+ auth_settings=_auth_settings,
2627
+ collection_formats=_collection_formats,
2628
+ _host=_host,
2629
+ _request_auth=_request_auth
2630
+ )
2631
+
2632
+