wds-client 0.13.0__py3-none-any.whl → 0.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1419 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Workspace Data Service
5
+
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
+
8
+ The version of the OpenAPI document: v0.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
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, StrictStr
20
+ from typing import List
21
+ from typing_extensions import Annotated
22
+ from wds_client.models.collection import Collection
23
+
24
+ from wds_client.api_client import ApiClient, RequestSerialized
25
+ from wds_client.api_response import ApiResponse
26
+ from wds_client.rest import RESTResponseType
27
+
28
+
29
+ class CollectionApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def create_collection_v1(
44
+ self,
45
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
46
+ collection: Annotated[Collection, Field(description="The collection to create")],
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Annotated[StrictFloat, Field(gt=0)]
53
+ ]
54
+ ] = None,
55
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
+ _content_type: Optional[StrictStr] = None,
57
+ _headers: Optional[Dict[StrictStr, Any]] = None,
58
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
+ ) -> Collection:
60
+ """Create a collection in this workspace.
61
+
62
+ If collection id is specified in the request body, it must be a valid UUID. If omitted, the system will generate an id.
63
+
64
+ :param workspace_id: Workspace id (required)
65
+ :type workspace_id: str
66
+ :param collection: The collection to create (required)
67
+ :type collection: Collection
68
+ :param _request_timeout: timeout setting for this request. If one
69
+ number provided, it will be total request
70
+ timeout. It can also be a pair (tuple) of
71
+ (connection, read) timeouts.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._create_collection_v1_serialize(
91
+ workspace_id=workspace_id,
92
+ collection=collection,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '201': "Collection",
101
+ }
102
+ response_data = self.api_client.call_api(
103
+ *_param,
104
+ _request_timeout=_request_timeout
105
+ )
106
+ response_data.read()
107
+ return self.api_client.response_deserialize(
108
+ response_data=response_data,
109
+ response_types_map=_response_types_map,
110
+ ).data
111
+
112
+
113
+ @validate_call
114
+ def create_collection_v1_with_http_info(
115
+ self,
116
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
117
+ collection: Annotated[Collection, Field(description="The collection to create")],
118
+ _request_timeout: Union[
119
+ None,
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Tuple[
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Annotated[StrictFloat, Field(gt=0)]
124
+ ]
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[Collection]:
131
+ """Create a collection in this workspace.
132
+
133
+ If collection id is specified in the request body, it must be a valid UUID. If omitted, the system will generate an id.
134
+
135
+ :param workspace_id: Workspace id (required)
136
+ :type workspace_id: str
137
+ :param collection: The collection to create (required)
138
+ :type collection: Collection
139
+ :param _request_timeout: timeout setting for this request. If one
140
+ number provided, it will be total request
141
+ timeout. It can also be a pair (tuple) of
142
+ (connection, read) timeouts.
143
+ :type _request_timeout: int, tuple(int, int), optional
144
+ :param _request_auth: set to override the auth_settings for an a single
145
+ request; this effectively ignores the
146
+ authentication in the spec for a single request.
147
+ :type _request_auth: dict, optional
148
+ :param _content_type: force content-type for the request.
149
+ :type _content_type: str, Optional
150
+ :param _headers: set to override the headers for a single
151
+ request; this effectively ignores the headers
152
+ in the spec for a single request.
153
+ :type _headers: dict, optional
154
+ :param _host_index: set to override the host_index for a single
155
+ request; this effectively ignores the host_index
156
+ in the spec for a single request.
157
+ :type _host_index: int, optional
158
+ :return: Returns the result object.
159
+ """ # noqa: E501
160
+
161
+ _param = self._create_collection_v1_serialize(
162
+ workspace_id=workspace_id,
163
+ collection=collection,
164
+ _request_auth=_request_auth,
165
+ _content_type=_content_type,
166
+ _headers=_headers,
167
+ _host_index=_host_index
168
+ )
169
+
170
+ _response_types_map: Dict[str, Optional[str]] = {
171
+ '201': "Collection",
172
+ }
173
+ response_data = self.api_client.call_api(
174
+ *_param,
175
+ _request_timeout=_request_timeout
176
+ )
177
+ response_data.read()
178
+ return self.api_client.response_deserialize(
179
+ response_data=response_data,
180
+ response_types_map=_response_types_map,
181
+ )
182
+
183
+
184
+ @validate_call
185
+ def create_collection_v1_without_preload_content(
186
+ self,
187
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
188
+ collection: Annotated[Collection, Field(description="The collection to create")],
189
+ _request_timeout: Union[
190
+ None,
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Tuple[
193
+ Annotated[StrictFloat, Field(gt=0)],
194
+ Annotated[StrictFloat, Field(gt=0)]
195
+ ]
196
+ ] = None,
197
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
198
+ _content_type: Optional[StrictStr] = None,
199
+ _headers: Optional[Dict[StrictStr, Any]] = None,
200
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
201
+ ) -> RESTResponseType:
202
+ """Create a collection in this workspace.
203
+
204
+ If collection id is specified in the request body, it must be a valid UUID. If omitted, the system will generate an id.
205
+
206
+ :param workspace_id: Workspace id (required)
207
+ :type workspace_id: str
208
+ :param collection: The collection to create (required)
209
+ :type collection: Collection
210
+ :param _request_timeout: timeout setting for this request. If one
211
+ number provided, it will be total request
212
+ timeout. It can also be a pair (tuple) of
213
+ (connection, read) timeouts.
214
+ :type _request_timeout: int, tuple(int, int), optional
215
+ :param _request_auth: set to override the auth_settings for an a single
216
+ request; this effectively ignores the
217
+ authentication in the spec for a single request.
218
+ :type _request_auth: dict, optional
219
+ :param _content_type: force content-type for the request.
220
+ :type _content_type: str, Optional
221
+ :param _headers: set to override the headers for a single
222
+ request; this effectively ignores the headers
223
+ in the spec for a single request.
224
+ :type _headers: dict, optional
225
+ :param _host_index: set to override the host_index for a single
226
+ request; this effectively ignores the host_index
227
+ in the spec for a single request.
228
+ :type _host_index: int, optional
229
+ :return: Returns the result object.
230
+ """ # noqa: E501
231
+
232
+ _param = self._create_collection_v1_serialize(
233
+ workspace_id=workspace_id,
234
+ collection=collection,
235
+ _request_auth=_request_auth,
236
+ _content_type=_content_type,
237
+ _headers=_headers,
238
+ _host_index=_host_index
239
+ )
240
+
241
+ _response_types_map: Dict[str, Optional[str]] = {
242
+ '201': "Collection",
243
+ }
244
+ response_data = self.api_client.call_api(
245
+ *_param,
246
+ _request_timeout=_request_timeout
247
+ )
248
+ return response_data.response
249
+
250
+
251
+ def _create_collection_v1_serialize(
252
+ self,
253
+ workspace_id,
254
+ collection,
255
+ _request_auth,
256
+ _content_type,
257
+ _headers,
258
+ _host_index,
259
+ ) -> RequestSerialized:
260
+
261
+ _host = None
262
+
263
+ _collection_formats: Dict[str, str] = {
264
+ }
265
+
266
+ _path_params: Dict[str, str] = {}
267
+ _query_params: List[Tuple[str, str]] = []
268
+ _header_params: Dict[str, Optional[str]] = _headers or {}
269
+ _form_params: List[Tuple[str, str]] = []
270
+ _files: Dict[str, Union[str, bytes]] = {}
271
+ _body_params: Optional[bytes] = None
272
+
273
+ # process the path parameters
274
+ if workspace_id is not None:
275
+ _path_params['workspaceId'] = workspace_id
276
+ # process the query parameters
277
+ # process the header parameters
278
+ # process the form parameters
279
+ # process the body parameter
280
+ if collection is not None:
281
+ _body_params = collection
282
+
283
+
284
+ # set the HTTP header `Accept`
285
+ if 'Accept' not in _header_params:
286
+ _header_params['Accept'] = self.api_client.select_header_accept(
287
+ [
288
+ 'application/json'
289
+ ]
290
+ )
291
+
292
+ # set the HTTP header `Content-Type`
293
+ if _content_type:
294
+ _header_params['Content-Type'] = _content_type
295
+ else:
296
+ _default_content_type = (
297
+ self.api_client.select_header_content_type(
298
+ [
299
+ 'application/json'
300
+ ]
301
+ )
302
+ )
303
+ if _default_content_type is not None:
304
+ _header_params['Content-Type'] = _default_content_type
305
+
306
+ # authentication setting
307
+ _auth_settings: List[str] = [
308
+ 'bearerAuth'
309
+ ]
310
+
311
+ return self.api_client.param_serialize(
312
+ method='POST',
313
+ resource_path='/collections/v1/{workspaceId}',
314
+ path_params=_path_params,
315
+ query_params=_query_params,
316
+ header_params=_header_params,
317
+ body=_body_params,
318
+ post_params=_form_params,
319
+ files=_files,
320
+ auth_settings=_auth_settings,
321
+ collection_formats=_collection_formats,
322
+ _host=_host,
323
+ _request_auth=_request_auth
324
+ )
325
+
326
+
327
+
328
+
329
+ @validate_call
330
+ def delete_collection_v1(
331
+ self,
332
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
333
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
334
+ _request_timeout: Union[
335
+ None,
336
+ Annotated[StrictFloat, Field(gt=0)],
337
+ Tuple[
338
+ Annotated[StrictFloat, Field(gt=0)],
339
+ Annotated[StrictFloat, Field(gt=0)]
340
+ ]
341
+ ] = None,
342
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
343
+ _content_type: Optional[StrictStr] = None,
344
+ _headers: Optional[Dict[StrictStr, Any]] = None,
345
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
346
+ ) -> None:
347
+ """Delete the specified collection.
348
+
349
+
350
+ :param workspace_id: Workspace id (required)
351
+ :type workspace_id: str
352
+ :param collection_id: Collection id (required)
353
+ :type collection_id: str
354
+ :param _request_timeout: timeout setting for this request. If one
355
+ number provided, it will be total request
356
+ timeout. It can also be a pair (tuple) of
357
+ (connection, read) timeouts.
358
+ :type _request_timeout: int, tuple(int, int), optional
359
+ :param _request_auth: set to override the auth_settings for an a single
360
+ request; this effectively ignores the
361
+ authentication in the spec for a single request.
362
+ :type _request_auth: dict, optional
363
+ :param _content_type: force content-type for the request.
364
+ :type _content_type: str, Optional
365
+ :param _headers: set to override the headers for a single
366
+ request; this effectively ignores the headers
367
+ in the spec for a single request.
368
+ :type _headers: dict, optional
369
+ :param _host_index: set to override the host_index for a single
370
+ request; this effectively ignores the host_index
371
+ in the spec for a single request.
372
+ :type _host_index: int, optional
373
+ :return: Returns the result object.
374
+ """ # noqa: E501
375
+
376
+ _param = self._delete_collection_v1_serialize(
377
+ workspace_id=workspace_id,
378
+ collection_id=collection_id,
379
+ _request_auth=_request_auth,
380
+ _content_type=_content_type,
381
+ _headers=_headers,
382
+ _host_index=_host_index
383
+ )
384
+
385
+ _response_types_map: Dict[str, Optional[str]] = {
386
+ '204': None,
387
+ }
388
+ response_data = self.api_client.call_api(
389
+ *_param,
390
+ _request_timeout=_request_timeout
391
+ )
392
+ response_data.read()
393
+ return self.api_client.response_deserialize(
394
+ response_data=response_data,
395
+ response_types_map=_response_types_map,
396
+ ).data
397
+
398
+
399
+ @validate_call
400
+ def delete_collection_v1_with_http_info(
401
+ self,
402
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
403
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
404
+ _request_timeout: Union[
405
+ None,
406
+ Annotated[StrictFloat, Field(gt=0)],
407
+ Tuple[
408
+ Annotated[StrictFloat, Field(gt=0)],
409
+ Annotated[StrictFloat, Field(gt=0)]
410
+ ]
411
+ ] = None,
412
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
413
+ _content_type: Optional[StrictStr] = None,
414
+ _headers: Optional[Dict[StrictStr, Any]] = None,
415
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
416
+ ) -> ApiResponse[None]:
417
+ """Delete the specified collection.
418
+
419
+
420
+ :param workspace_id: Workspace id (required)
421
+ :type workspace_id: str
422
+ :param collection_id: Collection id (required)
423
+ :type collection_id: str
424
+ :param _request_timeout: timeout setting for this request. If one
425
+ number provided, it will be total request
426
+ timeout. It can also be a pair (tuple) of
427
+ (connection, read) timeouts.
428
+ :type _request_timeout: int, tuple(int, int), optional
429
+ :param _request_auth: set to override the auth_settings for an a single
430
+ request; this effectively ignores the
431
+ authentication in the spec for a single request.
432
+ :type _request_auth: dict, optional
433
+ :param _content_type: force content-type for the request.
434
+ :type _content_type: str, Optional
435
+ :param _headers: set to override the headers for a single
436
+ request; this effectively ignores the headers
437
+ in the spec for a single request.
438
+ :type _headers: dict, optional
439
+ :param _host_index: set to override the host_index for a single
440
+ request; this effectively ignores the host_index
441
+ in the spec for a single request.
442
+ :type _host_index: int, optional
443
+ :return: Returns the result object.
444
+ """ # noqa: E501
445
+
446
+ _param = self._delete_collection_v1_serialize(
447
+ workspace_id=workspace_id,
448
+ collection_id=collection_id,
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
+ '204': None,
457
+ }
458
+ response_data = self.api_client.call_api(
459
+ *_param,
460
+ _request_timeout=_request_timeout
461
+ )
462
+ response_data.read()
463
+ return self.api_client.response_deserialize(
464
+ response_data=response_data,
465
+ response_types_map=_response_types_map,
466
+ )
467
+
468
+
469
+ @validate_call
470
+ def delete_collection_v1_without_preload_content(
471
+ self,
472
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
473
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
474
+ _request_timeout: Union[
475
+ None,
476
+ Annotated[StrictFloat, Field(gt=0)],
477
+ Tuple[
478
+ Annotated[StrictFloat, Field(gt=0)],
479
+ Annotated[StrictFloat, Field(gt=0)]
480
+ ]
481
+ ] = None,
482
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
483
+ _content_type: Optional[StrictStr] = None,
484
+ _headers: Optional[Dict[StrictStr, Any]] = None,
485
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
486
+ ) -> RESTResponseType:
487
+ """Delete the specified collection.
488
+
489
+
490
+ :param workspace_id: Workspace id (required)
491
+ :type workspace_id: str
492
+ :param collection_id: Collection id (required)
493
+ :type collection_id: str
494
+ :param _request_timeout: timeout setting for this request. If one
495
+ number provided, it will be total request
496
+ timeout. It can also be a pair (tuple) of
497
+ (connection, read) timeouts.
498
+ :type _request_timeout: int, tuple(int, int), optional
499
+ :param _request_auth: set to override the auth_settings for an a single
500
+ request; this effectively ignores the
501
+ authentication in the spec for a single request.
502
+ :type _request_auth: dict, optional
503
+ :param _content_type: force content-type for the request.
504
+ :type _content_type: str, Optional
505
+ :param _headers: set to override the headers for a single
506
+ request; this effectively ignores the headers
507
+ in the spec for a single request.
508
+ :type _headers: dict, optional
509
+ :param _host_index: set to override the host_index for a single
510
+ request; this effectively ignores the host_index
511
+ in the spec for a single request.
512
+ :type _host_index: int, optional
513
+ :return: Returns the result object.
514
+ """ # noqa: E501
515
+
516
+ _param = self._delete_collection_v1_serialize(
517
+ workspace_id=workspace_id,
518
+ collection_id=collection_id,
519
+ _request_auth=_request_auth,
520
+ _content_type=_content_type,
521
+ _headers=_headers,
522
+ _host_index=_host_index
523
+ )
524
+
525
+ _response_types_map: Dict[str, Optional[str]] = {
526
+ '204': None,
527
+ }
528
+ response_data = self.api_client.call_api(
529
+ *_param,
530
+ _request_timeout=_request_timeout
531
+ )
532
+ return response_data.response
533
+
534
+
535
+ def _delete_collection_v1_serialize(
536
+ self,
537
+ workspace_id,
538
+ collection_id,
539
+ _request_auth,
540
+ _content_type,
541
+ _headers,
542
+ _host_index,
543
+ ) -> RequestSerialized:
544
+
545
+ _host = None
546
+
547
+ _collection_formats: Dict[str, str] = {
548
+ }
549
+
550
+ _path_params: Dict[str, str] = {}
551
+ _query_params: List[Tuple[str, str]] = []
552
+ _header_params: Dict[str, Optional[str]] = _headers or {}
553
+ _form_params: List[Tuple[str, str]] = []
554
+ _files: Dict[str, Union[str, bytes]] = {}
555
+ _body_params: Optional[bytes] = None
556
+
557
+ # process the path parameters
558
+ if workspace_id is not None:
559
+ _path_params['workspaceId'] = workspace_id
560
+ if collection_id is not None:
561
+ _path_params['collectionId'] = collection_id
562
+ # process the query parameters
563
+ # process the header parameters
564
+ # process the form parameters
565
+ # process the body parameter
566
+
567
+
568
+
569
+
570
+ # authentication setting
571
+ _auth_settings: List[str] = [
572
+ 'bearerAuth'
573
+ ]
574
+
575
+ return self.api_client.param_serialize(
576
+ method='DELETE',
577
+ resource_path='/collections/v1/{workspaceId}/{collectionId}',
578
+ path_params=_path_params,
579
+ query_params=_query_params,
580
+ header_params=_header_params,
581
+ body=_body_params,
582
+ post_params=_form_params,
583
+ files=_files,
584
+ auth_settings=_auth_settings,
585
+ collection_formats=_collection_formats,
586
+ _host=_host,
587
+ _request_auth=_request_auth
588
+ )
589
+
590
+
591
+
592
+
593
+ @validate_call
594
+ def get_collection_v1(
595
+ self,
596
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
597
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
598
+ _request_timeout: Union[
599
+ None,
600
+ Annotated[StrictFloat, Field(gt=0)],
601
+ Tuple[
602
+ Annotated[StrictFloat, Field(gt=0)],
603
+ Annotated[StrictFloat, Field(gt=0)]
604
+ ]
605
+ ] = None,
606
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
607
+ _content_type: Optional[StrictStr] = None,
608
+ _headers: Optional[Dict[StrictStr, Any]] = None,
609
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
610
+ ) -> Collection:
611
+ """Retrieve a single collection.
612
+
613
+
614
+ :param workspace_id: Workspace id (required)
615
+ :type workspace_id: str
616
+ :param collection_id: Collection id (required)
617
+ :type collection_id: str
618
+ :param _request_timeout: timeout setting for this request. If one
619
+ number provided, it will be total request
620
+ timeout. It can also be a pair (tuple) of
621
+ (connection, read) timeouts.
622
+ :type _request_timeout: int, tuple(int, int), optional
623
+ :param _request_auth: set to override the auth_settings for an a single
624
+ request; this effectively ignores the
625
+ authentication in the spec for a single request.
626
+ :type _request_auth: dict, optional
627
+ :param _content_type: force content-type for the request.
628
+ :type _content_type: str, Optional
629
+ :param _headers: set to override the headers for a single
630
+ request; this effectively ignores the headers
631
+ in the spec for a single request.
632
+ :type _headers: dict, optional
633
+ :param _host_index: set to override the host_index for a single
634
+ request; this effectively ignores the host_index
635
+ in the spec for a single request.
636
+ :type _host_index: int, optional
637
+ :return: Returns the result object.
638
+ """ # noqa: E501
639
+
640
+ _param = self._get_collection_v1_serialize(
641
+ workspace_id=workspace_id,
642
+ collection_id=collection_id,
643
+ _request_auth=_request_auth,
644
+ _content_type=_content_type,
645
+ _headers=_headers,
646
+ _host_index=_host_index
647
+ )
648
+
649
+ _response_types_map: Dict[str, Optional[str]] = {
650
+ '200': "Collection",
651
+ }
652
+ response_data = self.api_client.call_api(
653
+ *_param,
654
+ _request_timeout=_request_timeout
655
+ )
656
+ response_data.read()
657
+ return self.api_client.response_deserialize(
658
+ response_data=response_data,
659
+ response_types_map=_response_types_map,
660
+ ).data
661
+
662
+
663
+ @validate_call
664
+ def get_collection_v1_with_http_info(
665
+ self,
666
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
667
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
668
+ _request_timeout: Union[
669
+ None,
670
+ Annotated[StrictFloat, Field(gt=0)],
671
+ Tuple[
672
+ Annotated[StrictFloat, Field(gt=0)],
673
+ Annotated[StrictFloat, Field(gt=0)]
674
+ ]
675
+ ] = None,
676
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
677
+ _content_type: Optional[StrictStr] = None,
678
+ _headers: Optional[Dict[StrictStr, Any]] = None,
679
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
680
+ ) -> ApiResponse[Collection]:
681
+ """Retrieve a single collection.
682
+
683
+
684
+ :param workspace_id: Workspace id (required)
685
+ :type workspace_id: str
686
+ :param collection_id: Collection id (required)
687
+ :type collection_id: str
688
+ :param _request_timeout: timeout setting for this request. If one
689
+ number provided, it will be total request
690
+ timeout. It can also be a pair (tuple) of
691
+ (connection, read) timeouts.
692
+ :type _request_timeout: int, tuple(int, int), optional
693
+ :param _request_auth: set to override the auth_settings for an a single
694
+ request; this effectively ignores the
695
+ authentication in the spec for a single request.
696
+ :type _request_auth: dict, optional
697
+ :param _content_type: force content-type for the request.
698
+ :type _content_type: str, Optional
699
+ :param _headers: set to override the headers for a single
700
+ request; this effectively ignores the headers
701
+ in the spec for a single request.
702
+ :type _headers: dict, optional
703
+ :param _host_index: set to override the host_index for a single
704
+ request; this effectively ignores the host_index
705
+ in the spec for a single request.
706
+ :type _host_index: int, optional
707
+ :return: Returns the result object.
708
+ """ # noqa: E501
709
+
710
+ _param = self._get_collection_v1_serialize(
711
+ workspace_id=workspace_id,
712
+ collection_id=collection_id,
713
+ _request_auth=_request_auth,
714
+ _content_type=_content_type,
715
+ _headers=_headers,
716
+ _host_index=_host_index
717
+ )
718
+
719
+ _response_types_map: Dict[str, Optional[str]] = {
720
+ '200': "Collection",
721
+ }
722
+ response_data = self.api_client.call_api(
723
+ *_param,
724
+ _request_timeout=_request_timeout
725
+ )
726
+ response_data.read()
727
+ return self.api_client.response_deserialize(
728
+ response_data=response_data,
729
+ response_types_map=_response_types_map,
730
+ )
731
+
732
+
733
+ @validate_call
734
+ def get_collection_v1_without_preload_content(
735
+ self,
736
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
737
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
738
+ _request_timeout: Union[
739
+ None,
740
+ Annotated[StrictFloat, Field(gt=0)],
741
+ Tuple[
742
+ Annotated[StrictFloat, Field(gt=0)],
743
+ Annotated[StrictFloat, Field(gt=0)]
744
+ ]
745
+ ] = None,
746
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
747
+ _content_type: Optional[StrictStr] = None,
748
+ _headers: Optional[Dict[StrictStr, Any]] = None,
749
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
750
+ ) -> RESTResponseType:
751
+ """Retrieve a single collection.
752
+
753
+
754
+ :param workspace_id: Workspace id (required)
755
+ :type workspace_id: str
756
+ :param collection_id: Collection id (required)
757
+ :type collection_id: str
758
+ :param _request_timeout: timeout setting for this request. If one
759
+ number provided, it will be total request
760
+ timeout. It can also be a pair (tuple) of
761
+ (connection, read) timeouts.
762
+ :type _request_timeout: int, tuple(int, int), optional
763
+ :param _request_auth: set to override the auth_settings for an a single
764
+ request; this effectively ignores the
765
+ authentication in the spec for a single request.
766
+ :type _request_auth: dict, optional
767
+ :param _content_type: force content-type for the request.
768
+ :type _content_type: str, Optional
769
+ :param _headers: set to override the headers for a single
770
+ request; this effectively ignores the headers
771
+ in the spec for a single request.
772
+ :type _headers: dict, optional
773
+ :param _host_index: set to override the host_index for a single
774
+ request; this effectively ignores the host_index
775
+ in the spec for a single request.
776
+ :type _host_index: int, optional
777
+ :return: Returns the result object.
778
+ """ # noqa: E501
779
+
780
+ _param = self._get_collection_v1_serialize(
781
+ workspace_id=workspace_id,
782
+ collection_id=collection_id,
783
+ _request_auth=_request_auth,
784
+ _content_type=_content_type,
785
+ _headers=_headers,
786
+ _host_index=_host_index
787
+ )
788
+
789
+ _response_types_map: Dict[str, Optional[str]] = {
790
+ '200': "Collection",
791
+ }
792
+ response_data = self.api_client.call_api(
793
+ *_param,
794
+ _request_timeout=_request_timeout
795
+ )
796
+ return response_data.response
797
+
798
+
799
+ def _get_collection_v1_serialize(
800
+ self,
801
+ workspace_id,
802
+ collection_id,
803
+ _request_auth,
804
+ _content_type,
805
+ _headers,
806
+ _host_index,
807
+ ) -> RequestSerialized:
808
+
809
+ _host = None
810
+
811
+ _collection_formats: Dict[str, str] = {
812
+ }
813
+
814
+ _path_params: Dict[str, str] = {}
815
+ _query_params: List[Tuple[str, str]] = []
816
+ _header_params: Dict[str, Optional[str]] = _headers or {}
817
+ _form_params: List[Tuple[str, str]] = []
818
+ _files: Dict[str, Union[str, bytes]] = {}
819
+ _body_params: Optional[bytes] = None
820
+
821
+ # process the path parameters
822
+ if workspace_id is not None:
823
+ _path_params['workspaceId'] = workspace_id
824
+ if collection_id is not None:
825
+ _path_params['collectionId'] = collection_id
826
+ # process the query parameters
827
+ # process the header parameters
828
+ # process the form parameters
829
+ # process the body parameter
830
+
831
+
832
+ # set the HTTP header `Accept`
833
+ if 'Accept' not in _header_params:
834
+ _header_params['Accept'] = self.api_client.select_header_accept(
835
+ [
836
+ 'application/json'
837
+ ]
838
+ )
839
+
840
+
841
+ # authentication setting
842
+ _auth_settings: List[str] = [
843
+ 'bearerAuth'
844
+ ]
845
+
846
+ return self.api_client.param_serialize(
847
+ method='GET',
848
+ resource_path='/collections/v1/{workspaceId}/{collectionId}',
849
+ path_params=_path_params,
850
+ query_params=_query_params,
851
+ header_params=_header_params,
852
+ body=_body_params,
853
+ post_params=_form_params,
854
+ files=_files,
855
+ auth_settings=_auth_settings,
856
+ collection_formats=_collection_formats,
857
+ _host=_host,
858
+ _request_auth=_request_auth
859
+ )
860
+
861
+
862
+
863
+
864
+ @validate_call
865
+ def list_collections_v1(
866
+ self,
867
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
868
+ _request_timeout: Union[
869
+ None,
870
+ Annotated[StrictFloat, Field(gt=0)],
871
+ Tuple[
872
+ Annotated[StrictFloat, Field(gt=0)],
873
+ Annotated[StrictFloat, Field(gt=0)]
874
+ ]
875
+ ] = None,
876
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
877
+ _content_type: Optional[StrictStr] = None,
878
+ _headers: Optional[Dict[StrictStr, Any]] = None,
879
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
880
+ ) -> List[Collection]:
881
+ """List all collections in this workspace.
882
+
883
+
884
+ :param workspace_id: Workspace id (required)
885
+ :type workspace_id: str
886
+ :param _request_timeout: timeout setting for this request. If one
887
+ number provided, it will be total request
888
+ timeout. It can also be a pair (tuple) of
889
+ (connection, read) timeouts.
890
+ :type _request_timeout: int, tuple(int, int), optional
891
+ :param _request_auth: set to override the auth_settings for an a single
892
+ request; this effectively ignores the
893
+ authentication in the spec for a single request.
894
+ :type _request_auth: dict, optional
895
+ :param _content_type: force content-type for the request.
896
+ :type _content_type: str, Optional
897
+ :param _headers: set to override the headers for a single
898
+ request; this effectively ignores the headers
899
+ in the spec for a single request.
900
+ :type _headers: dict, optional
901
+ :param _host_index: set to override the host_index for a single
902
+ request; this effectively ignores the host_index
903
+ in the spec for a single request.
904
+ :type _host_index: int, optional
905
+ :return: Returns the result object.
906
+ """ # noqa: E501
907
+
908
+ _param = self._list_collections_v1_serialize(
909
+ workspace_id=workspace_id,
910
+ _request_auth=_request_auth,
911
+ _content_type=_content_type,
912
+ _headers=_headers,
913
+ _host_index=_host_index
914
+ )
915
+
916
+ _response_types_map: Dict[str, Optional[str]] = {
917
+ '200': "List[Collection]",
918
+ }
919
+ response_data = self.api_client.call_api(
920
+ *_param,
921
+ _request_timeout=_request_timeout
922
+ )
923
+ response_data.read()
924
+ return self.api_client.response_deserialize(
925
+ response_data=response_data,
926
+ response_types_map=_response_types_map,
927
+ ).data
928
+
929
+
930
+ @validate_call
931
+ def list_collections_v1_with_http_info(
932
+ self,
933
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
934
+ _request_timeout: Union[
935
+ None,
936
+ Annotated[StrictFloat, Field(gt=0)],
937
+ Tuple[
938
+ Annotated[StrictFloat, Field(gt=0)],
939
+ Annotated[StrictFloat, Field(gt=0)]
940
+ ]
941
+ ] = None,
942
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
943
+ _content_type: Optional[StrictStr] = None,
944
+ _headers: Optional[Dict[StrictStr, Any]] = None,
945
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
946
+ ) -> ApiResponse[List[Collection]]:
947
+ """List all collections in this workspace.
948
+
949
+
950
+ :param workspace_id: Workspace id (required)
951
+ :type workspace_id: str
952
+ :param _request_timeout: timeout setting for this request. If one
953
+ number provided, it will be total request
954
+ timeout. It can also be a pair (tuple) of
955
+ (connection, read) timeouts.
956
+ :type _request_timeout: int, tuple(int, int), optional
957
+ :param _request_auth: set to override the auth_settings for an a single
958
+ request; this effectively ignores the
959
+ authentication in the spec for a single request.
960
+ :type _request_auth: dict, optional
961
+ :param _content_type: force content-type for the request.
962
+ :type _content_type: str, Optional
963
+ :param _headers: set to override the headers for a single
964
+ request; this effectively ignores the headers
965
+ in the spec for a single request.
966
+ :type _headers: dict, optional
967
+ :param _host_index: set to override the host_index for a single
968
+ request; this effectively ignores the host_index
969
+ in the spec for a single request.
970
+ :type _host_index: int, optional
971
+ :return: Returns the result object.
972
+ """ # noqa: E501
973
+
974
+ _param = self._list_collections_v1_serialize(
975
+ workspace_id=workspace_id,
976
+ _request_auth=_request_auth,
977
+ _content_type=_content_type,
978
+ _headers=_headers,
979
+ _host_index=_host_index
980
+ )
981
+
982
+ _response_types_map: Dict[str, Optional[str]] = {
983
+ '200': "List[Collection]",
984
+ }
985
+ response_data = self.api_client.call_api(
986
+ *_param,
987
+ _request_timeout=_request_timeout
988
+ )
989
+ response_data.read()
990
+ return self.api_client.response_deserialize(
991
+ response_data=response_data,
992
+ response_types_map=_response_types_map,
993
+ )
994
+
995
+
996
+ @validate_call
997
+ def list_collections_v1_without_preload_content(
998
+ self,
999
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
1000
+ _request_timeout: Union[
1001
+ None,
1002
+ Annotated[StrictFloat, Field(gt=0)],
1003
+ Tuple[
1004
+ Annotated[StrictFloat, Field(gt=0)],
1005
+ Annotated[StrictFloat, Field(gt=0)]
1006
+ ]
1007
+ ] = None,
1008
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1009
+ _content_type: Optional[StrictStr] = None,
1010
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1011
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1012
+ ) -> RESTResponseType:
1013
+ """List all collections in this workspace.
1014
+
1015
+
1016
+ :param workspace_id: Workspace id (required)
1017
+ :type workspace_id: str
1018
+ :param _request_timeout: timeout setting for this request. If one
1019
+ number provided, it will be total request
1020
+ timeout. It can also be a pair (tuple) of
1021
+ (connection, read) timeouts.
1022
+ :type _request_timeout: int, tuple(int, int), optional
1023
+ :param _request_auth: set to override the auth_settings for an a single
1024
+ request; this effectively ignores the
1025
+ authentication in the spec for a single request.
1026
+ :type _request_auth: dict, optional
1027
+ :param _content_type: force content-type for the request.
1028
+ :type _content_type: str, Optional
1029
+ :param _headers: set to override the headers for a single
1030
+ request; this effectively ignores the headers
1031
+ in the spec for a single request.
1032
+ :type _headers: dict, optional
1033
+ :param _host_index: set to override the host_index for a single
1034
+ request; this effectively ignores the host_index
1035
+ in the spec for a single request.
1036
+ :type _host_index: int, optional
1037
+ :return: Returns the result object.
1038
+ """ # noqa: E501
1039
+
1040
+ _param = self._list_collections_v1_serialize(
1041
+ workspace_id=workspace_id,
1042
+ _request_auth=_request_auth,
1043
+ _content_type=_content_type,
1044
+ _headers=_headers,
1045
+ _host_index=_host_index
1046
+ )
1047
+
1048
+ _response_types_map: Dict[str, Optional[str]] = {
1049
+ '200': "List[Collection]",
1050
+ }
1051
+ response_data = self.api_client.call_api(
1052
+ *_param,
1053
+ _request_timeout=_request_timeout
1054
+ )
1055
+ return response_data.response
1056
+
1057
+
1058
+ def _list_collections_v1_serialize(
1059
+ self,
1060
+ workspace_id,
1061
+ _request_auth,
1062
+ _content_type,
1063
+ _headers,
1064
+ _host_index,
1065
+ ) -> RequestSerialized:
1066
+
1067
+ _host = None
1068
+
1069
+ _collection_formats: Dict[str, str] = {
1070
+ }
1071
+
1072
+ _path_params: Dict[str, str] = {}
1073
+ _query_params: List[Tuple[str, str]] = []
1074
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1075
+ _form_params: List[Tuple[str, str]] = []
1076
+ _files: Dict[str, Union[str, bytes]] = {}
1077
+ _body_params: Optional[bytes] = None
1078
+
1079
+ # process the path parameters
1080
+ if workspace_id is not None:
1081
+ _path_params['workspaceId'] = workspace_id
1082
+ # process the query parameters
1083
+ # process the header parameters
1084
+ # process the form parameters
1085
+ # process the body parameter
1086
+
1087
+
1088
+ # set the HTTP header `Accept`
1089
+ if 'Accept' not in _header_params:
1090
+ _header_params['Accept'] = self.api_client.select_header_accept(
1091
+ [
1092
+ 'application/json'
1093
+ ]
1094
+ )
1095
+
1096
+
1097
+ # authentication setting
1098
+ _auth_settings: List[str] = [
1099
+ 'bearerAuth'
1100
+ ]
1101
+
1102
+ return self.api_client.param_serialize(
1103
+ method='GET',
1104
+ resource_path='/collections/v1/{workspaceId}',
1105
+ path_params=_path_params,
1106
+ query_params=_query_params,
1107
+ header_params=_header_params,
1108
+ body=_body_params,
1109
+ post_params=_form_params,
1110
+ files=_files,
1111
+ auth_settings=_auth_settings,
1112
+ collection_formats=_collection_formats,
1113
+ _host=_host,
1114
+ _request_auth=_request_auth
1115
+ )
1116
+
1117
+
1118
+
1119
+
1120
+ @validate_call
1121
+ def update_collection_v1(
1122
+ self,
1123
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
1124
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
1125
+ collection: Annotated[Collection, Field(description="The collection to update")],
1126
+ _request_timeout: Union[
1127
+ None,
1128
+ Annotated[StrictFloat, Field(gt=0)],
1129
+ Tuple[
1130
+ Annotated[StrictFloat, Field(gt=0)],
1131
+ Annotated[StrictFloat, Field(gt=0)]
1132
+ ]
1133
+ ] = None,
1134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1135
+ _content_type: Optional[StrictStr] = None,
1136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1138
+ ) -> Collection:
1139
+ """Update the specified collection.
1140
+
1141
+ Collection id is optional in the request body. If specified, it must match the collection id specified in the url.
1142
+
1143
+ :param workspace_id: Workspace id (required)
1144
+ :type workspace_id: str
1145
+ :param collection_id: Collection id (required)
1146
+ :type collection_id: str
1147
+ :param collection: The collection to update (required)
1148
+ :type collection: Collection
1149
+ :param _request_timeout: timeout setting for this request. If one
1150
+ number provided, it will be total request
1151
+ timeout. It can also be a pair (tuple) of
1152
+ (connection, read) timeouts.
1153
+ :type _request_timeout: int, tuple(int, int), optional
1154
+ :param _request_auth: set to override the auth_settings for an a single
1155
+ request; this effectively ignores the
1156
+ authentication in the spec for a single request.
1157
+ :type _request_auth: dict, optional
1158
+ :param _content_type: force content-type for the request.
1159
+ :type _content_type: str, Optional
1160
+ :param _headers: set to override the headers for a single
1161
+ request; this effectively ignores the headers
1162
+ in the spec for a single request.
1163
+ :type _headers: dict, optional
1164
+ :param _host_index: set to override the host_index for a single
1165
+ request; this effectively ignores the host_index
1166
+ in the spec for a single request.
1167
+ :type _host_index: int, optional
1168
+ :return: Returns the result object.
1169
+ """ # noqa: E501
1170
+
1171
+ _param = self._update_collection_v1_serialize(
1172
+ workspace_id=workspace_id,
1173
+ collection_id=collection_id,
1174
+ collection=collection,
1175
+ _request_auth=_request_auth,
1176
+ _content_type=_content_type,
1177
+ _headers=_headers,
1178
+ _host_index=_host_index
1179
+ )
1180
+
1181
+ _response_types_map: Dict[str, Optional[str]] = {
1182
+ '200': "Collection",
1183
+ }
1184
+ response_data = self.api_client.call_api(
1185
+ *_param,
1186
+ _request_timeout=_request_timeout
1187
+ )
1188
+ response_data.read()
1189
+ return self.api_client.response_deserialize(
1190
+ response_data=response_data,
1191
+ response_types_map=_response_types_map,
1192
+ ).data
1193
+
1194
+
1195
+ @validate_call
1196
+ def update_collection_v1_with_http_info(
1197
+ self,
1198
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
1199
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
1200
+ collection: Annotated[Collection, Field(description="The collection to update")],
1201
+ _request_timeout: Union[
1202
+ None,
1203
+ Annotated[StrictFloat, Field(gt=0)],
1204
+ Tuple[
1205
+ Annotated[StrictFloat, Field(gt=0)],
1206
+ Annotated[StrictFloat, Field(gt=0)]
1207
+ ]
1208
+ ] = None,
1209
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1210
+ _content_type: Optional[StrictStr] = None,
1211
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1212
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1213
+ ) -> ApiResponse[Collection]:
1214
+ """Update the specified collection.
1215
+
1216
+ Collection id is optional in the request body. If specified, it must match the collection id specified in the url.
1217
+
1218
+ :param workspace_id: Workspace id (required)
1219
+ :type workspace_id: str
1220
+ :param collection_id: Collection id (required)
1221
+ :type collection_id: str
1222
+ :param collection: The collection to update (required)
1223
+ :type collection: Collection
1224
+ :param _request_timeout: timeout setting for this request. If one
1225
+ number provided, it will be total request
1226
+ timeout. It can also be a pair (tuple) of
1227
+ (connection, read) timeouts.
1228
+ :type _request_timeout: int, tuple(int, int), optional
1229
+ :param _request_auth: set to override the auth_settings for an a single
1230
+ request; this effectively ignores the
1231
+ authentication in the spec for a single request.
1232
+ :type _request_auth: dict, optional
1233
+ :param _content_type: force content-type for the request.
1234
+ :type _content_type: str, Optional
1235
+ :param _headers: set to override the headers for a single
1236
+ request; this effectively ignores the headers
1237
+ in the spec for a single request.
1238
+ :type _headers: dict, optional
1239
+ :param _host_index: set to override the host_index for a single
1240
+ request; this effectively ignores the host_index
1241
+ in the spec for a single request.
1242
+ :type _host_index: int, optional
1243
+ :return: Returns the result object.
1244
+ """ # noqa: E501
1245
+
1246
+ _param = self._update_collection_v1_serialize(
1247
+ workspace_id=workspace_id,
1248
+ collection_id=collection_id,
1249
+ collection=collection,
1250
+ _request_auth=_request_auth,
1251
+ _content_type=_content_type,
1252
+ _headers=_headers,
1253
+ _host_index=_host_index
1254
+ )
1255
+
1256
+ _response_types_map: Dict[str, Optional[str]] = {
1257
+ '200': "Collection",
1258
+ }
1259
+ response_data = self.api_client.call_api(
1260
+ *_param,
1261
+ _request_timeout=_request_timeout
1262
+ )
1263
+ response_data.read()
1264
+ return self.api_client.response_deserialize(
1265
+ response_data=response_data,
1266
+ response_types_map=_response_types_map,
1267
+ )
1268
+
1269
+
1270
+ @validate_call
1271
+ def update_collection_v1_without_preload_content(
1272
+ self,
1273
+ workspace_id: Annotated[StrictStr, Field(description="Workspace id")],
1274
+ collection_id: Annotated[StrictStr, Field(description="Collection id")],
1275
+ collection: Annotated[Collection, Field(description="The collection to update")],
1276
+ _request_timeout: Union[
1277
+ None,
1278
+ Annotated[StrictFloat, Field(gt=0)],
1279
+ Tuple[
1280
+ Annotated[StrictFloat, Field(gt=0)],
1281
+ Annotated[StrictFloat, Field(gt=0)]
1282
+ ]
1283
+ ] = None,
1284
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1285
+ _content_type: Optional[StrictStr] = None,
1286
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1287
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1288
+ ) -> RESTResponseType:
1289
+ """Update the specified collection.
1290
+
1291
+ Collection id is optional in the request body. If specified, it must match the collection id specified in the url.
1292
+
1293
+ :param workspace_id: Workspace id (required)
1294
+ :type workspace_id: str
1295
+ :param collection_id: Collection id (required)
1296
+ :type collection_id: str
1297
+ :param collection: The collection to update (required)
1298
+ :type collection: Collection
1299
+ :param _request_timeout: timeout setting for this request. If one
1300
+ number provided, it will be total request
1301
+ timeout. It can also be a pair (tuple) of
1302
+ (connection, read) timeouts.
1303
+ :type _request_timeout: int, tuple(int, int), optional
1304
+ :param _request_auth: set to override the auth_settings for an a single
1305
+ request; this effectively ignores the
1306
+ authentication in the spec for a single request.
1307
+ :type _request_auth: dict, optional
1308
+ :param _content_type: force content-type for the request.
1309
+ :type _content_type: str, Optional
1310
+ :param _headers: set to override the headers for a single
1311
+ request; this effectively ignores the headers
1312
+ in the spec for a single request.
1313
+ :type _headers: dict, optional
1314
+ :param _host_index: set to override the host_index for a single
1315
+ request; this effectively ignores the host_index
1316
+ in the spec for a single request.
1317
+ :type _host_index: int, optional
1318
+ :return: Returns the result object.
1319
+ """ # noqa: E501
1320
+
1321
+ _param = self._update_collection_v1_serialize(
1322
+ workspace_id=workspace_id,
1323
+ collection_id=collection_id,
1324
+ collection=collection,
1325
+ _request_auth=_request_auth,
1326
+ _content_type=_content_type,
1327
+ _headers=_headers,
1328
+ _host_index=_host_index
1329
+ )
1330
+
1331
+ _response_types_map: Dict[str, Optional[str]] = {
1332
+ '200': "Collection",
1333
+ }
1334
+ response_data = self.api_client.call_api(
1335
+ *_param,
1336
+ _request_timeout=_request_timeout
1337
+ )
1338
+ return response_data.response
1339
+
1340
+
1341
+ def _update_collection_v1_serialize(
1342
+ self,
1343
+ workspace_id,
1344
+ collection_id,
1345
+ collection,
1346
+ _request_auth,
1347
+ _content_type,
1348
+ _headers,
1349
+ _host_index,
1350
+ ) -> RequestSerialized:
1351
+
1352
+ _host = None
1353
+
1354
+ _collection_formats: Dict[str, str] = {
1355
+ }
1356
+
1357
+ _path_params: Dict[str, str] = {}
1358
+ _query_params: List[Tuple[str, str]] = []
1359
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1360
+ _form_params: List[Tuple[str, str]] = []
1361
+ _files: Dict[str, Union[str, bytes]] = {}
1362
+ _body_params: Optional[bytes] = None
1363
+
1364
+ # process the path parameters
1365
+ if workspace_id is not None:
1366
+ _path_params['workspaceId'] = workspace_id
1367
+ if collection_id is not None:
1368
+ _path_params['collectionId'] = collection_id
1369
+ # process the query parameters
1370
+ # process the header parameters
1371
+ # process the form parameters
1372
+ # process the body parameter
1373
+ if collection is not None:
1374
+ _body_params = collection
1375
+
1376
+
1377
+ # set the HTTP header `Accept`
1378
+ if 'Accept' not in _header_params:
1379
+ _header_params['Accept'] = self.api_client.select_header_accept(
1380
+ [
1381
+ 'application/json'
1382
+ ]
1383
+ )
1384
+
1385
+ # set the HTTP header `Content-Type`
1386
+ if _content_type:
1387
+ _header_params['Content-Type'] = _content_type
1388
+ else:
1389
+ _default_content_type = (
1390
+ self.api_client.select_header_content_type(
1391
+ [
1392
+ 'application/json'
1393
+ ]
1394
+ )
1395
+ )
1396
+ if _default_content_type is not None:
1397
+ _header_params['Content-Type'] = _default_content_type
1398
+
1399
+ # authentication setting
1400
+ _auth_settings: List[str] = [
1401
+ 'bearerAuth'
1402
+ ]
1403
+
1404
+ return self.api_client.param_serialize(
1405
+ method='PUT',
1406
+ resource_path='/collections/v1/{workspaceId}/{collectionId}',
1407
+ path_params=_path_params,
1408
+ query_params=_query_params,
1409
+ header_params=_header_params,
1410
+ body=_body_params,
1411
+ post_params=_form_params,
1412
+ files=_files,
1413
+ auth_settings=_auth_settings,
1414
+ collection_formats=_collection_formats,
1415
+ _host=_host,
1416
+ _request_auth=_request_auth
1417
+ )
1418
+
1419
+